Scope Closing Brace

Indentation of a closing brace must match the indentation of the line containing the opening brace.

Valid: Closing brace aligned with line containing opening brace.

function foo() { <em>}</em>

if (!class_exists('Foo')) { class Foo { <em>}</em> <em>}</em>

<?php if ($something) { ?> <span>some output</span> <em><?php }</em> ?>

Invalid: Closing brace misaligned with line containing opening brace.

function foo() { <em> }</em>

if (!class_exists('Foo')) { class Foo { <em>}</em> <em> }</em>

<?php if ($something) { ?> <span>some output</span> <em> <?php }</em> ?>
Closing brace must be on a line by itself.

Valid: Close brace on its own line.

enum Foo { <em>}</em>

Invalid: Close brace on a line containing other code.

enum Foo {<em>}</em>