I can't imagine my life without PHP CodeStyle Fixer and here is why.
https://github.com/FriendsOfPHP/PHP-CS-Fixer
This thing automatically makes your code PSR-1 & PSR-2 compatible, cleans spaces, makes arrays shorter ([] instead of array()) and makes code written by different developers looks similar. Further reading will be easier and it's lowering CTO butthurt level about exess spaces before the if.
This tool has a plugin for every popular IDE so you can make code looks perfect just by pressing the hotkey. Or even on every save. But it's too much. Just by hotkey is OK.
Here is our config which are we using. You could use it but don't forget to read the docs.
https://gist.github.com/chekalskiy/c79c77657a18419125c72c86fe333b86
#library #php #psr2
https://github.com/FriendsOfPHP/PHP-CS-Fixer
This thing automatically makes your code PSR-1 & PSR-2 compatible, cleans spaces, makes arrays shorter ([] instead of array()) and makes code written by different developers looks similar. Further reading will be easier and it's lowering CTO butthurt level about exess spaces before the if.
This tool has a plugin for every popular IDE so you can make code looks perfect just by pressing the hotkey. Or even on every save. But it's too much. Just by hotkey is OK.
Here is our config which are we using. You could use it but don't forget to read the docs.
https://gist.github.com/chekalskiy/c79c77657a18419125c72c86fe333b86
#library #php #psr2
JSON5 is starting to take off.
It is a new JSON extension format making it more convenient to write by hands.
In JSON5 you can:
• use comments,
• use single quotes,
• write keys without quotes at all,
• add a trailing comma everywhere,
and many more.
PHP library
#php #library
It is a new JSON extension format making it more convenient to write by hands.
In JSON5 you can:
• use comments,
• use single quotes,
• write keys without quotes at all,
• add a trailing comma everywhere,
and many more.
PHP library
#php #library
About copy-paste again.
Today i've learned a difference between
#php
Today i've learned a difference between
sprintf("%015.2F", $var)
and sprintf("%015.2f", $var)
. In function which i've copied from first google search result was the second variant and suprisingly it's result depends from locale. It become clear only on stage server, where code cannot find the dot in the result.#php