phpcs

@phpcs@phpc.social

Making it easy to make your code more maintainable.

This profile is from a federated server and may be incomplete. Browse more on the original instance.

phpcs, to random

Released: PHP_CodeSniffer 3.10.1 🎉

This release contains a hotfix for a bug in the DNF syntax support layer, which could get confused over named parameters.

It also fixes a longer-standing bug which was plaguing match expressions containing nested arrays/closures or other nested structures.

Things should now be shiny again.

https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/tag/3.10.1

phpcs, to random

Released: PHPCSUtils 1.0.12 🎉

This release brings DNF support to PHPCSUtils for both the native functionality as well as for the BackCompat layer.
Of course, it also contains a few tweaks and bug fixes for your happiness.

Go get it while you can and --update-with-dependencies 😉

https://github.com/PHPCSStandards/PHPCSUtils/releases/tag/1.0.12

phpcs, to random

Released: PHP_CodeSniffer 3.10.0 🎉

This release adds support for PHP 8.2 DNF types in all the right places.

Additionally, the help screens have had a facelift and should be significantly more informative now.
Try it out by running phpcs -h.

Thanks go out to the 8 people who contributed to this release!

Like what you see ? Please consider funding this project: https://opencollective.com/php_codesniffer

https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/tag/3.10.0

phpcs,

@menelion Have you tried the "explain" option ?

https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Usage#listing-sniffs-inside-a-coding-standard

You can use it for your own standard, but also with PHPCS native standards or external standards and it will show you the names of the (available) sniffs in that standard.

phpcs, to random

Released: PHPCSUtils 1.0.11, which provides synchronicity with PHP_CodeSniffer 3.9.0-3.9.2 for the File::getMethodProperties() and the FunctionDeclarations::getProperties() methods.

Enjoy!

https://github.com/PHPCSStandards/PHPCSUtils/releases/tag/1.0.11

phpcs, to random

Released: PHP_CodeSniffer 3.9.2

This release fixes a bug in the arrow function tokenization and contains a bunch of bug fixes to remedy potential fixer conflicts which PHPCBF could run into.

Thanks go out to @fredden Rodrigo Primo and @jrf_nl for their contributions.

Enjoy!

https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/tag/3.9.2

phpcs, to random

Giving the PHPCS help screens a facelift.

What do you think ? Better ?

https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/447

phpcs,

@connorhu Thanks!

As a side-note: symfony/console wouldn't have been accepted as a dependency for a range of reasons.

phpcs, to random
phpcs, to random

Released: PHP_CodeSniffer 3.9.1 🎉

This release contains new documentation for four sniffs, performance improvements, in particular for Windows users, and a few bug fixes.

Please join me in thanking the six people who contributed to this release.

https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/tag/3.9.1

phpcs,

@thomastospace Not a silly question at all.

Let me introduce you to the --generator=Text CLI argument...

If you run phpcs with that argument (and without any other arguments), PHPCS will display documentation for all sniffs in your custom ruleset ([.]phpcs.xml[.dist]) with code samples of what is correct/incorrect (that is: all sniffs for which documentation is available).

phpcs,

@thomastospace
You can also use --generator=HTML or --generator=Markdown to get the output formatted for copy/paste to your coding standards website/wiki etc.

And... you can, of course, combine the argument with other CLI arguments, so: phpcs --generator=Text --standard=PSR12 will display all available documentation for all sniffs included in the PSR12 ruleset.
Or if you just want the docs for one particular sniff, use the --sniffs=Stnd.Cat.Sniffname CLI argument.

phpcs,

@thomastospace The actual documentation is contained in XML files in a Docs subdirectory in each standard in the repo.

This will also work for external standards, providing they ship with XML doc files in the location PHPCS expects them to be.

There are still sniffs in PHPCS for which docs are missing though. If you want to help with that, have a look at: https://github.com/PHPCSStandards/PHP_CodeSniffer/issues/148

Hope this helps! Let me know if you have additional questions.

phpcs,

@thomastospace For strict types, I'd say you are probably looking for the Generic.PHP.RequireStrictTypes sniff, though as adding strict types can break code, it doesn't auto-fix.

As for a website with a sniff search... have a read through https://github.com/PHPCSStandards/PHP_CodeSniffer/issues/317 ...

And yes, help on that would definitely be welcome ;-)

Short version: I'd like to get a GH Pages website set up at some point with the docs from the Wiki, some tutorials and a searchable sniff "database".

phpcs,

@thomastospace In the mean time, the --generator option and the -e (explain) option are your friends.

Explain is a great way to find out which sniffs are included in each standard (even when there are no docs) as the sniff names should help find the sniff you are looking for.

There are, of course, more ways to do it, but these are some of the options which can help.

phpcs, to random

Released: PHPCSUtils 1.0.10

This release fixes some PHP 8.4 deprecation notices and the minimum supported version of PHP_CodeSniffer has been updated to 3.9.0 for improved PHP 8.3 syntax support.

Enjoy and always update --with-dependencies

https://github.com/PHPCSStandards/PHPCSUtils/releases/tag/1.0.10

phpcs,

@imperator Cause even if the package doesn't strictly need the latest versions, you probably do.

phpcs, to random

Kudos to @mbootsman for donating the remaining funds of his fund raiser to the PHP_CodeSniffer project.

Thank you for your support!

https://walktowc.eu/2024/02/09/a-2024-update

phpcs, to random

Released: PHP_CodeSniffer 3.9.0 🎉

Notable changes:

  • Support for PHP 8.3 typed class constants
  • Support for PHP 8.3 readonly anonymous classes
  • New DepecatedSniff interface
  • New RequireExplicitBooleanOperatorPrecedence sniff
  • and much much more....

This release is brought to you by @fredden @made_by_denis @remicollet @timwolla Rodrigo Primo Joachim Noreiko and @jrf_nl

Enjoy and please consider funding the project!

https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/tag/3.9.0

tjdraper, to random
@tjdraper@phpc.social avatar

@phpcs I’m a little confused. phpcsstandards/php_codesniffer on Packagist (https://packagist.org/packages/phpcsstandards/php_codesniffer) is saying it’s abandoned. I switched because it seemed like that’s the thing to do now based on this issue: https://github.com/squizlabs/PHP_CodeSniffer/issues/3932

Any insight would be helpful 🙂. Thanks!

image/png

phpcs,

@tjdraper As it says quite clearly in the ticket you linked to: "The Composer/Packagist name will stay the same."

Also see the top of the 3.8.0 release notes: https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/tag/3.8.0

So, I'm not sure what there is to be confused about ?

phpcs,

@tjdraper No problem.

phpcs, to random

Released: PHP_CodeSniffer 3.8.1 bringing you fixes to the default (Full) report, improved support for modern PHP in the Squiz/VariableComment sniff and documentation for 10 more sniffs.

Enjoy and please consider financially supporting the project!

https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/tag/3.8.1

phpcs, to random

Pro-tip: if you get separate Dependabot PRs to update both the actions/download-artifact and the actions/upload-artifact to v4 and now your build is broken...

Cherry-pick the commit from the one PR to the other PR to update both at the same time and see if that fixes your build. It did for me.

ramsey, to php
@ramsey@phpc.social avatar

One of the first things I did when I was laid off was to cancel all my FOSS donations, which made me sad, but I’m still not sure how long this period of unemployment will last, so it was the prudent thing to so.

But once I get hired, I know I’m going to sign up to regularly donate to @phpcs! https://opencollective.com/php_codesniffer

phpcs,

@ramsey (((hugs))) Much appreciated and I totally understand and support your priorities.

Hope you'll find a new job you'll get excited about soon!

phpcs, to random

Released: PHPCSUtils 1.0.9

PHPCSUtils now requires PHP_CodeSniffer 3.8.0.
This release also includes a significant performance improvement to the UtilityMethodTestCase.

Thanks @fredden for contributing!

Enjoy and always update --with-dependencies

https://github.com/PHPCSStandards/PHPCSUtils/releases/tag/1.0.9

  • All
  • Subscribed
  • Moderated
  • Favorites
  • anitta
  • kavyap
  • DreamBathrooms
  • InstantRegret
  • magazineikmin
  • Durango
  • GTA5RPClips
  • thenastyranch
  • Youngstown
  • rosin
  • slotface
  • khanakhh
  • osvaldo12
  • tacticalgear
  • JUstTest
  • cubers
  • everett
  • Leos
  • tester
  • mdbf
  • ngwrru68w68
  • ethstaker
  • modclub
  • megavids
  • provamag3
  • cisconetworking
  • normalnudes
  • lostlight
  • All magazines