Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sniff for new reserved words in PHP7 #186

Closed
fabiang opened this issue Apr 8, 2015 · 8 comments
Closed

Add sniff for new reserved words in PHP7 #186

fabiang opened this issue Apr 8, 2015 · 8 comments
Assignees

Comments

@fabiang
Copy link

fabiang commented Apr 8, 2015

PHP7 will reserve some keywords for class-, interface-, trait names and namespaces:

Would be a nice feature if phpcs could have a sniff for those keywords

@llaville
Copy link
Owner

llaville commented Apr 9, 2015

Sure, but no date due because PHP 7 is still under development. And probably only for first RFC accepted. The second is partially accepted

@llaville llaville self-assigned this Apr 9, 2015
@llaville llaville added this to the 5.0.0 milestone Oct 10, 2015
@llaville
Copy link
Owner

llaville commented Dec 5, 2015

Will be add later in 5.1, because I've no free time to have a chance to implement these sniffs.
And as I want to release today the final stable version 5.0 of php-compatinfo with sniff architecture and its new migration analyser.

@llaville llaville modified the milestones: 5.1.0, 5.0.0 Dec 5, 2015
@llaville llaville modified the milestones: 5.1.0, 6.0 Oct 5, 2017
@llaville
Copy link
Owner

llaville commented Oct 5, 2017

Finally, i've aborted dev of branch 5.1, to a reworks on new major version 6.0

Sniff arch was dropped in profit of simple node visitor patterns. More news will come soon !

@llaville
Copy link
Owner

Finally Sniff architecture is kept and gave us a chance to solve the situation !

@llaville llaville removed this from the 6.0 milestone Jul 10, 2020
@llaville
Copy link
Owner

Will be included in upcoming release 5.4.0 (under active development)

@llaville llaville mentioned this issue Jul 15, 2020
24 tasks
@llaville
Copy link
Owner

First code reorganization phase is now applied (see #266 (comment)).
Next step is to fix the KeywordReservedSniff to solve this issue/report.

llaville added a commit that referenced this issue Jul 18, 2020
@llaville
Copy link
Owner

In waiting release of 5.4.0RC1, the current branch 5.4 solved this issue. A ForbiddenSniff will be add very soon to complete list of reserved keywords

@llaville
Copy link
Owner

ForbiddenSniff is impossible to be introduces in v5.4 easily. So it's deferred to major version 6.0

llaville added a commit that referenced this issue Oct 1, 2020
new Application version strategy - see GH-267
make compatibility analyser compatible with Sniff architecture - see GH-268
removes old phpunit result printer system
fix DeclareSniff following code reorganization applied to solve issue GH-186
fix AnonymousClassSniff following code reorganization applied to solve issue GH-186
fix ReturnTypeDeclarationSniff following code reorganization applied to solve issue GH-186
migrate old documentation from AsciiDoc to Markdown format
add FilterVisitor and DataCollector(s) component in new architecture 5.4
add contract for ReferenceCollection
add Profiler component in new architecture 5.4
includes part of PHP_Reflect code to decouple CompatInfo from Reflect runner
better identification of anonymous classes, closures, generators
reorganize sniffs by sub folders
use rename ExponantiationSniff to PowOperatorSniff (with ParamTypeDeclarationSniff) to fully fix issue GH-142
use ShortTernaryOperatorSniff to detect elvis syntax
renamed AnonymousFunctionSniff to ClosureSniff
add UseTraitSniff to solve issue gh-227
add CombinedComparisonOperatorSniff to detect Spaceship syntax since PHP 7.0
rename ClassMemberAccessOnInstantiationSniff to ClassMemberAccessSniff and add onCloning PHP 7 feature
add MagicClassConstantSniff to detect ::class syntax since PHP 5.5
add GeneratorSniff to solve issue gh-226; Return expression is not yet handle
add TypedPropertySniff for PHP 7.4 new feature
add phpunit group not_implemented to solve situation of generator return expression (test case exists but not yet implementation)
use ClassExprSyntaxSniff to detect Class::{'expr'} syntax since PHP 5.4
add BinaryNumberFormatSniff to detect bin number format syntax introduced in PHP 5.4
switch from internal api v3 to v5 with a lite analyser:run command with only source path (no more json config file required)
introduces ErrorHandler compatible with nikic/php-parser handled by --stop-on-failure option
introduces logger with --debug option to replace old plugin system
refactor event dispatcher/subscriber features and add container with symfony/dependency-injection component
allow to use the new config option to load dynamically php external configuration via symfony/dependency-injection
add MagicMethodsSniff to detect magic methods since PHP 5.1
replace hard-coded sniffs by a dynamic collection (see dependency-injection/container)
introduces ApplicationInterface to be able to replace instance of console application easily
remove display of php.all info in compatibility analyser
analyser V5 never used anymore the Reflect common v3 component
add CryptStringSniff to solve issue gh-220 (refactor for v5.4)
add new ConditionalCodeSniff
speed-up analysis process by removing priority file queue that is no more necessary
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants