{"id":316720,"date":"2021-01-21T15:00:34","date_gmt":"2021-01-21T15:00:34","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=316720"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=316720","title":{"rendered":"\u041d\u043e\u0432\u043e\u0435 \u0432 Symfony 5.2: \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b PHP 8"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<blockquote>\n<p>\u0412 \u043f\u0440\u0435\u0434\u0434\u0432\u0435\u0440\u0438\u0438 \u0441\u0442\u0430\u0440\u0442\u0430 <a href=\"https:\/\/otus.pw\/WMg5\/\">\u043a\u0443\u0440\u0441\u0430 \u00abSymfony Framework\u00bb<\/a> \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c \u0431\u0443\u0434\u0443\u0449\u0438\u043c \u0441\u0442\u0443\u0434\u0435\u043d\u0442\u0430\u043c \u0438 \u0432\u0441\u0435\u043c \u0436\u0435\u043b\u0430\u044e\u0449\u0438\u043c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u044c \u0432\u0435\u0431\u0438\u043d\u0430\u0440\u0430 \u043d\u0430 \u0442\u0435\u043c\u0443 <a href=\"https:\/\/otus.pw\/NKv3\/\">\u00ab\u041c\u0438\u043a\u0440\u043e\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0438: \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 Symfony \u0438 Symlex\u00bb<\/a>.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0434\u0435\u043b\u0438\u043c\u0441\u044f \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u043e\u043c \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0433\u043e \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430.<\/p>\n<\/blockquote>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9c6\/311\/c86\/9c6311c86aebd43077f0d94a575ed935\" width=\"780\" height=\"439\"><figcaption><\/figcaption><\/figure>\n<hr>\n<p>\u0412 PHP 8 \u0431\u044b\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b \u043d\u043e\u0432\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u0444\u0438\u0447\u0438, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a <a href=\"https:\/\/wiki.php.net\/rfc\/union_types_v2\">\u0442\u0438\u043f\u044b \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f<\/a>, <a href=\"https:\/\/wiki.php.net\/rfc\/match_expression_v2\">match-\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f <\/a>\u0438 <a href=\"https:\/\/wiki.php.net\/rfc\/constructor_promotion\">constructor property promotion<\/a>. \u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0432\u043e\u0441\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043d\u043e\u0432\u043e\u0439 \u0444\u0438\u0447\u0435\u0439 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f <strong>\u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b<\/strong> (\u0442\u0430\u043a\u0436\u0435 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f\u043c\u0438).<\/p>\n<p>Symfony 5.2 \u0431\u0443\u0434\u0435\u0442 \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 PHP 8 \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0440\u043e\u0443\u0442\u043e\u0432 \u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439. \u0415\u0441\u043b\u0438 \u0432\u044b \u0443\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438, \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0431\u0435\u0441\u0448\u043e\u0432\u043d\u044b\u043c:<\/p>\n<pre><code class=\"php\">\/\/ \u0414\u041e: \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Doctrine Annotations use Symfony\\Component\\Routing\\Annotation\\Route;  class SomeController {     \/**      * @Route(\"\/path\", name=\"action\")      *\/     public function someAction()     {         \/\/ ...     } }<\/code><\/pre>\n<pre><code class=\"php\">\/\/ \u041f\u041e\u0421\u041b\u0415: \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 PHP 8 use Symfony\\Component\\Routing\\Annotation\\Route;  class SomeController {     #[Route('\/path', name: 'action')]     public function someAction()     {         \/\/ ...     } }<\/code><\/pre>\n<p>\u0422\u043e\u0442 \u0436\u0435 \u043a\u043b\u0430\u0441\u0441 <code>Route<\/code> \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0439 Doctrine \u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 PHP, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0438\u043c\u043f\u043e\u0440\u0442 \u043a\u043b\u0430\u0441\u0441\u0430. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u2014 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a: <code>#[\u2026]<\/code> \u0412\u043e\u0442 \u0438 \u0432\u0441\u0435! \u0412\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0442\u0435\u043f\u0435\u0440\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b PHP, \u0438 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a <code>doctrine\/annotations<\/code>, \u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u0438\u0445 \u0433\u0434\u0435-\u043b\u0438\u0431\u043e \u0435\u0449\u0435.<\/p>\n<p>\u041c\u044b \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <code>#[Required]<\/code>, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044e <code>@Required<\/code> \u0438 \u0441\u043e\u043e\u0431\u0449\u0438\u0442\u044c Symfony, \u0447\u0442\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e\/\u043c\u0435\u0442\u043e\u0434 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u0443\u044e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c:<\/p>\n<pre><code class=\"php\">use Symfony\\Contracts\\Service\\Attribute\\Required;  class SomeService {     #[Required]     public Bar $bar;      #[Required]     public function setFoo(Foo $foo): void     {         \/\/ ...     } }<\/code><\/pre>\n<p>PHP \u0432\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u0432 \u043d\u043e\u0432\u0443\u044e \u0437\u043e\u043b\u043e\u0442\u0443\u044e \u044d\u0440\u0443 \u0441 \u0432\u044b\u043f\u0443\u0441\u043a\u043e\u043c PHP 8, \u0438 Symfony \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441 \u043d\u0438\u043c \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c \u0441 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0434\u043d\u044f. \u042d\u0442\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u2014 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0430\u043b\u043e, \u0438 \u0432 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0435 \u043d\u0435\u0434\u0435\u043b\u0438 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0435\u0449\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438).<\/p>\n<hr>\n<blockquote>\n<p><a href=\"https:\/\/otus.pw\/WMg5\/\"><strong><em>\u0423\u0437\u043d\u0430\u0442\u044c \u043f\u043e\u0434\u043e\u0431\u043d\u0435\u0435 \u043e \u043a\u0443\u0440\u0441\u0435 <\/em><\/strong><\/a><strong><em>\u00abSymfony Framework\u00bb.<\/p>\n<p><\/em><\/strong><a href=\"https:\/\/otus.pw\/NKv3\/\"><strong><em>\u0421\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u044c \u0432\u0435\u0431\u0438\u043d\u0430\u0440\u0430<\/em><\/strong><\/a><strong><em> \u00ab\u041c\u0438\u043a\u0440\u043e\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0438: \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 Symfony \u0438 Symlex\u00bb.<\/em><\/strong><\/p>\n<\/blockquote>\n<hr>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6dc\/5eb\/11a\/6dc5eb11ac9eeff93ce6747cce24bdb7\" width=\"1200\" height=\"628\"><figcaption><\/figcaption><\/figure>\n<p><a href=\"https:\/\/otus.pw\/6sRG\/\"><strong>\u0417\u0410\u0411\u0420\u0410\u0422\u042c \u0421\u041a\u0418\u0414\u041a\u0423<\/strong><\/a><\/p>\n<\/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=\"https:\/\/habr.com\/ru\/company\/otus\/blog\/538482\/\"> https:\/\/habr.com\/ru\/company\/otus\/blog\/538482\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<blockquote>\n<p>\u0412 \u043f\u0440\u0435\u0434\u0434\u0432\u0435\u0440\u0438\u0438 \u0441\u0442\u0430\u0440\u0442\u0430 <a href=\"https:\/\/otus.pw\/WMg5\/\">\u043a\u0443\u0440\u0441\u0430 \u00abSymfony Framework\u00bb<\/a> \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c \u0431\u0443\u0434\u0443\u0449\u0438\u043c \u0441\u0442\u0443\u0434\u0435\u043d\u0442\u0430\u043c \u0438 \u0432\u0441\u0435\u043c \u0436\u0435\u043b\u0430\u044e\u0449\u0438\u043c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u044c \u0432\u0435\u0431\u0438\u043d\u0430\u0440\u0430 \u043d\u0430 \u0442\u0435\u043c\u0443 <a href=\"https:\/\/otus.pw\/NKv3\/\">\u00ab\u041c\u0438\u043a\u0440\u043e\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0438: \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 Symfony \u0438 Symlex\u00bb<\/a>.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0434\u0435\u043b\u0438\u043c\u0441\u044f \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u043e\u043c \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0433\u043e \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430.<\/p>\n<\/blockquote>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<hr>\n<p>\u0412 PHP 8 \u0431\u044b\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b \u043d\u043e\u0432\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u0444\u0438\u0447\u0438, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a <a href=\"https:\/\/wiki.php.net\/rfc\/union_types_v2\">\u0442\u0438\u043f\u044b \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f<\/a>, <a href=\"https:\/\/wiki.php.net\/rfc\/match_expression_v2\">match-\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f <\/a>\u0438 <a href=\"https:\/\/wiki.php.net\/rfc\/constructor_promotion\">constructor property promotion<\/a>. \u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0432\u043e\u0441\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043d\u043e\u0432\u043e\u0439 \u0444\u0438\u0447\u0435\u0439 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f <strong>\u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b<\/strong> (\u0442\u0430\u043a\u0436\u0435 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f\u043c\u0438).<\/p>\n<p>Symfony 5.2 \u0431\u0443\u0434\u0435\u0442 \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 PHP 8 \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0440\u043e\u0443\u0442\u043e\u0432 \u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439. \u0415\u0441\u043b\u0438 \u0432\u044b \u0443\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438, \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0431\u0435\u0441\u0448\u043e\u0432\u043d\u044b\u043c:<\/p>\n<pre><code class=\"php\">\/\/ \u0414\u041e: \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Doctrine Annotations use Symfony\\Component\\Routing\\Annotation\\Route;  class SomeController {     \/**      * @Route(\"\/path\", name=\"action\")      *\/     public function someAction()     {         \/\/ ...     } }<\/code><\/pre>\n<pre><code class=\"php\">\/\/ \u041f\u041e\u0421\u041b\u0415: \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 PHP 8 use Symfony\\Component\\Routing\\Annotation\\Route;  class SomeController {     #[Route('\/path', name: 'action')]     public function someAction()     {         \/\/ ...     } }<\/code><\/pre>\n<p>\u0422\u043e\u0442 \u0436\u0435 \u043a\u043b\u0430\u0441\u0441 <code>Route<\/code> \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0439 Doctrine \u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 PHP, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0438\u043c\u043f\u043e\u0440\u0442 \u043a\u043b\u0430\u0441\u0441\u0430. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u2014 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a: <code>#[\u2026]<\/code> \u0412\u043e\u0442 \u0438 \u0432\u0441\u0435! \u0412\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0442\u0435\u043f\u0435\u0440\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b PHP, \u0438 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a <code>doctrine\/annotations<\/code>, \u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u0438\u0445 \u0433\u0434\u0435-\u043b\u0438\u0431\u043e \u0435\u0449\u0435.<\/p>\n<p>\u041c\u044b \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <code>#[Required]<\/code>, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044e <code>@Required<\/code> \u0438 \u0441\u043e\u043e\u0431\u0449\u0438\u0442\u044c Symfony, \u0447\u0442\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e\/\u043c\u0435\u0442\u043e\u0434 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u0443\u044e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c:<\/p>\n<pre><code class=\"php\">use Symfony\\Contracts\\Service\\Attribute\\Required;  class SomeService {     #[Required]     public Bar $bar;      #[Required]     public function setFoo(Foo $foo): void     {         \/\/ ...     } }<\/code><\/pre>\n<p>PHP \u0432\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u0432 \u043d\u043e\u0432\u0443\u044e \u0437\u043e\u043b\u043e\u0442\u0443\u044e \u044d\u0440\u0443 \u0441 \u0432\u044b\u043f\u0443\u0441\u043a\u043e\u043c PHP 8, \u0438 Symfony \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441 \u043d\u0438\u043c \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c \u0441 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0434\u043d\u044f. \u042d\u0442\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u2014 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0430\u043b\u043e, \u0438 \u0432 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0435 \u043d\u0435\u0434\u0435\u043b\u0438 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0435\u0449\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438).<\/p>\n<hr>\n<blockquote>\n<p><a href=\"https:\/\/otus.pw\/WMg5\/\"><strong><em>\u0423\u0437\u043d\u0430\u0442\u044c \u043f\u043e\u0434\u043e\u0431\u043d\u0435\u0435 \u043e \u043a\u0443\u0440\u0441\u0435 <\/em><\/strong><\/a><strong><em>\u00abSymfony Framework\u00bb.<\/p>\n<p><\/em><\/strong><a href=\"https:\/\/otus.pw\/NKv3\/\"><strong><em>\u0421\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u044c \u0432\u0435\u0431\u0438\u043d\u0430\u0440\u0430<\/em><\/strong><\/a><strong><em> \u00ab\u041c\u0438\u043a\u0440\u043e\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0438: \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 Symfony \u0438 Symlex\u00bb.<\/em><\/strong><\/p>\n<\/blockquote>\n<hr>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p><a href=\"https:\/\/otus.pw\/6sRG\/\"><strong>\u0417\u0410\u0411\u0420\u0410\u0422\u042c \u0421\u041a\u0418\u0414\u041a\u0423<\/strong><\/a><\/p>\n<\/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=\"https:\/\/habr.com\/ru\/company\/otus\/blog\/538482\/\"> https:\/\/habr.com\/ru\/company\/otus\/blog\/538482\/<\/a><br \/><\/br><\/br><\/p>\n<\/blockquote>\n<\/hr>\n<\/hr>\n<\/blockquote>\n<\/div>\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-316720","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/316720","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=316720"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/316720\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=316720"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=316720"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=316720"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}