Josh,
i was aware of custom rules for PHPCS, but haven't been able to dig deep 
into *how* they should be written. Last time i read into it, some 
formatting rules can't be overridden. Maybe that's changed, or maybe i 
misunderstood it the first time around.

i'll take another look at that and try to find some tutorials. Thanks for 
the response.
-jlt


On Monday, 22 April 2019 11:23:04 UTC-4, Josh Bruce wrote:
>
>
> On Apr 22, 2019, at 6:58 AM, Joe T. <thoo...@gmail.com <javascript:>> 
> wrote:
>
> i want my team to comply with code standards, but right now PSR, Symfony, 
> and Zend are the only "standards" supported by most PHP IDEs. i would love 
> to implement this formatting as the rule, but inspection tools like PHPCS 
> don't recognize this formatting.
>
>
> FWIW, you can create custom rules (sniffs) for PHPCS. Hope that helps.
>
> I just created one for my preferred method style, submitted as a PR for 
> PSR-12: https://github.com/php-fig/fig-standards/pull/1165
>
> Given that these are recommendations not standards in the strictest sense 
> (governing body will slap your hands with a ruler until you change) nor 
> laws (baked into the language - app won’t compile if not followed) then, at 
> a macro-"you’re wrong!"-level, they don't matter. 
>
> Having said that, if we create too many dialects for syntax and semantics, 
> adoption and learning curve by peers might come into play mostly from 
> pedants of the recommendations, “Why aren’t your braces like this? You have 
> a blank line where there shouldn’t be one!” (Give this email to an English 
> major.)
>
> Because of my change above, I can’t say I follow PSR-12 100% anymore, I’m 
> okay with this as I believe the rationale is sound; therefore, I don’t say 
> I follow PSR-12 100% - 
> https://8fold.gitbook.io/handbook/coding-standards-and-styles - just that 
> I follow PSR-12 *except* here, here, and here. And I can create PHPCS 
> sniffs to override or create my own; thereby, getting feedback from my IDE 
> (Sublime Text 3 in this case).
>
> I also think prioritizing who/what the recommendation is for would be 
> beneficial.
>
> For me:
>
> 1. Other developers (humans).
> 2. Average Citizen who doesn’t know how to code really and gets 
> intimidated by all the punctuation, acronyms, and nested function calls.
> 3. IDEs to gain feedback and autocomplete (indirectly developers). 
>
>

-- 
You received this message because you are subscribed to the Google Groups "PHP 
Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to php-fig+unsubscr...@googlegroups.com.
To post to this group, send email to php-fig@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/php-fig/7635d474-a437-4a6b-99cb-3a4158f05db4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to