PHP 7 reserved words should not be used as class, interfaces or traits names

  • Major
  • Bugrisk

More information: https://insight.sensiolabs.com/what-we-analyse/php.php7_reserved_words

New rule! We've recently added this rule to Insight. Don't be surprised to see new violations even though the codebase didn't change.
  1. *
  2. * @category Naneau
  3. * @package FileGen
  4. * @subpackage File
  5. */
  6. class String implements Contents

    This name is a reserved word since PHP 7 and should not be used as class, interface or trait name.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Maurice Fonk
  7. {
  8. /**
  9. * Contents of the file
  10. *
  11. * @var string

Interfaces names should end with "Interface" 2

  • Info
  • Codestyle

More information: https://insight.sensiolabs.com/what-we-analyse/php.interface_has_no_interface_suffix

  1. *
  2. * @category Naneau
  3. * @package FileGen
  4. * @subpackage File
  5. */
  6. interface Contents

    Interface Contents should be named ContentsInterface for better clarity.

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Maurice Fonk
  7. {
  8. /**
  9. * Get the contents for a file
  10. *
  11. * @return string
  1. *
  2. * @category Naneau
  3. * @package FileGen
  4. * @subpackage Parameters
  5. */
  6. interface Parameterized

    Interface Parameterized should be named ParameterizedInterface for better clarity.

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Maurice Fonk
  7. {
  8. /**
  9. * Get the parameters
  10. *
  11. * @return array[string]string