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

disallow old array() syntax #13

Merged
merged 2 commits into from
Jul 11, 2014
Merged

Conversation

nkovacs
Copy link
Contributor

@nkovacs nkovacs commented Jun 6, 2014

Since Yii2 uses the short array syntax, I wrote this sniff to catch accidental use of array().

I checked the framework source, and it found a couple files, mostly translation files and requirements.php (I guess that one has to stay so that it can run on older php, so it can be added to exclusions).

@klimov-paul
Copy link
Member

We may have long array syntax at some places. For example: YiiRequirementChecker needs it.
Whould this PR create a problem for such code?

@nkovacs
Copy link
Contributor Author

nkovacs commented Jun 7, 2014

You could add codingStandardsIgnore tags to code that needs it. The rest should be fixed.

@nkovacs
Copy link
Contributor Author

nkovacs commented Jun 7, 2014

I've added an exclude pattern to ignore the entire requirements directory, and removed the two separate ones.
Here are all the errors and warnings in the framework directory: https://gist.github.com/nkovacs/e70f105e68e79bf0260d

@nkovacs
Copy link
Contributor Author

nkovacs commented Jul 11, 2014

Well?

samdark added a commit that referenced this pull request Jul 11, 2014
@samdark samdark merged commit 2b884f9 into yiisoft:master Jul 11, 2014
@samdark
Copy link
Member

samdark commented Jul 11, 2014

Merged. Thanks!

@nkovacs nkovacs deleted the long_array_syntax branch May 23, 2016 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants