{"id":322059,"date":"2021-04-25T21:00:17","date_gmt":"2021-04-25T21:00:17","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=322059"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=322059","title":{"rendered":"\u041d\u0435 \u043c\u043e\u043a\u0430\u0439\u0442\u0435 \u0442\u043e, \u0447\u0435\u043c \u0432\u044b \u043d\u0435 \u0432\u043b\u0430\u0434\u0435\u0435\u0442\u0435"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<p><em>\u041f\u0440\u0438\u043c. \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a\u0430: \u0441\u0430\u043c\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u0442\u0430\u0440\u043e\u0435, \u0434\u0430 \u0438 \u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 &#8212; \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u0441\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442 \u0441\u043a\u043e\u0440\u0435\u0435 \u0434\u043b\u044f \u043d\u043e\u0432\u0438\u0447\u043a\u043e\u0432, \u043b\u044e\u0434\u0438 \u0441 \u0445\u043e\u0440\u043e\u0448\u0438\u043c \u043e\u043f\u044b\u0442\u043e\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u043e\u0432, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043d\u0435 \u043d\u0430\u0439\u0434\u0443\u0442 \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u043e\u0432\u043e\u0433\u043e. UPD. \u042f \u0432\u0441\u0435 \u0436\u0435 \u043d\u0435 \u0434\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u0430\u0432\u0442\u043e\u0440 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0438\u043c \u0441\u043b\u043e\u0435\u043c \u0432\u0441\u0435 \u0430\u043f\u0438 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0432\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u0435 (\u043d\u0443 \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u043a\u0440\u0430\u0439\u043d\u0435 \u0441\u0442\u0440\u0430\u043d\u043d\u043e), \u0442\u0443\u0442 \u0441\u043a\u043e\u0440\u0435\u0435 \u0440\u0435\u0447\u044c \u043e \u0441\u043b\u0430\u0431\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445\/\u0442\u0438\u043f\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u0430\u0445 \u043e\u0431\u0449\u0435\u0433\u043e \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0432\u0440\u043e\u0434\u0435 HttpRequest \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435.<\/em><\/p>\n<p>\u0412\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0437\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u0441\u043e\u0437\u0434\u0430\u043d\u044b \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432. \u041e\u0431\u044b\u0447\u043d\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u044f\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u0443 \u043d\u0430\u0441 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u043a\u0430\u043a<\/p>\n<pre><code class=\"php\">interface HttpRequest {     public function get(string $name): string;      \/\/ ... }<\/code><\/pre>\n<p>\u0438\u043b\u0438 \u0434\u0430\u0436\u0435 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441, \u0442\u0430\u043a\u043e\u0439 \u043a\u0430\u043a<\/p>\n<pre><code class=\"php\">class HttpRequest {     public function get(string $name): string     {         \/\/ ...     }      \/\/ ... }<\/code><\/pre>\n<p>\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c (\u0438 \u0434\u043e\u043b\u0436\u043d\u044b) \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0430.<\/p>\n<p>\u0412 symfony, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u0442\u044c Symfony\\Component\\HttpFoundation\\Request::get(). \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0431\u0435\u0441\u043f\u043e\u043a\u043e\u0438\u0442\u044c\u0441\u044f \u043e \u0442\u043e\u043c, \u043a\u0430\u043a\u043e\u0439 \u0442\u0438\u043f HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043c\u044b \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c (GET, POST \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u043e\u0439). \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u043e\u0447\u0438\u043c\u0441\u044f \u043d\u0430 \u043d\u0435\u044f\u0432\u043d\u044b\u0445 API, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a HttpRequest::get(), \u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043d\u0438 \u0441\u043e\u0437\u0434\u0430\u044e\u0442.<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u043c\u0435\u0442\u043e\u0434 get() \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c. \u041d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0441 \u044f\u0432\u043d\u044b\u043c \u0438\u043c\u0435\u043d\u0435\u043c \u0434\u043b\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u0438\u043c\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u0430\u043a \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u043c\u0435\u0442\u043e\u0434\u0443 get():<\/p>\n<pre><code class=\"php\">class SomeController {     public function execute(HttpRequest $request): HttpResponse     {         $id     = $request-&gt;get('id');         $amount = $request-&gt;get('amount');         $price  = $request-&gt;get('price');          \/\/ ...     } }<\/code><\/pre>\n<p>\u041c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0441\u043f\u043e\u0440\u0438\u0442\u044c \u043e \u0442\u043e\u043c, \u0434\u043e\u043b\u0436\u0435\u043d \u043b\u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0438\u043c\u0435\u0442\u044c \u043e\u0434\u0438\u043d action-\u043c\u0435\u0442\u043e\u0434 \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e (\u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0430: <a href=\"https:\/\/vimeo.com\/148989192\" rel=\"noopener noreferrer nofollow\">\u0443 \u043d\u0435\u0433\u043e \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d<\/a> (eng \u0432\u0438\u0434\u0435\u043e)). \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0442\u044c \u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u0430.<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442 HttpRequest \u043d\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u0443\u044e \u0437\u0430\u0433\u043b\u0443\u0448\u043a\u0443 (stub) \u0438\u043b\u0438 mock-\u043e\u0431\u044a\u0435\u043a\u0442 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f SomeController \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e \u043e\u0442 \u0441\u0435\u0442\u0438 \u0438 \u043e\u0442 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430, \u043c\u044b \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u043c\u0441\u044f \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u043e\u0434\u043d\u043e\u0433\u043e \u0438 \u0442\u043e\u0433\u043e \u0436\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 get() \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0442\u0440\u043e\u043a\u0438: &#8216;id&#8217;, &#8216;amount&#8217; \u0438 &#8216;price&#8217;.<\/p>\n<p>\u041c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u043e\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430, \u0438\u043d\u0430\u0447\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0435 \u043f\u0440\u043e\u0439\u0434\u0443\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443, \u0438 \u043c\u044b \u043d\u0435 \u043f\u0440\u043e\u0439\u0434\u0435\u043c \u043f\u043e \u043f\u043e\u0437\u0438\u0442\u0438\u0432\u043d\u043e\u043c\u0443 \u043f\u0443\u0442\u0438 \u043d\u0430\u0448\u0435\u0433\u043e action-\u043c\u0435\u0442\u043e\u0434\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430.<\/p>\n<p>\u0414\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f SomeController \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e \u043e\u0442 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 HttpRequest \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u043e\u0432\u0443\u044e \u0437\u0430\u0433\u043b\u0443\u0448\u043a\u0443 (stub) \u0432 unit \u0442\u0435\u0441\u0442\u0435 \u0441 PHPUnit \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"php\">$request = $this-&gt;createStub(HttpRequest::class);  $request-&gt;method('get')         -&gt;willReturnOnConsecutiveCalls(               '1',               '2',               '3',           );  $controller = new SomeController;  $controller-&gt;execute($request);<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u043c\u044b \u0442\u0430\u043a\u0436\u0435 \u0445\u043e\u0442\u0438\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0441\u0432\u044f\u0437\u044c \u043c\u0435\u0436\u0434\u0443 SomeController \u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c HttpRequest, \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f mock-\u043e\u0431\u044a\u0435\u043a\u0442, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u043d\u0430\u0448\u0435\u043c \u0442\u0435\u0441\u0442\u0435:<\/p>\n<pre><code class=\"php\">$request = $this-&gt;createMock(HttpRequest::class);  $request-&gt;expects($this-&gt;exactly(3))         -&gt;method('get')         -&gt;withConsecutive(             ['id'],             ['amount'],             ['price']         )         -&gt;willReturnOnConsecutiveCalls(             '1',             '2',             '3',         );  $controller = new SomeController;  $controller-&gt;execute($request);<\/code><\/pre>\n<p>\u041a\u043e\u0434, \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u0432\u044b\u0448\u0435, \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0442\u0440\u0443\u0434\u043d\u043e \u0447\u0438\u0442\u0430\u0442\u044c, \u044d\u0442\u043e <a href=\"https:\/\/wiki.c2.com\/?CodeSmell\" rel=\"noopener noreferrer nofollow\">\u0437\u0430\u043f\u0430\u0445 \u043a\u043e\u0434\u0430<\/a> (<em>\u043f\u0440\u0438\u043c \u043f\u0435\u0440. \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043c\u043e\u0436\u043d\u043e <\/em><a href=\"https:\/\/refactoring.guru\/ru\/refactoring\/smells\" rel=\"noopener noreferrer nofollow\"><em>\u0442\u0443\u0442<\/em><\/a>).<\/p>\n<p>\u041c\u044b \u0437\u0430\u044f\u0432\u043b\u044f\u0435\u043c, \u0447\u0442\u043e HttpRequest::get() \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0442\u0440\u0438 \u0440\u0430\u0437\u0430: \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0441 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u00abid\u00bb, \u0437\u0430\u0442\u0435\u043c \u0441 \u00abamount\u00bb \u0438, \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u0441 \u00abprice\u00bb.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043c\u044b \u0438\u0437\u043c\u0435\u043d\u0438\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e SomeController::execute(), \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0437\u043c\u0435\u043d\u0438\u043c \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0432\u044b\u0437\u043e\u0432\u043e\u0432 HttpRequest::get(), \u043d\u0430\u0448 \u0442\u0435\u0441\u0442 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0441\u044f \u043e\u0448\u0438\u0431\u043a\u043e\u0439. \u042d\u0442\u043e \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043d\u0430\u043c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043c\u044b \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0441\u0438\u043b\u044c\u043d\u043e \u0441\u0432\u044f\u0437\u0430\u043b\u0438 \u043d\u0430\u0448 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u043a\u043e\u0434 \u0441 \u0440\u0430\u0431\u043e\u0447\u0438\u043c \u043a\u043e\u0434\u043e\u043c. \u042d\u0442\u043e \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u0437\u0430\u043f\u0430\u0445.<\/p>\n<p>\u041d\u0430\u0441\u0442\u043e\u044f\u0449\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043c\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0441  HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043d\u0435\u044f\u0432\u043d\u044b\u0439 API, \u0433\u0434\u0435 \u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0438\u0439 \u0438\u043c\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 HTTP, \u0432 \u043e\u0431\u0449\u0438\u0439 \u043c\u0435\u0442\u043e\u0434 get(). \u0418, \u0447\u0442\u043e \u0435\u0449\u0435 \u0445\u0443\u0436\u0435, \u043c\u044b \u0438\u043c\u0438\u0442\u0438\u0440\u0443\u0435\u043c \u0442\u0438\u043f, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043d\u0435 \u0432\u043b\u0430\u0434\u0435\u0435\u043c: HttpRequest \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u043c, \u0430 \u043d\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e\u0434 \u043d\u0430\u0448\u0438\u043c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0435\u043c.<\/p>\n<p>\u041c\u0443\u0434\u0440\u043e\u0441\u0442\u044c \u00ab\u043d\u0435 \u043c\u043e\u043a\u0430\u0439\u0442\u0435 \u0442\u043e, \u0447\u0442\u043e \u0432\u0430\u043c \u043d\u0435 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442\u00bb \u0431\u0435\u0440\u0435\u0442 \u0441\u0432\u043e\u0435 \u043d\u0430\u0447\u0430\u043b\u043e \u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0435 \u00ab\u041b\u043e\u043d\u0434\u043e\u043d\u0441\u043a\u043e\u0439 \u0448\u043a\u043e\u043b\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043d\u0430 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438\u00bb. \u041a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0421\u0442\u0438\u0432 \u0424\u0440\u0438\u043c\u0430\u043d \u0438 \u041d\u0430\u0442 \u041f\u0440\u0430\u0439\u0441 \u0432 2009 \u0433\u043e\u0434\u0443 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u00ab<a href=\"http:\/\/www.growing-object-oriented-software.com\/\" rel=\"noopener noreferrer nofollow\">\u0420\u0430\u0437\u0432\u0438\u0442\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e-\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0442\u0435\u0441\u0442\u043e\u0432<\/a>\u00bb:<\/p>\n<blockquote>\n<p>\u00ab\u041c\u044b \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b\u0438, \u0447\u0442\u043e \u0442\u0435\u0441\u0442\u044b, \u043c\u043e\u043a\u0430\u044e\u0449\u0438\u0435 \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0447\u0430\u0441\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u043c\u0438, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a\u043e\u0434 \u0432 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0434\u043b\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u0430. \u0411\u0435\u0441\u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0432 \u0442\u0430\u043a\u0438\u0445 \u0442\u0435\u0441\u0442\u0430\u0445 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043d\u0430\u043c, \u0447\u0442\u043e \u0434\u0438\u0437\u0430\u0439\u043d \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439, \u043d\u043e \u0432\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0435\u043c \u043a\u043e\u0434\u0430, \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u043d\u043e\u0441\u0438\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043a\u0430\u043a \u0432 \u043a\u043e\u0434, \u0442\u0430\u043a \u0438 \u0432 \u0442\u0435\u0441\u0442\u044b\u00bb.<\/p>\n<\/blockquote>\n<p>\u041d\u043e \u0435\u0441\u043b\u0438 \u043c\u044b \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u043c\u043e\u043a\u0430\u0442\u044c \u0442\u043e, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0435 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442, \u0442\u043e \u043a\u0430\u043a \u043d\u0430\u043c \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448 \u043a\u043e\u0434 \u043e\u0442 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0433\u043e \u043a\u043e\u0434\u0430? \u0421\u0442\u0438\u0432 \u0424\u0440\u0438\u043c\u0430\u043d \u0438 \u041d\u0430\u0442 \u041f\u0440\u0430\u0439\u0441 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u043b\u0438:<\/p>\n<blockquote>\n<p>\u00ab\u041c\u044b [&#8230;] \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u0443\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u044b \u0434\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, &#8212; \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c\u0441\u044f \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u0445 \u0434\u043e\u043c\u0435\u043d\u0430 \u043d\u0430\u0448\u0438\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u0430 \u043d\u0435 \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u041c\u044b \u043f\u0438\u0448\u0435\u043c \u0441\u043b\u043e\u0439 \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0430 [&#8230;], \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0442\u0440\u0435\u0442\u044c\u0435-\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0439 API \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u044d\u0442\u0438\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 [&#8230;] &#171;<\/p>\n<\/blockquote>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u044d\u0442\u043e \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u043a\u043e\u0434\u0443:<\/p>\n<pre><code class=\"php\">interface SomeRequestInterface {     public function getId(): string;      public function getAmount(): string;      public function getPrice(): string; }<\/code><\/pre>\n<p>\u0412\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443, \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0438\u043b\u0438 \u0434\u0430\u0436\u0435 value-\u043e\u0431\u044a\u0435\u043a\u0442\u044b. \u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u0438\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0442\u0440\u043e\u043a.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0434\u0432\u043e\u0439\u043d\u0438\u043a\u0430 \u0434\u043b\u044f SomeRequestInterface \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e:<\/p>\n<pre><code class=\"php\">$request = $this-&gt;createStub(SomeRequestInterface::class);  $request-&gt;method('getId')         -&gt;willReturn(1);  $request-&gt;method('getAmount')         -&gt;willReturn(2);  $request-&gt;method('getPrice')         -&gt;willReturn(3);<\/code><\/pre>\n<p>\u0421 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430, \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0435\u0439, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 &#8212; \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0439 HTTP-\u0437\u0430\u043f\u0440\u043e\u0441 \u0432 \u0432\u0438\u0434\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0430. \u041e\u0434\u043d\u0430\u043a\u043e \u044d\u0442\u043e \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u043c\u0435\u0448\u0430\u0442\u044c \u043d\u0430\u043c \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043e\u0431\u0449\u0438\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u0441 \u043d\u0430\u0448\u0438\u043c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u041d\u0430\u043c \u0434\u0430\u0436\u0435 \u043d\u0435 \u043d\u0443\u0436\u0435\u043d \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u0430\u043f\u043f\u0435\u0440. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0431\u0435\u0440\u043d\u0443\u0442\u044c \u043e\u0431\u0449\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441:<\/p>\n<pre><code class=\"php\">class SomeRequest implements SomeRequestInterface {     private HttpRequest $request;      public function __construct(HttpRequest $request)     {         $this-&gt;request = $request;     }      public function getId(): string     {         return $this-&gt;request-&gt;get('id');     }      public function getAmount(): string     {         return $this-&gt;request-&gt;get('amount');     }      public function getPrice(): string     {         return $this-&gt;request-&gt;get('price');     } }<\/code><\/pre>\n<p>\u0418 \u0432\u043e\u0442 \u043a\u0430\u043a \u043c\u044b \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432\u043c\u0435\u0441\u0442\u0435:<\/p>\n<pre><code class=\"php\">class SomeController {     public function execute(HttpRequest $request)     {         return $this-&gt;executable-&gt;execute(             new SomeRequest($request)         )     } }<\/code><\/pre>\n<p>\u0414\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 SomeController \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u043a\u043b\u0430\u0441\u0441\u043e\u043c \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u043e\u0433\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u043c, \u0432\u0430\u0448 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043e\u0434 \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u043c \u043e\u0442 HTTP \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430. <\/p>\n<p>\u0412\u044b, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0432\u043e\u044e \u043e\u0431\u0435\u0440\u0442\u043a\u0443 request&#8217;a, \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u0443\u044e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430. \u0412\u0430\u0448\u0435\u043c\u0443 \u043a\u043e\u0434\u0443 \u043d\u0443\u0436\u043d\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438? \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043c\u0435\u0442\u043e\u0434, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0445. \u0412\u0430\u0448\u0435\u043c\u0443 \u043a\u043e\u0434\u0443 \u043d\u0443\u0436\u0435\u043d \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b? \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e\u0433\u043e.<\/p>\n<p>\u041f\u043e\u043b\u043d\u044b\u0439 HTTP-\u0437\u0430\u043f\u0440\u043e\u0441 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b, \u0442\u0435\u043b\u043e POST \u0438 \u0442. \u0434. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0439 \u0437\u0430\u0433\u043b\u0443\u0448\u043a\u0438 \u0438\u043b\u0438 mock&#8217;\u0430 \u0434\u043b\u044f \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e\u0433\u043e, \u043f\u043e\u043a\u0430 \u0432\u044b \u043d\u0435 \u0432\u043b\u0430\u0434\u0435\u0435\u0442\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c, \u043c\u0435\u0448\u0430\u0435\u0442 \u0432\u0430\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443. \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0437\u0430\u0434\u0430\u0447\u0443.<\/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\/554318\/\"> https:\/\/habr.com\/ru\/post\/554318\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<p><em>\u041f\u0440\u0438\u043c. \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a\u0430: \u0441\u0430\u043c\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u0442\u0430\u0440\u043e\u0435, \u0434\u0430 \u0438 \u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 &#8212; \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u0441\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442 \u0441\u043a\u043e\u0440\u0435\u0435 \u0434\u043b\u044f \u043d\u043e\u0432\u0438\u0447\u043a\u043e\u0432, \u043b\u044e\u0434\u0438 \u0441 \u0445\u043e\u0440\u043e\u0448\u0438\u043c \u043e\u043f\u044b\u0442\u043e\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u043e\u0432, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043d\u0435 \u043d\u0430\u0439\u0434\u0443\u0442 \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u043e\u0432\u043e\u0433\u043e. UPD. \u042f \u0432\u0441\u0435 \u0436\u0435 \u043d\u0435 \u0434\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u0430\u0432\u0442\u043e\u0440 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0438\u043c \u0441\u043b\u043e\u0435\u043c \u0432\u0441\u0435 \u0430\u043f\u0438 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0432\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u0435 (\u043d\u0443 \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u043a\u0440\u0430\u0439\u043d\u0435 \u0441\u0442\u0440\u0430\u043d\u043d\u043e), \u0442\u0443\u0442 \u0441\u043a\u043e\u0440\u0435\u0435 \u0440\u0435\u0447\u044c \u043e \u0441\u043b\u0430\u0431\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445\/\u0442\u0438\u043f\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u0430\u0445 \u043e\u0431\u0449\u0435\u0433\u043e \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0432\u0440\u043e\u0434\u0435 HttpRequest \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435.<\/em><\/p>\n<p>\u0412\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0437\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u0441\u043e\u0437\u0434\u0430\u043d\u044b \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432. \u041e\u0431\u044b\u0447\u043d\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u044f\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u0443 \u043d\u0430\u0441 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u043a\u0430\u043a<\/p>\n<pre><code class=\"php\">interface HttpRequest {     public function get(string $name): string;      \/\/ ... }<\/code><\/pre>\n<p>\u0438\u043b\u0438 \u0434\u0430\u0436\u0435 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441, \u0442\u0430\u043a\u043e\u0439 \u043a\u0430\u043a<\/p>\n<pre><code class=\"php\">class HttpRequest {     public function get(string $name): string     {         \/\/ ...     }      \/\/ ... }<\/code><\/pre>\n<p>\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c (\u0438 \u0434\u043e\u043b\u0436\u043d\u044b) \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0430.<\/p>\n<p>\u0412 symfony, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u0442\u044c Symfony\\Component\\HttpFoundation\\Request::get(). \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0431\u0435\u0441\u043f\u043e\u043a\u043e\u0438\u0442\u044c\u0441\u044f \u043e \u0442\u043e\u043c, \u043a\u0430\u043a\u043e\u0439 \u0442\u0438\u043f HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043c\u044b \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c (GET, POST \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u043e\u0439). \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u043e\u0447\u0438\u043c\u0441\u044f \u043d\u0430 \u043d\u0435\u044f\u0432\u043d\u044b\u0445 API, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a HttpRequest::get(), \u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043d\u0438 \u0441\u043e\u0437\u0434\u0430\u044e\u0442.<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u043c\u0435\u0442\u043e\u0434 get() \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c. \u041d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0441 \u044f\u0432\u043d\u044b\u043c \u0438\u043c\u0435\u043d\u0435\u043c \u0434\u043b\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u0438\u043c\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u0430\u043a \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u043c\u0435\u0442\u043e\u0434\u0443 get():<\/p>\n<pre><code class=\"php\">class SomeController {     public function execute(HttpRequest $request): HttpResponse     {         $id     = $request-&gt;get('id');         $amount = $request-&gt;get('amount');         $price  = $request-&gt;get('price');          \/\/ ...     } }<\/code><\/pre>\n<p>\u041c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0441\u043f\u043e\u0440\u0438\u0442\u044c \u043e \u0442\u043e\u043c, \u0434\u043e\u043b\u0436\u0435\u043d \u043b\u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0438\u043c\u0435\u0442\u044c \u043e\u0434\u0438\u043d action-\u043c\u0435\u0442\u043e\u0434 \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e (\u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0430: <a href=\"https:\/\/vimeo.com\/148989192\" rel=\"noopener noreferrer nofollow\">\u0443 \u043d\u0435\u0433\u043e \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d<\/a> (eng \u0432\u0438\u0434\u0435\u043e)). \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0442\u044c \u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u0430.<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442 HttpRequest \u043d\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u0443\u044e \u0437\u0430\u0433\u043b\u0443\u0448\u043a\u0443 (stub) \u0438\u043b\u0438 mock-\u043e\u0431\u044a\u0435\u043a\u0442 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f SomeController \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e \u043e\u0442 \u0441\u0435\u0442\u0438 \u0438 \u043e\u0442 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430, \u043c\u044b \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u043c\u0441\u044f \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u043e\u0434\u043d\u043e\u0433\u043e \u0438 \u0442\u043e\u0433\u043e \u0436\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 get() \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0442\u0440\u043e\u043a\u0438: &#8216;id&#8217;, &#8216;amount&#8217; \u0438 &#8216;price&#8217;.<\/p>\n<p>\u041c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u043e\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430, \u0438\u043d\u0430\u0447\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0435 \u043f\u0440\u043e\u0439\u0434\u0443\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443, \u0438 \u043c\u044b \u043d\u0435 \u043f\u0440\u043e\u0439\u0434\u0435\u043c \u043f\u043e \u043f\u043e\u0437\u0438\u0442\u0438\u0432\u043d\u043e\u043c\u0443 \u043f\u0443\u0442\u0438 \u043d\u0430\u0448\u0435\u0433\u043e action-\u043c\u0435\u0442\u043e\u0434\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430.<\/p>\n<p>\u0414\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f SomeController \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e \u043e\u0442 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 HttpRequest \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u043e\u0432\u0443\u044e \u0437\u0430\u0433\u043b\u0443\u0448\u043a\u0443 (stub) \u0432 unit \u0442\u0435\u0441\u0442\u0435 \u0441 PHPUnit \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"php\">$request = $this-&gt;createStub(HttpRequest::class);  $request-&gt;method('get')         -&gt;willReturnOnConsecutiveCalls(               '1',               '2',               '3',           );  $controller = new SomeController;  $controller-&gt;execute($request);<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u043c\u044b \u0442\u0430\u043a\u0436\u0435 \u0445\u043e\u0442\u0438\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0441\u0432\u044f\u0437\u044c \u043c\u0435\u0436\u0434\u0443 SomeController \u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c HttpRequest, \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f mock-\u043e\u0431\u044a\u0435\u043a\u0442, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u043d\u0430\u0448\u0435\u043c \u0442\u0435\u0441\u0442\u0435:<\/p>\n<pre><code class=\"php\">$request = $this-&gt;createMock(HttpRequest::class);  $request-&gt;expects($this-&gt;exactly(3))         -&gt;method('get')         -&gt;withConsecutive(             ['id'],             ['amount'],             ['price']         )         -&gt;willReturnOnConsecutiveCalls(             '1',             '2',             '3',         );  $controller = new SomeController;  $controller-&gt;execute($request);<\/code><\/pre>\n<p>\u041a\u043e\u0434, \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u0432\u044b\u0448\u0435, \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0442\u0440\u0443\u0434\u043d\u043e \u0447\u0438\u0442\u0430\u0442\u044c, \u044d\u0442\u043e <a href=\"https:\/\/wiki.c2.com\/?CodeSmell\" rel=\"noopener noreferrer nofollow\">\u0437\u0430\u043f\u0430\u0445 \u043a\u043e\u0434\u0430<\/a> (<em>\u043f\u0440\u0438\u043c \u043f\u0435\u0440. \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043c\u043e\u0436\u043d\u043e <\/em><a href=\"https:\/\/refactoring.guru\/ru\/refactoring\/smells\" rel=\"noopener noreferrer nofollow\"><em>\u0442\u0443\u0442<\/em><\/a>).<\/p>\n<p>\u041c\u044b \u0437\u0430\u044f\u0432\u043b\u044f\u0435\u043c, \u0447\u0442\u043e HttpRequest::get() \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0442\u0440\u0438 \u0440\u0430\u0437\u0430: \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0441 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u00abid\u00bb, \u0437\u0430\u0442\u0435\u043c \u0441 \u00abamount\u00bb \u0438, \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u0441 \u00abprice\u00bb.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043c\u044b \u0438\u0437\u043c\u0435\u043d\u0438\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e SomeController::execute(), \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0437\u043c\u0435\u043d\u0438\u043c \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0432\u044b\u0437\u043e\u0432\u043e\u0432 HttpRequest::get(), \u043d\u0430\u0448 \u0442\u0435\u0441\u0442 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0441\u044f \u043e\u0448\u0438\u0431\u043a\u043e\u0439. \u042d\u0442\u043e \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043d\u0430\u043c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043c\u044b \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0441\u0438\u043b\u044c\u043d\u043e \u0441\u0432\u044f\u0437\u0430\u043b\u0438 \u043d\u0430\u0448 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u043a\u043e\u0434 \u0441 \u0440\u0430\u0431\u043e\u0447\u0438\u043c \u043a\u043e\u0434\u043e\u043c. \u042d\u0442\u043e \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u0437\u0430\u043f\u0430\u0445.<\/p>\n<p>\u041d\u0430\u0441\u0442\u043e\u044f\u0449\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043c\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0441  HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043d\u0435\u044f\u0432\u043d\u044b\u0439 API, \u0433\u0434\u0435 \u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0438\u0439 \u0438\u043c\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 HTTP, \u0432 \u043e\u0431\u0449\u0438\u0439 \u043c\u0435\u0442\u043e\u0434 get(). \u0418, \u0447\u0442\u043e \u0435\u0449\u0435 \u0445\u0443\u0436\u0435, \u043c\u044b \u0438\u043c\u0438\u0442\u0438\u0440\u0443\u0435\u043c \u0442\u0438\u043f, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043d\u0435 \u0432\u043b\u0430\u0434\u0435\u0435\u043c: HttpRequest \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u043c, \u0430 \u043d\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e\u0434 \u043d\u0430\u0448\u0438\u043c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0435\u043c.<\/p>\n<p>\u041c\u0443\u0434\u0440\u043e\u0441\u0442\u044c \u00ab\u043d\u0435 \u043c\u043e\u043a\u0430\u0439\u0442\u0435 \u0442\u043e, \u0447\u0442\u043e \u0432\u0430\u043c \u043d\u0435 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442\u00bb \u0431\u0435\u0440\u0435\u0442 \u0441\u0432\u043e\u0435 \u043d\u0430\u0447\u0430\u043b\u043e \u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0435 \u00ab\u041b\u043e\u043d\u0434\u043e\u043d\u0441\u043a\u043e\u0439 \u0448\u043a\u043e\u043b\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043d\u0430 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438\u00bb. \u041a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0421\u0442\u0438\u0432 \u0424\u0440\u0438\u043c\u0430\u043d \u0438 \u041d\u0430\u0442 \u041f\u0440\u0430\u0439\u0441 \u0432 2009 \u0433\u043e\u0434\u0443 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u00ab<a href=\"http:\/\/www.growing-object-oriented-software.com\/\" rel=\"noopener noreferrer nofollow\">\u0420\u0430\u0437\u0432\u0438\u0442\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e-\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0442\u0435\u0441\u0442\u043e\u0432<\/a>\u00bb:<\/p>\n<blockquote>\n<p>\u00ab\u041c\u044b \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b\u0438, \u0447\u0442\u043e \u0442\u0435\u0441\u0442\u044b, \u043c\u043e\u043a\u0430\u044e\u0449\u0438\u0435 \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0447\u0430\u0441\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u043c\u0438, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a\u043e\u0434 \u0432 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0434\u043b\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u0430. \u0411\u0435\u0441\u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0432 \u0442\u0430\u043a\u0438\u0445 \u0442\u0435\u0441\u0442\u0430\u0445 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043d\u0430\u043c, \u0447\u0442\u043e \u0434\u0438\u0437\u0430\u0439\u043d \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439, \u043d\u043e \u0432\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0435\u043c \u043a\u043e\u0434\u0430, \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u043d\u043e\u0441\u0438\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043a\u0430\u043a \u0432 \u043a\u043e\u0434, \u0442\u0430\u043a \u0438 \u0432 \u0442\u0435\u0441\u0442\u044b\u00bb.<\/p>\n<\/blockquote>\n<p>\u041d\u043e \u0435\u0441\u043b\u0438 \u043c\u044b \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u043c\u043e\u043a\u0430\u0442\u044c \u0442\u043e, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0435 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442, \u0442\u043e \u043a\u0430\u043a \u043d\u0430\u043c \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448 \u043a\u043e\u0434 \u043e\u0442 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0433\u043e \u043a\u043e\u0434\u0430? \u0421\u0442\u0438\u0432 \u0424\u0440\u0438\u043c\u0430\u043d \u0438 \u041d\u0430\u0442 \u041f\u0440\u0430\u0439\u0441 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u043b\u0438:<\/p>\n<blockquote>\n<p>\u00ab\u041c\u044b [&#8230;] \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u0443\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u044b \u0434\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, &#8212; \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c\u0441\u044f \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u0445 \u0434\u043e\u043c\u0435\u043d\u0430 \u043d\u0430\u0448\u0438\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u0430 \u043d\u0435 \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u041c\u044b \u043f\u0438\u0448\u0435\u043c \u0441\u043b\u043e\u0439 \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0430 [&#8230;], \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0442\u0440\u0435\u0442\u044c\u0435-\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0439 API \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u044d\u0442\u0438\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 [&#8230;] &#171;<\/p>\n<\/blockquote>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u044d\u0442\u043e \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u043a\u043e\u0434\u0443:<\/p>\n<pre><code class=\"php\">interface SomeRequestInterface {     public function getId(): string;      public function getAmount(): string;      public function getPrice(): string; }<\/code><\/pre>\n<p>\u0412\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443, \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0438\u043b\u0438 \u0434\u0430\u0436\u0435 value-\u043e\u0431\u044a\u0435\u043a\u0442\u044b. \u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u0438\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0442\u0440\u043e\u043a.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0434\u0432\u043e\u0439\u043d\u0438\u043a\u0430 \u0434\u043b\u044f SomeRequestInterface \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e:<\/p>\n<pre><code class=\"php\">$request = $this-&gt;createStub(SomeRequestInterface::class);  $request-&gt;method('getId')         -&gt;willReturn(1);  $request-&gt;method('getAmount')         -&gt;willReturn(2);  $request-&gt;method('getPrice')         -&gt;willReturn(3);<\/code><\/pre>\n<p>\u0421 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430, \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0435\u0439, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 &#8212; \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0439 HTTP-\u0437\u0430\u043f\u0440\u043e\u0441 \u0432 \u0432\u0438\u0434\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0430. \u041e\u0434\u043d\u0430\u043a\u043e \u044d\u0442\u043e \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u043c\u0435\u0448\u0430\u0442\u044c \u043d\u0430\u043c \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043e\u0431\u0449\u0438\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u0441 \u043d\u0430\u0448\u0438\u043c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u041d\u0430\u043c \u0434\u0430\u0436\u0435 \u043d\u0435 \u043d\u0443\u0436\u0435\u043d \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u0430\u043f\u043f\u0435\u0440. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0431\u0435\u0440\u043d\u0443\u0442\u044c \u043e\u0431\u0449\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441:<\/p>\n<pre><code class=\"php\">class SomeRequest implements SomeRequestInterface {     private HttpRequest $request;      public function __construct(HttpRequest $request)     {         $this-&gt;request = $request;     }      public function getId(): string     {         return $this-&gt;request-&gt;get('id');     }      public function getAmount(): string     {         return $this-&gt;request-&gt;get('amount');     }      public function getPrice(): string     {         return $this-&gt;request-&gt;get('price');     } }<\/code><\/pre>\n<p>\u0418 \u0432\u043e\u0442 \u043a\u0430\u043a \u043c\u044b \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432\u043c\u0435\u0441\u0442\u0435:<\/p>\n<pre><code class=\"php\">class SomeController {     public function execute(HttpRequest $request)     {         return $this-&gt;executable-&gt;execute(             new SomeRequest($request)         )     } }<\/code><\/pre>\n<p>\u0414\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 SomeController \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u043a\u043b\u0430\u0441\u0441\u043e\u043c \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u043e\u0433\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u043c, \u0432\u0430\u0448 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043e\u0434 \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u043c \u043e\u0442 HTTP \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430. <\/p>\n<p>\u0412\u044b, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0432\u043e\u044e \u043e\u0431\u0435\u0440\u0442\u043a\u0443 request&#8217;a, \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u0443\u044e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430. \u0412\u0430\u0448\u0435\u043c\u0443 \u043a\u043e\u0434\u0443 \u043d\u0443\u0436\u043d\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438? \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043c\u0435\u0442\u043e\u0434, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0445. \u0412\u0430\u0448\u0435\u043c\u0443 \u043a\u043e\u0434\u0443 \u043d\u0443\u0436\u0435\u043d \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b? \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e\u0433\u043e.<\/p>\n<p>\u041f\u043e\u043b\u043d\u044b\u0439 HTTP-\u0437\u0430\u043f\u0440\u043e\u0441 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b, \u0442\u0435\u043b\u043e POST \u0438 \u0442. \u0434. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0439 \u0437\u0430\u0433\u043b\u0443\u0448\u043a\u0438 \u0438\u043b\u0438 mock&#8217;\u0430 \u0434\u043b\u044f \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e\u0433\u043e, \u043f\u043e\u043a\u0430 \u0432\u044b \u043d\u0435 \u0432\u043b\u0430\u0434\u0435\u0435\u0442\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c, \u043c\u0435\u0448\u0430\u0435\u0442 \u0432\u0430\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443. \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0437\u0430\u0434\u0430\u0447\u0443.<\/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\/554318\/\"> https:\/\/habr.com\/ru\/post\/554318\/<\/a><br \/><\/br><\/br><\/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-322059","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/322059","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=322059"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/322059\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=322059"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=322059"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=322059"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}