mirror of
https://github.com/codeguy/php-the-right-way.git
synced 2025-08-07 14:36:29 +02:00
Link to "new" location of PSRs
This commit is contained in:
@@ -29,7 +29,7 @@ applications that implement the components can have consistency even when workin
|
|||||||
You can use [PHP_CodeSniffer][phpcs] to check code against any one of these recommendations, and plugins for text
|
You can use [PHP_CodeSniffer][phpcs] to check code against any one of these recommendations, and plugins for text
|
||||||
editors like [Sublime Text 2][st-cs] to be given real time feedback.
|
editors like [Sublime Text 2][st-cs] to be given real time feedback.
|
||||||
|
|
||||||
You can fix the code layout automatically by using one of the two following tools. One is the [PHP Coding Standards Fixer][phpcsfixer] which has a very well tested codebase.
|
You can fix the code layout automatically by using one of the two following tools. One is the [PHP Coding Standards Fixer][phpcsfixer] which has a very well tested codebase.
|
||||||
Another option is [php.tools][phptools], which is made popular by the [sublime-phpfmt][sublime-phpfmt] editor plugin. While being newer, it makes great improvements in performance, meaning real-time editor fixing is more fluid.
|
Another option is [php.tools][phptools], which is made popular by the [sublime-phpfmt][sublime-phpfmt] editor plugin. While being newer, it makes great improvements in performance, meaning real-time editor fixing is more fluid.
|
||||||
|
|
||||||
And you can run phpcs manually from shell:
|
And you can run phpcs manually from shell:
|
||||||
@@ -46,10 +46,10 @@ readable by all current and future parties who may be working on the codebase.
|
|||||||
|
|
||||||
|
|
||||||
[fig]: http://www.php-fig.org/
|
[fig]: http://www.php-fig.org/
|
||||||
[psr0]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md
|
[psr0]: http://www.php-fig.org/psr/psr-0/
|
||||||
[psr1]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md
|
[psr1]: http://www.php-fig.org/psr/psr-1/
|
||||||
[psr2]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md
|
[psr2]: http://www.php-fig.org/psr/psr-2/
|
||||||
[psr4]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader.md
|
[psr4]: http://www.php-fig.org/psr/psr-4/
|
||||||
[pear-cs]: http://pear.php.net/manual/en/standards.php
|
[pear-cs]: http://pear.php.net/manual/en/standards.php
|
||||||
[symfony-cs]: http://symfony.com/doc/current/contributing/code/standards.html
|
[symfony-cs]: http://symfony.com/doc/current/contributing/code/standards.html
|
||||||
[phpcs]: http://pear.php.net/package/PHP_CodeSniffer/
|
[phpcs]: http://pear.php.net/package/PHP_CodeSniffer/
|
||||||
|
@@ -21,10 +21,10 @@ namespace convention to allow plug-and-play code.
|
|||||||
|
|
||||||
In October 2014 the PHP-FIG deprecated the previous autoloading standard: [PSR-0][psr0], which has been replaced with
|
In October 2014 the PHP-FIG deprecated the previous autoloading standard: [PSR-0][psr0], which has been replaced with
|
||||||
[PSR-4][psr4]. Currently both are still perfectly usable and PSR-0 is not going away. As PSR-4 requires PHP 5.3 and
|
[PSR-4][psr4]. Currently both are still perfectly usable and PSR-0 is not going away. As PSR-4 requires PHP 5.3 and
|
||||||
many PHP 5.2-only projects currently implement PSR-0. Luckily those PHP 5.2-only projects are starting to up their
|
many PHP 5.2-only projects currently implement PSR-0. Luckily those PHP 5.2-only projects are starting to up their
|
||||||
version requirements, meaning PSR-0 is being used less and less.
|
version requirements, meaning PSR-0 is being used less and less.
|
||||||
|
|
||||||
If you're going to use an autoloader standard for a new application or package then you almost certainly want
|
If you're going to use an autoloader standard for a new application or package then you almost certainly want
|
||||||
to look into PSR-4.
|
to look into PSR-4.
|
||||||
|
|
||||||
* [Read about Namespaces][namespaces]
|
* [Read about Namespaces][namespaces]
|
||||||
@@ -33,5 +33,5 @@ to look into PSR-4.
|
|||||||
|
|
||||||
|
|
||||||
[namespaces]: http://php.net/language.namespaces
|
[namespaces]: http://php.net/language.namespaces
|
||||||
[psr0]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md
|
[psr0]: http://www.php-fig.org/psr/psr-0/
|
||||||
[psr4]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader.md
|
[psr4]: http://www.php-fig.org/psr/psr-4/
|
||||||
|
@@ -26,5 +26,5 @@ installed in any application you like:
|
|||||||
[4]: http://packages.zendframework.com/docs/latest/manual/en/index.html#zend-db
|
[4]: http://packages.zendframework.com/docs/latest/manual/en/index.html#zend-db
|
||||||
[6]: https://github.com/auraphp/Aura.Sql
|
[6]: https://github.com/auraphp/Aura.Sql
|
||||||
[7]: http://propelorm.org/
|
[7]: http://propelorm.org/
|
||||||
[psr0]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md
|
[psr0]: http://www.php-fig.org/psr/psr-0/
|
||||||
[psr4]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader.md
|
[psr4]: http://www.php-fig.org/psr/psr-4/
|
||||||
|
Reference in New Issue
Block a user