{"id":254613,"date":"2015-04-06T17:10:02","date_gmt":"2015-04-06T13:10:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=254613"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=254613","title":{"rendered":"\u0421\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 PHP \u043a\u043e\u0434\u0430 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 Symfony2 (\u0447\u0430\u0441\u0442\u044c 2)"},"content":{"rendered":"<br \/>\n<h1>\u0410\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f<\/h1>\n<p>  \u0412\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/248971\/\">\u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438<\/a> \u043d\u0435 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043b\u043e\u0441\u044c, \u043d\u043e \u0442\u0435\u043c\u0430 \u043d\u0430\u0448\u043b\u0430 \u043e\u0442\u043a\u043b\u0438\u043a, \u0442\u0430\u043a \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c.<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u043a\u043e\u0434\u0430 \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c, \u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u043d\u0430 PHP \u2014 \u043d\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435. \u041f\u043e \u0441\u0443\u0442\u0438, \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u043b\u043e\u0433\u0438\u044f \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f \u0441\u0440\u0435\u0434\u0441\u0442\u0432 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0431\u0443\u0434\u0443\u0442 \u0442\u0435 \u0436\u0435, \u0447\u0442\u043e \u0438, \u0441\u043a\u0430\u0436\u0435\u043c, <a href=\"http:\/\/habrahabr.ru\/company\/pvs-studio\/blog\/254855\/\">\u0432 \u0421++<\/a>. <\/p>\n<p>  \u041f\u0440\u0438 \u043f\u043e\u0432\u0441\u0435\u0434\u043d\u0435\u0432\u043d\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0441\u0440\u0435\u0434\u0441\u0442\u0432 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043c\u0435\u0442\u043d\u043e\u0433\u043e \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043e\u0448\u0438\u0431\u043e\u043a, \u043d\u043e \u0438 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u043a\u043e\u0434\u0430 \u0432 \u0446\u0435\u043b\u043e\u043c \u2014 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u044d\u0442\u043e \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0438 \u0435\u0441\u0442\u044c \u0446\u0435\u043b\u044c \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438.<\/p>\n<p>  \u041e \u0442\u043e\u043c, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0441 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u0432\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 (\u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u0442\u0434\u0430\u0447\u0435\u0439) \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h2>\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b<\/h2>\n<p>  \u0418\u0437 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 <a href=\"https:\/\/plugins.jetbrains.com\/plugin\/7622?pr=phpStorm\">Php Inspections (EA Extended)<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0442\u0430\u0432\u0438\u0442\u0441\u044f \u043a\u0430\u043a \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u043a PhpStorm.<\/p>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0443\u0442\u0438\u043d\u0443 \u043f\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044e \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f <a href=\"http:\/\/cs.sensiolabs.org\/\">PHP CS Fixer<\/a>, \u0442\u0435\u043c \u0431\u043e\u043b\u0435\u0435, \u0447\u0442\u043e \u043a\u043e\u0435-\u0447\u0442\u043e \u0438\u0437 Php Inspections (EA Extended) \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043e \u0432 CS Fixer (<a href=\"https:\/\/github.com\/FriendsOfPHP\/PHP-CS-Fixer\/blob\/master\/Symfony\/CS\/Fixer\/Symfony\/AliasFunctionsFixer.php\">\u0432\u043e\u0442<\/a>, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440). \u0421\u0442\u043e\u0438\u0442 \u043f\u0440\u0438\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c\u0441\u044f \u043a \u044d\u0442\u043e\u0439 \u0443\u0442\u0438\u043b\u0438\u0442\u0435 \u2014 \u043e\u043d\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043a\u043e\u0434, \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0430\u044f \u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0438 \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u0442 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0432\u043d\u0435\u0441\u0442\u0438 \u043e\u0448\u0438\u0431\u043a\u0438, \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u044f \u043a\u043e\u0434 \u0432\u0440\u0443\u0447\u043d\u0443\u044e.<\/p>\n<p>  \u041d\u0443 \u0438, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0441\u043b\u0435\u043f\u043e \u0432\u0435\u0440\u0438\u0442\u044c \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430\u043c: \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u043a\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u2014 \u0432\u0435\u0449\u044c \u043d\u0435\u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u0430\u044f. \u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u043a\u043e\u0434 \u043f\u043e\u043a\u0440\u044b\u0442 \u0442\u0435\u0441\u0442\u0430\u043c\u0438 \u0434\u043e \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u2014 \u0440\u0430\u0431\u043e\u0442\u0430 \u0441\u043e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430\u043c\u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0442\u0435\u0445\u043d\u0438\u043a\u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438.<\/p>\n<h1>\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0434\u0435\u0444\u0435\u043a\u0442\u043e\u0432<\/h1>\n<p>  <\/p>\n<h2>Reference mismatch \u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u043f\u0430\u043c\u044f\u0442\u044c\u044e<\/h2>\n<p>  \u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u0439\u0442\u0438 \u044d\u0442\u043e\u0442 \u0442\u0438\u043f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0431\u0435\u0437 \u0434\u043e\u043b\u0433\u043e\u0433\u043e \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u0447\u0435\u043d\u044c \u043c\u0430\u043b\u0430, \u043d\u043e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u044b\u044f\u0432\u0438\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u043c\u0435\u0441\u0442\u0430. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 \u0438 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430\u0445, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u043b\u0430\u0441\u044c \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0440\u0430\u0441\u0445\u043e\u0434\u0430 \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<p>  \u0412 \u0438\u0434\u0435\u0430\u043b\u0435, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0437\u0430\u043c\u0435\u0442\u0438\u0442 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u0438 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u043c\u044b \u0443\u0436\u0435 \u043d\u0435 \u0443\u0432\u0438\u0434\u0438\u043c. \u041e\u0433\u043e\u0432\u043e\u0440\u044e\u0441\u044c, \u0447\u0442\u043e \u0438\u043d\u0441\u043f\u0435\u043a\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0440\u0435\u043b\u0438\u0437\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u0430.<\/p>\n<pre><code class=\"php\">namespace Symfony\\Component\\HttpFoundation\\Session\\Attribute;  class NamespacedAttributeBag extends AttributeBag {     ...     public function get($name, $default = null) {         \/*          * protected function &resolveAttributePath($name, $writeContext = false);          * reference mismatch, \u043a\u043e\u043f\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u0430 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e          *\/          $attributes = $this-&gt;resolveAttributePath($name);          ...     }     ... } <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c:  <\/p>\n<pre><code class=\"php\">    public function get($name, $default = null) {         $attributes = &$this-&gt;resolveAttributePath($name);         ...     } <\/code><\/pre>\n<p>  <\/p>\n<h2>Foreach, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 \u0438 \u043d\u0435\u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438<\/h2>\n<p>  \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c foreach \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u043d \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438, \u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u0441\u0442\u0430\u044e\u0442\u0441\u044f \u0432 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u0430\u043a \u0441\u0441\u044b\u043b\u043a\u0443, \u043c\u043e\u0436\u043d\u043e \u0432\u043d\u0435\u0441\u0442\u0438 \u043e\u0447\u0435\u043d\u044c \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u044b\u0439 \u0431\u0430\u0433, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0431\u0435\u0437 \u0432\u0438\u0434\u0438\u043c\u043e\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u044b. <\/p>\n<p>  \u0421\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0432\u044b\u044f\u0432\u0438\u0442 \u0442\u0430\u043a\u0438\u0435 \u043c\u0435\u0441\u0442\u0430 \u0443\u0436\u0435 \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u0440\u043e\u0445\u043e\u0434\u0435.  <\/p>\n<pre><code class=\"php\">namespace Symfony\\Component\\Console\\Descriptor;  class ApplicationDescription {     ...     private function sortCommands(array $commands) {         ...         foreach ($namespacedCommands as &$commands) {             ksort($commands);         }         \/*          * \u0415\u0441\u043b\u0438 \u0442\u0443\u0442 \u0447\u0442\u043e-\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441 $commands,          * \u0442\u043e \u043f\u043e\u0441\u043b\u0435\u043d\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 $namespacedCommands \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0432\u0440\u0435\u0436\u0434\u0451\u043d          *\/          return $namespacedCommands;     }     ... } <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c:  <\/p>\n<pre><code class=\"php\">    private function sortCommands(array $commands)     {         ...         foreach ($namespacedCommands as &$commands) {             ksort($commands);         }         unset($commands);         ...          return $namespacedCommands;     } <\/code><\/pre>\n<p>  <\/p>\n<h2>\u041c\u0438\u043a\u0440\u043e-\u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438<\/h2>\n<p>  \u0422\u0443\u0442 \u044f \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435\u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b, \u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442 \u0441\u0432\u043e\u044e \u0437\u0430\u0434\u0430\u0447\u0443.<br \/>  \u041f\u043e \u043c\u043e\u0438\u043c \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f\u043c, \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 \u043f\u0440\u0438 \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u043c\u0435\u043d\u0435 \u0447\u043b\u0435\u043d\u043e\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0441 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432.<\/p>\n<p>  \u041c\u043e\u0436\u043d\u043e \u0441\u043c\u0435\u044f\u0442\u044c\u0441\u044f \u0438 \u043e\u0431\u0441\u0443\u0436\u0434\u0430\u0442\u044c \u043a\u043e\u043c\u043f\u0435\u0442\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432, \u043d\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u043e\u0440\u0443 \u0438\u043b\u0438 \u0442\u0438\u043c\u043b\u0438\u0434\u0443 \u043b\u0443\u0447\u0448\u0435 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u043c\u0435\u0441\u0442\u0430 \u0441\u0430\u043c\u043e\u043c\u0443 \u0438 \u0431\u0435\u0437 \u043b\u0438\u0448\u043d\u0435\u0439 \u043a\u0440\u0438\u0442\u0438\u043a\u0438 \u2014 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u043e\u0446\u0435\u043d\u0438\u0442 \u0438 \u0441\u0444\u043e\u043a\u0443\u0441\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447\u0430\u0445.<\/p>\n<pre><code class=\"php\">\/\/  if (false !== strpos($lang, '-')) - \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442     if (strstr($lang, '-')) {         ...     }  \/\/  $cast = (int) $value - \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442     $cast = intval($value);  \/\/  return (float) $value - \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442     return floatval($value);  \/\/  $this-&gt;ignore |= static::IGNORE_DOT_FILES - \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442     $this-&gt;ignore = $this-&gt;ignore | static::IGNORE_DOT_FILES;  \/\/  if (!in_array(static::$availableOptions[$option], $this-&gt;options)) - \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442     if (false === array_search(static::$availableOptions[$option], $this-&gt;options)) {         ...     }  \/\/  ++$calls[$id] - \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442     $calls[$id] += 1;  \/\/  if ('root' === get_current_user()) - \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442     if (in_array(get_current_user(), array('root'))) {         ...     }  \/\/  if (array_key_exists($id, $container-&gt;getAliases())) - \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442     if (in_array($id, array_keys($container-&gt;getAliases()))) {         ...     }  \/\/  return '' === $relativePath ? '.\/' : $relativePath - \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442     return (strlen($relativePath) === 0) ? '.\/' : $relativePath; <\/code><\/pre>\n<p>  <\/p>\n<h2>\u041c\u0451\u0440\u0442\u0432\u044b\u0439 \u043a\u043e\u0434<\/h2>\n<p>  \u0418\u043d\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u044b \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430, \u043d\u0435\u0437\u0430\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u043c\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430\u043c\u0438.  <\/p>\n<pre><code class=\"php\">namespace Symfony\\Component\\Security\\Acl\\Dbal;  class MutableAclProvider extends AclProvider implements MutableAclProviderInterface, PropertyChangedListener { \t...     private function updateNewFieldAceProperty($name, array $changes)     {         ...         \/\/ \u043c\u0451\u0440\u0442\u0432\u044b\u0439 \u043a\u043e\u0434         $currentIds = array();          foreach ($changes[1] as $field =&gt; $new) {             for ($i = 0, $c = count($new); $i &lt; $c; $i++) {                 ...                  if (null === $ace-&gt;getId()) {                     ...                 } else {                     \/\/ \u043c\u0451\u0440\u0442\u0432\u044b\u0439 \u043a\u043e\u0434\t\t                     $currentIds[$ace-&gt;getId()] = true;\t\t                 }             }         }     }  \t... } <\/code><\/pre>\n<p>  <\/p>\n<h1>\u0412\u043c\u0435\u0441\u0442\u043e \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f<\/h1>\n<p>  \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0438\u0437 \u0441\u0442\u0430\u0442\u044c\u0438 (\u0430 \u0432\u0441\u0435 \u043e\u043d\u0438 \u0447\u0430\u0441\u0442\u044c PRs \u0432 Symfony2) \u043c\u043e\u0442\u0438\u0432\u0438\u0440\u0443\u044e\u0442 \u0432\u0430\u0441 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0441\u0432\u043e\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u0435\u0449\u0435 \u0440\u0430\u0437 \u0438 \u0432\u043d\u0435\u0434\u0440\u0438\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0432 \u043f\u043e\u0432\u0441\u0435\u0434\u043d\u0435\u0432\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443. <\/p>\n<p>  \u0412 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043a\u043e\u043c\u043c\u0435\u0440\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0435 5-10 \u043b\u0435\u0442 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u043d\u0430 \u043d\u0430\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043f\u043e\u0440\u044f\u0434\u043a\u0430 \u0438 \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u00ab\u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0445\u00bb \u043e\u0448\u0438\u0431\u043e\u043a, Php Inspections (EA Extended) \u0438 PHP CS Fixer \u0441\u0442\u0430\u043d\u0443\u0442 \u0434\u043b\u044f \u0432\u0430\u0441 \u043d\u0435\u0437\u0430\u043c\u0435\u043d\u0438\u043c\u044b\u043c\u0438 \u0438\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0434\u0435\u043d\u044c.<\/p>\n<p>  \u0414\u043b\u044f \u043e\u043f\u0435\u043d\u0441\u043e\u0440\u0441\u0430 \u044f \u043d\u0430\u043f\u043e\u043c\u043d\u044e \u043f\u0440\u043e <a href=\"http:\/\/scrutinizer-ci.com\">Scrutinizer CI<\/a> \u0438 <a href=\"http:\/\/insight.sensiolabs.com\">Sensio Labs Insights<\/a> \u2014 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0434\u0432\u0443\u043c\u044f \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u043c\u0438.     \t<\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/254949\/\"> http:\/\/habrahabr.ru\/post\/254949\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<br \/>\n<h1>\u0410\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f<\/h1>\n<p>  \u0412\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/248971\/\">\u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438<\/a> \u043d\u0435 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043b\u043e\u0441\u044c, \u043d\u043e \u0442\u0435\u043c\u0430 \u043d\u0430\u0448\u043b\u0430 \u043e\u0442\u043a\u043b\u0438\u043a, \u0442\u0430\u043a \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c.<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u043a\u043e\u0434\u0430 \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c, \u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u043d\u0430 PHP \u2014 \u043d\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435. \u041f\u043e \u0441\u0443\u0442\u0438, \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u043b\u043e\u0433\u0438\u044f \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f \u0441\u0440\u0435\u0434\u0441\u0442\u0432 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0431\u0443\u0434\u0443\u0442 \u0442\u0435 \u0436\u0435, \u0447\u0442\u043e \u0438, \u0441\u043a\u0430\u0436\u0435\u043c, <a href=\"http:\/\/habrahabr.ru\/company\/pvs-studio\/blog\/254855\/\">\u0432 \u0421++<\/a>. <\/p>\n<p>  \u041f\u0440\u0438 \u043f\u043e\u0432\u0441\u0435\u0434\u043d\u0435\u0432\u043d\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0441\u0440\u0435\u0434\u0441\u0442\u0432 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043c\u0435\u0442\u043d\u043e\u0433\u043e \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043e\u0448\u0438\u0431\u043e\u043a, \u043d\u043e \u0438 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u043a\u043e\u0434\u0430 \u0432 \u0446\u0435\u043b\u043e\u043c \u2014 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u044d\u0442\u043e \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0438 \u0435\u0441\u0442\u044c \u0446\u0435\u043b\u044c \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438.<\/p>\n<p>  \u041e \u0442\u043e\u043c, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0441 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u0432\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 (\u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u0442\u0434\u0430\u0447\u0435\u0439) \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-254613","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/254613","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=254613"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/254613\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=254613"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=254613"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=254613"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}