symplify / coding-standard

Coding Standard rules for PHP projects with focus on Clean Architecture
MIT License
347 stars 20 forks source link

[StandaloneLineConstructorParamFixer] Ignore constructor without arguments #32

Closed ruudk closed 11 months ago

ruudk commented 11 months ago

When you have a constructor without arguments, the fixer changes it to:

-protected function __construct() {
+protected function __construct(
+) {

Not sure how to solve this. Any advice?

TomasVotruba commented 11 months ago

I'd skip the ) as following token or get arguments count and skip if === 0.

TomasVotruba commented 11 months ago

I'd skip the ) as following token or get arguments count and skip if === 0.

ruudk commented 11 months ago

While running this test locally, I notice that my changes in src/Fixer/Spacing/StandaloneLineConstructorParamFixer.php are not used.

Upon running it with Xdebug, I notice that the tests use this file:

vendor/symplify/easy-coding-standard/vendor/symplify/coding-standard/src/Fixer/Spacing/StandaloneLineConstructorParamFixer.php

Is there a developer contributing guideline that I'm missing?

I checked out the repo, ran composer install, and ran the tests. I expected it to use the code in src but apparently it uses the scoped vendor code in vendor/symplify/easy-coding-standard/vendor/.

ruudk commented 11 months ago

@TomasVotruba I think I found a way to solve it. Could you approve the workflow?

ruudk commented 11 months ago

@TomasVotruba Please approve again. Why is there approval needed?

TomasVotruba commented 11 months ago

That's Github default for first-contributors. Do you know how to turn it off?

TomasVotruba commented 11 months ago

Thanks for the fix 👍

ruudk commented 11 months ago

Thanks for the hint and the merge. Please tag it 💙

TomasVotruba commented 11 months ago

Expect next week