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

PHPCSStandards / PHPCSUtils / 151 / 30

DEFAULT BRANCH: develop
Build:
LAST BUILD BRANCH: stable
Ran 22 Jan 2020 11:44AM PST
Files 12
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 - 11:28 coverage: 94.408%. First build
PHPCS_VERSION="2.9.2" COVERALLS_VERSION="^2.0"

Pull #40

travis-ci-com

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

Add a new property related to PHP reserved variables names:
* `$phpReservedVars`

Also adds three new utility methods using this property, for convenience:
* `isPHPReservedVarName()` - to check if a given variable name is the name of a PHP reserved variable. Returns true/false.
* `isSuperglobal()` - to check if a given variable or string array key token points to a PHP superglobal. Returns true/false.
* `isSuperglobalName()` - to check if a given variable name is the name of a PHP superglobal variable. Returns true/false.

When passing a `T_CONSTANT_ENCAPSED_STRING` array index token to the `Name` functions, the string quotes around the name should be stripped in advance.

**Note**: I have not currently added a `isPHPReservedVar()` method as a number of the reserved vars are created within a particular scope depending on the use of a function which creates them and that would need to be checked thoroughly if such a function would be implemented.

Includes dedicated unit tests for the new methods.
Pull Request #40: Utils\Variables: add new reserved name related utility methods

1148 of 1216 relevant lines covered (94.41%)

14.78 hits per line

Source Files on job 151.30 (PHPCS_VERSION="2.9.2" COVERALLS_VERSION="^2.0")
  • Tree
  • List 12
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 57
  • Travis Job 151.30
  • 70b136a9 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