{"id":302511,"date":"2020-04-26T03:00:10","date_gmt":"2020-04-26T03:00:10","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=302511"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=302511","title":{"rendered":"\u041a\u0430\u043a \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u0441 \u0431\u0430\u043d\u0434\u043b\u0430\u043c\u0438 Symfony 5? \u0427\u0430\u0441\u0442\u044c 4. \u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0431\u0430\u043d\u0434\u043b\u0430 \u0432 \u0445\u043e\u0441\u0442\u0435"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/499074\/\">\n<p>\u041f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043f\u0440\u0435\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442\u0438\u0442\u044c \u043c\u0435\u0436\u0434\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u043c\u0438 \u0438 \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u043a\u043e\u0434 \u0432 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u044b\u0439 \u0431\u0430\u043d\u0434\u043b Symfony 5. \u0421\u0435\u0440\u0438\u044f \u0441\u0442\u0430\u0442\u0435\u0439, \u043e\u0431\u043e\u0431\u0449\u0430\u044e\u0449\u0438\u0445 \u043c\u043e\u0439 \u043e\u043f\u044b\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0430\u043d\u0434\u043b\u0430\u043c\u0438, \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u0442 \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u043e\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0431\u0430\u043d\u0434\u043b\u0430 \u0438 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u0434\u0435\u043c\u043e-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0434\u043e \u0442\u0435\u0441\u0442\u043e\u0432 \u0438 \u0440\u0435\u043b\u0438\u0437\u043d\u043e\u0433\u043e \u0446\u0438\u043a\u043b\u0430 \u0431\u0430\u043d\u0434\u043b\u0430.<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u0443\u044f \u0431\u0430\u043d\u0434\u043b, \u043d\u0430\u0434\u043e \u0434\u0443\u043c\u0430\u0442\u044c, \u0447\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0435\u0433\u043e, \u0430 \u0447\u0442\u043e \u2014 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0414\u043e\u043b\u0436\u0435\u043d \u043b\u0438 \u0431\u0430\u043d\u0434\u043b \u0438\u043c\u0435\u0442\u044c \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438\u043b\u0438 \u0431\u044b\u0442\u044c \u0433\u0438\u0431\u043a\u0438\u043c \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0442\u044c \u0441\u0435\u0431\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0442\u044c? \u0415\u0441\u043b\u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u044c, \u0442\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0442\u043e\u0447\u043a\u0438-\u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0431\u0430\u043d\u0434\u043b\u0430, \u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0442\u043e\u0447\u043a\u0438 \u0432 \u043d\u0430\u0448\u0435\u043c \u0434\u0435\u043c\u043e-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0438 \u043a \u0431\u0430\u043d\u0434\u043b\u0443<\/li>\n<li>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u0442\u0435\u0433\u0430\u043c\u0438<\/li>\n<li>Compiler Pass<\/li>\n<li>\u0410\u0432\u0442\u043e\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432<\/li>\n<\/ul>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 \u0441\u0435\u0440\u0438\u0438<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<p><a href=\"https:\/\/habr.com\/ru\/post\/498134\/\">\u0427\u0430\u0441\u0442\u044c 1. \u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0431\u0430\u043d\u0434\u043b<\/a><br \/>  <a href=\"https:\/\/habr.com\/ru\/post\/498536\/\">\u0427\u0430\u0441\u0442\u044c 2. \u0412\u044b\u043d\u043e\u0441\u0438\u043c \u043a\u043e\u0434 \u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u0432 \u0431\u0430\u043d\u0434\u043b<\/a><br \/>  <a href=\"https:\/\/habr.com\/ru\/post\/498610\/\">\u0427\u0430\u0441\u0442\u044c 3. \u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0431\u0430\u043d\u0434\u043b\u0430 \u0441 \u0445\u043e\u0441\u0442\u043e\u043c: \u0448\u0430\u0431\u043b\u043e\u043d\u044b, \u0441\u0442\u0438\u043b\u0438, JS<\/a><br \/>  <strong>\u0427\u0430\u0441\u0442\u044c 4. \u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0431\u0430\u043d\u0434\u043b\u0430<\/strong><br \/>  \u0427\u0430\u0441\u0442\u044c 5. \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f<br \/>  \u0427\u0430\u0441\u0442\u044c 6. \u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u043c\u0438\u043a\u0440\u043e\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<br \/>  \u0427\u0430\u0441\u0442\u044c 7. \u0420\u0435\u043b\u0438\u0437\u043d\u044b\u0439 \u0446\u0438\u043a\u043b, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435<\/p>\n<\/div><\/div>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0435 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b, \u0442\u043e \u0441\u043a\u0430\u0447\u0430\u0439\u0442\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438\u0437 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f:<br \/>  <a href=\"https:\/\/github.com\/bravik\/symfony-bundles-tutorial\/\" rel=\"nofollow\">https:\/\/github.com\/bravik\/symfony-bundles-tutorial\/<\/a><br \/>  \u0438 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u0441\u044c \u043d\u0430 \u0432\u0435\u0442\u043a\u0443 <a href=\"https:\/\/github.com\/bravik\/symfony-bundles-tutorial\/tree\/3-integration\" rel=\"nofollow\">3-integration<\/a>. <\/p>\n<p>  <\/p>\n<p>\u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043f\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432 \u0444\u0430\u0439\u043b\u0435 <code>README.md<\/code>.<br \/>  \u0424\u0438\u043d\u0430\u043b\u044c\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u0432\u044b \u043d\u0430\u0439\u0434\u0435\u0442\u0435 \u0432 \u0432\u0435\u0442\u043a\u0435 <a href=\"https:\/\/github.com\/bravik\/symfony-bundles-tutorial\/tree\/4-extend\" rel=\"nofollow\">4-extend<\/a>.<\/p>\n<p>  <\/p>\n<h2 id=\"zadacha\">\u0417\u0430\u0434\u0430\u0447\u0430<\/h2>\n<p>  <\/p>\n<p>\u0412 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u0435 \u0435\u0441\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0432 GoogleCalendar \u0438\u043b\u0438 iCalendar.<br \/>  \u041d\u0430\u0448\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u2014 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430\u0448 \u0431\u0430\u043d\u0434\u043b \u0433\u0438\u0431\u0447\u0435 \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u0431\u0430\u043d\u0434\u043b\u0430 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0442\u044c \u0435\u0433\u043e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c\u0438 \u0444\u043e\u0440\u043c\u0430\u0442\u0430\u043c\u0438 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0430 \u0432 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445. <\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u044d\u043a\u0441\u043f\u043e\u0440\u0442 \u0432 JSON-\u0444\u0430\u0439\u043b. \u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/lm\/sd\/7o\/lmsd7ohzuqif1h_tbbyknmjojwk.png\"><\/p>\n<p>  <\/p>\n<h2 id=\"kak-ustroen-eksport-meropriyatiy\">\u041a\u0430\u043a \u0443\u0441\u0442\u0440\u043e\u0435\u043d \u044d\u043a\u0441\u043f\u043e\u0440\u0442 \u043c\u0435\u0440\u043e\u043f\u0440\u0438\u044f\u0442\u0438\u0439?<\/h2>\n<p>  <\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 <a href=\"https:\/\/github.com\/bravik\/symfony-bundles-tutorial\/tree\/3-integration\/bundles\/CalendarBundle\/src\/Service\/EventExporter\" rel=\"nofollow\">EventExporter<\/a>.<\/p>\n<p>  <\/p>\n<p>\u041b\u043e\u0433\u0438\u043a\u0430 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0435 <code>EventExporter<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0432 <code>services\/EventExporter<\/code>. \u041c\u044b \u0443\u0436\u0435 \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u043b\u0438 \u0435\u0433\u043e \u0432 \u0431\u0430\u043d\u0434\u043b \u0438 \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u043b\u0438 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432 \u0438\u043c\u0435\u043d. \u0413\u043b\u0430\u0432\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u044d\u0442\u043e:<\/p>\n<p>  <\/p>\n<ul>\n<li><code>ExporterInterface<\/code> \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0438<\/li>\n<li><code>ExporterManager<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0445\u0440\u0430\u043d\u0438\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0435\u0440\u0430\u0445 \u0438 \u0432\u044b\u0434\u0430\u0435\u0442 \u0438\u0445 \u043f\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041e\u0442\u043a\u0440\u043e\u0435\u043c <code>ExporterInterface<\/code>.<\/p>\n<p>  <\/p>\n<p>\u042d\u043a\u0441\u043f\u043e\u0440\u0442\u0435\u0440 \u2014 \u044d\u0442\u043e \u043e\u0431\u044a\u0435\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0438\u0437 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043b\u0438\u0431\u043e \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0441\u0441\u044b\u043b\u043a\u0443 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0430 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f Google Calendar), \u043b\u0438\u0431\u043e \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f iCalendar). \u041f\u0435\u0440\u0432\u044b\u0435 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0435\u0440\u044b \u0431\u0443\u0434\u0435\u043c \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c inline. \u0410 \u0434\u043b\u044f \u0432\u0442\u043e\u0440\u044b\u0445 \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u044d\u043a\u0448\u043d \u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435 <code>EventController::export()<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0434\u0430\u0432\u0430\u0442\u044c \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0443 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b. <\/p>\n<p>  <\/p>\n<p>\u042d\u043a\u0441\u043f\u043e\u0440\u0442\u0435\u0440 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u043a\u043b\u0430\u0441\u0441\u043e\u043c, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0435\u0433\u043e<\/p>\n<p>  <\/p>\n<ul>\n<li>\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435<\/li>\n<li>\u0442\u0438\u043f<\/li>\n<li>\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0435\u0440 inline<\/li>\n<li>\u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0430<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c 2 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0445 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0451\u0440\u0430 <code>AbtractInlineExporter<\/code> \u0438 <code>AbstractFileExporter<\/code>. \u041f\u0435\u0440\u0432\u044b\u0439 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0430 \u0441\u0442\u0440\u043e\u043a\u0443 (\u043e\u0442\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0441\u0441\u044b\u043b\u043a\u0443), \u0432\u0442\u043e\u0440\u043e\u0439 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442, \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u0444\u0430\u0439\u043b (<code>ExportedFile<\/code>).<\/p>\n<p>  <\/p>\n<p>\u0418\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u043d\u0430\u0448 \u0431\u0430\u043d\u0434\u043b \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 2\u043c\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f\u043c\u0438 \u2014 <code>GoogleCalendarExporter<\/code> \u0438 <code>ICalendarExporter<\/code>.<\/p>\n<p>  <\/p>\n<p>\u041d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u044f, \u043c\u044b \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0435\u0440\u043e\u0432 \u043b\u0438\u0431\u043e \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0441\u0441\u044b\u043b\u043a\u0443 \u0434\u043b\u044f inline \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0435\u0440\u043e\u0432, \u043b\u0438\u0431\u043e \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0431\u0430\u043d\u0434\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0442\u0434\u0430\u0441\u0442 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b. <\/p>\n<p>  <\/p>\n<h2 id=\"sozdaem-svoy-format-eksporta\">\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u0432\u043e\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0430<\/h2>\n<p>  <\/p>\n<p>\u0412 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438-\u0445\u043e\u0441\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043b\u0430\u0441\u0441 JSON-\u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0435\u0440\u0430.<\/p>\n<p>  <\/p>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u044b\u0442\u0430\u0449\u0438\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043a\u043e\u0434 \u043a\u043b\u0430\u0441\u0441\u0430 \u0438\u0437 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">git checkout 4-extend -- src\/Service\/EventExporter\/JsonExporter.php<\/code><\/pre>\n<p>  <\/p>\n<p>\u0438\u043b\u0438 \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c <code>src\/Service\/EventExporter\/JsonExporter.php<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"php\">&lt;?php declare(strict_types=1);  namespace App\\Service\\EventExporter;  use bravik\\CalendarBundle\\Entity\\Event; use bravik\\CalendarBundle\\Service\\EventExporter\\AbstractFileExporter; use bravik\\CalendarBundle\\Service\\EventExporter\\ExportedFile;  \/**  * Generates a JSON file  *\/ class JsonExporter extends AbstractFileExporter {     private const DATE_FORMAT = 'Y-m-d H:i:s';      public function getName(): string     {         return '\u0424\u0430\u0439\u043b JSON';     }      public function getType(): string     {         return 'json-file';     }      public function export(Event $event): ExportedFile     {         $data = [             'id'            =&gt; $event-&gt;getId(),             'title'         =&gt; $event-&gt;getTitle(),             'description'   =&gt; $event-&gt;getDescription(),             'venueName'     =&gt; $event-&gt;getVenueName(),             'venueAddress'  =&gt; $event-&gt;getVenueAddress(),             'startsAt'      =&gt; $event-&gt;getStartsAt()-&gt;format(self::DATE_FORMAT),             'endsAt'        =&gt; $event-&gt;getEndsAt() ? $event-&gt;getEndsAt()-&gt;format(self::DATE_FORMAT) : null,         ];          return new ExportedFile('event.json', 'application\/json', json_encode($data));     } }<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"kak-podklyuchit-novyy-format-eksporta\">\u041a\u0430\u043a \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0430?<\/h2>\n<p>  <\/p>\n<p>\u0421\u0435\u0439\u0447\u0430\u0441 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0435\u0440\u044b \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043a\u0430\u043a \u0441\u0435\u0440\u0432\u0438\u0441 \u0432 DI-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b <code>config\/services.yaml<\/code> \u0431\u0430\u043d\u0434\u043b\u0430. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043e\u043d\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0432 <code>ExporterManager<\/code> \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430.<\/p>\n<p>  <\/p>\n<p>\u0412 Symfony \u043a\u043e\u043d\u0444\u0438\u0433 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f-\u0445\u043e\u0441\u0442\u0430 \u0432\u0441\u0435\u0433\u0434\u0430 \u0438\u043c\u0435\u0435\u0442 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u043d\u0430\u0434 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0431\u0430\u043d\u0434\u043b\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u043a\u0430\u043a \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441 <code>ExporterManager<\/code> \u0432 <code>services.yaml<\/code> \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u0430\u043a:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">bravik\\CalendarBundle\\Service\\EventExporter\\ExporterManager:     arguments:         $exporters:             - '@bravik\\CalendarBundle\\Service\\EventExporter\\Exporters\\GoogleCalendarExporter'             - '@bravik\\CalendarBundle\\Service\\EventExporter\\Exporters\\ICalendarExporter'             - 'App\\Service\\EventExporter\\Exporters\\JsonExporter'<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u043e \u0432 \u0442\u0430\u043a\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u0435\u0441\u0442\u044c \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u043a: \u043c\u044b \u0433\u0440\u0443\u0431\u043e \u0432\u043c\u0435\u0448\u0438\u0432\u0430\u0435\u043c\u0441\u044f \u0432 \u0440\u0430\u0431\u043e\u0442\u0443 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u0447\u0430\u0441\u0442\u0435\u0439 \u0431\u0430\u043d\u0434\u043b\u0430, \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044f \u0435\u0433\u043e \u0447\u0430\u0441\u0442\u044c, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0438 \u043d\u0435 \u0445\u043e\u0442\u0435\u043b \u0431\u044b, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u043b\u0438. <\/p>\n<p>  <\/p>\n<p>\u0427\u0442\u043e \u0435\u0441\u043b\u0438 \u043d\u0430\u0448 \u0431\u0430\u043d\u0434\u043b \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0442\u044c\u0441\u044f, \u0438 \u0432 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u043e\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430, \u0438\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u044f\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0435 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u0432 \u0431\u0430\u043d\u0434\u043b \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0435\u0440\u044b, \u0438\u043b\u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u0431\u0430\u043d\u0434\u043b\u0430 <code>ExporterManager<\/code> \u0438\u0441\u0447\u0435\u0437\u043d\u0435\u0442 \u0438 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u0441\u044f \u0447\u0435\u043c-\u0442\u043e \u043d\u043e\u0432\u044b\u043c? \u0421\u043b\u0435\u0434\u0438\u0442\u044c \u0437\u0430 \u044d\u0442\u0438\u043c\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u0438 \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0432 \u0434\u0435\u0441\u044f\u0442\u043a\u0430\u0445 \u043d\u0430\u0448\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0431\u044b\u043b\u043e \u0431\u044b \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e.<\/p>\n<p>  <\/p>\n<blockquote><p>\u041f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0433\u043e \u0431\u0430\u043d\u0434\u043b\u0430, \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043a\u0430\u0442\u044c \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u044f\u0441\u043d\u044b\u0439 \u0438 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u0435\u0433\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u043d\u0438\u043c. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0443\u0436\u043d\u043e \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u043c\u0435\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e \u0432\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0435 \u0434\u0435\u043b\u0430 \u0431\u0430\u043d\u0434\u043b\u0430.<\/p><\/blockquote>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043a\u043b\u0430\u0441\u0441 <a href=\"https:\/\/github.com\/bravik\/symfony-bundles-tutorial\/blob\/3-integration\/bundles\/CalendarBundle\/src\/Service\/EventExporter\/ExporterManager.php\" rel=\"nofollow\">ExporterManager<\/a>.<\/p>\n<p>  <\/p>\n<p>\u041c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0432\u0441\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0435\u0440\u044b \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0441\u0442\u043e\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0435, \u0430 \u043f\u043e\u043f\u0430\u0434\u0430\u044e\u0442 \u0442\u0443\u0434\u0430 \u0447\u0435\u0440\u0435\u0437 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 <code>ExporterManager::registerExporter()<\/code>. \u041f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0435 \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0435\u0440\u044b \u0442\u043e\u0436\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u044d\u0442\u0438\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043c. \u0427\u0442\u043e\u0431\u044b \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0435\u0440, \u043d\u0443\u0436\u043d\u043e \u043b\u0438\u0431\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043b\u0438\u0431\u043e \u0433\u0434\u0435-\u0442\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 <code>registerExporter<\/code>. \u0418 \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043f\u0440\u0438 \u0441\u0431\u043e\u0440\u043a\u0435 DI-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430.<\/p>\n<p>  <\/p>\n<h2 id=\"pomechaem-servisy-tegami\">\u041f\u043e\u043c\u0435\u0447\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0442\u0435\u0433\u0430\u043c\u0438<\/h2>\n<p>  <\/p>\n<p>\u0412 Symfony \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u043c\u043e\u0436\u043d\u043e <a href=\"https:\/\/symfony.com\/doc\/current\/service_container\/tags.html\" rel=\"nofollow\">\u043f\u043e\u043c\u0435\u0447\u0430\u0442\u044c \u0442\u0435\u0433\u0430\u043c\u0438<\/a>. \u0422\u0435\u0433 \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 DI-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u044c \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0438 \u0447\u0442\u043e-\u0442\u043e \u0441 \u043d\u0438\u043c\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u0435 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0435\u0440\u044b \u0432 <code>ExporterManager<\/code>.<\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u0437\u043d\u0430\u0447\u0438\u043c \u0442\u0435\u0433 <code>JsonExporter<\/code> \u0432 <code>services.yaml<\/code> \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f-\u0445\u043e\u0441\u0442\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">App\\Service\\EventExporter\\JsonExporter:     tags: ['bravik.calendar.exporter']<\/code><\/pre>\n<p>  <\/p>\n<p>\u0410 \u0442\u0430\u043a \u0436\u0435 \u043d\u0430\u0437\u043d\u0430\u0447\u0438\u043c \u0442\u0435\u0433 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0435\u0440\u0430\u043c \u0431\u0430\u043d\u0434\u043b\u0430 \u043f\u0440\u0438 \u0438\u0445 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0432 <code>services.yaml<\/code> \u0431\u0430\u043d\u0434\u043b\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">bravik\\CalendarBundle\\Service\\EventExporter\\Exporters\\GoogleCalendarExporter:     tags: ['bravik.calendar.exporter'] bravik\\CalendarBundle\\Service\\EventExporter\\Exporters\\ICalendarExporter:     tags: ['bravik.calendar.exporter']<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0435\u0433\u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0432 \u043e\u0431\u0449\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u0438\u043c\u0435\u043d, \u043f\u043e\u044d\u0442\u043e\u043c\u0443, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u043e\u0432, \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 <code>vendor.package.name<\/code>.<\/p>\n<p>  <\/p>\n<h2 id=\"prostoy-put-peredat-pomechennye-tegom-servisy\">\u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0443\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u0435 \u0442\u0435\u0433\u043e\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u044b<\/h2>\n<p>  <\/p>\n<p>\u041d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 Symfony 3.4 \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u0435 \u0442\u0435\u0433\u043e\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0432 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u043e\u0434\u043d\u0443 \u0441\u0442\u0440\u043e\u043a\u0443 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438.<\/p>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0435\u0434\u0430\u0434\u0438\u043c \u0432\u0441\u0435 \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u0435 \u0442\u0435\u0433\u043e\u043c <code>bravik.calendar.exporter<\/code> \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0435\u0440\u044b \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 \u0432 <code>ExporterManager<\/code>. \u0412 <code>services.yaml<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">bravik\\CalendarBundle\\Service\\EventExporter\\ExporterManager:     arguments:         $exporters: !tagged bravik.calendar.exporter<\/code><\/pre>\n<p>  <\/p>\n<p><code>!tagged &lt;tag-name&gt;<\/code> \u043f\u0435\u0440\u0435\u0434\u0430\u0441\u0442 \u0432 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 <code>iterable<\/code> \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438, \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u043c\u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c \u0442\u0435\u0433\u043e\u043c. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c typehint \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 <code>ExporterManager<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"php\">    public function __construct(iterable $exporters) {     \/\/...     }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043b\u0438 \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. <\/p>\n<p>  <\/p>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043b\u044e\u0431\u043e\u0433\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0432 \u0434\u0440\u043e\u043f\u0434\u0430\u0443\u043d\u0435 \u00ab\u0412\u00a0\u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044c\u00bb \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u043d\u043e\u0432\u044b\u0439 \u043f\u0443\u043d\u043a\u0442 \u00ab\u0424\u0430\u0439\u043b JSON\u00bb, \u0430 \u043f\u043e \u043a\u043b\u0438\u043a\u0443 \u043d\u0430 \u043d\u0435\u0433\u043e \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f JSON-\u0444\u0430\u0439\u043b.<\/p>\n<p>  <\/p>\n<p>(\u0415\u0441\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c, \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u0441\u044c \u043d\u0430 \u0432\u0435\u0442\u043a\u0443 <a href=\"https:\/\/github.com\/bravik\/symfony-bundles-tutorial\/tree\/4-extend\" rel=\"nofollow\">4-extend<\/a> \u0441 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438.)<\/p>\n<p>  <\/p>\n<p>\u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f <code>!tagged &lt;tag-name&gt;<\/code>, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u0430\u044f \u0432 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442,\u00a0\u2014 \u044d\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u0430\u0445\u0430\u0440 \u043d\u0430\u0434 \u0431\u043e\u043b\u0435\u0435 \u0433\u043b\u0443\u0431\u043e\u043a\u0438\u043c \u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435\u043b\u044c\u0437\u044f \u043e\u0431\u043e\u0439\u0442\u0438 \u0441\u0442\u043e\u0440\u043e\u043d\u043e\u0439. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u043f\u043e \u0434\u0440\u0443\u0433\u043e\u043c\u0443.<\/p>\n<p>  <\/p>\n<h2 id=\"sozdaem-compiler-pass\">\u0421\u043e\u0437\u0434\u0430\u0435\u043c Compiler Pass<\/h2>\n<p>  <\/p>\n<blockquote><p>\u0412\u0441\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u0432 <code>services.yaml<\/code> \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432 DI-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u043a\u0430\u043a \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438. \u041d\u0430 \u0440\u0430\u043d\u043d\u0435\u043c \u044d\u0442\u0430\u043f\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430. Symfony \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0432\u0441\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0438, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0438 \u0438\u0445 \u0441\u0432\u044f\u0437\u0438 \u0434\u0440\u0443\u0433 \u0441 \u0434\u0440\u0443\u0433\u043e\u043c, \u043a\u044d\u0448\u0438\u0440\u0443\u0435\u0442 \u0438\u0445 \u0432 \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u044b\u0445 PHP-\u0444\u0430\u0439\u043b\u0430\u0445. \u0417\u0430 \u0441\u0447\u0435\u0442 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f Symfony \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0431\u044b\u0441\u0442\u0440\u043e.<\/p><\/blockquote>\n<p>\u041a\u0430\u0436\u0434\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <a href=\"https:\/\/symfony.com\/doc\/current\/service_container\/compiler_passes.html\" rel=\"nofollow\">Compiler Pass<\/a>. Symfony \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u043c\u0435\u0448\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 Compiler Pass.<\/p>\n<p>  <\/p>\n<p>\u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e, \u0447\u0442\u043e\u0431\u044b \u0435\u0449\u0435 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430, \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044e \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0435\u0440\u043e\u0432 \u0432 <code>ExporterManager<\/code>.<\/p>\n<p>  <\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043d\u043e\u0432\u0443\u044e \u043f\u0430\u043f\u043a\u0443 \u0438 \u043a\u043b\u0430\u0441\u0441 <code>bundles\/CalendarBundle\/src\/DependencyInjection\/Compiler\/ExporterRegistrationPass.php<\/code>, \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 <code>CompilerPassInterface<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"php\">namespace bravik\\CalendarBundle\\DependencyInjection\\Compiler;  use bravik\\CalendarBundle\\Service\\EventExporter\\ExporterManager; use Symfony\\Component\\DependencyInjection\\Compiler\\CompilerPassInterface; use Symfony\\Component\\DependencyInjection\\ContainerBuilder;  class ExporterRegistrationPass implements CompilerPassInterface {     public function process(ContainerBuilder $container)     {         if (!$container-&gt;has(ExporterManager::class)) {             return;         }          $exporterManagerDefinition = $container-&gt;findDefinition(ExporterManager::class);          $taggedServices = $container-&gt;findTaggedServiceIds('bravik.calendar.exporter');          $exporterReferences = [];         foreach ($taggedServices as $id =&gt; $tags) {             $exporterReferences[] = new Reference($id);         }          $exporterManagerDefinition-&gt;setArguments(['$exporters' =&gt; $exporterReferences]);     } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 Compiler Pass \u043a \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u0447\u0435\u0440\u0435\u0437 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043b\u0430\u0441\u0441 \u0431\u0430\u043d\u0434\u043b\u0430 <code>src\/CalendarBundle<\/code>. \u041f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u0435 \u0432 \u043d\u0435\u043c \u0443\u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043e\u0442 <code>Bundle<\/code> \u043c\u0435\u0442\u043e\u0434 <code>Bundle::build()<\/code> \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"php\">    public function build(ContainerBuilder $container)     {         parent::build($container);         $container-&gt;addCompilerPass(new ExporterRegistrationPass());     }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e pass \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d, \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 <code>die(&quot;pass&quot;)<\/code> \u0432 \u043d\u0430\u0447\u0430\u043b\u043e \u0435\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 <code>process<\/code> \u0438 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443. \u0415\u0441\u043b\u0438 \u0432\u044b \u0443\u0432\u0438\u0434\u0435\u043b\u0438 <code>pass<\/code> \u2014 \u0432\u0441\u0435 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e. <\/p>\n<p>  <\/p>\n<p>\u0427\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u043d\u0443\u0442\u0440\u0438?<\/p>\n<p>  <\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043a <code>ExporterManager<\/code> \u044d\u043a\u043f\u043e\u0440\u0442\u0435\u0440\u044b, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0438\u0437\u0432\u043b\u0435\u0447\u044c \u0438\u0445 \u0438\u0437 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u043e\u0433\u043e DI-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430.<br \/>  <code>ExporterManager<\/code> \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"php\">$exporterManagerDefinition = $container-&gt;findDefinition(ExporterManager::class);<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u043e \u0447\u0442\u043e \u0437\u0430 <code>Definition<\/code>?<\/p>\n<p>  <\/p>\n<p>\u041a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0445\u0440\u0430\u043d\u0438\u0442 \u043d\u0435 \u0441\u0430\u043c\u0438 \u044d\u0442\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u044b, \u0430 \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u0434\u0435\u0444\u0438\u043d\u0438\u0446\u0438\u0438 <a href=\"https:\/\/symfony.com\/doc\/current\/service_container\/definitions.html\" rel=\"nofollow\">Definition<\/a> \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432.<\/p>\n<p>  <\/p>\n<blockquote><p>\u0421\u0443\u0442\u044c DI-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u043d \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u0440\u0430\u0437\u0443 \u043f\u0440\u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438, \u0430 \u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u043e \u00ab\u043b\u0435\u043d\u0438\u0432\u043e\u00bb. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 <code>Definition<\/code> \u043e\u043d \u0445\u0440\u0430\u043d\u0438\u0442 \u00ab\u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438\u00bb: \u043a\u0430\u043a \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u044b, \u043a\u0430\u043a\u0438\u0435 \u0438\u043c \u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438.<\/p><\/blockquote>\n<p>\u0421\u0430\u043c\u0430 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u0433\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f \u0432 \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0430\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0433\u0434\u0435-\u0442\u043e \u0432 \u043a\u043e\u0434\u0435. \u0414\u0430\u043b\u0435\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u043a\u044d\u0448\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u0438, \u043f\u0440\u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438, DI-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0432\u044b\u0434\u0430\u0435\u0442 \u0443\u0436\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441. <\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u0440\u0438 \u0441\u0431\u043e\u0440\u043a\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u043c\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u043d\u0435 \u0441 \u0441\u0430\u043c\u0438\u043c\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438, \u0430 \u0441 \u0438\u0445 \u0434\u0435\u0444\u0438\u043d\u0438\u0446\u0438\u044f\u043c\u0438.<br \/>  \u0414\u0435\u0444\u0438\u043d\u0438\u0446\u0438\u0438 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0435\u0440\u043e\u0432 \u043c\u044b \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c \u043f\u043e \u0438\u0445 \u043c\u0435\u0442\u043a\u0435 \u0442\u0435\u0433\u043e\u043c <code>bravik.calendar.exporter<\/code>.<\/p>\n<p>  <\/p>\n<pre><code class=\"php\">$taggedServices = $container-&gt;findTaggedServiceIds('bravik.calendar.exporter');<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u0441\u044b\u043b\u043a\u0443 <code>Reference<\/code> \u043d\u0430 \u043d\u0435\u0433\u043e, \u0438 \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u043c \u0434\u0435\u0444\u0438\u043d\u0438\u0446\u0438\u0438 <code>ExporterManager<\/code>, \u0447\u0442\u043e \u043f\u0440\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0443\u0436\u043d\u043e \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <code>$exporters<\/code> \u0441 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u043c\u0438 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0435\u0440\u0430\u043c\u0438.<\/p>\n<p>  <\/p>\n<pre><code class=\"php\">$exporterReferences = []; foreach ($taggedServices as $id =&gt; $tags) {     $exporterReferences[] = new Reference($id); }  $exporterManagerDefinition-&gt;setArguments(['$exporters' =&gt; $exporterReferences]);<\/code><\/pre>\n<p>  <\/p>\n<p>\u0423\u0431\u0435\u0440\u0435\u043c \u0432 <code>services.yaml<\/code> \u0431\u0430\u043d\u0434\u043b\u0430 \u044f\u0432\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0438\u0437 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 <code>ExporterManager<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">bravik\\CalendarBundle\\Service\\EventExporter\\ExporterManager: ~<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043b\u0438 \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. <\/p>\n<p>  <\/p>\n<h2 id=\"avtomaticheskoe-naznachenie-tegov-autoconfiguration\">\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0442\u0435\u0433\u043e\u0432 (autoconfiguration)<\/h2>\n<p>  <\/p>\n<p>\u0412\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0438 <code>services.yaml<\/code>.<\/p>\n<p>  <\/p>\n<p>\u0423 \u043d\u0430\u0441 \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0438 \u0432 \u0431\u0430\u043d\u0434\u043b\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432\u0441\u0435\u0433\u043e 2 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0435\u0440\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">bravik\\CalendarBundle\\Service\\EventExporter\\Exporters\\GoogleCalendarExporter:     tags: ['bravik.calendar.exporter'] bravik\\CalendarBundle\\Service\\EventExporter\\Exporters\\ICalendarExporter:     tags: ['bravik.calendar.exporter']<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418 \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0435 \u0445\u043e\u0441\u0442\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">App\\Service\\EventExporter\\JsonExporter:     tags: ['bravik.calendar.exporter']<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u043d\u0435 3, \u0430 30 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0435\u0440\u043e\u0432. \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0442\u044c \u0442\u0435\u0433 \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0431\u044b\u043b\u043e \u0431\u044b \u0443\u0442\u043e\u043c\u0438\u0442\u0435\u043b\u044c\u043d\u043e.<\/p>\n<p>  <\/p>\n<blockquote><p>\u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0430\u0437\u043d\u0430\u0447\u0438\u0442\u044c \u0442\u0435\u0433 \u0432\u0441\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0438\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441. <\/p><\/blockquote>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <code>ExporterInterface<\/code>.<\/p>\n<p>  <\/p>\n<h3 id=\"sposob-1-_instanceof-v-konfige\">\u0421\u043f\u043e\u0441\u043e\u0431 \u21161. _instanceof \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0435<\/h3>\n<p>  <\/p>\n<p>\u0412\u043c\u0435\u0441\u0442\u043e \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u043e\u0442\u0440\u044b\u0432\u043a\u0430 \u043a\u043e\u0434\u0430 \u0432\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0432 <code>services.yaml<\/code> \u0431\u0430\u043d\u0434\u043b\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">_instanceof:     # Apply tag to all ExporterInterface implementations     bravik\\CalendarBundle\\Service\\EventExporter\\ExporterInterface:         tags: ['bravik.calendar.exporter']<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0431\u043d\u043e\u0432\u0438\u043c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u2014 \u0432\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442!<\/p>\n<p>  <\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0435\u0441\u043b\u0438 \u0443\u0431\u0440\u0430\u0442\u044c \u0442\u0435\u0433 \u0443 <code>App\\Service\\EventExporter\\JsonExporter<\/code>, \u0442\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0435\u0433\u043e \u0443\u0436\u0435 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u0442.<br \/>  \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043a\u043e\u043d\u0444\u0438\u0433 \u0431\u0430\u043d\u0434\u043b\u0430 \u0438\u043c\u0435\u0435\u0442 \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438, \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u0443\u044e \u0442\u043e\u043b\u044c\u043a\u043e \u0431\u0430\u043d\u0434\u043b\u043e\u043c. \u041d\u043e \u0435\u0441\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431, \u0438\u0437\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0430.<\/p>\n<p>  <\/p>\n<h3 id=\"sposob-2-avtokonfiguraciya-symfony\">\u0421\u043f\u043e\u0441\u043e\u0431 \u21162. \u0410\u0432\u0442\u043e\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f Symfony<\/h3>\n<p>  <\/p>\n<p>\u0423\u0431\u0435\u0440\u0435\u043c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u043e\u0442\u0440\u044b\u0432\u043e\u043a \u0438\u0437 \u043a\u043e\u043d\u0444\u0438\u0433\u0430, \u0438 \u0432 \u0444\u0430\u0439\u043b\u0435 <code>DependencyInjection\/CalendarExtension<\/code> \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043d\u0430\u0447\u0430\u043b\u043e \u043c\u0435\u0442\u043e\u0434\u0430 <code>load()<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"php\"> public function load(array $configs, ContainerBuilder $container) {     $container-&gt;registerForAutoconfiguration(ExporterInterface::class)         -&gt;addTag('bravik.calendar.exporter');     \/\/... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/symfony.com\/doc\/current\/service_container.html#the-autoconfigure-option\" rel=\"nofollow\">\u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 \u0430\u0432\u0442\u043e\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438<\/a> Symfony \u0432\u0441\u0435 \u0434\u0435\u0444\u0438\u043d\u0438\u0446\u0438\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u044e\u0449\u0438\u0445 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u044b \u0442\u0435\u0433\u043e\u043c.<\/p>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043c\u043e\u0436\u0435\u043c \u0443\u0431\u0440\u0430\u0442\u044c \u0438\u0437 \u043a\u043e\u043d\u0444\u0438\u0433\u043e\u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044e \u043a\u0430\u043a \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0435\u0440\u043e\u0432, \u0442\u0430\u043a \u0438 <code>ExporterManager<\/code>. \u041e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u043b\u0438\u0448\u044c:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\"># Register all EventExporter classes as injectable services bravik\\CalendarBundle\\Service\\EventExporter\\:     resource: '..\/src\/Service\/EventExporter\/*'<\/code><\/pre>\n<p>  <\/p>\n<p>\u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0435 \u0431\u0430\u043d\u0434\u043b\u0430.<\/p>\n<p>  <\/p>\n<h2 id=\"rezyume\">\u0420\u0435\u0437\u044e\u043c\u0435<\/h2>\n<p>  <\/p>\n<p>\u041c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 <a href=\"https:\/\/symfony.com\/doc\/current\/service_container\/tags.html\" rel=\"nofollow\">\u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 \u0442\u0435\u0433\u043e\u0432<\/a> \u0432 Symfony, \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0432 \u0431\u0430\u043d\u0434\u043b, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b\u0438 \u0442\u043e\u0447\u043a\u0443 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0431\u0430\u043d\u0434\u043b\u0430 \u043c\u043e\u0433\u0443\u0442 \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c \u0435\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c. \u041c\u044b \u0442\u0430\u043a \u0436\u0435 \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u043b\u0438 \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442 Symfony: \u0443\u0437\u043d\u0430\u043b\u0438, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430, \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/symfony.com\/doc\/current\/service_container\/compiler_passes.html\" rel=\"nofollow\">Compiler Pass<\/a> \u0438 \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/symfony.com\/doc\/current\/service_container.html#the-autoconfigure-option\" rel=\"nofollow\">\u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0430\u0432\u0442\u043e\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438<\/a>. <\/p>\n<p>  <\/p>\n<p>\u0424\u0438\u043d\u0430\u043b\u044c\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u0432\u044b \u043d\u0430\u0439\u0434\u0435\u0442\u0435 \u0432 \u0432\u0435\u0442\u043a\u0435 <a href=\"https:\/\/github.com\/bravik\/symfony-bundles-tutorial\/tree\/4-extend\" rel=\"nofollow\">4-extend<\/a>.<\/p>\n<p>  <\/p>\n<p>\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0444\u0430\u0439\u043b\u0430, \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438, \u043d\u0430\u0443\u0447\u0438\u043c Symfony \u0435\u0433\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c.<\/p>\n<p>  <\/p>\n<p>\u041e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0435\u0449\u0435 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0441\u0435\u0432\u0434\u043e\u043d\u0438\u043c\u043e\u0432 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0442\u043e\u0447\u0435\u043a \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u043a\u0443\u0440\u0441\u0435:<br \/>  (<a href=\"https:\/\/symfonycasts.com\/screencast\/symfony-bundle\/override-service#play\" rel=\"nofollow\">https:\/\/symfonycasts.com\/screencast\/symfony-bundle\/override-service#play<\/a>)<\/p>\n<p>  <\/p>\n<h2 id=\"drugie-stati-serii\">\u0414\u0440\u0443\u0433\u0438\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u0441\u0435\u0440\u0438\u0438:<\/h2>\n<p>  <\/p>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/498134\/\">\u0427\u0430\u0441\u0442\u044c 1. \u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0431\u0430\u043d\u0434\u043b<\/a><br \/>  <a href=\"https:\/\/habr.com\/ru\/post\/498536\/\">\u0427\u0430\u0441\u0442\u044c 2. \u0412\u044b\u043d\u043e\u0441\u0438\u043c \u043a\u043e\u0434 \u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u0432 \u0431\u0430\u043d\u0434\u043b<\/a><br \/>  <a href=\"https:\/\/habr.com\/ru\/post\/498610\/\">\u0427\u0430\u0441\u0442\u044c 3. \u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0431\u0430\u043d\u0434\u043b\u0430 \u0441 \u0445\u043e\u0441\u0442\u043e\u043c: \u0448\u0430\u0431\u043b\u043e\u043d\u044b, \u0441\u0442\u0438\u043b\u0438, JS<\/a><br \/>  <strong>\u0427\u0430\u0441\u0442\u044c 4. \u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0431\u0430\u043d\u0434\u043b\u0430<\/strong><br \/>  \u0427\u0430\u0441\u0442\u044c 5. \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f<br \/>  \u0427\u0430\u0441\u0442\u044c 6. \u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u043c\u0438\u043a\u0440\u043e\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<br \/>  \u0427\u0430\u0441\u0442\u044c 7. \u0420\u0435\u043b\u0438\u0437\u043d\u044b\u0439 \u0446\u0438\u043a\u043b, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435<\/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\/post\/499074\/\"> https:\/\/habr.com\/ru\/post\/499074\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/499074\/\">\n<p>\u041f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043f\u0440\u0435\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442\u0438\u0442\u044c \u043c\u0435\u0436\u0434\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u043c\u0438 \u0438 \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u043a\u043e\u0434 \u0432 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u044b\u0439 \u0431\u0430\u043d\u0434\u043b Symfony 5. \u0421\u0435\u0440\u0438\u044f \u0441\u0442\u0430\u0442\u0435\u0439, \u043e\u0431\u043e\u0431\u0449\u0430\u044e\u0449\u0438\u0445 \u043c\u043e\u0439 \u043e\u043f\u044b\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0430\u043d\u0434\u043b\u0430\u043c\u0438, \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u0442 \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u043e\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0431\u0430\u043d\u0434\u043b\u0430 \u0438 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u0434\u0435\u043c\u043e-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0434\u043e \u0442\u0435\u0441\u0442\u043e\u0432 \u0438 \u0440\u0435\u043b\u0438\u0437\u043d\u043e\u0433\u043e \u0446\u0438\u043a\u043b\u0430 \u0431\u0430\u043d\u0434\u043b\u0430.<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u0443\u044f \u0431\u0430\u043d\u0434\u043b, \u043d\u0430\u0434\u043e \u0434\u0443\u043c\u0430\u0442\u044c, \u0447\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0435\u0433\u043e, \u0430 \u0447\u0442\u043e \u2014 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0414\u043e\u043b\u0436\u0435\u043d \u043b\u0438 \u0431\u0430\u043d\u0434\u043b \u0438\u043c\u0435\u0442\u044c \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438\u043b\u0438 \u0431\u044b\u0442\u044c \u0433\u0438\u0431\u043a\u0438\u043c \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0442\u044c \u0441\u0435\u0431\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0442\u044c? \u0415\u0441\u043b\u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u044c, \u0442\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0442\u043e\u0447\u043a\u0438-\u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0431\u0430\u043d\u0434\u043b\u0430, \u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0442\u043e\u0447\u043a\u0438 \u0432 \u043d\u0430\u0448\u0435\u043c \u0434\u0435\u043c\u043e-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0438 \u043a \u0431\u0430\u043d\u0434\u043b\u0443<\/li>\n<li>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u0442\u0435\u0433\u0430\u043c\u0438<\/li>\n<li>Compiler Pass<\/li>\n<li>\u0410\u0432\u0442\u043e\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432<\/li>\n<\/ul>\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-302511","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/302511","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=302511"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/302511\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=302511"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=302511"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=302511"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}