Skip to content

Files

Latest commit

 

History

History
21 lines (14 loc) · 866 Bytes

PHPCompatibility.Classes.NewClasses.md

File metadata and controls

21 lines (14 loc) · 866 Bytes

Pattern: Use of new native class

Issue: -

Description

Detects use of new PHP native classes.

The sniff analyses the following constructs to find usage of new classes:

  • Class instantiation using the new keyword.
  • (Anonymous) Class declarations to detect new classes being extended by userland classes.
  • Static use of class properties, constants or functions using the double colon.
  • Function/closure declarations to detect new classes used as parameter type declarations.
  • Function/closure declarations to detect new classes used as return type declarations.
  • Try/catch statements to detect new exception classes being caught.

PHP version All.

Further Reading