Skip to content
On this page

no-content-after-bracefixable

Ensure there is no comment or a statement after a brace on the same line

Examples

  • Examples of correct code for this rule using default options

Closing braces are not followed by a comment or a statement

php
<?php
class Logger {
	public function log($msg) {
		echo $msg;
	}
	// Previous line has no content after brace
}
  • Examples of incorrect code for this rule using default options

Closing braces are followed by content

php
<?php
class Logger {
	public function log($msg) {
		echo $msg;
	} // End of log method
} // End of logger class

function callLogger () {
	$logger = new Logger();
	$logger->log("Hello World");
} echo "End of file";

Released under the MIT License.