manticoresoftware / manticoresearch-php

Official PHP client for Manticore Search
MIT License
164 stars 32 forks source link

PHP Code Style #137

Closed aivchen closed 7 months ago

aivchen commented 10 months ago

As I see php code style is very various across the project. How about replacing PHP_CodeSniffer with Php-Cs-Fixer? The latter is very flexible, easy to set up and allows to fine tune almost any aspect of php code. Also I see that PHP_CodeSniffer is configured for PSR-2 checking. But PHP-FIG has released PSR-12 and PER - more strict standards. How about switching to PSR-12/PER?

sanikolaev commented 10 months ago

Thanks for the suggestion @aivchen

@Nick-S-2018 @donhardman Please think about it.

sanikolaev commented 10 months ago

The related PR https://github.com/manticoresoftware/manticoresearch-php/pull/141 has been approved and merged. The change will be includes in the upcoming release. Thank you for the contribution @aivchen!

aivchen commented 10 months ago

141 is not related. In #141 we just refactored PHP_CodeSniffer. But we still follow PSR-2.

In this issue I suggest switching from PSR-2 to PSR-12 or PER.

sanikolaev commented 10 months ago

Got it. Reopened.

donhardman commented 9 months ago

It's a good idea to merge our common standard introduced in Buddy & Backup projects here also.

https://github.com/manticoresoftware/php-code-standard

It also combines rules that we use and uses strict phpstan validation.

Also, I would like to hear opinion from @Nick-S-2018

Nick-S-2018 commented 9 months ago

Ok, no objections from me

sanikolaev commented 9 months ago

OK. I don't object too. Now we need to make the code compatible with it. I've asked @aivchen in https://github.com/manticoresoftware/manticoresearch-php/pull/148 if he'd like to help with that.

aivchen commented 9 months ago

Done: #148