• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

PHPCSStandards / PHPCSUtils / 151
97%
develop: 100%

Build:
Build:
LAST BUILD BRANCH: dependabot/github_actions/action-runners-c4b2a15d30
DEFAULT BRANCH: develop
Ran 22 Jan 2020 07:44PM UTC
Jobs 4
Files 12
Run time 2min
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

pending completion
151

Pull #40

travis-ci-com

web-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

26 of 26 new or added lines in 1 file covered. (100.0%)

1165 of 1204 relevant lines covered (96.76%)

58.66 hits per line

Jobs
ID Job ID Ran Files Coverage
29 151.29 (LINT=1 PHPCS_VERSION="dev-master" COVERALLS_VERSION="^2.0") 22 Jan 2020 07:44PM UTC 0
94.0
Travis Job 151.29
30 151.30 (PHPCS_VERSION="2.9.2" COVERALLS_VERSION="^2.0") 22 Jan 2020 07:44PM UTC 0
94.41
Travis Job 151.30
31 151.31 (LINT=1 PHPCS_VERSION="dev-master" COVERALLS_VERSION="^1.0") 22 Jan 2020 07:44PM UTC 0
92.98
Travis Job 151.31
32 151.32 (PHPCS_VERSION="2.6.0" COVERALLS_VERSION="^1.0") 22 Jan 2020 07:46PM UTC 0
92.91
Travis Job 151.32
Source Files on build 151
Detailed source file information is not available for this build.
  • Back to Repo
  • Build #151
  • Pull Request #40
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc