#phpcs

klausiklausi
2025-05-03

Coder 8.3.29 released!🚀

ignore directives are now handled a bit better.

A new sniff for hook names in PHP attributes has been added.

drupal.org/project/coder/relea

Jeffrey A. "jam" McGuirehorncologne@fosstodon.org
2025-04-14

Hey, #OpenSource and #PHP friends!

@jrf_nl, maintainer of #PHP_CodeSniffer is live-streaming the upgrade to the 4.0 branch of #PHPCS this week!

Such a fun idea! Come along and watch #FOSS in action!

github.com/PHPCSStandards/PHP_

2025-03-25

How come there is no sniff for #phpcs that enforces $snake_case variables. By whatever reason it is, I need this and I can't find how to do it...

2025-02-14

TIP: If you want to know how to integrate an existing PHPCS configuration into Tomas Votruba's excellent easy-coding-standard linting tool -> here you go : github.com/lgersman/docker-ecs

The repo features a xdebug+vscode ready configuration for ecs including a custom WordPress Coding Standard derivate consumed by ecs.

#wordpress #ecs #easy-coding-standard #phpcs #lint

cory hughartcr0ybot
2025-02-05

Maybe it's because I started writing vanilla HTML first before adding , and I was meticulous with code formatting before I was introduced to , but my brain still thinks about indentation in PHP as separate from HTML indentation.

I have yet to find a coding standard or sniff for this.

Screenshot of a comparison between two PHP code formatting styles. The first shows HTML tags indented as they would be without any PHP. The PHP open and close tags are on their own line, and the PHP code follows it's own internal indentation logic unaffected by HTML nesting level.

The second example shows "standard" indentation where both HTML and PHP affect each others' indentation level.
2024-12-30

I love clean code. Thus, I’ve created my own coding standard for PHP Code Sniffer. 🎉

epiph.yt/en/blog/2024/i-releas

#PHP #PHPCS #CodingStandard #CleanCode #Code

2024-12-30

Ich liebe sauberen Code. Deshalb habe ich meinen eigenen Coding Standard für PHPCS erstellt. 🎉

epiph.yt/blog/2024/ich-habe-me

#PHP #PHPCS #CodingStandard #CleanCode #Code

2024-11-14

PHPStrom kann das hübsch machen, aber ich finde keine Rule für eins der üblichen Tools, so dass wir das automatisieren und in der CI testen können…
Ich kann mir nicht vorstellen dass es da NICHTS gibt… gucke ich falsch? Hat jemand einen Tipp?
#typo3 #phpcs #rector #phpcsfixer #codestyle

2024-11-14

Wir räumen eine recht große legacy code base auf. Rector hilft uns dabei sehr, macht aber auch den CodeStyle durcheinander. phpcs kann das meiste sehr gut wieder aufräumen - nur große arrays nicht (TCA, ext_emconf). Rector schreibt alles items in eine laaaaaange Zeile.
#typo3 #phpcs #rector #phpcsfixer #codestyle

Emanuele Panzthepanz@phpc.social
2024-10-29

Looking for help: does a multiline PHP attribute constructor fixer rule exists for php-cs-fixer?

I would like to transform attributes constructors into multiline, from:
```
#[ORM\ManyToMany(targetEntity: Permission::class, inversedBy: 'group', fetch: 'EAGER')]
private $permission;
```

To:
```
#[ORM\ManyToMany(
targetEntity: Permission::class,
inversedBy: 'group',
fetch: 'EAGER',
)]
private $permission;
```

#php #phpcsfixer #phpcs

2024-10-01

📦 #CPX: A tool for running #PHP #Composer packages effortlessly

• 🔧 Execute commands from any Composer package without installation
• 🔄 Automatically manages package updates and avoids dependency conflicts
• 🧰 Supports popular tools like #PHPUnit, #Psalm, and #PHPCS
• 🔍 Detects project-specific tools for testing, analysis, and formatting
• 💻 Includes REPL functionality with automatic project autoloaders
• 🔌 Features dynamic package inclusion and class aliasing

#OpenSource #DeveloperTools #ProductivityTools

CPX streamlines PHP development workflows by providing easy access to the entire PHP ecosystem. It allows developers to run commands from any Composer package without worrying about installation or conflicts. The tool also offers normalized workflows across different projects and enhanced PHP execution capabilities.

cpx.dev/

Event Federationblog@event-federation.eu
2024-09-21

Testing WordPress plugins using Forgejo Actions

Preface: Almost all public WordPress plugin development takes place on GitHub. We also collaborate on GitHub. However, we want to use and promote free alternatives for our own project. We currently host our own forgejo instance, but have been thinking about moving our repositories to @Codeberg, where we are more likely to find contributors and bug reports until the forgejo federation is more mature.

Automated Testing Workflows: It took us a long time to set up working workflows that run integrations tests with WordPress and the WordPress ActivityPub-plugin within Forgejo Actions using the Forgejo-Runner. Copy pasting the GitHub Actions workflow from for instance the ActivityPub plugin was just the beginning of an almost ten hour long debugging session. But now the tests are working.

#ForgejoActions #ForgejoRunner #Forgejo #PHPCS #PHPUnit #WordPress

Katy TransWomenAreWomen Ereiramaccath@phpc.social
2024-05-29

The life of a maintainer (and generally any back-end engineer) - if your existence is acknowledged, something's probably gone wrong! I feel you, @jrf_nl

Thank you to all of the package maintainers out there đź’•

#ipc24 #webinale24 #intPHPcon #webinale #ipc #php #phpcs

"If something 'just' works, it generally means someone in the background is putting a sh*tload of effort into it to keep it running smoothly" reads the projected slide that Juliette is presenting to a seated audience.
2024-05-22

@shochdoerfer @markusstaab I am curious, though, why it’s a #PHPStan extension and not a #phpcs sniff (or something of the code style sort).

Patrick Hellerhellpat
2024-05-13

@bigcalm IMO it is not possible to maintain code style, when the surrounding code is formatted badly.

If you have a config you can fix the Codebase without a huge invest of time and without a big risk.

If you don't want to be responsible via `git blame` you could ignore the reformatting commit: akrabat.com/ignoring-revisions

Looks like there is a way: github.com/exussum12/coverageC
but I did not check it, because I think fixing the Codebase is more helpful.

Hope I could help at least a little bit 🤟

2024-02-06

This Thursday I'll be at #010PHP for an Ask-Me-Anything session about PHP_CodeSniffer.

Ask your question and I'll answer with a live demo.

Should be fun, come join us if you can :elephpant_blue:

meetup.com/010php/events/29865

#phpcs

2024-01-29

I'm hoping to get most of the syntax support for PHP 8.3 ready over the next few days, which means that if all goes well, it will be included in #PHP_CodeSniffer 3.9.0 release.

The PR to add Tokenizer support for PHP 8.3 readonly anonymous classes to PHPCS is already open.

github.com/PHPCSStandards/PHP_

#phpcs

2023-12-12

In case you missed it:

Last Friday, one week after the announcement that I'd be taking over maintenance of PHP_CodeSniffer, I have released version 3.8.0.

Enjoy!

#phpcs #php

github.com/PHPCSStandards/PHP_

2023-12-10

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! opencollective.com/php_codesni

#PHP #PHPCS

2023-12-06

Cleaning up merged branches... the PHP_CodeSniffer 3.8.0 release is going to be great!

#phpcs

Screenshot from a git prune run showing dozens of branches being deleted after they were merged into the new repository.

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst