Skip to content
On this page

new-class-parenthesesfixable

Ensure that class instantiations are followed by parentheses

Examples

  • Examples of correct code for this rule using default options

Class instantiation with no arguments

php
<?php
$logger = new Logger();
$test = new Test();
$database = new Database();
$database = new Database(  );
  • Examples of incorrect code for this rule using default options

Class instantiation with no arguments and no parentheses

php
<?php
$logger = new Logger;
$test = new Test;
$database = new Database;

Released under the MIT License.