pock/classes/Pock-PockBuilder.html
2022-04-14 12:44:13 +00:00

2905 lines
143 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>pock</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<base href="../">
<link rel="icon" href="images/favicon.ico"/>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/base.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;600;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/template.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/css/all.min.css" integrity="sha256-ybRkN9dBjhcS2qrW1z+hfCxq+1aBdwyQM5wlQoQVt/0=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-okaidia.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.css">
<script src="https://cdn.jsdelivr.net/npm/fuse.js@3.4.6"></script>
<script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2"></script>
<script src="js/search.js"></script>
<script defer src="js/searchIndex.js"></script>
</head>
<body id="top">
<header class="phpdocumentor-header phpdocumentor-section">
<h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">pock</a></h1>
<input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
<label class="phpdocumentor-header__menu-icon" for="menu-button">
<i class="fas fa-bars"></i>
</label>
<section data-search-form class="phpdocumentor-search">
<label>
<span class="visually-hidden">Search for</span>
<svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
<line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
</svg>
<input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
</label>
</section>
<nav class="phpdocumentor-topnav">
<ul class="phpdocumentor-topnav__menu">
</ul>
</nav>
</header>
<main class="phpdocumentor">
<div class="phpdocumentor-section">
<input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
<label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
Menu
</label>
<aside class="phpdocumentor-column -four phpdocumentor-sidebar">
<section class="phpdocumentor-sidebar__category">
<h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="namespaces/pock.html" class="">Pock</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="namespaces/pock-comparator.html" class="">Comparator</a>
</li>
<li>
<a href="namespaces/pock-creator.html" class="">Creator</a>
</li>
<li>
<a href="namespaces/pock-enum.html" class="">Enum</a>
</li>
<li>
<a href="namespaces/pock-exception.html" class="">Exception</a>
</li>
<li>
<a href="namespaces/pock-factory.html" class="">Factory</a>
</li>
<li>
<a href="namespaces/pock-matchers.html" class="">Matchers</a>
</li>
<li>
<a href="namespaces/pock-promise.html" class="">Promise</a>
</li>
<li>
<a href="namespaces/pock-serializer.html" class="">Serializer</a>
</li>
<li>
<a href="namespaces/pock-traits.html" class="">Traits</a>
</li>
</ul>
</section>
<section class="phpdocumentor-sidebar__category">
<h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="packages/Pock.html" class="">Pock</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="packages/Pock-Comparator.html" class="">Comparator</a>
</li>
<li>
<a href="packages/Pock-Creator.html" class="">Creator</a>
</li>
<li>
<a href="packages/Pock-Enum.html" class="">Enum</a>
</li>
<li>
<a href="packages/Pock-Exception.html" class="">Exception</a>
</li>
<li>
<a href="packages/Pock-Factory.html" class="">Factory</a>
</li>
<li>
<a href="packages/Pock-Matchers.html" class="">Matchers</a>
</li>
<li>
<a href="packages/Pock-Promise.html" class="">Promise</a>
</li>
<li>
<a href="packages/Pock-Serializer.html" class="">Serializer</a>
</li>
<li>
<a href="packages/Pock-Traits.html" class="">Traits</a>
</li>
</ul>
</section>
<section class="phpdocumentor-sidebar__category">
<h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
</section>
<section class="phpdocumentor-sidebar__category">
<h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
</section>
</aside>
<div class="phpdocumentor-column -eight phpdocumentor-content">
<ul class="phpdocumentor-breadcrumbs">
<li class="phpdocumentor-breadcrumb"><a href="namespaces/pock.html">Pock</a></li>
</ul>
<article class="phpdocumentor-element -class">
<h2 class="phpdocumentor-content__title">
PockBuilder
<div class="phpdocumentor-element__package">
in package
<ul class="phpdocumentor-breadcrumbs">
<li class="phpdocumentor-breadcrumb"><a href="packages/Pock.html">Pock</a></li>
</ul>
</div>
<span class="phpdocumentor-element__extends">
Uses
<a href="classes/Pock-Traits-JsonDecoderTrait.html"><abbr title="\Pock\Traits\JsonDecoderTrait">JsonDecoderTrait</abbr></a>, <a href="classes/Pock-Traits-JsonSerializerAwareTrait.html"><abbr title="\Pock\Traits\JsonSerializerAwareTrait">JsonSerializerAwareTrait</abbr></a>, <a href="classes/Pock-Traits-XmlSerializerAwareTrait.html"><abbr title="\Pock\Traits\XmlSerializerAwareTrait">XmlSerializerAwareTrait</abbr></a> </span>
</h2>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/PockBuilder.php"><a href="files/src-pockbuilder.html"><abbr title="src/PockBuilder.php">PockBuilder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">69</span>
</aside>
<p class="phpdocumentor-summary">Class PockBuilder</p>
<h5 class="phpdocumentor-tag-list__heading" id="tags">
Tags
<a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
</h5>
<dl class="phpdocumentor-tag-list">
<dt class="phpdocumentor-tag-list__entry">
<span class="phpdocumentor-tag__name">category</span>
</dt>
<dd class="phpdocumentor-tag-list__definition">
<section class="phpdocumentor-description"><p>PockBuilder</p>
</section>
</dd>
<dt class="phpdocumentor-tag-list__entry">
<span class="phpdocumentor-tag__name">SuppressWarnings</span>
</dt>
<dd class="phpdocumentor-tag-list__definition">
<section class="phpdocumentor-description"><p>(PHPMD.CouplingBetweenObjects)</p>
</section>
</dd>
<dt class="phpdocumentor-tag-list__entry">
<span class="phpdocumentor-tag__name">SuppressWarnings</span>
</dt>
<dd class="phpdocumentor-tag-list__definition">
<section class="phpdocumentor-description"><p>(PHPMD.TooManyPublicMethods)</p>
</section>
</dd>
<dt class="phpdocumentor-tag-list__entry">
<span class="phpdocumentor-tag__name">SuppressWarnings</span>
</dt>
<dd class="phpdocumentor-tag-list__definition">
<section class="phpdocumentor-description"><p>(PHPMD.TooManyMethods)</p>
</section>
</dd>
<dt class="phpdocumentor-tag-list__entry">
<span class="phpdocumentor-tag__name">SuppressWarnings</span>
</dt>
<dd class="phpdocumentor-tag-list__definition">
<section class="phpdocumentor-description"><p>(PHPMD.ExcessivePublicCount)</p>
</section>
</dd>
<dt class="phpdocumentor-tag-list__entry">
<span class="phpdocumentor-tag__name">SuppressWarnings</span>
</dt>
<dd class="phpdocumentor-tag-list__definition">
<section class="phpdocumentor-description"><p>(PHPMD.ExcessiveClassComplexity)</p>
</section>
</dd>
</dl>
<h3 id="toc">
Table of Contents
<a href="#toc" class="headerlink"><i class="fas fa-link"></i></a>
</h3>
<dl class="phpdocumentor-table-of-contents">
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Pock-PockBuilder.html#method___construct">__construct()</a>
<span>
&nbsp;: mixed </span>
</dt>
<dd>PockBuilder constructor.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Pock-PockBuilder.html#method_addMatcher">addMatcher()</a>
<span>
&nbsp;: self </span>
</dt>
<dd>Add custom matcher to the mock.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Pock-PockBuilder.html#method_always">always()</a>
<span>
&nbsp;: self </span>
</dt>
<dd>Always execute this mock if matched. Mock with this call will not be expired ever.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Pock-PockBuilder.html#method_at">at()</a>
<span>
&nbsp;: self </span>
</dt>
<dd>Match request only at Nth hit. Previous matches will not be executed.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Pock-PockBuilder.html#method_getClient">getClient()</a>
<span>
&nbsp;: <a href="classes/Pock-Client.html"><abbr title="\Pock\Client">Client</abbr></a> </span>
</dt>
<dd></dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Pock-Traits-JsonDecoderTrait.html#method_jsonDecode">jsonDecode()</a>
<span>
&nbsp;: mixed </span>
</dt>
<dd>json_decode which throws exception on error.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Pock-PockBuilder.html#method_matchBody">matchBody()</a>
<span>
&nbsp;: self </span>
</dt>
<dd>Match entire request body.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Pock-PockBuilder.html#method_matchBodyRegExp">matchBodyRegExp()</a>
<span>
&nbsp;: self </span>
</dt>
<dd>Match entire request body using provided regular expression.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Pock-PockBuilder.html#method_matchCallback">matchCallback()</a>
<span>
&nbsp;: self </span>
</dt>
<dd>Match request using provided callback. Callback should receive RequestInterface and return boolean.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Pock-PockBuilder.html#method_matchExactFormData">matchExactFormData()</a>
<span>
&nbsp;: self </span>
</dt>
<dd>Match request with form-data. Additional fields aren&#039;t allowed.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Pock-PockBuilder.html#method_matchExactHeader">matchExactHeader()</a>
<span>
&nbsp;: self </span>
</dt>
<dd>Matches request by the exact header pattern or values.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Pock-PockBuilder.html#method_matchExactHeaders">matchExactHeaders()</a>
<span>
&nbsp;: self </span>
</dt>
<dd>Matches request by headers values or several values.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Pock-PockBuilder.html#method_matchExactQuery">matchExactQuery()</a>
<span>
&nbsp;: self </span>
</dt>
<dd>Match request by its query. Additional query parameters aren&#039;t allowed.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Pock-PockBuilder.html#method_matchFormData">matchFormData()</a>
<span>
&nbsp;: self </span>
</dt>
<dd>Match request with form-data.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Pock-PockBuilder.html#method_matchHeader">matchHeader()</a>
<span>
&nbsp;: self </span>
</dt>
<dd>Matches request by header value or several values. Header can have other values which are not specified here.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Pock-PockBuilder.html#method_matchHeaderLine">matchHeaderLine()</a>
<span>
&nbsp;: self </span>
</dt>
<dd>Matches request by the unparsed header line.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Pock-PockBuilder.html#method_matchHeaderLineRegexp">matchHeaderLineRegexp()</a>
<span>
&nbsp;: self </span>
</dt>
<dd>Matches request by the unparsed header line using provided regular expression.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Pock-PockBuilder.html#method_matchHeaders">matchHeaders()</a>
<span>
&nbsp;: self </span>
</dt>
<dd>Matches request by headers values or several values. Headers can have other values which are not specified here.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Pock-PockBuilder.html#method_matchHost">matchHost()</a>
<span>
&nbsp;: self </span>
</dt>
<dd>Matches request by hostname.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Pock-PockBuilder.html#method_matchJsonBody">matchJsonBody()</a>
<span>
&nbsp;: self </span>
</dt>
<dd>Match JSON request body.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Pock-PockBuilder.html#method_matchMethod">matchMethod()</a>
<span>
&nbsp;: self </span>
</dt>
<dd>Match request by its method.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Pock-PockBuilder.html#method_matchMultipartFormData">matchMultipartFormData()</a>
<span>
&nbsp;: self </span>
</dt>
<dd>Match request multipart form data. Will not match the request if body is not multipart.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Pock-PockBuilder.html#method_matchOrigin">matchOrigin()</a>
<span>
&nbsp;: self </span>
</dt>
<dd>Matches request by origin.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Pock-PockBuilder.html#method_matchPath">matchPath()</a>
<span>
&nbsp;: self </span>
</dt>
<dd>Match request by its path. Path with and without slash at the start will be treated as the same path.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Pock-PockBuilder.html#method_matchPathRegExp">matchPathRegExp()</a>
<span>
&nbsp;: self </span>
</dt>
<dd>Match request by its path using regular expression. This matcher doesn&#039;t care about prefix slash
since it&#039;s pretty easy to do it using regular expression.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Pock-PockBuilder.html#method_matchPort">matchPort()</a>
<span>
&nbsp;: self </span>
</dt>
<dd>Matches request by the port.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Pock-PockBuilder.html#method_matchQuery">matchQuery()</a>
<span>
&nbsp;: self </span>
</dt>
<dd>Match request by its query. Request can contain other query variables.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Pock-PockBuilder.html#method_matchQueryRegExp">matchQueryRegExp()</a>
<span>
&nbsp;: self </span>
</dt>
<dd>Match request by its query using regular expression.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Pock-PockBuilder.html#method_matchScheme">matchScheme()</a>
<span>
&nbsp;: self </span>
</dt>
<dd>Match request by its scheme.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Pock-PockBuilder.html#method_matchSerializedJsonBody">matchSerializedJsonBody()</a>
<span>
&nbsp;: self </span>
</dt>
<dd>Match JSON request body against JSON string or array with data.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Pock-PockBuilder.html#method_matchSerializedXmlBody">matchSerializedXmlBody()</a>
<span>
&nbsp;: self </span>
</dt>
<dd>Match XML request body.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Pock-PockBuilder.html#method_matchUri">matchUri()</a>
<span>
&nbsp;: self </span>
</dt>
<dd>Matches request by the whole URI.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Pock-PockBuilder.html#method_matchUriRegExp">matchUriRegExp()</a>
<span>
&nbsp;: self </span>
</dt>
<dd>Matches request by the whole URI using regular expression.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Pock-PockBuilder.html#method_matchXmlBody">matchXmlBody()</a>
<span>
&nbsp;: self </span>
</dt>
<dd>Match XML request body using raw XML data.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Pock-PockBuilder.html#method_repeat">repeat()</a>
<span>
&nbsp;: self </span>
</dt>
<dd>Repeat this mock provided amount of times.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Pock-PockBuilder.html#method_reply">reply()</a>
<span>
&nbsp;: <a href="classes/Pock-PockResponseBuilder.html"><abbr title="\Pock\PockResponseBuilder">PockResponseBuilder</abbr></a> </span>
</dt>
<dd></dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Pock-PockBuilder.html#method_replyWithCallback">replyWithCallback()</a>
<span>
&nbsp;: void </span>
</dt>
<dd>Construct the response during request execution using provided callback.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Pock-PockBuilder.html#method_replyWithClient">replyWithClient()</a>
<span>
&nbsp;: void </span>
</dt>
<dd>Reply to the request using provided client. Can be used to send real network request.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Pock-PockBuilder.html#method_replyWithFactory">replyWithFactory()</a>
<span>
&nbsp;: void </span>
</dt>
<dd>Construct the response during request execution using provided ReplytFactoryInterface implementation.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Pock-PockBuilder.html#method_reset">reset()</a>
<span>
&nbsp;: self </span>
</dt>
<dd>Resets the builder.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Pock-PockBuilder.html#method_setFallbackClient">setFallbackClient()</a>
<span>
&nbsp;: self </span>
</dt>
<dd>Sets fallback Client. It will be used if no request can be matched.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Pock-PockBuilder.html#method_throwClientException">throwClientException()</a>
<span>
&nbsp;: self </span>
</dt>
<dd>Throw an ClientExceptionInterface instance with specified message</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Pock-PockBuilder.html#method_throwException">throwException()</a>
<span>
&nbsp;: self </span>
</dt>
<dd>Throw an exception when request is being sent.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Pock-PockBuilder.html#method_throwNetworkException">throwNetworkException()</a>
<span>
&nbsp;: self </span>
</dt>
<dd>Throw an NetworkExceptionInterface instance with specified message</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Pock-PockBuilder.html#method_throwRequestException">throwRequestException()</a>
<span>
&nbsp;: self </span>
</dt>
<dd>Throw an RequestExceptionInterface instance with specified message</dd>
</dl>
<section class="phpdocumentor-methods">
<h3 class="phpdocumentor-elements__header" id="methods">
Methods
<a href="classes/Pock-PockBuilder.html#methods" class="headerlink"><i class="fas fa-link"></i></a>
</h3>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method___construct">
__construct()
<a href="classes/Pock-PockBuilder.html#method___construct" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/PockBuilder.php"><a href="files/src-pockbuilder.html"><abbr title="src/PockBuilder.php">PockBuilder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">102</span>
</aside>
<p class="phpdocumentor-summary">PockBuilder constructor.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">__construct</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">mixed</span></code>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">mixed</span>
&mdash;
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_addMatcher">
addMatcher()
<a href="classes/Pock-PockBuilder.html#method_addMatcher" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/PockBuilder.php"><a href="files/src-pockbuilder.html"><abbr title="src/PockBuilder.php">PockBuilder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">509</span>
</aside>
<p class="phpdocumentor-summary">Add custom matcher to the mock.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">addMatcher</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type"><a href="classes/Pock-Matchers-RequestMatcherInterface.html"><abbr title="\Pock\Matchers\RequestMatcherInterface">RequestMatcherInterface</abbr></a>&nbsp;</span><span class="phpdocumentor-signature__argument__name">$matcher</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">self</span></code>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$matcher</span>
: <span class="phpdocumentor-signature__argument__return-type"><a href="classes/Pock-Matchers-RequestMatcherInterface.html"><abbr title="\Pock\Matchers\RequestMatcherInterface">RequestMatcherInterface</abbr></a></span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">self</span>
&mdash;
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_always">
always()
<a href="classes/Pock-PockBuilder.html#method_always" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/PockBuilder.php"><a href="files/src-pockbuilder.html"><abbr title="src/PockBuilder.php">PockBuilder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">541</span>
</aside>
<p class="phpdocumentor-summary">Always execute this mock if matched. Mock with this call will not be expired ever.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">always</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">self</span></code>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">self</span>
&mdash;
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_at">
at()
<a href="classes/Pock-PockBuilder.html#method_at" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/PockBuilder.php"><a href="files/src-pockbuilder.html"><abbr title="src/PockBuilder.php">PockBuilder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">571</span>
</aside>
<p class="phpdocumentor-summary">Match request only at Nth hit. Previous matches will not be executed.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">at</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$hit</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">self</span></code>
<section class="phpdocumentor-description"><p><strong>Note:</strong> There IS a catch if you use this with the equal mocks. The test Client will not register hit
for the second mock and the second mock will be executed at N+1 time.</p>
<p>For example, if you try to send 5 requests with this mocks and log response codes:</p>
<pre class="prettyprint"><code class="language-php">$builder = new PockBuilder();
$builder-&gt;matchHost('example.com')-&gt;at(2)-&gt;reply(200);
$builder-&gt;matchHost('example.com')-&gt;at(4)-&gt;reply(201);
$builder-&gt;always()-&gt;reply(400);
</code></pre>
<p>You will get this: 400, 400, 200, 400, 400, 201
Instead of this: 400, 400, 200, 400, 201, 400</p>
</section>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$hit</span>
: <span class="phpdocumentor-signature__argument__return-type">int</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">self</span>
&mdash;
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_getClient">
getClient()
<a href="classes/Pock-PockBuilder.html#method_getClient" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/PockBuilder.php"><a href="files/src-pockbuilder.html"><abbr title="src/PockBuilder.php">PockBuilder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">720</span>
</aside>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">getClient</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type"><a href="classes/Pock-Client.html"><abbr title="\Pock\Client">Client</abbr></a></span></code>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type"><a href="classes/Pock-Client.html"><abbr title="\Pock\Client">Client</abbr></a></span>
&mdash;
</article>
<article
class="phpdocumentor-element
-method
-public
-static "
>
<h4 class="phpdocumentor-element__name" id="method_jsonDecode">
jsonDecode()
<a href="classes/Pock-Traits-JsonDecoderTrait.html#method_jsonDecode" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/Traits/JsonDecoderTrait.php"><a href="files/src-traits-jsondecodertrait.html"><abbr title="src/Traits/JsonDecoderTrait.php">JsonDecoderTrait.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">36</span>
</aside>
<p class="phpdocumentor-summary">json_decode which throws exception on error.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__static">static</span> <span class="phpdocumentor-signature__name">jsonDecode</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$json</span></span><span class="phpdocumentor-signature__argument"><span>[</span><span>, </span><span class="phpdocumentor-signature__argument__return-type">bool&nbsp;</span><span class="phpdocumentor-signature__argument__name">$associative</span><span> = </span><span class="phpdocumentor-signature__argument__default-value">false</span><span> ]</span></span><span class="phpdocumentor-signature__argument"><span>[</span><span>, </span><span class="phpdocumentor-signature__argument__return-type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$depth</span><span> = </span><span class="phpdocumentor-signature__argument__default-value">512</span><span> ]</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$flags</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">mixed</span></code>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$json</span>
: <span class="phpdocumentor-signature__argument__return-type">string</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$associative</span>
: <span class="phpdocumentor-signature__argument__return-type">bool</span>
= <span class="phpdocumentor-signature__argument__default-value">false</span> </dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$depth</span>
: <span class="phpdocumentor-signature__argument__return-type">int</span>
= <span class="phpdocumentor-signature__argument__default-value">512</span> </dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$flags</span>
: <span class="phpdocumentor-signature__argument__return-type">int</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
</dl>
<h5 class="phpdocumentor-tag-list__heading" id="tags">
Tags
<a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
</h5>
<dl class="phpdocumentor-tag-list">
<dt class="phpdocumentor-tag-list__entry">
<span class="phpdocumentor-tag__name">throws</span>
</dt>
<dd class="phpdocumentor-tag-list__definition">
<span class="phpdocumentor-tag-link"><a href="classes/Pock-Exception-JsonException.html"><abbr title="\Pock\Exception\JsonException">JsonException</abbr></a></span>
</dd>
<dt class="phpdocumentor-tag-list__entry">
<span class="phpdocumentor-tag__name">SuppressWarnings</span>
</dt>
<dd class="phpdocumentor-tag-list__definition">
<section class="phpdocumentor-description"><p>(PHPMD.BooleanArgumentFlag)</p>
</section>
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">mixed</span>
&mdash;
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_matchBody">
matchBody()
<a href="classes/Pock-PockBuilder.html#method_matchBody" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/PockBuilder.php"><a href="files/src-pockbuilder.html"><abbr title="src/PockBuilder.php">PockBuilder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">401</span>
</aside>
<p class="phpdocumentor-summary">Match entire request body.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">matchBody</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type"><abbr title="\Psr\Http\Message\StreamInterface">StreamInterface</abbr>|resource|string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$data</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">self</span></code>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$data</span>
: <span class="phpdocumentor-signature__argument__return-type"><abbr title="\Psr\Http\Message\StreamInterface">StreamInterface</abbr>|resource|string</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">self</span>
&mdash;
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_matchBodyRegExp">
matchBodyRegExp()
<a href="classes/Pock-PockBuilder.html#method_matchBodyRegExp" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/PockBuilder.php"><a href="files/src-pockbuilder.html"><abbr title="src/PockBuilder.php">PockBuilder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">414</span>
</aside>
<p class="phpdocumentor-summary">Match entire request body using provided regular expression.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">matchBodyRegExp</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$expression</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$flags</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">self</span></code>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$expression</span>
: <span class="phpdocumentor-signature__argument__return-type">string</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$flags</span>
: <span class="phpdocumentor-signature__argument__return-type">int</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">self</span>
&mdash;
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_matchCallback">
matchCallback()
<a href="classes/Pock-PockBuilder.html#method_matchCallback" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/PockBuilder.php"><a href="files/src-pockbuilder.html"><abbr title="src/PockBuilder.php">PockBuilder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">497</span>
</aside>
<p class="phpdocumentor-summary">Match request using provided callback. Callback should receive RequestInterface and return boolean.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">matchCallback</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">callable&nbsp;</span><span class="phpdocumentor-signature__argument__name">$callback</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">self</span></code>
<section class="phpdocumentor-description"><p>If returned value is true then request is matched.</p>
</section>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$callback</span>
: <span class="phpdocumentor-signature__argument__return-type">callable</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
<section class="phpdocumentor-description"><p>Callable that accepts PSR-7 RequestInterface as it's first argument.</p>
</section>
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">self</span>
&mdash;
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_matchExactFormData">
matchExactFormData()
<a href="classes/Pock-PockBuilder.html#method_matchExactFormData" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/PockBuilder.php"><a href="files/src-pockbuilder.html"><abbr title="src/PockBuilder.php">PockBuilder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">375</span>
</aside>
<p class="phpdocumentor-summary">Match request with form-data. Additional fields aren&#039;t allowed.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">matchExactFormData</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">array&lt;string, mixed&gt;&nbsp;</span><span class="phpdocumentor-signature__argument__name">$formFields</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">self</span></code>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$formFields</span>
: <span class="phpdocumentor-signature__argument__return-type">array&lt;string, mixed&gt;</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">self</span>
&mdash;
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_matchExactHeader">
matchExactHeader()
<a href="classes/Pock-PockBuilder.html#method_matchExactHeader" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/PockBuilder.php"><a href="files/src-pockbuilder.html"><abbr title="src/PockBuilder.php">PockBuilder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">246</span>
</aside>
<p class="phpdocumentor-summary">Matches request by the exact header pattern or values.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">matchExactHeader</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$header</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">string|array&lt;string|int, string&gt;&nbsp;</span><span class="phpdocumentor-signature__argument__name">$value</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">self</span></code>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$header</span>
: <span class="phpdocumentor-signature__argument__return-type">string</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$value</span>
: <span class="phpdocumentor-signature__argument__return-type">string|array&lt;string|int, string&gt;</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">self</span>
&mdash;
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_matchExactHeaders">
matchExactHeaders()
<a href="classes/Pock-PockBuilder.html#method_matchExactHeaders" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/PockBuilder.php"><a href="files/src-pockbuilder.html"><abbr title="src/PockBuilder.php">PockBuilder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">260</span>
</aside>
<p class="phpdocumentor-summary">Matches request by headers values or several values.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">matchExactHeaders</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">array&lt;string, string|string[]&gt;&nbsp;</span><span class="phpdocumentor-signature__argument__name">$headers</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">self</span></code>
<section class="phpdocumentor-description"><p>Note: only host header will be dropped. Any other headers will not be excluded and can result in the problems
with the exact matching.</p>
</section>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$headers</span>
: <span class="phpdocumentor-signature__argument__return-type">array&lt;string, string|string[]&gt;</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">self</span>
&mdash;
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_matchExactQuery">
matchExactQuery()
<a href="classes/Pock-PockBuilder.html#method_matchExactQuery" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/PockBuilder.php"><a href="files/src-pockbuilder.html"><abbr title="src/PockBuilder.php">PockBuilder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">351</span>
</aside>
<p class="phpdocumentor-summary">Match request by its query. Additional query parameters aren&#039;t allowed.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">matchExactQuery</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">array&lt;string, mixed&gt;&nbsp;</span><span class="phpdocumentor-signature__argument__name">$query</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">self</span></code>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$query</span>
: <span class="phpdocumentor-signature__argument__return-type">array&lt;string, mixed&gt;</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">self</span>
&mdash;
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_matchFormData">
matchFormData()
<a href="classes/Pock-PockBuilder.html#method_matchFormData" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/PockBuilder.php"><a href="files/src-pockbuilder.html"><abbr title="src/PockBuilder.php">PockBuilder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">363</span>
</aside>
<p class="phpdocumentor-summary">Match request with form-data.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">matchFormData</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">array&lt;string, mixed&gt;&nbsp;</span><span class="phpdocumentor-signature__argument__name">$formFields</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">self</span></code>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$formFields</span>
: <span class="phpdocumentor-signature__argument__return-type">array&lt;string, mixed&gt;</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">self</span>
&mdash;
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_matchHeader">
matchHeader()
<a href="classes/Pock-PockBuilder.html#method_matchHeader" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/PockBuilder.php"><a href="files/src-pockbuilder.html"><abbr title="src/PockBuilder.php">PockBuilder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">220</span>
</aside>
<p class="phpdocumentor-summary">Matches request by header value or several values. Header can have other values which are not specified here.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">matchHeader</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$header</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">string|array&lt;string|int, string&gt;&nbsp;</span><span class="phpdocumentor-signature__argument__name">$value</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">self</span></code>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$header</span>
: <span class="phpdocumentor-signature__argument__return-type">string</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$value</span>
: <span class="phpdocumentor-signature__argument__return-type">string|array&lt;string|int, string&gt;</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
</dl>
<h5 class="phpdocumentor-tag-list__heading" id="tags">
Tags
<a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
</h5>
<dl class="phpdocumentor-tag-list">
<dt class="phpdocumentor-tag-list__entry">
<span class="phpdocumentor-tag__name">see</span>
</dt>
<dd class="phpdocumentor-tag-list__definition">
<span class="phpdocumentor-tag-link"><a href="classes/Pock-PockBuilder.html#method_matchExactHeader"><abbr title="\Pock\PockBuilder::matchExactHeader()">PockBuilder::matchExactHeader()</abbr></a></span>
<section class="phpdocumentor-description"><p>if you want to match exact header values.</p>
</section>
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">self</span>
&mdash;
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_matchHeaderLine">
matchHeaderLine()
<a href="classes/Pock-PockBuilder.html#method_matchHeaderLine" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/PockBuilder.php"><a href="files/src-pockbuilder.html"><abbr title="src/PockBuilder.php">PockBuilder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">273</span>
</aside>
<p class="phpdocumentor-summary">Matches request by the unparsed header line.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">matchHeaderLine</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$header</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$value</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">self</span></code>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$header</span>
: <span class="phpdocumentor-signature__argument__return-type">string</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$value</span>
: <span class="phpdocumentor-signature__argument__return-type">string</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">self</span>
&mdash;
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_matchHeaderLineRegexp">
matchHeaderLineRegexp()
<a href="classes/Pock-PockBuilder.html#method_matchHeaderLineRegexp" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/PockBuilder.php"><a href="files/src-pockbuilder.html"><abbr title="src/PockBuilder.php">PockBuilder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">286</span>
</aside>
<p class="phpdocumentor-summary">Matches request by the unparsed header line using provided regular expression.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">matchHeaderLineRegexp</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$header</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$pattern</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">self</span></code>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$header</span>
: <span class="phpdocumentor-signature__argument__return-type">string</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$pattern</span>
: <span class="phpdocumentor-signature__argument__return-type">string</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">self</span>
&mdash;
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_matchHeaders">
matchHeaders()
<a href="classes/Pock-PockBuilder.html#method_matchHeaders" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/PockBuilder.php"><a href="files/src-pockbuilder.html"><abbr title="src/PockBuilder.php">PockBuilder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">233</span>
</aside>
<p class="phpdocumentor-summary">Matches request by headers values or several values. Headers can have other values which are not specified here.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">matchHeaders</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">array&lt;string, string|string[]&gt;&nbsp;</span><span class="phpdocumentor-signature__argument__name">$headers</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">self</span></code>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$headers</span>
: <span class="phpdocumentor-signature__argument__return-type">array&lt;string, string|string[]&gt;</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
</dl>
<h5 class="phpdocumentor-tag-list__heading" id="tags">
Tags
<a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
</h5>
<dl class="phpdocumentor-tag-list">
<dt class="phpdocumentor-tag-list__entry">
<span class="phpdocumentor-tag__name">see</span>
</dt>
<dd class="phpdocumentor-tag-list__definition">
<span class="phpdocumentor-tag-link"><a href="classes/Pock-PockBuilder.html#method_matchExactHeaders"><abbr title="\Pock\PockBuilder::matchExactHeaders()">PockBuilder::matchExactHeaders()</abbr></a></span>
<section class="phpdocumentor-description"><p>if you want to match exact headers collection.</p>
</section>
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">self</span>
&mdash;
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_matchHost">
matchHost()
<a href="classes/Pock-PockBuilder.html#method_matchHost" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/PockBuilder.php"><a href="files/src-pockbuilder.html"><abbr title="src/PockBuilder.php">PockBuilder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">138</span>
</aside>
<p class="phpdocumentor-summary">Matches request by hostname.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">matchHost</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$host</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">self</span></code>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$host</span>
: <span class="phpdocumentor-signature__argument__return-type">string</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">self</span>
&mdash;
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_matchJsonBody">
matchJsonBody()
<a href="classes/Pock-PockBuilder.html#method_matchJsonBody" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/PockBuilder.php"><a href="files/src-pockbuilder.html"><abbr title="src/PockBuilder.php">PockBuilder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">427</span>
</aside>
<p class="phpdocumentor-summary">Match JSON request body.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">matchJsonBody</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">mixed&nbsp;</span><span class="phpdocumentor-signature__argument__name">$data</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">self</span></code>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$data</span>
: <span class="phpdocumentor-signature__argument__return-type">mixed</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
</dl>
<h5 class="phpdocumentor-tag-list__heading" id="tags">
Tags
<a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
</h5>
<dl class="phpdocumentor-tag-list">
<dt class="phpdocumentor-tag-list__entry">
<span class="phpdocumentor-tag__name">throws</span>
</dt>
<dd class="phpdocumentor-tag-list__definition">
<span class="phpdocumentor-tag-link"><a href="classes/Pock-Exception-JsonException.html"><abbr title="\Pock\Exception\JsonException">JsonException</abbr></a></span>
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">self</span>
&mdash;
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_matchMethod">
matchMethod()
<a href="classes/Pock-PockBuilder.html#method_matchMethod" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/PockBuilder.php"><a href="files/src-pockbuilder.html"><abbr title="src/PockBuilder.php">PockBuilder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">114</span>
</aside>
<p class="phpdocumentor-summary">Match request by its method.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">matchMethod</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$method</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">self</span></code>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$method</span>
: <span class="phpdocumentor-signature__argument__return-type">string</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">self</span>
&mdash;
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_matchMultipartFormData">
matchMultipartFormData()
<a href="classes/Pock-PockBuilder.html#method_matchMultipartFormData" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/PockBuilder.php"><a href="files/src-pockbuilder.html"><abbr title="src/PockBuilder.php">PockBuilder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">389</span>
</aside>
<p class="phpdocumentor-summary">Match request multipart form data. Will not match the request if body is not multipart.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">matchMultipartFormData</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">callable&nbsp;</span><span class="phpdocumentor-signature__argument__name">$callback</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">self</span></code>
<section class="phpdocumentor-description"><p>Uses third-party library to parse the data.</p>
</section>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$callback</span>
: <span class="phpdocumentor-signature__argument__return-type">callable</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
<section class="phpdocumentor-description"><p>Accepts Riverline\MultiPartParser\StreamedPart as an argument, returns true if matched.</p>
</section>
</dd>
</dl>
<h5 class="phpdocumentor-tag-list__heading" id="tags">
Tags
<a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
</h5>
<dl class="phpdocumentor-tag-list">
<dt class="phpdocumentor-tag-list__entry">
<span class="phpdocumentor-tag__name">see</span>
</dt>
<dd class="phpdocumentor-tag-list__definition">
<span class="phpdocumentor-tag-link"><a href="https://github.com/Riverline/multipart-parser#usage"><abbr title="https://github.com/Riverline/multipart-parser#usage">https://github.com/Riverline/multipart-parser#usage</abbr></a></span>
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">self</span>
&mdash;
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_matchOrigin">
matchOrigin()
<a href="classes/Pock-PockBuilder.html#method_matchOrigin" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/PockBuilder.php"><a href="files/src-pockbuilder.html"><abbr title="src/PockBuilder.php">PockBuilder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">163</span>
</aside>
<p class="phpdocumentor-summary">Matches request by origin.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">matchOrigin</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$origin</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">self</span></code>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$origin</span>
: <span class="phpdocumentor-signature__argument__return-type">string</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
</dl>
<h5 class="phpdocumentor-tag-list__heading" id="tags">
Tags
<a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
</h5>
<dl class="phpdocumentor-tag-list">
<dt class="phpdocumentor-tag-list__entry">
<span class="phpdocumentor-tag__name">throws</span>
</dt>
<dd class="phpdocumentor-tag-list__definition">
<span class="phpdocumentor-tag-link"><abbr title="\RuntimeException">RuntimeException</abbr></span>
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">self</span>
&mdash;
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_matchPath">
matchPath()
<a href="classes/Pock-PockBuilder.html#method_matchPath" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/PockBuilder.php"><a href="files/src-pockbuilder.html"><abbr title="src/PockBuilder.php">PockBuilder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">299</span>
</aside>
<p class="phpdocumentor-summary">Match request by its path. Path with and without slash at the start will be treated as the same path.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">matchPath</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$path</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">self</span></code>
<section class="phpdocumentor-description"><p>It's not the same for the path with slash at the end of it.</p>
</section>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$path</span>
: <span class="phpdocumentor-signature__argument__return-type">string</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">self</span>
&mdash;
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_matchPathRegExp">
matchPathRegExp()
<a href="classes/Pock-PockBuilder.html#method_matchPathRegExp" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/PockBuilder.php"><a href="files/src-pockbuilder.html"><abbr title="src/PockBuilder.php">PockBuilder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">313</span>
</aside>
<p class="phpdocumentor-summary">Match request by its path using regular expression. This matcher doesn&#039;t care about prefix slash
since it&#039;s pretty easy to do it using regular expression.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">matchPathRegExp</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$expression</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$flags</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">self</span></code>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$expression</span>
: <span class="phpdocumentor-signature__argument__return-type">string</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$flags</span>
: <span class="phpdocumentor-signature__argument__return-type">int</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">self</span>
&mdash;
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_matchPort">
matchPort()
<a href="classes/Pock-PockBuilder.html#method_matchPort" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/PockBuilder.php"><a href="files/src-pockbuilder.html"><abbr title="src/PockBuilder.php">PockBuilder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">150</span>
</aside>
<p class="phpdocumentor-summary">Matches request by the port.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">matchPort</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$port</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">self</span></code>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$port</span>
: <span class="phpdocumentor-signature__argument__return-type">int</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">self</span>
&mdash;
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_matchQuery">
matchQuery()
<a href="classes/Pock-PockBuilder.html#method_matchQuery" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/PockBuilder.php"><a href="files/src-pockbuilder.html"><abbr title="src/PockBuilder.php">PockBuilder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">326</span>
</aside>
<p class="phpdocumentor-summary">Match request by its query. Request can contain other query variables.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">matchQuery</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">array&lt;string, mixed&gt;&nbsp;</span><span class="phpdocumentor-signature__argument__name">$query</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">self</span></code>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$query</span>
: <span class="phpdocumentor-signature__argument__return-type">array&lt;string, mixed&gt;</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
</dl>
<h5 class="phpdocumentor-tag-list__heading" id="tags">
Tags
<a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
</h5>
<dl class="phpdocumentor-tag-list">
<dt class="phpdocumentor-tag-list__entry">
<span class="phpdocumentor-tag__name">see</span>
</dt>
<dd class="phpdocumentor-tag-list__definition">
<span class="phpdocumentor-tag-link"><a href="classes/Pock-PockBuilder.html#method_matchExactQuery"><abbr title="\Pock\PockBuilder::matchExactQuery()">PockBuilder::matchExactQuery()</abbr></a></span>
<section class="phpdocumentor-description"><p>if you want to match an entire query string.</p>
</section>
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">self</span>
&mdash;
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_matchQueryRegExp">
matchQueryRegExp()
<a href="classes/Pock-PockBuilder.html#method_matchQueryRegExp" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/PockBuilder.php"><a href="files/src-pockbuilder.html"><abbr title="src/PockBuilder.php">PockBuilder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">339</span>
</aside>
<p class="phpdocumentor-summary">Match request by its query using regular expression.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">matchQueryRegExp</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$expression</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$flags</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">self</span></code>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$expression</span>
: <span class="phpdocumentor-signature__argument__return-type">string</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$flags</span>
: <span class="phpdocumentor-signature__argument__return-type">int</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">self</span>
&mdash;
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_matchScheme">
matchScheme()
<a href="classes/Pock-PockBuilder.html#method_matchScheme" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/PockBuilder.php"><a href="files/src-pockbuilder.html"><abbr title="src/PockBuilder.php">PockBuilder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">126</span>
</aside>
<p class="phpdocumentor-summary">Match request by its scheme.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">matchScheme</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$scheme</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">self</span></code>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$scheme</span>
: <span class="phpdocumentor-signature__argument__return-type">string</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">self</span>
&mdash;
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_matchSerializedJsonBody">
matchSerializedJsonBody()
<a href="classes/Pock-PockBuilder.html#method_matchSerializedJsonBody" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/PockBuilder.php"><a href="files/src-pockbuilder.html"><abbr title="src/PockBuilder.php">PockBuilder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">445</span>
</aside>
<p class="phpdocumentor-summary">Match JSON request body against JSON string or array with data.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">matchSerializedJsonBody</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">array&lt;int|string, mixed&gt;|string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$data</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">self</span></code>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$data</span>
: <span class="phpdocumentor-signature__argument__return-type">array&lt;int|string, mixed&gt;|string</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
</dl>
<h5 class="phpdocumentor-tag-list__heading" id="tags">
Tags
<a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
</h5>
<dl class="phpdocumentor-tag-list">
<dt class="phpdocumentor-tag-list__entry">
<span class="phpdocumentor-tag__name">throws</span>
</dt>
<dd class="phpdocumentor-tag-list__definition">
<span class="phpdocumentor-tag-link"><a href="classes/Pock-Exception-JsonException.html"><abbr title="\Pock\Exception\JsonException">JsonException</abbr></a></span>
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">self</span>
&mdash;
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_matchSerializedXmlBody">
matchSerializedXmlBody()
<a href="classes/Pock-PockBuilder.html#method_matchSerializedXmlBody" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/PockBuilder.php"><a href="files/src-pockbuilder.html"><abbr title="src/PockBuilder.php">PockBuilder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">484</span>
</aside>
<p class="phpdocumentor-summary">Match XML request body.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">matchSerializedXmlBody</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">string|array&lt;string|int, mixed&gt;|object&nbsp;</span><span class="phpdocumentor-signature__argument__name">$data</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">self</span></code>
<section class="phpdocumentor-description"><p>This method will try to use available XML serializer before matching.</p>
</section>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$data</span>
: <span class="phpdocumentor-signature__argument__return-type">string|array&lt;string|int, mixed&gt;|object</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
</dl>
<h5 class="phpdocumentor-tag-list__heading" id="tags">
Tags
<a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
</h5>
<dl class="phpdocumentor-tag-list">
<dt class="phpdocumentor-tag-list__entry">
<span class="phpdocumentor-tag__name">phpstan-ignore-next-line</span>
</dt>
<dd class="phpdocumentor-tag-list__definition">
</dd>
<dt class="phpdocumentor-tag-list__entry">
<span class="phpdocumentor-tag__name">throws</span>
</dt>
<dd class="phpdocumentor-tag-list__definition">
<span class="phpdocumentor-tag-link"><a href="classes/Pock-Exception-XmlException.html"><abbr title="\Pock\Exception\XmlException">XmlException</abbr></a></span>
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">self</span>
&mdash;
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_matchUri">
matchUri()
<a href="classes/Pock-PockBuilder.html#method_matchUri" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/PockBuilder.php"><a href="files/src-pockbuilder.html"><abbr title="src/PockBuilder.php">PockBuilder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">193</span>
</aside>
<p class="phpdocumentor-summary">Matches request by the whole URI.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">matchUri</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type"><abbr title="\Psr\Http\Message\UriInterface">UriInterface</abbr>|string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$uri</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">self</span></code>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$uri</span>
: <span class="phpdocumentor-signature__argument__return-type"><abbr title="\Psr\Http\Message\UriInterface">UriInterface</abbr>|string</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">self</span>
&mdash;
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_matchUriRegExp">
matchUriRegExp()
<a href="classes/Pock-PockBuilder.html#method_matchUriRegExp" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/PockBuilder.php"><a href="files/src-pockbuilder.html"><abbr title="src/PockBuilder.php">PockBuilder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">206</span>
</aside>
<p class="phpdocumentor-summary">Matches request by the whole URI using regular expression.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">matchUriRegExp</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$expression</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$flags</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">self</span></code>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$expression</span>
: <span class="phpdocumentor-signature__argument__return-type">string</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$flags</span>
: <span class="phpdocumentor-signature__argument__return-type">int</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">self</span>
&mdash;
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_matchXmlBody">
matchXmlBody()
<a href="classes/Pock-PockBuilder.html#method_matchXmlBody" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/PockBuilder.php"><a href="files/src-pockbuilder.html"><abbr title="src/PockBuilder.php">PockBuilder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">468</span>
</aside>
<p class="phpdocumentor-summary">Match XML request body using raw XML data.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">matchXmlBody</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type"><abbr title="\DOMDocument">DOMDocument</abbr>|<abbr title="\Psr\Http\Message\StreamInterface">StreamInterface</abbr>|resource|string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$data</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">self</span></code>
<section class="phpdocumentor-description"><p><strong>Note:</strong> this method will fallback to the string comparison if ext-xsl is not available.
It also doesn't serializer values with available XML serializer.
Use PockBuilder::matchSerializedXmlBody if you want to execute available serializer.</p>
</section>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$data</span>
: <span class="phpdocumentor-signature__argument__return-type"><abbr title="\DOMDocument">DOMDocument</abbr>|<abbr title="\Psr\Http\Message\StreamInterface">StreamInterface</abbr>|resource|string</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
</dl>
<h5 class="phpdocumentor-tag-list__heading" id="tags">
Tags
<a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
</h5>
<dl class="phpdocumentor-tag-list">
<dt class="phpdocumentor-tag-list__entry">
<span class="phpdocumentor-tag__name">throws</span>
</dt>
<dd class="phpdocumentor-tag-list__definition">
<span class="phpdocumentor-tag-link"><a href="classes/Pock-Exception-XmlException.html"><abbr title="\Pock\Exception\XmlException">XmlException</abbr></a></span>
</dd>
<dt class="phpdocumentor-tag-list__entry">
<span class="phpdocumentor-tag__name">see</span>
</dt>
<dd class="phpdocumentor-tag-list__definition">
<span class="phpdocumentor-tag-link"><a href="classes/Pock-PockBuilder.html#method_matchSerializedXmlBody"><abbr title="\Pock\PockBuilder::matchSerializedXmlBody()">PockBuilder::matchSerializedXmlBody()</abbr></a></span>
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">self</span>
&mdash;
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_repeat">
repeat()
<a href="classes/Pock-PockBuilder.html#method_repeat" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/PockBuilder.php"><a href="files/src-pockbuilder.html"><abbr title="src/PockBuilder.php">PockBuilder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">525</span>
</aside>
<p class="phpdocumentor-summary">Repeat this mock provided amount of times.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">repeat</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$hits</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">self</span></code>
<section class="phpdocumentor-description"><p>For example, if you pass 2 as an argument mock will be able to handle two identical requests.</p>
</section>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$hits</span>
: <span class="phpdocumentor-signature__argument__return-type">int</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">self</span>
&mdash;
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_reply">
reply()
<a href="classes/Pock-PockBuilder.html#method_reply" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/PockBuilder.php"><a href="files/src-pockbuilder.html"><abbr title="src/PockBuilder.php">PockBuilder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">634</span>
</aside>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">reply</span><span>(</span><span class="phpdocumentor-signature__argument"><span>[</span><span class="phpdocumentor-signature__argument__return-type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$statusCode</span><span> = </span><span class="phpdocumentor-signature__argument__default-value">200</span><span> ]</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type"><a href="classes/Pock-PockResponseBuilder.html"><abbr title="\Pock\PockResponseBuilder">PockResponseBuilder</abbr></a></span></code>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$statusCode</span>
: <span class="phpdocumentor-signature__argument__return-type">int</span>
= <span class="phpdocumentor-signature__argument__default-value">200</span> </dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type"><a href="classes/Pock-PockResponseBuilder.html"><abbr title="\Pock\PockResponseBuilder">PockResponseBuilder</abbr></a></span>
&mdash;
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_replyWithCallback">
replyWithCallback()
<a href="classes/Pock-PockBuilder.html#method_replyWithCallback" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/PockBuilder.php"><a href="files/src-pockbuilder.html"><abbr title="src/PockBuilder.php">PockBuilder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">665</span>
</aside>
<p class="phpdocumentor-summary">Construct the response during request execution using provided callback.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">replyWithCallback</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">callable&nbsp;</span><span class="phpdocumentor-signature__argument__name">$callback</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">void</span></code>
<section class="phpdocumentor-description"><p>Callback should receive the same parameters as in the <code class="prettyprint">ReplyFactoryInterface::createReply</code> method.</p>
</section>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$callback</span>
: <span class="phpdocumentor-signature__argument__return-type">callable</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
</dl>
<h5 class="phpdocumentor-tag-list__heading" id="tags">
Tags
<a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
</h5>
<dl class="phpdocumentor-tag-list">
<dt class="phpdocumentor-tag-list__entry">
<span class="phpdocumentor-tag__name">see</span>
</dt>
<dd class="phpdocumentor-tag-list__definition">
<span class="phpdocumentor-tag-link"><a href="classes/Pock-Factory-ReplyFactoryInterface.html#method_createReply"><abbr title="\Pock\Factory\ReplyFactoryInterface::createReply()">ReplyFactoryInterface::createReply()</abbr></a></span>
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">void</span>
&mdash;
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_replyWithClient">
replyWithClient()
<a href="classes/Pock-PockBuilder.html#method_replyWithClient" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/PockBuilder.php"><a href="files/src-pockbuilder.html"><abbr title="src/PockBuilder.php">PockBuilder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">676</span>
</aside>
<p class="phpdocumentor-summary">Reply to the request using provided client. Can be used to send real network request.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">replyWithClient</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type"><abbr title="\Psr\Http\Client\ClientInterface">ClientInterface</abbr>&nbsp;</span><span class="phpdocumentor-signature__argument__name">$client</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">void</span></code>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$client</span>
: <span class="phpdocumentor-signature__argument__return-type"><abbr title="\Psr\Http\Client\ClientInterface">ClientInterface</abbr></span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
</dl>
<h5 class="phpdocumentor-tag-list__heading" id="tags">
Tags
<a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
</h5>
<dl class="phpdocumentor-tag-list">
<dt class="phpdocumentor-tag-list__entry">
<span class="phpdocumentor-tag__name">SuppressWarnings</span>
</dt>
<dd class="phpdocumentor-tag-list__definition">
<section class="phpdocumentor-description"><p>(unused)</p>
</section>
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">void</span>
&mdash;
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_replyWithFactory">
replyWithFactory()
<a href="classes/Pock-PockBuilder.html#method_replyWithFactory" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/PockBuilder.php"><a href="files/src-pockbuilder.html"><abbr title="src/PockBuilder.php">PockBuilder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">651</span>
</aside>
<p class="phpdocumentor-summary">Construct the response during request execution using provided ReplytFactoryInterface implementation.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">replyWithFactory</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type"><a href="classes/Pock-Factory-ReplyFactoryInterface.html"><abbr title="\Pock\Factory\ReplyFactoryInterface">ReplyFactoryInterface</abbr></a>&nbsp;</span><span class="phpdocumentor-signature__argument__name">$factory</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">void</span></code>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$factory</span>
: <span class="phpdocumentor-signature__argument__return-type"><a href="classes/Pock-Factory-ReplyFactoryInterface.html"><abbr title="\Pock\Factory\ReplyFactoryInterface">ReplyFactoryInterface</abbr></a></span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
</dl>
<h5 class="phpdocumentor-tag-list__heading" id="tags">
Tags
<a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
</h5>
<dl class="phpdocumentor-tag-list">
<dt class="phpdocumentor-tag-list__entry">
<span class="phpdocumentor-tag__name">see</span>
</dt>
<dd class="phpdocumentor-tag-list__definition">
<span class="phpdocumentor-tag-link"><a href="classes/Pock-Factory-ReplyFactoryInterface.html"><abbr title="\Pock\Factory\ReplyFactoryInterface">ReplyFactoryInterface</abbr></a></span>
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">void</span>
&mdash;
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_reset">
reset()
<a href="classes/Pock-PockBuilder.html#method_reset" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/PockBuilder.php"><a href="files/src-pockbuilder.html"><abbr title="src/PockBuilder.php">PockBuilder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">691</span>
</aside>
<p class="phpdocumentor-summary">Resets the builder.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">reset</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">self</span></code>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">self</span>
&mdash;
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_setFallbackClient">
setFallbackClient()
<a href="classes/Pock-PockBuilder.html#method_setFallbackClient" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/PockBuilder.php"><a href="files/src-pockbuilder.html"><abbr title="src/PockBuilder.php">PockBuilder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">711</span>
</aside>
<p class="phpdocumentor-summary">Sets fallback Client. It will be used if no request can be matched.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">setFallbackClient</span><span>(</span><span class="phpdocumentor-signature__argument"><span>[</span><span class="phpdocumentor-signature__argument__return-type"><abbr title="\Psr\Http\Client\ClientInterface">ClientInterface</abbr>|null&nbsp;</span><span class="phpdocumentor-signature__argument__name">$fallbackClient</span><span> = </span><span class="phpdocumentor-signature__argument__default-value">null</span><span> ]</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">self</span></code>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$fallbackClient</span>
: <span class="phpdocumentor-signature__argument__return-type"><abbr title="\Psr\Http\Client\ClientInterface">ClientInterface</abbr>|null</span>
= <span class="phpdocumentor-signature__argument__default-value">null</span> </dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">self</span>
&mdash;
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_throwClientException">
throwClientException()
<a href="classes/Pock-PockBuilder.html#method_throwClientException" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/PockBuilder.php"><a href="files/src-pockbuilder.html"><abbr title="src/PockBuilder.php">PockBuilder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">600</span>
</aside>
<p class="phpdocumentor-summary">Throw an ClientExceptionInterface instance with specified message</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">throwClientException</span><span>(</span><span class="phpdocumentor-signature__argument"><span>[</span><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$message</span><span> = </span><span class="phpdocumentor-signature__argument__default-value">&#039;Pock ClientException&#039;</span><span> ]</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">self</span></code>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$message</span>
: <span class="phpdocumentor-signature__argument__return-type">string</span>
= <span class="phpdocumentor-signature__argument__default-value">&#039;Pock ClientException&#039;</span> </dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">self</span>
&mdash;
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_throwException">
throwException()
<a href="classes/Pock-PockBuilder.html#method_throwException" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/PockBuilder.php"><a href="files/src-pockbuilder.html"><abbr title="src/PockBuilder.php">PockBuilder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">586</span>
</aside>
<p class="phpdocumentor-summary">Throw an exception when request is being sent.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">throwException</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type"><abbr title="\Throwable">Throwable</abbr>&nbsp;</span><span class="phpdocumentor-signature__argument__name">$throwable</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">self</span></code>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$throwable</span>
: <span class="phpdocumentor-signature__argument__return-type"><abbr title="\Throwable">Throwable</abbr></span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">self</span>
&mdash;
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_throwNetworkException">
throwNetworkException()
<a href="classes/Pock-PockBuilder.html#method_throwNetworkException" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/PockBuilder.php"><a href="files/src-pockbuilder.html"><abbr title="src/PockBuilder.php">PockBuilder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">612</span>
</aside>
<p class="phpdocumentor-summary">Throw an NetworkExceptionInterface instance with specified message</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">throwNetworkException</span><span>(</span><span class="phpdocumentor-signature__argument"><span>[</span><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$message</span><span> = </span><span class="phpdocumentor-signature__argument__default-value">&#039;Pock NetworkException&#039;</span><span> ]</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">self</span></code>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$message</span>
: <span class="phpdocumentor-signature__argument__return-type">string</span>
= <span class="phpdocumentor-signature__argument__default-value">&#039;Pock NetworkException&#039;</span> </dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">self</span>
&mdash;
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_throwRequestException">
throwRequestException()
<a href="classes/Pock-PockBuilder.html#method_throwRequestException" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/PockBuilder.php"><a href="files/src-pockbuilder.html"><abbr title="src/PockBuilder.php">PockBuilder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">624</span>
</aside>
<p class="phpdocumentor-summary">Throw an RequestExceptionInterface instance with specified message</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">throwRequestException</span><span>(</span><span class="phpdocumentor-signature__argument"><span>[</span><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$message</span><span> = </span><span class="phpdocumentor-signature__argument__default-value">&#039;Pock RequestException&#039;</span><span> ]</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">self</span></code>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$message</span>
: <span class="phpdocumentor-signature__argument__return-type">string</span>
= <span class="phpdocumentor-signature__argument__default-value">&#039;Pock RequestException&#039;</span> </dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">self</span>
&mdash;
</article>
</section>
<script type="text/javascript">
function loadExternalCodeSnippets(line) {
Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach((pre) => {
var src = pre.getAttribute('data-src').replace( /\\/g, '/');
var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
var language = 'php';
var code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
pre.setAttribute('data-line', line)
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
}
else if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
}
else {
code.textContent = '✖ Error: File does not exist, is empty or trying to view from localhost';
}
}
};
xhr.send(null);
});
}
var modals = document.querySelectorAll("[data-modal]");
modals.forEach(function (trigger) {
trigger.addEventListener("click", function (event) {
//event.preventDefault();
const modal = document.getElementById(trigger.dataset.modal);
modal.classList.add("phpdocumentor-modal__open");
loadExternalCodeSnippets(trigger.dataset.line)
const exits = modal.querySelectorAll("[data-exit-button]");
exits.forEach(function (exit) {
exit.addEventListener("click", function (event) {
event.preventDefault();
modal.classList.remove("phpdocumentor-modal__open");
});
});
});
});
</script>
</article>
<section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
<section class="phpdocumentor-search-results__dialog">
<header class="phpdocumentor-search-results__header">
<h2 class="phpdocumentor-search-results__title">Search results</h2>
<button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
</header>
<section class="phpdocumentor-search-results__body">
<ul class="phpdocumentor-search-results__entries"></ul>
</section>
</section>
</section>
</div>
</div>
<a href="classes/Pock-PockBuilder.html#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
</main>
<script>
cssVars({});
</script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
</body>
</html>