Coveralls logob
Coveralls logo
  • Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

PHPCSStandards / PHPCSUtils / 139 / 32

DEFAULT BRANCH: develop
Build:
LAST BUILD BRANCH: stable
Ran 22 Jan 2020 09:50AM PST
Files 11
Run time 2s
Badge
Badge Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

22 Jan 2020 - 9:23 coverage: 92.434%. First build
PHPCS_VERSION="2.6.0" COVERALLS_VERSION="^1.0"

Pull #37

travis-ci-com

9181eb84f9c35729a3bad740fb7f9d93?size=18&default=identiconweb-flow
Util\FunctionDeclarations: add new reserved name related utility methods

Add three new properties related to PHP reserved function names:
* `$magicFunctions`
* `$magicMethods`
* `$methodsDoubleUnderscore`

Also adds eight new utility methods using these properties, for convenience:
* `isMagicFunction()` - to check if the function declared on a `T_FUNCTION` token is a PHP magic function. Returns true/false.
* `isMagicFunctionName()` - to check if a given function name is the name of a PHP magic function. Returns true/false.
* `isMagicMethod()` - to check if the function declared on a `T_FUNCTION` token is a PHP magic method. Returns true/false.
* `isMagicMethodName()` - to check if a given function name is the name of a PHP magic method. Returns true/false.
* `isPHPDoubleUnderscoreMethod()` - to check if the function declared on a `T_FUNCTION` token is a PHP native double underscore method. Returns true/false.
* `isPHPDoubleUnderscoreMethodName()` - to check if a given function name is the name of a PHP native double underscore method. Returns true/false.
* `isSpecialMethod()` - to check if the function declared on a `T_FUNCTION` token is a PHP magic method or a PHP native double underscore method. Returns true/false.
* `isSpecialMethodName()` - to check if a given function name is the name of a PHP magic method or PHP native double underscore method. Returns true/false.

The `Name` methods only check a given name, the non-`Name` method also check if the function is a method or global function.

Includes dedicated unit tests for the new methods.
Pull Request #37: Util\FunctionDeclarations: add new reserved name related utility methods

1234 of 1335 relevant lines covered (92.43%)

13.91 hits per line

Source Files on job 139.32 (PHPCS_VERSION="2.6.0" COVERALLS_VERSION="^1.0")
  • Tree
  • List 11
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 54
  • Travis Job 139.32
  • e918452d on github
Troubleshooting · Open an Issue · Sales · Support · ENTERPRISE · CAREERS · STATUS
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2023 Coveralls, Inc