Release notes
*Sourced from [squizlabs/php_codesniffer's releases](https://github.com/squizlabs/PHP_CodeSniffer/releases).*
> ## 3.5.0
> ## PSR-12 Standard Ready
>
> PHP_CodeSniffer has included an in-progress PSR-12 standard since 3.3.0, but this release includes the completed standard. You can now check your code using the PSR-12 standard:
> ```
> phpcs --standard=PSR12 /path/to/code
> ```
> Most of the errors found can also be automatically fixed by PHPCBF:
> ```
> phpcbf --standard=PSR12 /path/to/code
> ```
>
> ## Changelog
>
> * Added support for PHP 7.4 typed properties
> * The nullable operator is now tokenized as `T_NULLABLE` inside property types, as it is elsewhere
> * To get the type of a member var, use the `File::getMemberProperties()` method, which now contains a `type` array index
> * This contains the type of the member var, or a blank string if not specified
> * If the type is nullable, the return type will contain the leading `?`
> * If a type is specified, the position of the first token in the type will be set in a `type_token` array index
> * If a type is specified, the position of the last token in the type will be set in a `type_end_token` array index
> * If the type is nullable, a `nullable_type` array index will also be set to `TRUE`
> * If the type contains namespace information, it will be cleaned of whitespace and comments in the return value
> * The PSR1 standard now correctly bans alternate PHP tags
> * Previously, it only banned short open tags and not the pre-7.0 alternate tags
> * Added support for only checking files that have been locally staged in a git repo
> * Use `--filter=gitstaged` to check these files
> * You still need to give PHPCS a list of files or directories in which to apply the filter
> * Thanks to Juliette Reinders Folmer for the contribution
> * JSON reports now end with a newline character
> * The `phpcs.xsd` schema now validates `phpcs-only` and `phpcbf-only` attributes correctly
> * Thanks to Juliette Reinders Folmer for the patch
> * The tokenizer now correctly identifies inline control structures in more cases
> * All helper methods inside the `File` class now throw `RuntimeException` instead of `TokenizerException`
> * Some tokenizer methods were also throwing `RuntimeExpection` but now correctly throw `TokenizerException`
> * Thanks to Juliette Reinders Folmer for the patch
> * The `File::getMethodParameters()` method now returns more information, and supports closure USE groups
> * If a type hint is specified, the position of the last token in the hint will be set in a `type_hint_end_token` array index
> * If a default is specified, the position of the first token in the default value will be set in a `default_token` array index
> * If a default is specified, the position of the equals sign will be set in a `default_equal_token` array index
> * If the param is not the last, the position of the comma will be set in a `comma_token` array index
> * If the param is passed by reference, the position of the reference operator will be set in a `reference_token` array index
> * If the param is variable length, the position of the variadic operator will be set in a `variadic_token` array index
> * The `T_LIST` token and it's opening and closing parentheses now contain references to each other in the tokens array
> * Uses the same parenthesis_opener/closer/owner indexes as other tokens
> * Thanks to Juliette Reinders Folmer for the patch
> * The `T_ANON_CLASS` token and it's opening and closing parentheses now contain references to each other in the tokens array
> * Uses the same parenthesis_opener/closer/owner indexes as other tokens
> * Only applicable if the anon class is passing arguments to the constructor
> * Thanks to Juliette Reinders Folmer for the patch
> ... (truncated)
Commits
- [`0afebf1`](https://github.com/squizlabs/PHP_CodeSniffer/commit/0afebf16a2e7f1e434920fa976253576151effe9) Prepare for 3.5.0 release
- [`1a202bb`](https://github.com/squizlabs/PHP_CodeSniffer/commit/1a202bb5e2cd116ab61380bc912a70fb749b17d7) Added missing include for when running tests from a PEAR install
- [`99d6757`](https://github.com/squizlabs/PHP_CodeSniffer/commit/99d6757858fc016b4ac8414a758241382efb1de8) Added checking for syntax errors
- [`cf655b4`](https://github.com/squizlabs/PHP_CodeSniffer/commit/cf655b41de258b53d647d85cd85675b9bd2fd7f8) Fixed incorrect property description (ref [#2224](https://github-redirect.dependabot.com/squizlabs/PHP_CodeSniffer/issues/2224))
- [`523afe3`](https://github.com/squizlabs/PHP_CodeSniffer/commit/523afe3bea2ffb30da46e39fd08d91e273543380) Fixed incorrect property name (ref [#2224](https://github-redirect.dependabot.com/squizlabs/PHP_CodeSniffer/issues/2224))
- [`83de998`](https://github.com/squizlabs/PHP_CodeSniffer/commit/83de998f27a83dff4f2fdc2852c23cf35f1e7c09) Merge branch 'multilevel-indenting' of https://github.com/marcospassos/PHP_Co...
- [`fb04e08`](https://github.com/squizlabs/PHP_CodeSniffer/commit/fb04e087749f032ec2cdc546419b26302955aa4a) Changelog for [#2534](https://github-redirect.dependabot.com/squizlabs/PHP_CodeSniffer/issues/2534)
- [`3c65796`](https://github.com/squizlabs/PHP_CodeSniffer/commit/3c65796c446a14788e6eb7cf44789d57e8e95252) Merge branch 'master' of https://github.com/ndm2/PHP_CodeSniffer
- [`991ed9a`](https://github.com/squizlabs/PHP_CodeSniffer/commit/991ed9a2758999c30bb101a3443e706ca3e31cd8) Add extra testcase for PSR2.Classes.ClassDeclaration.SpaceAfterKeyword
- [`e72994f`](https://github.com/squizlabs/PHP_CodeSniffer/commit/e72994fcbbf163f4d5c23367745b7736938cb274) Changelog for [#2541](https://github-redirect.dependabot.com/squizlabs/PHP_CodeSniffer/issues/2541)
- Additional commits viewable in [compare view](https://github.com/squizlabs/PHP_CodeSniffer/compare/3.4.2...3.5.0)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
If all status checks pass Dependabot will automatically merge this pull request.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme
Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Pull request limits (per update run and/or open at any time)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)
Finally, you can contact us by mentioning @dependabot.
Bumps squizlabs/php_codesniffer from 3.4.2 to 3.5.0.
Release notes
*Sourced from [squizlabs/php_codesniffer's releases](https://github.com/squizlabs/PHP_CodeSniffer/releases).* > ## 3.5.0 > ## PSR-12 Standard Ready > > PHP_CodeSniffer has included an in-progress PSR-12 standard since 3.3.0, but this release includes the completed standard. You can now check your code using the PSR-12 standard: > ``` > phpcs --standard=PSR12 /path/to/code > ``` > Most of the errors found can also be automatically fixed by PHPCBF: > ``` > phpcbf --standard=PSR12 /path/to/code > ``` > > ## Changelog > > * Added support for PHP 7.4 typed properties > * The nullable operator is now tokenized as `T_NULLABLE` inside property types, as it is elsewhere > * To get the type of a member var, use the `File::getMemberProperties()` method, which now contains a `type` array index > * This contains the type of the member var, or a blank string if not specified > * If the type is nullable, the return type will contain the leading `?` > * If a type is specified, the position of the first token in the type will be set in a `type_token` array index > * If a type is specified, the position of the last token in the type will be set in a `type_end_token` array index > * If the type is nullable, a `nullable_type` array index will also be set to `TRUE` > * If the type contains namespace information, it will be cleaned of whitespace and comments in the return value > * The PSR1 standard now correctly bans alternate PHP tags > * Previously, it only banned short open tags and not the pre-7.0 alternate tags > * Added support for only checking files that have been locally staged in a git repo > * Use `--filter=gitstaged` to check these files > * You still need to give PHPCS a list of files or directories in which to apply the filter > * Thanks to Juliette Reinders Folmer for the contribution > * JSON reports now end with a newline character > * The `phpcs.xsd` schema now validates `phpcs-only` and `phpcbf-only` attributes correctly > * Thanks to Juliette Reinders Folmer for the patch > * The tokenizer now correctly identifies inline control structures in more cases > * All helper methods inside the `File` class now throw `RuntimeException` instead of `TokenizerException` > * Some tokenizer methods were also throwing `RuntimeExpection` but now correctly throw `TokenizerException` > * Thanks to Juliette Reinders Folmer for the patch > * The `File::getMethodParameters()` method now returns more information, and supports closure USE groups > * If a type hint is specified, the position of the last token in the hint will be set in a `type_hint_end_token` array index > * If a default is specified, the position of the first token in the default value will be set in a `default_token` array index > * If a default is specified, the position of the equals sign will be set in a `default_equal_token` array index > * If the param is not the last, the position of the comma will be set in a `comma_token` array index > * If the param is passed by reference, the position of the reference operator will be set in a `reference_token` array index > * If the param is variable length, the position of the variadic operator will be set in a `variadic_token` array index > * The `T_LIST` token and it's opening and closing parentheses now contain references to each other in the tokens array > * Uses the same parenthesis_opener/closer/owner indexes as other tokens > * Thanks to Juliette Reinders Folmer for the patch > * The `T_ANON_CLASS` token and it's opening and closing parentheses now contain references to each other in the tokens array > * Uses the same parenthesis_opener/closer/owner indexes as other tokens > * Only applicable if the anon class is passing arguments to the constructor > * Thanks to Juliette Reinders Folmer for the patch > ... (truncated)Commits
- [`0afebf1`](https://github.com/squizlabs/PHP_CodeSniffer/commit/0afebf16a2e7f1e434920fa976253576151effe9) Prepare for 3.5.0 release - [`1a202bb`](https://github.com/squizlabs/PHP_CodeSniffer/commit/1a202bb5e2cd116ab61380bc912a70fb749b17d7) Added missing include for when running tests from a PEAR install - [`99d6757`](https://github.com/squizlabs/PHP_CodeSniffer/commit/99d6757858fc016b4ac8414a758241382efb1de8) Added checking for syntax errors - [`cf655b4`](https://github.com/squizlabs/PHP_CodeSniffer/commit/cf655b41de258b53d647d85cd85675b9bd2fd7f8) Fixed incorrect property description (ref [#2224](https://github-redirect.dependabot.com/squizlabs/PHP_CodeSniffer/issues/2224)) - [`523afe3`](https://github.com/squizlabs/PHP_CodeSniffer/commit/523afe3bea2ffb30da46e39fd08d91e273543380) Fixed incorrect property name (ref [#2224](https://github-redirect.dependabot.com/squizlabs/PHP_CodeSniffer/issues/2224)) - [`83de998`](https://github.com/squizlabs/PHP_CodeSniffer/commit/83de998f27a83dff4f2fdc2852c23cf35f1e7c09) Merge branch 'multilevel-indenting' of https://github.com/marcospassos/PHP_Co... - [`fb04e08`](https://github.com/squizlabs/PHP_CodeSniffer/commit/fb04e087749f032ec2cdc546419b26302955aa4a) Changelog for [#2534](https://github-redirect.dependabot.com/squizlabs/PHP_CodeSniffer/issues/2534) - [`3c65796`](https://github.com/squizlabs/PHP_CodeSniffer/commit/3c65796c446a14788e6eb7cf44789d57e8e95252) Merge branch 'master' of https://github.com/ndm2/PHP_CodeSniffer - [`991ed9a`](https://github.com/squizlabs/PHP_CodeSniffer/commit/991ed9a2758999c30bb101a3443e706ca3e31cd8) Add extra testcase for PSR2.Classes.ClassDeclaration.SpaceAfterKeyword - [`e72994f`](https://github.com/squizlabs/PHP_CodeSniffer/commit/e72994fcbbf163f4d5c23367745b7736938cb274) Changelog for [#2541](https://github-redirect.dependabot.com/squizlabs/PHP_CodeSniffer/issues/2541) - Additional commits viewable in [compare view](https://github.com/squizlabs/PHP_CodeSniffer/compare/3.4.2...3.5.0)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.If all status checks pass Dependabot will automatically merge this pull request.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language - `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com): - Update frequency (including time of day and day of week) - Pull request limits (per update run and/or open at any time) - Automerge options (never/patch/minor, and dev/runtime dependencies) - Out-of-range updates (receive only lockfile updates, if desired) - Security updates (receive only security updates, if desired) Finally, you can contact us by mentioning @dependabot.