{"id":280757,"date":"2016-11-10T16:55:03","date_gmt":"2016-11-10T13:55:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=280757"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=280757","title":{"rendered":"\u041c\u0430\u0440\u0441\u043e\u0445\u043e\u0434, \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f"},"content":{"rendered":"<p><a href=\"https:\/\/habrahabr.ru\/post\/314544\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/147\/222\/882\/1472228826b441d2b4bc5a64978d996f.png\"\/><\/a><\/p>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0435\u0440\u0438\u0438 \u0441\u0442\u0430\u0442\u0435\u0439 \u043c\u044b \u0441\u0442\u0440\u043e\u0438\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u0435 \u043c\u0430\u0440\u0441\u043e\u0445\u043e\u0434\u0430 \u0432 <a href=\"https:\/\/habrahabr.ru\/post\/314536\/\">\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f\u043c\u0438<\/a>. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430\u043c \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044b:<\/p>\n<ul>\n<li>Monolithic Repositories \u2014 <strong>MonoRepo<\/strong> <em>(\u041c\u043e\u043d\u043e\u043b\u0438\u0442\u043d\u044b\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438)<\/em><\/li>\n<li>Command\/Query Responsibility Segregation \u2014 <strong>CQRS<\/strong> <em>(\u0421\u0435\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u044f \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043d\u0430 \u0447\u0442\u0435\u043d\u0438\u0435 \u0438 \u0437\u0430\u043f\u0438\u0441\u044c)<\/em><\/li>\n<li>Event Sourcing \u2014 <strong>ES<\/strong> <em>(\u0421\u043e\u0431\u044b\u0442\u0438\u044f \u043a\u0430\u043a \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a)<\/em><\/li>\n<li>Test Driven Development \u2014 <strong>TDD<\/strong> <em>(\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0447\u0435\u0440\u0435\u0437 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435)<\/em><\/li>\n<\/ul>\n<p>  \u041d\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442.<\/p>\n<h2>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f<\/h2>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u0447\u043d\u0435\u043c \u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e git-\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f:<\/p>\n<pre><code class=\"bash\">mkdir rover cd rover git init <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/getcomposer.org\/\">Composer<\/a>, \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c <code>composer.json<\/code>:<a name=\"habracut\"><\/a><\/p>\n<pre><code class=\"bash\">{     &quot;name&quot;: &quot;mars-rover\/mars-rover&quot;,     &quot;license&quot;: &quot;MIT&quot;,     &quot;type&quot;: &quot;project&quot;,     &quot;description&quot;: &quot;Mars Rover&quot;,     &quot;require&quot;: {         &quot;php&quot;: &quot;^7.0&quot;     } } <\/code><\/pre>\n<p>  \u0414\u043e\u0431\u0430\u0432\u0438\u043c <code>.gitignore<\/code> \u0434\u043b\u044f \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438:<\/p>\n<pre><code class=\"bash\"># Third Party libraries \/vendor\/ <\/code><\/pre>\n<p>  \u0417\u0430\u043a\u043e\u043d\u0447\u0438\u0432 \u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c <code>composer<\/code>:<\/p>\n<pre><code class=\"bash\">composer install --optimize-autoloader <\/code><\/pre>\n<p>  \u042d\u0442\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043b\u044f \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043a\u043e\u043c\u043c\u0438\u0442\u0430:<\/p>\n<pre><code class=\"bash\">git add composer.json .gitignore git commit -m '0: Created project' <\/code><\/pre>\n<p>  <\/p>\n<h2>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 <code>navigation<\/code>-\u043f\u0430\u043a\u0435\u0442\u0430<\/h2>\n<p>  \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0432 \u043d\u0430 <a href=\"https:\/\/habrahabr.ru\/post\/314536\/\">\u0434\u0435\u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u044e \u0437\u0430\u0434\u0430\u0447\u0438<\/a>, \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0437\u0430\u0434\u0430\u0447\u0438 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u0432 <code>write-only<\/code> \u0438 <code>read-only<\/code>:<\/p>\n<ol>\n<li>\u041f\u043e\u0441\u0430\u0434\u043a\u0430 \u0440\u043e\u0432\u0435\u0440\u0430 \u043d\u0430 \u041c\u0430\u0440\u0441 \u2014 <code>write-only<\/code><\/li>\n<li>\u0412\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u0440\u043e\u0432\u0435\u0440\u0430 \u2014 <code>write-only<\/code><\/li>\n<li>\u0417\u0430\u043f\u0440\u043e\u0441 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u2014 <code>read-only<\/code><\/li>\n<\/ol>\n<p>  \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u0440\u0438\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443 <strong>CQRS<\/strong>, \u043f\u043e\u043b\u043e\u0436\u0438\u043c <code>write-only<\/code> \u043b\u043e\u0433\u0438\u043a\u0443 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043e\u0442 <code>read-only<\/code>. \u041f\u043e\u0441\u0430\u0434\u043a\u0430 \u0438 \u0432\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u2014 \u044d\u0442\u043e \u0432\u0441\u0435 \u043f\u0440\u043e \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u0447\u043d\u0435\u043c \u0441 \u043d\u0435\u0433\u043e:<\/p>\n<pre><code class=\"bash\">git checkout -b 1-navigation mkdir -p packages\/navigation cd packages\/navigation <\/code><\/pre>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c <code>composer.json<\/code> \u0434\u043b\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u0430:<\/p>\n<pre><code class=\"bash\">{     &quot;name&quot;: &quot;mars-rover\/navigation&quot;,     &quot;license&quot;: &quot;MIT&quot;,     &quot;type&quot;: &quot;library&quot;,     &quot;description&quot;: &quot;Mars Rover - Navigation&quot;,     &quot;autoload&quot;: {         &quot;psr-4&quot;: { &quot;MarsRover\\\\Navigation\\\\&quot;: &quot;src\/MarsRover\/Navigation&quot; }     },     &quot;require&quot;: {         &quot;php&quot;: &quot;^7.0&quot;     },     &quot;require-dev&quot;: {         &quot;memio\/spec-gen&quot;: &quot;^0.6&quot;     } } <\/code><\/pre>\n<p>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b \u0432\u043e\u0437\u044c\u043c\u0435\u043c <a href=\"http:\/\/phpspec.net\/\">phpspec<\/a>, \u0438 \u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 \u0442\u0435\u0441\u0442\u043e\u0432 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 <a href=\"http:\/\/memio.github.io\/spec-gen\">SpecGen<\/a>. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0432 \u043a\u043e\u0440\u043d\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 <code>phpspec.yml.dist<\/code>:<\/p>\n<pre><code class=\"bash\">extensions:     Memio\\SpecGen\\MemioSpecGenExtension: ~ <\/code><\/pre>\n<p>  <em><strong>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435<\/strong>: \u0414\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e phpspec <a href=\"https:\/\/gnugat.github.io\/2015\/08\/03\/phpspec.html\">\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u0441\u0442\u0430\u0442\u044c\u044e<\/a>.<\/em><br \/>  \u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c <code>git<\/code> \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u0430 \u043f\u0443\u0442\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f <code>.gitignore<\/code> \u0444\u0430\u0439\u043b\u0430:<\/p>\n<pre><code class=\"bash\"># Configuration \/phpspec.yml  # Third Party libraries \/vendor\/ \/composer.lock <\/code><\/pre>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u043c\u044b \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u0430, \u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c <code>Composer<\/code>:<\/p>\n<pre><code class=\"bash\">composer install --optimize-autoloader <\/code><\/pre>\n<p>  \u0417\u0430\u0444\u0438\u043a\u0441\u0438\u0440\u0443\u0435\u043c \u043d\u0430\u0448\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u043a\u043e\u043c\u043c\u0438\u0442\u0435:<\/p>\n<pre><code class=\"bash\">git add -A git commit -m '1: Created Navigation package' <\/code><\/pre>\n<p>  <\/p>\n<h2>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 <code>navigation<\/code>-\u043f\u0430\u043a\u0435\u0442\u0430 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442<\/h2>\n<p>  \u0412\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u043a \u043a\u043e\u0440\u043d\u044e \u043f\u0440\u043e\u0435\u043a\u0442\u0430:<\/p>\n<pre><code class=\"bash\">cd ..\/..\/ <\/code><\/pre>\n<p>  \u041e\u0434\u043d\u0438\u043c \u0438\u0437 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432 <strong>MonoRepo<\/strong> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0442\u0435\u0441\u0442\u044b \u0432\u0441\u0435\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u043e\u0434\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439. \u0414\u043b \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u043e\u0442 <code>navigation<\/code> \u0432 <code>composer.json<\/code> \u0444\u0430\u0439\u043b\u0435 \u043d\u0430\u0448\u0435\u0433\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430:<\/p>\n<pre><code class=\"bash\">{     &quot;name&quot;: &quot;mars-rover\/mars-rover&quot;,     &quot;license&quot;: &quot;MIT&quot;,     &quot;type&quot;: &quot;project&quot;,     &quot;description&quot;: &quot;Mars Rover&quot;,     &quot;repositories&quot;: [         {             &quot;type&quot;: &quot;path&quot;,             &quot;url&quot;: &quot;.\/packages\/*&quot;         }     ],     &quot;require&quot;: {         &quot;mars-rover\/navigation&quot;: &quot;*@dev&quot;,         &quot;php&quot;: &quot;^7.0&quot;     } } <\/code><\/pre>\n<p>  \u041f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e <code>Composer<\/code> \u0438\u0449\u0435\u0442 \u043f\u0430\u043a\u0435\u0442\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0432 <a href=\"https:\/\/packagist.org\/\">Packagist<\/a>. \u0414\u043e\u0431\u0430\u0432\u0438\u0432 \u043d\u043e\u0432\u0443\u044e \u0441\u0435\u043a\u0446\u0438\u044e <code>repositories<\/code> \u043c\u044b \u0433\u043e\u0432\u043e\u0440\u0438\u043c \u0435\u043c\u0443 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0435\u0449\u0435 \u0438 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0432 <code>.\/packages<\/code>, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b \u0432 \u0441\u0435\u043a\u0446\u0438\u0438 <code>require<\/code>.<\/p>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u043e\u0431\u0449\u0438\u0442\u044c \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0443 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u043a\u0430\u043a\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u043c\u044b \u0431\u044b \u0445\u043e\u0442\u0435\u043b\u0438, \u043d\u043e \u0432 \u043c\u043e\u043d\u043e\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u0432\u0441\u0435 \u043f\u0430\u043a\u0435\u0442\u044b \u0438\u043c\u0435\u044e\u0442 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c <code>*<\/code> (\u043b\u044e\u0431\u0430\u044f). \u041d\u043e \u0447\u0442\u043e\u0431\u044b \u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u0442\u0435\u0433\u0430\u043c\u0438 \u0432\u0435\u0440\u0441\u0438\u0439, \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u0435\u043c\u0443\u044e \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u044c (<code>@dev<\/code>).<\/p>\n<p>  \u041d\u0443 \u0438 \u0440\u0430\u0437 \u0443\u0436 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c <code>phpspec<\/code> \u0434\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432, \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0434\u0435\u0432-\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438 \u043d\u0430 \u043d\u0435\u0433\u043e:<\/p>\n<pre><code class=\"bash\">composer require --dev phpspec\/phpspec:^3.0 <\/code><\/pre>\n<p>  <code>phpspec<\/code> \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043a\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u044b \u0432 \u043a\u043e\u0440\u043d\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u041d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c <code>phpspec.yml.dist<\/code>, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u043e\u0431\u0449\u0438\u0442\u044c \u043e \u043d\u0430\u043b\u0438\u0447\u0438\u0438 <code>navigation<\/code>-\u043f\u0430\u043a\u0435\u0442\u0430:<\/p>\n<pre><code class=\"bash\">suites:     navigation:         namespace: 'MarsRover\\Navigation'         src_path: packages\/navigation\/src         spec_path: packages\/navigation <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0442\u0430\u043a\u0436\u0435 \u043e\u0431\u043d\u043e\u0432\u0438\u043c <code>.gitignore<\/code>:<\/p>\n<pre><code class=\"bash\"># Configuration \/phpspec.yml  # Third Party libraries \/vendor\/ <\/code><\/pre>\n<p>  \u0412\u043e\u0442 \u043e\u043d\u043e! \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c <code>Composer<\/code> \u0438 \u0437\u0430\u0442\u0435\u043c <code>phpspec<\/code>:<\/p>\n<pre><code class=\"bash\">composer update --optimize-autoloader .\/vendor\/bin\/phpspec run <\/code><\/pre>\n<p>  \u0417\u0430\u043a\u043e\u043c\u043c\u0438\u0442\u0438\u043c \u0432\u0441\u0435 \u044d\u0442\u043e:<\/p>\n<pre><code class=\"bash\">git add -A git commit -m '1: Added navigation package to main project' <\/code><\/pre>\n<p>  \u0418 \u0441\u043c\u0435\u0440\u0434\u0436\u0438\u043c\u0441\u044f \u0441 \u043c\u0430\u0441\u0442\u0435\u0440-\u0432\u0435\u0442\u043a\u043e\u0439:<\/p>\n<pre><code class=\"bash\">git checkout master git merge --no-ff 1-navigation <\/code><\/pre>\n<p>  <\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  C <code>Composer<\/code> \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u043c\u0430\u043a\u0435\u0442\u043e\u0432 \u0432\u043d\u0443\u0442\u0440\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f, \u0430 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044f \u043f\u043e\u0434\u0445\u043e\u0434 <code>MonoRepo<\/code> \u2014 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0432\u0441\u0435 \u0442\u0435\u0441\u0442\u044b \u043e\u0434\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439.<\/p>\n<h2>\u0427\u0442\u043e \u0434\u0430\u043b\u044c\u0448\u0435<\/h2>\n<p>  \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0437\u0430\u0439\u043c\u0435\u043c\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u0447\u0430\u0441\u0442\u044c\u044e \u0437\u0430\u0434\u0430\u0447\u0438 \u201c\u041f\u043e\u0441\u0430\u0434\u043a\u0430 \u0440\u043e\u0432\u0435\u0440\u0430 \u043d\u0430 \u041c\u0430\u0440\u0441\u201d, \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0432 \u043f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0431\u043e\u0442\u044b <strong>Event Sourcing<\/strong> \u0438 <strong>TDD<\/strong>.<br \/> \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:\/\/habrahabr.ru\/post\/314544\/\"> https:\/\/habrahabr.ru\/post\/314544\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p><a href=\"https:\/\/habrahabr.ru\/post\/314544\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/147\/222\/882\/1472228826b441d2b4bc5a64978d996f.png\"\/><\/a><\/p>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0435\u0440\u0438\u0438 \u0441\u0442\u0430\u0442\u0435\u0439 \u043c\u044b \u0441\u0442\u0440\u043e\u0438\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u0435 \u043c\u0430\u0440\u0441\u043e\u0445\u043e\u0434\u0430 \u0432 <a href=\"https:\/\/habrahabr.ru\/post\/314536\/\">\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f\u043c\u0438<\/a>. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430\u043c \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044b:<\/p>\n<ul>\n<li>Monolithic Repositories \u2014 <strong>MonoRepo<\/strong> <em>(\u041c\u043e\u043d\u043e\u043b\u0438\u0442\u043d\u044b\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438)<\/em><\/li>\n<li>Command\/Query Responsibility Segregation \u2014 <strong>CQRS<\/strong> <em>(\u0421\u0435\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u044f \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043d\u0430 \u0447\u0442\u0435\u043d\u0438\u0435 \u0438 \u0437\u0430\u043f\u0438\u0441\u044c)<\/em><\/li>\n<li>Event Sourcing \u2014 <strong>ES<\/strong> <em>(\u0421\u043e\u0431\u044b\u0442\u0438\u044f \u043a\u0430\u043a \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a)<\/em><\/li>\n<li>Test Driven Development \u2014 <strong>TDD<\/strong> <em>(\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0447\u0435\u0440\u0435\u0437 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435)<\/em><\/li>\n<\/ul>\n<p>  \u041d\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442.<\/p>\n<h2>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f<\/h2>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u0447\u043d\u0435\u043c \u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e git-\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f:<\/p>\n<pre><code class=\"bash\">mkdir rover cd rover git init <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/getcomposer.org\/\">Composer<\/a>, \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c <code>composer.json<\/code>:<\/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-280757","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/280757","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=280757"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/280757\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=280757"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=280757"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=280757"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}