Missing use statement should be avoided 2

  • Major
  • Bugrisk

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

in src/CustomAndZend.php, line 411
  1. * @param mixed $data
  2. * @param array $jsonOptions Options to pass to JsonFormatter::encode()
  3. *
  4. * @return string|void
  5. */
  6. public function json(mixed $data, array $jsonOptions) : string {}

    The mixed type hint resolves to the DBlackborough\Zf3ViewHelpersCC\mixed class which PHP does not seem to be able to autoload.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Dean Blackborough
  7. /**
  8. * Set layout template or retrieve "layout" view model
  9. *
  10. * If no arguments are given, grabs the "root" or "layout" view model.
in src/Zend.php, line 336
  1. * @param mixed $data
  2. * @param array $jsonOptions Options to pass to JsonFormatter::encode()
  3. *
  4. * @return string|void
  5. */
  6. public function json(mixed $data, array $jsonOptions) : string {}

    The mixed type hint resolves to the DBlackborough\Zf3ViewHelpersCC\mixed class which PHP does not seem to be able to autoload.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Dean Blackborough
  7. /**
  8. * Set layout template or retrieve "layout" view model
  9. *
  10. * If no arguments are given, grabs the "root" or "layout" view model.

Code should not be duplicated

  • Minor
  • Architecture

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

in src/CustomAndZend.php, line 122
  1. /**
  2. * @param string $asset
  3. *
  4. * @return string
  5. */
  6. public function asset(string $asset) : string {}

    The next 400 lines appear both in src/CustomAndZend.php:122 and src/Zend.php:47.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Dean Blackborough
  7. /**
  8. * Returns site's base path, or file with base path prepended.
  9. *
  10. * $file is appended to the base path for simplicity.

User specific files should not appear in .gitignore

  • Minor
  • Codestyle

More information: https://insight.sensiolabs.com/what-we-analyse/git.user_specific_ignored_file

in .gitignore, line 2
  1. /vendor/
  2. .idea/

    .idea/ is user-specific and should not appear in a project .gitignore. Consider adding it to the user global .gitignore instead.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Dean Blackborough

PHP code should follow PSR-1 basic coding standard 2

  • Info
  • Codestyle

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

in src/CustomAndZend.php, line 376
  1. *
  2. * @param array $attribs
  3. *
  4. * @return HtmlTag
  5. */
  6. public function HtmlTag(array $attribs) : HtmlTag {}

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Dean Blackborough
  7. /**
  8. * Retrieve the current identity, if any.
  9. *
  10. * If none available, returns null.
in src/Zend.php, line 301
  1. *
  2. * @param array $attribs
  3. *
  4. * @return HtmlTag
  5. */
  6. public function HtmlTag(array $attribs) : HtmlTag {}

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Dean Blackborough
  7. /**
  8. * Retrieve the current identity, if any.
  9. *
  10. * If none available, returns null.