Guzzle is a PHP HTTP client
& framework for building RESTful web service clients.
Guzzle takes the pain out of sending HTTP requests and the redundancy out of creating web service clients. It's + a framework that includes the tools needed to create a robust web service client, including: + Service descriptions for defining the inputs and outputs of an API, resource iterators for traversing + paginated resources, batching for sending a large number of requests as efficiently as possible.
+ +<?php +require_once 'vendor/autoload.php'; +use Guzzle\Http\Client; + +// Create a client and provide a base URL +$client = new Client('https://api.github.com'); +// Create a request with basic Auth +$request = $client->get('/user')->setAuth('user', 'pass'); +// Send the request and get the response +$response = $request->send(); +echo $response->getBody(); +// >>> {"type":"User", ... +echo $response->getHeader('Content-Length'); +// >>> 792 ++ +
<?php +// Create a client to work with the Twitter API +$client = new Client('https://api.twitter.com/{version}', array( + 'version' => '1.1' +)); + +// Sign all requests with the OauthPlugin +$client->addSubscriber(new Guzzle\Plugin\Oauth\OauthPlugin(array( + 'consumer_key' => '***', + 'consumer_secret' => '***', + 'token' => '***', + 'token_secret' => '***' +))); + +echo $client->get('statuses/user_timeline.json')->send()->getBody(); +// >>> {"public_gists":6,"type":"User" ... + +// Create a tweet using POST +$request = $client->post('statuses/update.json', null, array( + 'status' => 'Tweeted with Guzzle, http://guzzlephp.org' +)); + +// Send the request and parse the JSON response into an array +$data = $request->send()->json(); +echo $data['text']; +// >>> Tweeted with Guzzle, http://t.co/kngJMfRk ++
+ * var_export($response->getLinks());
+ * array(
+ * array(
+ * 'url' => 'http:/.../front.jpeg',
+ * 'rel' => 'back',
+ * 'type' => 'image/jpeg',
+ * )
+ * )
+ *
+ *
+ * @return array
+ */
+ public function getLinks()
+ {
+ $links = $this->parseParams();
+
+ foreach ($links as &$link) {
+ $key = key($link);
+ unset($link[$key]);
+ $link['url'] = trim($key, '<> ');
+ }
+
+ return $links;
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/guzzle/guzzle/src/Guzzle/Http/Message/MessageInterface.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/guzzle/guzzle/src/Guzzle/Http/Message/MessageInterface.php
new file mode 100644
index 00000000000..62bcd439133
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/guzzle/guzzle/src/Guzzle/Http/Message/MessageInterface.php
@@ -0,0 +1,102 @@
+fieldName = $fieldName;
+ $this->setFilename($filename);
+ $this->postname = $postname ? $postname : basename($filename);
+ $this->contentType = $contentType ?: $this->guessContentType();
+ }
+
+ public function setFieldName($name)
+ {
+ $this->fieldName = $name;
+
+ return $this;
+ }
+
+ public function getFieldName()
+ {
+ return $this->fieldName;
+ }
+
+ public function setFilename($filename)
+ {
+ // Remove leading @ symbol
+ if (strpos($filename, '@') === 0) {
+ $filename = substr($filename, 1);
+ }
+
+ if (!is_readable($filename)) {
+ throw new InvalidArgumentException("Unable to open {$filename} for reading");
+ }
+
+ $this->filename = $filename;
+
+ return $this;
+ }
+
+ public function setPostname($postname)
+ {
+ $this->postname = $postname;
+
+ return $this;
+ }
+
+ public function getFilename()
+ {
+ return $this->filename;
+ }
+
+ public function getPostname()
+ {
+ return $this->postname;
+ }
+
+ public function setContentType($type)
+ {
+ $this->contentType = $type;
+
+ return $this;
+ }
+
+ public function getContentType()
+ {
+ return $this->contentType;
+ }
+
+ public function getCurlValue()
+ {
+ // PHP 5.5 introduced a CurlFile object that deprecates the old @filename syntax
+ // See: https://wiki.php.net/rfc/curl-file-upload
+ if (function_exists('curl_file_create')) {
+ return curl_file_create($this->filename, $this->contentType, $this->postname);
+ }
+
+ // Use the old style if using an older version of PHP
+ $value = "@{$this->filename};filename=" . $this->postname;
+ if ($this->contentType) {
+ $value .= ';type=' . $this->contentType;
+ }
+
+ return $value;
+ }
+
+ /**
+ * @deprecated
+ * @codeCoverageIgnore
+ */
+ public function getCurlString()
+ {
+ Version::warn(__METHOD__ . ' is deprecated. Use getCurlValue()');
+ return $this->getCurlValue();
+ }
+
+ /**
+ * Determine the Content-Type of the file
+ */
+ protected function guessContentType()
+ {
+ return Mimetypes::getInstance()->fromFilename($this->filename) ?: 'application/octet-stream';
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/guzzle/guzzle/src/Guzzle/Http/Message/PostFileInterface.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/guzzle/guzzle/src/Guzzle/Http/Message/PostFileInterface.php
new file mode 100644
index 00000000000..7f0779d1e85
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/guzzle/guzzle/src/Guzzle/Http/Message/PostFileInterface.php
@@ -0,0 +1,83 @@
+method = strtoupper($method);
+ $this->curlOptions = new Collection();
+ $this->setUrl($url);
+
+ if ($headers) {
+ // Special handling for multi-value headers
+ foreach ($headers as $key => $value) {
+ // Deal with collisions with Host and Authorization
+ if ($key == 'host' || $key == 'Host') {
+ $this->setHeader($key, $value);
+ } elseif ($value instanceof HeaderInterface) {
+ $this->addHeader($key, $value);
+ } else {
+ foreach ((array) $value as $v) {
+ $this->addHeader($key, $v);
+ }
+ }
+ }
+ }
+
+ $this->setState(self::STATE_NEW);
+ }
+
+ public function __clone()
+ {
+ if ($this->eventDispatcher) {
+ $this->eventDispatcher = clone $this->eventDispatcher;
+ }
+ $this->curlOptions = clone $this->curlOptions;
+ $this->params = clone $this->params;
+ $this->url = clone $this->url;
+ $this->response = $this->responseBody = null;
+ $this->headers = clone $this->headers;
+
+ $this->setState(RequestInterface::STATE_NEW);
+ $this->dispatch('request.clone', array('request' => $this));
+ }
+
+ /**
+ * Get the HTTP request as a string
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return $this->getRawHeaders() . "\r\n\r\n";
+ }
+
+ /**
+ * Default method that will throw exceptions if an unsuccessful response is received.
+ *
+ * @param Event $event Received
+ * @throws BadResponseException if the response is not successful
+ */
+ public static function onRequestError(Event $event)
+ {
+ $e = BadResponseException::factory($event['request'], $event['response']);
+ $event['request']->setState(self::STATE_ERROR, array('exception' => $e) + $event->toArray());
+ throw $e;
+ }
+
+ public function setClient(ClientInterface $client)
+ {
+ $this->client = $client;
+
+ return $this;
+ }
+
+ public function getClient()
+ {
+ return $this->client;
+ }
+
+ public function getRawHeaders()
+ {
+ $protocolVersion = $this->protocolVersion ?: '1.1';
+
+ return trim($this->method . ' ' . $this->getResource()) . ' '
+ . strtoupper(str_replace('https', 'http', $this->url->getScheme()))
+ . '/' . $protocolVersion . "\r\n" . implode("\r\n", $this->getHeaderLines());
+ }
+
+ public function setUrl($url)
+ {
+ if ($url instanceof Url) {
+ $this->url = $url;
+ } else {
+ $this->url = Url::factory($url);
+ }
+
+ // Update the port and host header
+ $this->setPort($this->url->getPort());
+
+ if ($this->url->getUsername() || $this->url->getPassword()) {
+ $this->setAuth($this->url->getUsername(), $this->url->getPassword());
+ // Remove the auth info from the URL
+ $this->url->setUsername(null);
+ $this->url->setPassword(null);
+ }
+
+ return $this;
+ }
+
+ public function send()
+ {
+ if (!$this->client) {
+ throw new RuntimeException('A client must be set on the request');
+ }
+
+ return $this->client->send($this);
+ }
+
+ public function getResponse()
+ {
+ return $this->response;
+ }
+
+ public function getQuery($asString = false)
+ {
+ return $asString
+ ? (string) $this->url->getQuery()
+ : $this->url->getQuery();
+ }
+
+ public function getMethod()
+ {
+ return $this->method;
+ }
+
+ public function getScheme()
+ {
+ return $this->url->getScheme();
+ }
+
+ public function setScheme($scheme)
+ {
+ $this->url->setScheme($scheme);
+
+ return $this;
+ }
+
+ public function getHost()
+ {
+ return $this->url->getHost();
+ }
+
+ public function setHost($host)
+ {
+ $this->url->setHost($host);
+ $this->setPort($this->url->getPort());
+
+ return $this;
+ }
+
+ public function getProtocolVersion()
+ {
+ return $this->protocolVersion;
+ }
+
+ public function setProtocolVersion($protocol)
+ {
+ $this->protocolVersion = $protocol;
+
+ return $this;
+ }
+
+ public function getPath()
+ {
+ return '/' . ltrim($this->url->getPath(), '/');
+ }
+
+ public function setPath($path)
+ {
+ $this->url->setPath($path);
+
+ return $this;
+ }
+
+ public function getPort()
+ {
+ return $this->url->getPort();
+ }
+
+ public function setPort($port)
+ {
+ $this->url->setPort($port);
+
+ // Include the port in the Host header if it is not the default port for the scheme of the URL
+ $scheme = $this->url->getScheme();
+ if ($port && (($scheme == 'http' && $port != 80) || ($scheme == 'https' && $port != 443))) {
+ $this->headers['host'] = $this->headerFactory->createHeader('Host', $this->url->getHost() . ':' . $port);
+ } else {
+ $this->headers['host'] = $this->headerFactory->createHeader('Host', $this->url->getHost());
+ }
+
+ return $this;
+ }
+
+ public function getUsername()
+ {
+ return $this->username;
+ }
+
+ public function getPassword()
+ {
+ return $this->password;
+ }
+
+ public function setAuth($user, $password = '', $scheme = CURLAUTH_BASIC)
+ {
+ static $authMap = array(
+ 'basic' => CURLAUTH_BASIC,
+ 'digest' => CURLAUTH_DIGEST,
+ 'ntlm' => CURLAUTH_NTLM,
+ 'any' => CURLAUTH_ANY
+ );
+
+ // If we got false or null, disable authentication
+ if (!$user) {
+ $this->password = $this->username = null;
+ $this->removeHeader('Authorization');
+ $this->getCurlOptions()->remove(CURLOPT_HTTPAUTH);
+ return $this;
+ }
+
+ if (!is_numeric($scheme)) {
+ $scheme = strtolower($scheme);
+ if (!isset($authMap[$scheme])) {
+ throw new InvalidArgumentException($scheme . ' is not a valid authentication type');
+ }
+ $scheme = $authMap[$scheme];
+ }
+
+ $this->username = $user;
+ $this->password = $password;
+
+ // Bypass CURL when using basic auth to promote connection reuse
+ if ($scheme == CURLAUTH_BASIC) {
+ $this->getCurlOptions()->remove(CURLOPT_HTTPAUTH);
+ $this->setHeader('Authorization', 'Basic ' . base64_encode($this->username . ':' . $this->password));
+ } else {
+ $this->getCurlOptions()
+ ->set(CURLOPT_HTTPAUTH, $scheme)
+ ->set(CURLOPT_USERPWD, $this->username . ':' . $this->password);
+ }
+
+ return $this;
+ }
+
+ public function getResource()
+ {
+ $resource = $this->getPath();
+ if ($query = (string) $this->url->getQuery()) {
+ $resource .= '?' . $query;
+ }
+
+ return $resource;
+ }
+
+ public function getUrl($asObject = false)
+ {
+ return $asObject ? clone $this->url : (string) $this->url;
+ }
+
+ public function getState()
+ {
+ return $this->state;
+ }
+
+ public function setState($state, array $context = array())
+ {
+ $oldState = $this->state;
+ $this->state = $state;
+
+ switch ($state) {
+ case self::STATE_NEW:
+ $this->response = null;
+ break;
+ case self::STATE_TRANSFER:
+ if ($oldState !== $state) {
+ // Fix Content-Length and Transfer-Encoding collisions
+ if ($this->hasHeader('Transfer-Encoding') && $this->hasHeader('Content-Length')) {
+ $this->removeHeader('Transfer-Encoding');
+ }
+ $this->dispatch('request.before_send', array('request' => $this));
+ }
+ break;
+ case self::STATE_COMPLETE:
+ if ($oldState !== $state) {
+ $this->processResponse($context);
+ $this->responseBody = null;
+ }
+ break;
+ case self::STATE_ERROR:
+ if (isset($context['exception'])) {
+ $this->dispatch('request.exception', array(
+ 'request' => $this,
+ 'response' => isset($context['response']) ? $context['response'] : $this->response,
+ 'exception' => isset($context['exception']) ? $context['exception'] : null
+ ));
+ }
+ }
+
+ return $this->state;
+ }
+
+ public function getCurlOptions()
+ {
+ return $this->curlOptions;
+ }
+
+ public function startResponse(Response $response)
+ {
+ $this->state = self::STATE_TRANSFER;
+ $response->setEffectiveUrl((string) $this->getUrl());
+ $this->response = $response;
+
+ return $this;
+ }
+
+ public function setResponse(Response $response, $queued = false)
+ {
+ $response->setEffectiveUrl((string) $this->url);
+
+ if ($queued) {
+ $ed = $this->getEventDispatcher();
+ $ed->addListener('request.before_send', $f = function ($e) use ($response, &$f, $ed) {
+ $e['request']->setResponse($response);
+ $ed->removeListener('request.before_send', $f);
+ }, -9999);
+ } else {
+ $this->response = $response;
+ // If a specific response body is specified, then use it instead of the response's body
+ if ($this->responseBody && !$this->responseBody->getCustomData('default') && !$response->isRedirect()) {
+ $this->getResponseBody()->write((string) $this->response->getBody());
+ } else {
+ $this->responseBody = $this->response->getBody();
+ }
+ $this->setState(self::STATE_COMPLETE);
+ }
+
+ return $this;
+ }
+
+ public function setResponseBody($body)
+ {
+ // Attempt to open a file for writing if a string was passed
+ if (is_string($body)) {
+ // @codeCoverageIgnoreStart
+ if (!($body = fopen($body, 'w+'))) {
+ throw new InvalidArgumentException('Could not open ' . $body . ' for writing');
+ }
+ // @codeCoverageIgnoreEnd
+ }
+
+ $this->responseBody = EntityBody::factory($body);
+
+ return $this;
+ }
+
+ public function getResponseBody()
+ {
+ if ($this->responseBody === null) {
+ $this->responseBody = EntityBody::factory()->setCustomData('default', true);
+ }
+
+ return $this->responseBody;
+ }
+
+ /**
+ * Determine if the response body is repeatable (readable + seekable)
+ *
+ * @return bool
+ * @deprecated Use getResponseBody()->isSeekable()
+ * @codeCoverageIgnore
+ */
+ public function isResponseBodyRepeatable()
+ {
+ Version::warn(__METHOD__ . ' is deprecated. Use $request->getResponseBody()->isRepeatable()');
+ return !$this->responseBody ? true : $this->responseBody->isRepeatable();
+ }
+
+ public function getCookies()
+ {
+ if ($cookie = $this->getHeader('Cookie')) {
+ $data = ParserRegistry::getInstance()->getParser('cookie')->parseCookie($cookie);
+ return $data['cookies'];
+ }
+
+ return array();
+ }
+
+ public function getCookie($name)
+ {
+ $cookies = $this->getCookies();
+
+ return isset($cookies[$name]) ? $cookies[$name] : null;
+ }
+
+ public function addCookie($name, $value)
+ {
+ if (!$this->hasHeader('Cookie')) {
+ $this->setHeader('Cookie', "{$name}={$value}");
+ } else {
+ $this->getHeader('Cookie')->add("{$name}={$value}");
+ }
+
+ // Always use semicolons to separate multiple cookie headers
+ $this->getHeader('Cookie')->setGlue(';');
+
+ return $this;
+ }
+
+ public function removeCookie($name)
+ {
+ if ($cookie = $this->getHeader('Cookie')) {
+ foreach ($cookie as $cookieValue) {
+ if (strpos($cookieValue, $name . '=') === 0) {
+ $cookie->removeValue($cookieValue);
+ }
+ }
+ }
+
+ return $this;
+ }
+
+ public function setEventDispatcher(EventDispatcherInterface $eventDispatcher)
+ {
+ $this->eventDispatcher = $eventDispatcher;
+ $this->eventDispatcher->addListener('request.error', array(__CLASS__, 'onRequestError'), -255);
+
+ return $this;
+ }
+
+ public function getEventDispatcher()
+ {
+ if (!$this->eventDispatcher) {
+ $this->setEventDispatcher(new EventDispatcher());
+ }
+
+ return $this->eventDispatcher;
+ }
+
+ public function dispatch($eventName, array $context = array())
+ {
+ $context['request'] = $this;
+
+ return $this->getEventDispatcher()->dispatch($eventName, new Event($context));
+ }
+
+ public function addSubscriber(EventSubscriberInterface $subscriber)
+ {
+ $this->getEventDispatcher()->addSubscriber($subscriber);
+
+ return $this;
+ }
+
+ /**
+ * Get an array containing the request and response for event notifications
+ *
+ * @return array
+ */
+ protected function getEventArray()
+ {
+ return array(
+ 'request' => $this,
+ 'response' => $this->response
+ );
+ }
+
+ /**
+ * Process a received response
+ *
+ * @param array $context Contextual information
+ * @throws RequestException|BadResponseException on unsuccessful responses
+ */
+ protected function processResponse(array $context = array())
+ {
+ if (!$this->response) {
+ // If no response, then processResponse shouldn't have been called
+ $e = new RequestException('Error completing request');
+ $e->setRequest($this);
+ throw $e;
+ }
+
+ $this->state = self::STATE_COMPLETE;
+
+ // A request was sent, but we don't know if we'll send more or if the final response will be successful
+ $this->dispatch('request.sent', $this->getEventArray() + $context);
+
+ // Some response processors will remove the response or reset the state (example: ExponentialBackoffPlugin)
+ if ($this->state == RequestInterface::STATE_COMPLETE) {
+
+ // The request completed, so the HTTP transaction is complete
+ $this->dispatch('request.complete', $this->getEventArray());
+
+ // If the response is bad, allow listeners to modify it or throw exceptions. You can change the response by
+ // modifying the Event object in your listeners or calling setResponse() on the request
+ if ($this->response->isError()) {
+ $event = new Event($this->getEventArray());
+ $this->getEventDispatcher()->dispatch('request.error', $event);
+ // Allow events of request.error to quietly change the response
+ if ($event['response'] !== $this->response) {
+ $this->response = $event['response'];
+ }
+ }
+
+ // If a successful response was received, dispatch an event
+ if ($this->response->isSuccessful()) {
+ $this->dispatch('request.success', $this->getEventArray());
+ }
+ }
+ }
+
+ /**
+ * @deprecated Use Guzzle\Plugin\Cache\DefaultCanCacheStrategy
+ * @codeCoverageIgnore
+ */
+ public function canCache()
+ {
+ Version::warn(__METHOD__ . ' is deprecated. Use Guzzle\Plugin\Cache\DefaultCanCacheStrategy.');
+ if (class_exists('Guzzle\Plugin\Cache\DefaultCanCacheStrategy')) {
+ $canCache = new \Guzzle\Plugin\Cache\DefaultCanCacheStrategy();
+ return $canCache->canCacheRequest($this);
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * @deprecated Use the history plugin (not emitting a warning as this is built-into the RedirectPlugin for now)
+ * @codeCoverageIgnore
+ */
+ public function setIsRedirect($isRedirect)
+ {
+ $this->isRedirect = $isRedirect;
+
+ return $this;
+ }
+
+ /**
+ * @deprecated Use the history plugin
+ * @codeCoverageIgnore
+ */
+ public function isRedirect()
+ {
+ Version::warn(__METHOD__ . ' is deprecated. Use the HistoryPlugin to track this.');
+ return $this->isRedirect;
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/guzzle/guzzle/src/Guzzle/Http/Message/RequestFactory.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/guzzle/guzzle/src/Guzzle/Http/Message/RequestFactory.php
new file mode 100644
index 00000000000..ba00a767614
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/guzzle/guzzle/src/Guzzle/Http/Message/RequestFactory.php
@@ -0,0 +1,359 @@
+methods = array_flip(get_class_methods(__CLASS__));
+ }
+
+ public function fromMessage($message)
+ {
+ $parsed = ParserRegistry::getInstance()->getParser('message')->parseRequest($message);
+
+ if (!$parsed) {
+ return false;
+ }
+
+ $request = $this->fromParts($parsed['method'], $parsed['request_url'],
+ $parsed['headers'], $parsed['body'], $parsed['protocol'],
+ $parsed['version']);
+
+ // EntityEnclosingRequest adds an "Expect: 100-Continue" header when using a raw request body for PUT or POST
+ // requests. This factory method should accurately reflect the message, so here we are removing the Expect
+ // header if one was not supplied in the message.
+ if (!isset($parsed['headers']['Expect']) && !isset($parsed['headers']['expect'])) {
+ $request->removeHeader('Expect');
+ }
+
+ return $request;
+ }
+
+ public function fromParts(
+ $method,
+ array $urlParts,
+ $headers = null,
+ $body = null,
+ $protocol = 'HTTP',
+ $protocolVersion = '1.1'
+ ) {
+ return $this->create($method, Url::buildUrl($urlParts), $headers, $body)
+ ->setProtocolVersion($protocolVersion);
+ }
+
+ public function create($method, $url, $headers = null, $body = null, array $options = array())
+ {
+ $method = strtoupper($method);
+
+ if ($method == 'GET' || $method == 'HEAD' || $method == 'TRACE') {
+ // Handle non-entity-enclosing request methods
+ $request = new $this->requestClass($method, $url, $headers);
+ if ($body) {
+ // The body is where the response body will be stored
+ $type = gettype($body);
+ if ($type == 'string' || $type == 'resource' || $type == 'object') {
+ $request->setResponseBody($body);
+ }
+ }
+ } else {
+ // Create an entity enclosing request by default
+ $request = new $this->entityEnclosingRequestClass($method, $url, $headers);
+ if ($body || $body === '0') {
+ // Add POST fields and files to an entity enclosing request if an array is used
+ if (is_array($body) || $body instanceof Collection) {
+ // Normalize PHP style cURL uploads with a leading '@' symbol
+ foreach ($body as $key => $value) {
+ if (is_string($value) && substr($value, 0, 1) == '@') {
+ $request->addPostFile($key, $value);
+ unset($body[$key]);
+ }
+ }
+ // Add the fields if they are still present and not all files
+ $request->addPostFields($body);
+ } else {
+ // Add a raw entity body body to the request
+ $request->setBody($body, (string) $request->getHeader('Content-Type'));
+ if ((string) $request->getHeader('Transfer-Encoding') == 'chunked') {
+ $request->removeHeader('Content-Length');
+ }
+ }
+ }
+ }
+
+ if ($options) {
+ $this->applyOptions($request, $options);
+ }
+
+ return $request;
+ }
+
+ /**
+ * Clone a request while changing the method. Emulates the behavior of
+ * {@see Guzzle\Http\Message\Request::clone}, but can change the HTTP method.
+ *
+ * @param RequestInterface $request Request to clone
+ * @param string $method Method to set
+ *
+ * @return RequestInterface
+ */
+ public function cloneRequestWithMethod(RequestInterface $request, $method)
+ {
+ // Create the request with the same client if possible
+ if ($request->getClient()) {
+ $cloned = $request->getClient()->createRequest($method, $request->getUrl(), $request->getHeaders());
+ } else {
+ $cloned = $this->create($method, $request->getUrl(), $request->getHeaders());
+ }
+
+ $cloned->getCurlOptions()->replace($request->getCurlOptions()->toArray());
+ $cloned->setEventDispatcher(clone $request->getEventDispatcher());
+ // Ensure that that the Content-Length header is not copied if changing to GET or HEAD
+ if (!($cloned instanceof EntityEnclosingRequestInterface)) {
+ $cloned->removeHeader('Content-Length');
+ } elseif ($request instanceof EntityEnclosingRequestInterface) {
+ $cloned->setBody($request->getBody());
+ }
+ $cloned->getParams()->replace($request->getParams()->toArray());
+ $cloned->dispatch('request.clone', array('request' => $cloned));
+
+ return $cloned;
+ }
+
+ public function applyOptions(RequestInterface $request, array $options = array(), $flags = self::OPTIONS_NONE)
+ {
+ // Iterate over each key value pair and attempt to apply a config using function visitors
+ foreach ($options as $key => $value) {
+ $method = "visit_{$key}";
+ if (isset($this->methods[$method])) {
+ $this->{$method}($request, $value, $flags);
+ }
+ }
+ }
+
+ protected function visit_headers(RequestInterface $request, $value, $flags)
+ {
+ if (!is_array($value)) {
+ throw new InvalidArgumentException('headers value must be an array');
+ }
+
+ if ($flags & self::OPTIONS_AS_DEFAULTS) {
+ // Merge headers in but do not overwrite existing values
+ foreach ($value as $key => $header) {
+ if (!$request->hasHeader($key)) {
+ $request->setHeader($key, $header);
+ }
+ }
+ } else {
+ $request->addHeaders($value);
+ }
+ }
+
+ protected function visit_body(RequestInterface $request, $value, $flags)
+ {
+ if ($request instanceof EntityEnclosingRequestInterface) {
+ $request->setBody($value);
+ } else {
+ throw new InvalidArgumentException('Attempting to set a body on a non-entity-enclosing request');
+ }
+ }
+
+ protected function visit_allow_redirects(RequestInterface $request, $value, $flags)
+ {
+ if ($value === false) {
+ $request->getParams()->set(RedirectPlugin::DISABLE, true);
+ }
+ }
+
+ protected function visit_auth(RequestInterface $request, $value, $flags)
+ {
+ if (!is_array($value)) {
+ throw new InvalidArgumentException('auth value must be an array');
+ }
+
+ $request->setAuth($value[0], isset($value[1]) ? $value[1] : null, isset($value[2]) ? $value[2] : 'basic');
+ }
+
+ protected function visit_query(RequestInterface $request, $value, $flags)
+ {
+ if (!is_array($value)) {
+ throw new InvalidArgumentException('query value must be an array');
+ }
+
+ if ($flags & self::OPTIONS_AS_DEFAULTS) {
+ // Merge query string values in but do not overwrite existing values
+ $query = $request->getQuery();
+ $query->overwriteWith(array_diff_key($value, $query->toArray()));
+ } else {
+ $request->getQuery()->overwriteWith($value);
+ }
+ }
+
+ protected function visit_cookies(RequestInterface $request, $value, $flags)
+ {
+ if (!is_array($value)) {
+ throw new InvalidArgumentException('cookies value must be an array');
+ }
+
+ foreach ($value as $name => $v) {
+ $request->addCookie($name, $v);
+ }
+ }
+
+ protected function visit_events(RequestInterface $request, $value, $flags)
+ {
+ if (!is_array($value)) {
+ throw new InvalidArgumentException('events value must be an array');
+ }
+
+ foreach ($value as $name => $method) {
+ if (is_array($method)) {
+ $request->getEventDispatcher()->addListener($name, $method[0], $method[1]);
+ } else {
+ $request->getEventDispatcher()->addListener($name, $method);
+ }
+ }
+ }
+
+ protected function visit_plugins(RequestInterface $request, $value, $flags)
+ {
+ if (!is_array($value)) {
+ throw new InvalidArgumentException('plugins value must be an array');
+ }
+
+ foreach ($value as $plugin) {
+ $request->addSubscriber($plugin);
+ }
+ }
+
+ protected function visit_exceptions(RequestInterface $request, $value, $flags)
+ {
+ if ($value === false || $value === 0) {
+ $dispatcher = $request->getEventDispatcher();
+ foreach ($dispatcher->getListeners('request.error') as $listener) {
+ if (is_array($listener) && $listener[0] == 'Guzzle\Http\Message\Request' && $listener[1] = 'onRequestError') {
+ $dispatcher->removeListener('request.error', $listener);
+ break;
+ }
+ }
+ }
+ }
+
+ protected function visit_save_to(RequestInterface $request, $value, $flags)
+ {
+ $request->setResponseBody($value);
+ }
+
+ protected function visit_params(RequestInterface $request, $value, $flags)
+ {
+ if (!is_array($value)) {
+ throw new InvalidArgumentException('params value must be an array');
+ }
+
+ $request->getParams()->overwriteWith($value);
+ }
+
+ protected function visit_timeout(RequestInterface $request, $value, $flags)
+ {
+ if (defined('CURLOPT_TIMEOUT_MS')) {
+ $request->getCurlOptions()->set(CURLOPT_TIMEOUT_MS, $value * 1000);
+ } else {
+ $request->getCurlOptions()->set(CURLOPT_TIMEOUT, $value);
+ }
+ }
+
+ protected function visit_connect_timeout(RequestInterface $request, $value, $flags)
+ {
+ if (defined('CURLOPT_CONNECTTIMEOUT_MS')) {
+ $request->getCurlOptions()->set(CURLOPT_CONNECTTIMEOUT_MS, $value * 1000);
+ } else {
+ $request->getCurlOptions()->set(CURLOPT_CONNECTTIMEOUT, $value);
+ }
+ }
+
+ protected function visit_debug(RequestInterface $request, $value, $flags)
+ {
+ if ($value) {
+ $request->getCurlOptions()->set(CURLOPT_VERBOSE, true);
+ }
+ }
+
+ protected function visit_verify(RequestInterface $request, $value, $flags)
+ {
+ $curl = $request->getCurlOptions();
+ if ($value === true || is_string($value)) {
+ $curl[CURLOPT_SSL_VERIFYHOST] = 2;
+ $curl[CURLOPT_SSL_VERIFYPEER] = true;
+ if ($value !== true) {
+ $curl[CURLOPT_CAINFO] = $value;
+ }
+ } elseif ($value === false) {
+ unset($curl[CURLOPT_CAINFO]);
+ $curl[CURLOPT_SSL_VERIFYHOST] = 0;
+ $curl[CURLOPT_SSL_VERIFYPEER] = false;
+ }
+ }
+
+ protected function visit_proxy(RequestInterface $request, $value, $flags)
+ {
+ $request->getCurlOptions()->set(CURLOPT_PROXY, $value, $flags);
+ }
+
+ protected function visit_cert(RequestInterface $request, $value, $flags)
+ {
+ if (is_array($value)) {
+ $request->getCurlOptions()->set(CURLOPT_SSLCERT, $value[0]);
+ $request->getCurlOptions()->set(CURLOPT_SSLCERTPASSWD, $value[1]);
+ } else {
+ $request->getCurlOptions()->set(CURLOPT_SSLCERT, $value);
+ }
+ }
+
+ protected function visit_ssl_key(RequestInterface $request, $value, $flags)
+ {
+ if (is_array($value)) {
+ $request->getCurlOptions()->set(CURLOPT_SSLKEY, $value[0]);
+ $request->getCurlOptions()->set(CURLOPT_SSLKEYPASSWD, $value[1]);
+ } else {
+ $request->getCurlOptions()->set(CURLOPT_SSLKEY, $value);
+ }
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/guzzle/guzzle/src/Guzzle/Http/Message/RequestFactoryInterface.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/guzzle/guzzle/src/Guzzle/Http/Message/RequestFactoryInterface.php
new file mode 100644
index 00000000000..6088f10e994
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/guzzle/guzzle/src/Guzzle/Http/Message/RequestFactoryInterface.php
@@ -0,0 +1,105 @@
+ 'Continue',
+ 101 => 'Switching Protocols',
+ 102 => 'Processing',
+ 200 => 'OK',
+ 201 => 'Created',
+ 202 => 'Accepted',
+ 203 => 'Non-Authoritative Information',
+ 204 => 'No Content',
+ 205 => 'Reset Content',
+ 206 => 'Partial Content',
+ 207 => 'Multi-Status',
+ 208 => 'Already Reported',
+ 226 => 'IM Used',
+ 300 => 'Multiple Choices',
+ 301 => 'Moved Permanently',
+ 302 => 'Found',
+ 303 => 'See Other',
+ 304 => 'Not Modified',
+ 305 => 'Use Proxy',
+ 307 => 'Temporary Redirect',
+ 308 => 'Permanent Redirect',
+ 400 => 'Bad Request',
+ 401 => 'Unauthorized',
+ 402 => 'Payment Required',
+ 403 => 'Forbidden',
+ 404 => 'Not Found',
+ 405 => 'Method Not Allowed',
+ 406 => 'Not Acceptable',
+ 407 => 'Proxy Authentication Required',
+ 408 => 'Request Timeout',
+ 409 => 'Conflict',
+ 410 => 'Gone',
+ 411 => 'Length Required',
+ 412 => 'Precondition Failed',
+ 413 => 'Request Entity Too Large',
+ 414 => 'Request-URI Too Long',
+ 415 => 'Unsupported Media Type',
+ 416 => 'Requested Range Not Satisfiable',
+ 417 => 'Expectation Failed',
+ 422 => 'Unprocessable Entity',
+ 423 => 'Locked',
+ 424 => 'Failed Dependency',
+ 425 => 'Reserved for WebDAV advanced collections expired proposal',
+ 426 => 'Upgrade required',
+ 428 => 'Precondition Required',
+ 429 => 'Too Many Requests',
+ 431 => 'Request Header Fields Too Large',
+ 500 => 'Internal Server Error',
+ 501 => 'Not Implemented',
+ 502 => 'Bad Gateway',
+ 503 => 'Service Unavailable',
+ 504 => 'Gateway Timeout',
+ 505 => 'HTTP Version Not Supported',
+ 506 => 'Variant Also Negotiates (Experimental)',
+ 507 => 'Insufficient Storage',
+ 508 => 'Loop Detected',
+ 510 => 'Not Extended',
+ 511 => 'Network Authentication Required',
+ );
+
+ /** @var EntityBodyInterface The response body */
+ protected $body;
+
+ /** @var string The reason phrase of the response (human readable code) */
+ protected $reasonPhrase;
+
+ /** @var string The status code of the response */
+ protected $statusCode;
+
+ /** @var array Information about the request */
+ protected $info = array();
+
+ /** @var string The effective URL that returned this response */
+ protected $effectiveUrl;
+
+ /** @var array Cacheable response codes (see RFC 2616:13.4) */
+ protected static $cacheResponseCodes = array(200, 203, 206, 300, 301, 410);
+
+ /**
+ * Create a new Response based on a raw response message
+ *
+ * @param string $message Response message
+ *
+ * @return self|bool Returns false on error
+ */
+ public static function fromMessage($message)
+ {
+ $data = ParserRegistry::getInstance()->getParser('message')->parseResponse($message);
+ if (!$data) {
+ return false;
+ }
+
+ $response = new static($data['code'], $data['headers'], $data['body']);
+ $response->setProtocol($data['protocol'], $data['version'])
+ ->setStatus($data['code'], $data['reason_phrase']);
+
+ // Set the appropriate Content-Length if the one set is inaccurate (e.g. setting to X)
+ $contentLength = (string) $response->getHeader('Content-Length');
+ $actualLength = strlen($data['body']);
+ if (strlen($data['body']) > 0 && $contentLength != $actualLength) {
+ $response->setHeader('Content-Length', $actualLength);
+ }
+
+ return $response;
+ }
+
+ /**
+ * Construct the response
+ *
+ * @param string $statusCode The response status code (e.g. 200, 404, etc)
+ * @param ToArrayInterface|array $headers The response headers
+ * @param string|resource|EntityBodyInterface $body The body of the response
+ *
+ * @throws BadResponseException if an invalid response code is given
+ */
+ public function __construct($statusCode, $headers = null, $body = null)
+ {
+ parent::__construct();
+ $this->setStatus($statusCode);
+ $this->body = EntityBody::factory($body !== null ? $body : '');
+
+ if ($headers) {
+ if (is_array($headers)) {
+ $this->setHeaders($headers);
+ } elseif ($headers instanceof ToArrayInterface) {
+ $this->setHeaders($headers->toArray());
+ } else {
+ throw new BadResponseException('Invalid headers argument received');
+ }
+ }
+ }
+
+ /**
+ * @return string
+ */
+ public function __toString()
+ {
+ return $this->getMessage();
+ }
+
+ public function serialize()
+ {
+ return json_encode(array(
+ 'status' => $this->statusCode,
+ 'body' => (string) $this->body,
+ 'headers' => $this->headers->toArray()
+ ));
+ }
+
+ public function unserialize($serialize)
+ {
+ $data = json_decode($serialize, true);
+ $this->__construct($data['status'], $data['headers'], $data['body']);
+ }
+
+ /**
+ * Get the response entity body
+ *
+ * @param bool $asString Set to TRUE to return a string of the body rather than a full body object
+ *
+ * @return EntityBodyInterface|string
+ */
+ public function getBody($asString = false)
+ {
+ return $asString ? (string) $this->body : $this->body;
+ }
+
+ /**
+ * Set the response entity body
+ *
+ * @param EntityBodyInterface|string $body Body to set
+ *
+ * @return self
+ */
+ public function setBody($body)
+ {
+ $this->body = EntityBody::factory($body);
+
+ return $this;
+ }
+
+ /**
+ * Set the protocol and protocol version of the response
+ *
+ * @param string $protocol Response protocol
+ * @param string $version Protocol version
+ *
+ * @return self
+ */
+ public function setProtocol($protocol, $version)
+ {
+ $this->protocol = $protocol;
+ $this->protocolVersion = $version;
+
+ return $this;
+ }
+
+ /**
+ * Get the protocol used for the response (e.g. HTTP)
+ *
+ * @return string
+ */
+ public function getProtocol()
+ {
+ return $this->protocol;
+ }
+
+ /**
+ * Get the HTTP protocol version
+ *
+ * @return string
+ */
+ public function getProtocolVersion()
+ {
+ return $this->protocolVersion;
+ }
+
+ /**
+ * Get a cURL transfer information
+ *
+ * @param string $key A single statistic to check
+ *
+ * @return array|string|null Returns all stats if no key is set, a single stat if a key is set, or null if a key
+ * is set and not found
+ * @link http://www.php.net/manual/en/function.curl-getinfo.php
+ */
+ public function getInfo($key = null)
+ {
+ if ($key === null) {
+ return $this->info;
+ } elseif (array_key_exists($key, $this->info)) {
+ return $this->info[$key];
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * Set the transfer information
+ *
+ * @param array $info Array of cURL transfer stats
+ *
+ * @return self
+ */
+ public function setInfo(array $info)
+ {
+ $this->info = $info;
+
+ return $this;
+ }
+
+ /**
+ * Set the response status
+ *
+ * @param int $statusCode Response status code to set
+ * @param string $reasonPhrase Response reason phrase
+ *
+ * @return self
+ * @throws BadResponseException when an invalid response code is received
+ */
+ public function setStatus($statusCode, $reasonPhrase = '')
+ {
+ $this->statusCode = (int) $statusCode;
+
+ if (!$reasonPhrase && isset(self::$statusTexts[$this->statusCode])) {
+ $this->reasonPhrase = self::$statusTexts[$this->statusCode];
+ } else {
+ $this->reasonPhrase = $reasonPhrase;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get the response status code
+ *
+ * @return integer
+ */
+ public function getStatusCode()
+ {
+ return $this->statusCode;
+ }
+
+ /**
+ * Get the entire response as a string
+ *
+ * @return string
+ */
+ public function getMessage()
+ {
+ $message = $this->getRawHeaders();
+
+ // Only include the body in the message if the size is < 2MB
+ $size = $this->body->getSize();
+ if ($size < 2097152) {
+ $message .= (string) $this->body;
+ }
+
+ return $message;
+ }
+
+ /**
+ * Get the the raw message headers as a string
+ *
+ * @return string
+ */
+ public function getRawHeaders()
+ {
+ $headers = 'HTTP/1.1 ' . $this->statusCode . ' ' . $this->reasonPhrase . "\r\n";
+ $lines = $this->getHeaderLines();
+ if (!empty($lines)) {
+ $headers .= implode("\r\n", $lines) . "\r\n";
+ }
+
+ return $headers . "\r\n";
+ }
+
+ /**
+ * Get the response reason phrase- a human readable version of the numeric
+ * status code
+ *
+ * @return string
+ */
+ public function getReasonPhrase()
+ {
+ return $this->reasonPhrase;
+ }
+
+ /**
+ * Get the Accept-Ranges HTTP header
+ *
+ * @return string Returns what partial content range types this server supports.
+ */
+ public function getAcceptRanges()
+ {
+ return (string) $this->getHeader('Accept-Ranges');
+ }
+
+ /**
+ * Calculate the age of the response
+ *
+ * @return integer
+ */
+ public function calculateAge()
+ {
+ $age = $this->getHeader('Age');
+
+ if ($age === null && $this->getDate()) {
+ $age = time() - strtotime($this->getDate());
+ }
+
+ return $age === null ? null : (int) (string) $age;
+ }
+
+ /**
+ * Get the Age HTTP header
+ *
+ * @return integer|null Returns the age the object has been in a proxy cache in seconds.
+ */
+ public function getAge()
+ {
+ return (string) $this->getHeader('Age');
+ }
+
+ /**
+ * Get the Allow HTTP header
+ *
+ * @return string|null Returns valid actions for a specified resource. To be used for a 405 Method not allowed.
+ */
+ public function getAllow()
+ {
+ return (string) $this->getHeader('Allow');
+ }
+
+ /**
+ * Check if an HTTP method is allowed by checking the Allow response header
+ *
+ * @param string $method Method to check
+ *
+ * @return bool
+ */
+ public function isMethodAllowed($method)
+ {
+ $allow = $this->getHeader('Allow');
+ if ($allow) {
+ foreach (explode(',', $allow) as $allowable) {
+ if (!strcasecmp(trim($allowable), $method)) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Get the Cache-Control HTTP header
+ *
+ * @return string
+ */
+ public function getCacheControl()
+ {
+ return (string) $this->getHeader('Cache-Control');
+ }
+
+ /**
+ * Get the Connection HTTP header
+ *
+ * @return string
+ */
+ public function getConnection()
+ {
+ return (string) $this->getHeader('Connection');
+ }
+
+ /**
+ * Get the Content-Encoding HTTP header
+ *
+ * @return string|null
+ */
+ public function getContentEncoding()
+ {
+ return (string) $this->getHeader('Content-Encoding');
+ }
+
+ /**
+ * Get the Content-Language HTTP header
+ *
+ * @return string|null Returns the language the content is in.
+ */
+ public function getContentLanguage()
+ {
+ return (string) $this->getHeader('Content-Language');
+ }
+
+ /**
+ * Get the Content-Length HTTP header
+ *
+ * @return integer Returns the length of the response body in bytes
+ */
+ public function getContentLength()
+ {
+ return (int) (string) $this->getHeader('Content-Length');
+ }
+
+ /**
+ * Get the Content-Location HTTP header
+ *
+ * @return string|null Returns an alternate location for the returned data (e.g /index.htm)
+ */
+ public function getContentLocation()
+ {
+ return (string) $this->getHeader('Content-Location');
+ }
+
+ /**
+ * Get the Content-Disposition HTTP header
+ *
+ * @return string|null Returns the Content-Disposition header
+ */
+ public function getContentDisposition()
+ {
+ return (string) $this->getHeader('Content-Disposition');
+ }
+
+ /**
+ * Get the Content-MD5 HTTP header
+ *
+ * @return string|null Returns a Base64-encoded binary MD5 sum of the content of the response.
+ */
+ public function getContentMd5()
+ {
+ return (string) $this->getHeader('Content-MD5');
+ }
+
+ /**
+ * Get the Content-Range HTTP header
+ *
+ * @return string Returns where in a full body message this partial message belongs (e.g. bytes 21010-47021/47022).
+ */
+ public function getContentRange()
+ {
+ return (string) $this->getHeader('Content-Range');
+ }
+
+ /**
+ * Get the Content-Type HTTP header
+ *
+ * @return string Returns the mime type of this content.
+ */
+ public function getContentType()
+ {
+ return (string) $this->getHeader('Content-Type');
+ }
+
+ /**
+ * Checks if the Content-Type is of a certain type. This is useful if the
+ * Content-Type header contains charset information and you need to know if
+ * the Content-Type matches a particular type.
+ *
+ * @param string $type Content type to check against
+ *
+ * @return bool
+ */
+ public function isContentType($type)
+ {
+ return stripos($this->getHeader('Content-Type'), $type) !== false;
+ }
+
+ /**
+ * Get the Date HTTP header
+ *
+ * @return string|null Returns the date and time that the message was sent.
+ */
+ public function getDate()
+ {
+ return (string) $this->getHeader('Date');
+ }
+
+ /**
+ * Get the ETag HTTP header
+ *
+ * @return string|null Returns an identifier for a specific version of a resource, often a Message digest.
+ */
+ public function getEtag()
+ {
+ return (string) $this->getHeader('ETag');
+ }
+
+ /**
+ * Get the Expires HTTP header
+ *
+ * @return string|null Returns the date/time after which the response is considered stale.
+ */
+ public function getExpires()
+ {
+ return (string) $this->getHeader('Expires');
+ }
+
+ /**
+ * Get the Last-Modified HTTP header
+ *
+ * @return string|null Returns the last modified date for the requested object, in RFC 2822 format
+ * (e.g. Tue, 15 Nov 1994 12:45:26 GMT)
+ */
+ public function getLastModified()
+ {
+ return (string) $this->getHeader('Last-Modified');
+ }
+
+ /**
+ * Get the Location HTTP header
+ *
+ * @return string|null Used in redirection, or when a new resource has been created.
+ */
+ public function getLocation()
+ {
+ return (string) $this->getHeader('Location');
+ }
+
+ /**
+ * Get the Pragma HTTP header
+ *
+ * @return Header|null Returns the implementation-specific headers that may have various effects anywhere along
+ * the request-response chain.
+ */
+ public function getPragma()
+ {
+ return (string) $this->getHeader('Pragma');
+ }
+
+ /**
+ * Get the Proxy-Authenticate HTTP header
+ *
+ * @return string|null Authentication to access the proxy (e.g. Basic)
+ */
+ public function getProxyAuthenticate()
+ {
+ return (string) $this->getHeader('Proxy-Authenticate');
+ }
+
+ /**
+ * Get the Retry-After HTTP header
+ *
+ * @return int|null If an entity is temporarily unavailable, this instructs the client to try again after a
+ * specified period of time.
+ */
+ public function getRetryAfter()
+ {
+ return (string) $this->getHeader('Retry-After');
+ }
+
+ /**
+ * Get the Server HTTP header
+ *
+ * @return string|null A name for the server
+ */
+ public function getServer()
+ {
+ return (string) $this->getHeader('Server');
+ }
+
+ /**
+ * Get the Set-Cookie HTTP header
+ *
+ * @return string|null An HTTP cookie.
+ */
+ public function getSetCookie()
+ {
+ return (string) $this->getHeader('Set-Cookie');
+ }
+
+ /**
+ * Get the Trailer HTTP header
+ *
+ * @return string|null The Trailer general field value indicates that the given set of header fields is present in
+ * the trailer of a message encoded with chunked transfer-coding.
+ */
+ public function getTrailer()
+ {
+ return (string) $this->getHeader('Trailer');
+ }
+
+ /**
+ * Get the Transfer-Encoding HTTP header
+ *
+ * @return string|null The form of encoding used to safely transfer the entity to the user
+ */
+ public function getTransferEncoding()
+ {
+ return (string) $this->getHeader('Transfer-Encoding');
+ }
+
+ /**
+ * Get the Vary HTTP header
+ *
+ * @return string|null Tells downstream proxies how to match future request headers to decide whether the cached
+ * response can be used rather than requesting a fresh one from the origin server.
+ */
+ public function getVary()
+ {
+ return (string) $this->getHeader('Vary');
+ }
+
+ /**
+ * Get the Via HTTP header
+ *
+ * @return string|null Informs the client of proxies through which the response was sent.
+ */
+ public function getVia()
+ {
+ return (string) $this->getHeader('Via');
+ }
+
+ /**
+ * Get the Warning HTTP header
+ *
+ * @return string|null A general warning about possible problems with the entity body
+ */
+ public function getWarning()
+ {
+ return (string) $this->getHeader('Warning');
+ }
+
+ /**
+ * Get the WWW-Authenticate HTTP header
+ *
+ * @return string|null Indicates the authentication scheme that should be used to access the requested entity
+ */
+ public function getWwwAuthenticate()
+ {
+ return (string) $this->getHeader('WWW-Authenticate');
+ }
+
+ /**
+ * Checks if HTTP Status code is a Client Error (4xx)
+ *
+ * @return bool
+ */
+ public function isClientError()
+ {
+ return $this->statusCode >= 400 && $this->statusCode < 500;
+ }
+
+ /**
+ * Checks if HTTP Status code is Server OR Client Error (4xx or 5xx)
+ *
+ * @return boolean
+ */
+ public function isError()
+ {
+ return $this->isClientError() || $this->isServerError();
+ }
+
+ /**
+ * Checks if HTTP Status code is Information (1xx)
+ *
+ * @return bool
+ */
+ public function isInformational()
+ {
+ return $this->statusCode < 200;
+ }
+
+ /**
+ * Checks if HTTP Status code is a Redirect (3xx)
+ *
+ * @return bool
+ */
+ public function isRedirect()
+ {
+ return $this->statusCode >= 300 && $this->statusCode < 400;
+ }
+
+ /**
+ * Checks if HTTP Status code is Server Error (5xx)
+ *
+ * @return bool
+ */
+ public function isServerError()
+ {
+ return $this->statusCode >= 500 && $this->statusCode < 600;
+ }
+
+ /**
+ * Checks if HTTP Status code is Successful (2xx | 304)
+ *
+ * @return bool
+ */
+ public function isSuccessful()
+ {
+ return ($this->statusCode >= 200 && $this->statusCode < 300) || $this->statusCode == 304;
+ }
+
+ /**
+ * Check if the response can be cached based on the response headers
+ *
+ * @return bool Returns TRUE if the response can be cached or false if not
+ */
+ public function canCache()
+ {
+ // Check if the response is cacheable based on the code
+ if (!in_array((int) $this->getStatusCode(), self::$cacheResponseCodes)) {
+ return false;
+ }
+
+ // Make sure a valid body was returned and can be cached
+ if ((!$this->getBody()->isReadable() || !$this->getBody()->isSeekable())
+ && ($this->getContentLength() > 0 || $this->getTransferEncoding() == 'chunked')) {
+ return false;
+ }
+
+ // Never cache no-store resources (this is a private cache, so private
+ // can be cached)
+ if ($this->getHeader('Cache-Control') && $this->getHeader('Cache-Control')->hasDirective('no-store')) {
+ return false;
+ }
+
+ return $this->isFresh() || $this->getFreshness() === null || $this->canValidate();
+ }
+
+ /**
+ * Gets the number of seconds from the current time in which this response is still considered fresh
+ *
+ * @return int|null Returns the number of seconds
+ */
+ public function getMaxAge()
+ {
+ if ($header = $this->getHeader('Cache-Control')) {
+ // s-max-age, then max-age, then Expires
+ if ($age = $header->getDirective('s-maxage')) {
+ return $age;
+ }
+ if ($age = $header->getDirective('max-age')) {
+ return $age;
+ }
+ }
+
+ if ($this->getHeader('Expires')) {
+ return strtotime($this->getExpires()) - time();
+ }
+
+ return null;
+ }
+
+ /**
+ * Check if the response is considered fresh.
+ *
+ * A response is considered fresh when its age is less than or equal to the freshness lifetime (maximum age) of the
+ * response.
+ *
+ * @return bool|null
+ */
+ public function isFresh()
+ {
+ $fresh = $this->getFreshness();
+
+ return $fresh === null ? null : $fresh >= 0;
+ }
+
+ /**
+ * Check if the response can be validated against the origin server using a conditional GET request.
+ *
+ * @return bool
+ */
+ public function canValidate()
+ {
+ return $this->getEtag() || $this->getLastModified();
+ }
+
+ /**
+ * Get the freshness of the response by returning the difference of the maximum lifetime of the response and the
+ * age of the response (max-age - age).
+ *
+ * Freshness values less than 0 mean that the response is no longer fresh and is ABS(freshness) seconds expired.
+ * Freshness values of greater than zero is the number of seconds until the response is no longer fresh. A NULL
+ * result means that no freshness information is available.
+ *
+ * @return int
+ */
+ public function getFreshness()
+ {
+ $maxAge = $this->getMaxAge();
+ $age = $this->calculateAge();
+
+ return $maxAge && $age ? ($maxAge - $age) : null;
+ }
+
+ /**
+ * Parse the JSON response body and return an array
+ *
+ * @return array|string|int|bool|float
+ * @throws RuntimeException if the response body is not in JSON format
+ */
+ public function json()
+ {
+ $data = json_decode((string) $this->body, true);
+ if (JSON_ERROR_NONE !== json_last_error()) {
+ throw new RuntimeException('Unable to parse response body into JSON: ' . json_last_error());
+ }
+
+ return $data === null ? array() : $data;
+ }
+
+ /**
+ * Parse the XML response body and return a \SimpleXMLElement.
+ *
+ * In order to prevent XXE attacks, this method disables loading external
+ * entities. If you rely on external entities, then you must parse the
+ * XML response manually by accessing the response body directly.
+ *
+ * @return \SimpleXMLElement
+ * @throws RuntimeException if the response body is not in XML format
+ * @link http://websec.io/2012/08/27/Preventing-XXE-in-PHP.html
+ */
+ public function xml()
+ {
+ $errorMessage = null;
+ $internalErrors = libxml_use_internal_errors(true);
+ $disableEntities = libxml_disable_entity_loader(true);
+ libxml_clear_errors();
+
+ try {
+ $xml = new \SimpleXMLElement((string) $this->body ?: ' element, surround
+ // it with a pre element. Please note that we explicitly used str_replace
+ // and not preg_replace to gain performance
+ if (strpos($result, '') !== false) {
+ $result = str_replace(
+ array('', "\r\n", "\n", "\r", '
'),
+ array('', '', '', '', '
'),
+ $result
+ );
+ }
+
+ if (class_exists('Parsedown')) {
+ $markdown = \Parsedown::instance();
+ $result = $markdown->parse($result);
+ } elseif (class_exists('dflydev\markdown\MarkdownExtraParser')) {
+ $markdown = new \dflydev\markdown\MarkdownExtraParser();
+ $result = $markdown->transformMarkdown($result);
+ }
+
+ return trim($result);
+ }
+
+ /**
+ * Gets the docblock this tag belongs to.
+ *
+ * @return DocBlock The docblock this description belongs to.
+ */
+ public function getDocBlock()
+ {
+ return $this->docblock;
+ }
+
+ /**
+ * Sets the docblock this tag belongs to.
+ *
+ * @param DocBlock $docblock The new docblock this description belongs to.
+ * Setting NULL removes any association.
+ *
+ * @return $this
+ */
+ public function setDocBlock(DocBlock $docblock = null)
+ {
+ $this->docblock = $docblock;
+
+ return $this;
+ }
+
+ /**
+ * Builds a string representation of this object.
+ *
+ * @todo determine the exact format as used by PHP Reflection
+ * and implement it.
+ *
+ * @return void
+ * @codeCoverageIgnore Not yet implemented
+ */
+ public static function export()
+ {
+ throw new \Exception('Not yet implemented');
+ }
+
+ /**
+ * Returns the long description as a string.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return $this->getContents();
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Location.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Location.php
new file mode 100644
index 00000000000..966ed44d72d
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Location.php
@@ -0,0 +1,76 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock;
+
+/**
+ * The location a DocBlock occurs within a file.
+ *
+ * @author Vasil Rangelov
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class Location
+{
+ /** @var int Line where the DocBlock text starts. */
+ protected $lineNumber = 0;
+
+ /** @var int Column where the DocBlock text starts. */
+ protected $columnNumber = 0;
+
+ public function __construct(
+ $lineNumber = 0,
+ $columnNumber = 0
+ ) {
+ $this->setLineNumber($lineNumber)->setColumnNumber($columnNumber);
+ }
+
+ /**
+ * @return int Line where the DocBlock text starts.
+ */
+ public function getLineNumber()
+ {
+ return $this->lineNumber;
+ }
+
+ /**
+ *
+ * @param type $lineNumber
+ * @return $this
+ */
+ public function setLineNumber($lineNumber)
+ {
+ $this->lineNumber = (int)$lineNumber;
+
+ return $this;
+ }
+
+ /**
+ * @return int Column where the DocBlock text starts.
+ */
+ public function getColumnNumber()
+ {
+ return $this->columnNumber;
+ }
+
+ /**
+ *
+ * @param int $columnNumber
+ * @return $this
+ */
+ public function setColumnNumber($columnNumber)
+ {
+ $this->columnNumber = (int)$columnNumber;
+
+ return $this;
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Serializer.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Serializer.php
new file mode 100644
index 00000000000..c1617850e2b
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Serializer.php
@@ -0,0 +1,198 @@
+
+ * @copyright 2013 Mike van Riel / Naenius (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock;
+
+use phpDocumentor\Reflection\DocBlock;
+
+/**
+ * Serializes a DocBlock instance.
+ *
+ * @author Barry vd. Heuvel
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class Serializer
+{
+
+ /** @var string The string to indent the comment with. */
+ protected $indentString = ' ';
+
+ /** @var int The number of times the indent string is repeated. */
+ protected $indent = 0;
+
+ /** @var bool Whether to indent the first line. */
+ protected $isFirstLineIndented = true;
+
+ /** @var int|null The max length of a line. */
+ protected $lineLength = null;
+
+ /**
+ * Create a Serializer instance.
+ *
+ * @param int $indent The number of times the indent string is
+ * repeated.
+ * @param string $indentString The string to indent the comment with.
+ * @param bool $indentFirstLine Whether to indent the first line.
+ * @param int|null $lineLength The max length of a line or NULL to
+ * disable line wrapping.
+ */
+ public function __construct(
+ $indent = 0,
+ $indentString = ' ',
+ $indentFirstLine = true,
+ $lineLength = null
+ ) {
+ $this->setIndentationString($indentString);
+ $this->setIndent($indent);
+ $this->setIsFirstLineIndented($indentFirstLine);
+ $this->setLineLength($lineLength);
+ }
+
+ /**
+ * Sets the string to indent comments with.
+ *
+ * @param string $indentationString The string to indent comments with.
+ *
+ * @return $this This serializer object.
+ */
+ public function setIndentationString($indentString)
+ {
+ $this->indentString = (string)$indentString;
+ return $this;
+ }
+
+ /**
+ * Gets the string to indent comments with.
+ *
+ * @return string The indent string.
+ */
+ public function getIndentationString()
+ {
+ return $this->indentString;
+ }
+
+ /**
+ * Sets the number of indents.
+ *
+ * @param int $indent The number of times the indent string is repeated.
+ *
+ * @return $this This serializer object.
+ */
+ public function setIndent($indent)
+ {
+ $this->indent = (int)$indent;
+ return $this;
+ }
+
+ /**
+ * Gets the number of indents.
+ *
+ * @return int The number of times the indent string is repeated.
+ */
+ public function getIndent()
+ {
+ return $this->indent;
+ }
+
+ /**
+ * Sets whether or not the first line should be indented.
+ *
+ * Sets whether or not the first line (the one with the "/**") should be
+ * indented.
+ *
+ * @param bool $indentFirstLine The new value for this setting.
+ *
+ * @return $this This serializer object.
+ */
+ public function setIsFirstLineIndented($indentFirstLine)
+ {
+ $this->isFirstLineIndented = (bool)$indentFirstLine;
+ return $this;
+ }
+
+ /**
+ * Gets whether or not the first line should be indented.
+ *
+ * @return bool Whether or not the first line should be indented.
+ */
+ public function isFirstLineIndented()
+ {
+ return $this->isFirstLineIndented;
+ }
+
+ /**
+ * Sets the line length.
+ *
+ * Sets the length of each line in the serialization. Content will be
+ * wrapped within this limit.
+ *
+ * @param int|null $lineLength The length of each line. NULL to disable line
+ * wrapping altogether.
+ *
+ * @return $this This serializer object.
+ */
+ public function setLineLength($lineLength)
+ {
+ $this->lineLength = null === $lineLength ? null : (int)$lineLength;
+ return $this;
+ }
+
+ /**
+ * Gets the line length.
+ *
+ * @return int|null The length of each line or NULL if line wrapping is
+ * disabled.
+ */
+ public function getLineLength()
+ {
+ return $this->lineLength;
+ }
+
+ /**
+ * Generate a DocBlock comment.
+ *
+ * @param DocBlock The DocBlock to serialize.
+ *
+ * @return string The serialized doc block.
+ */
+ public function getDocComment(DocBlock $docblock)
+ {
+ $indent = str_repeat($this->indentString, $this->indent);
+ $firstIndent = $this->isFirstLineIndented ? $indent : '';
+
+ $text = $docblock->getText();
+ if ($this->lineLength) {
+ //3 === strlen(' * ')
+ $wrapLength = $this->lineLength - strlen($indent) - 3;
+ $text = wordwrap($text, $wrapLength);
+ }
+ $text = str_replace("\n", "\n{$indent} * ", $text);
+
+ $comment = "{$firstIndent}/**\n{$indent} * {$text}\n{$indent} *\n";
+
+ /** @var Tag $tag */
+ foreach ($docblock->getTags() as $tag) {
+ $tagText = (string) $tag;
+ if ($this->lineLength) {
+ $tagText = wordwrap($tagText, $wrapLength);
+ }
+ $tagText = str_replace("\n", "\n{$indent} * ", $tagText);
+
+ $comment .= "{$indent} * {$tagText}\n";
+ }
+
+ $comment .= $indent . ' */';
+
+ return $comment;
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag.php
new file mode 100644
index 00000000000..a96db09521d
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag.php
@@ -0,0 +1,377 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock;
+
+use phpDocumentor\Reflection\DocBlock;
+
+/**
+ * Parses a tag definition for a DocBlock.
+ *
+ * @author Mike van Riel
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class Tag implements \Reflector
+{
+ /**
+ * PCRE regular expression matching a tag name.
+ */
+ const REGEX_TAGNAME = '[\w\-\_\\\\]+';
+
+ /** @var string Name of the tag */
+ protected $tag = '';
+
+ /**
+ * @var string|null Content of the tag.
+ * When set to NULL, it means it needs to be regenerated.
+ */
+ protected $content = '';
+
+ /** @var string Description of the content of this tag */
+ protected $description = '';
+
+ /**
+ * @var array|null The description, as an array of strings and Tag objects.
+ * When set to NULL, it means it needs to be regenerated.
+ */
+ protected $parsedDescription = null;
+
+ /** @var Location Location of the tag. */
+ protected $location = null;
+
+ /** @var DocBlock The DocBlock which this tag belongs to. */
+ protected $docblock = null;
+
+ /**
+ * @var array An array with a tag as a key, and an FQCN to a class that
+ * handles it as an array value. The class is expected to inherit this
+ * class.
+ */
+ private static $tagHandlerMappings = array(
+ 'author'
+ => '\phpDocumentor\Reflection\DocBlock\Tag\AuthorTag',
+ 'covers'
+ => '\phpDocumentor\Reflection\DocBlock\Tag\CoversTag',
+ 'deprecated'
+ => '\phpDocumentor\Reflection\DocBlock\Tag\DeprecatedTag',
+ 'example'
+ => '\phpDocumentor\Reflection\DocBlock\Tag\ExampleTag',
+ 'link'
+ => '\phpDocumentor\Reflection\DocBlock\Tag\LinkTag',
+ 'method'
+ => '\phpDocumentor\Reflection\DocBlock\Tag\MethodTag',
+ 'param'
+ => '\phpDocumentor\Reflection\DocBlock\Tag\ParamTag',
+ 'property-read'
+ => '\phpDocumentor\Reflection\DocBlock\Tag\PropertyReadTag',
+ 'property'
+ => '\phpDocumentor\Reflection\DocBlock\Tag\PropertyTag',
+ 'property-write'
+ => '\phpDocumentor\Reflection\DocBlock\Tag\PropertyWriteTag',
+ 'return'
+ => '\phpDocumentor\Reflection\DocBlock\Tag\ReturnTag',
+ 'see'
+ => '\phpDocumentor\Reflection\DocBlock\Tag\SeeTag',
+ 'since'
+ => '\phpDocumentor\Reflection\DocBlock\Tag\SinceTag',
+ 'source'
+ => '\phpDocumentor\Reflection\DocBlock\Tag\SourceTag',
+ 'throw'
+ => '\phpDocumentor\Reflection\DocBlock\Tag\ThrowsTag',
+ 'throws'
+ => '\phpDocumentor\Reflection\DocBlock\Tag\ThrowsTag',
+ 'uses'
+ => '\phpDocumentor\Reflection\DocBlock\Tag\UsesTag',
+ 'var'
+ => '\phpDocumentor\Reflection\DocBlock\Tag\VarTag',
+ 'version'
+ => '\phpDocumentor\Reflection\DocBlock\Tag\VersionTag'
+ );
+
+ /**
+ * Factory method responsible for instantiating the correct sub type.
+ *
+ * @param string $tag_line The text for this tag, including description.
+ * @param DocBlock $docblock The DocBlock which this tag belongs to.
+ * @param Location $location Location of the tag.
+ *
+ * @throws \InvalidArgumentException if an invalid tag line was presented.
+ *
+ * @return static A new tag object.
+ */
+ final public static function createInstance(
+ $tag_line,
+ DocBlock $docblock = null,
+ Location $location = null
+ ) {
+ if (!preg_match(
+ '/^@(' . self::REGEX_TAGNAME . ')(?:\s*([^\s].*)|$)?/us',
+ $tag_line,
+ $matches
+ )) {
+ throw new \InvalidArgumentException(
+ 'Invalid tag_line detected: ' . $tag_line
+ );
+ }
+
+ $handler = __CLASS__;
+ if (isset(self::$tagHandlerMappings[$matches[1]])) {
+ $handler = self::$tagHandlerMappings[$matches[1]];
+ } elseif (isset($docblock)) {
+ $tagName = (string)new Type\Collection(
+ array($matches[1]),
+ $docblock->getContext()
+ );
+
+ if (isset(self::$tagHandlerMappings[$tagName])) {
+ $handler = self::$tagHandlerMappings[$tagName];
+ }
+ }
+
+ return new $handler(
+ $matches[1],
+ isset($matches[2]) ? $matches[2] : '',
+ $docblock,
+ $location
+ );
+ }
+
+ /**
+ * Registers a handler for tags.
+ *
+ * Registers a handler for tags. The class specified is autoloaded if it's
+ * not available. It must inherit from this class.
+ *
+ * @param string $tag Name of tag to regiser a handler for. When
+ * registering a namespaced tag, the full name, along with a prefixing
+ * slash MUST be provided.
+ * @param string|null $handler FQCN of handler. Specifing NULL removes the
+ * handler for the specified tag, if any.
+ *
+ * @return bool TRUE on success, FALSE on failure.
+ */
+ final public static function registerTagHandler($tag, $handler)
+ {
+ $tag = trim((string)$tag);
+
+ if (null === $handler) {
+ unset(self::$tagHandlerMappings[$tag]);
+ return true;
+ }
+
+ if ('' !== $tag
+ && class_exists($handler, true)
+ && is_subclass_of($handler, __CLASS__)
+ && !strpos($tag, '\\') //Accept no slash, and 1st slash at offset 0.
+ ) {
+ self::$tagHandlerMappings[$tag] = $handler;
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Parses a tag and populates the member variables.
+ *
+ * @param string $name Name of the tag.
+ * @param string $content The contents of the given tag.
+ * @param DocBlock $docblock The DocBlock which this tag belongs to.
+ * @param Location $location Location of the tag.
+ */
+ public function __construct(
+ $name,
+ $content,
+ DocBlock $docblock = null,
+ Location $location = null
+ ) {
+ $this
+ ->setName($name)
+ ->setContent($content)
+ ->setDocBlock($docblock)
+ ->setLocation($location);
+ }
+
+ /**
+ * Gets the name of this tag.
+ *
+ * @return string The name of this tag.
+ */
+ public function getName()
+ {
+ return $this->tag;
+ }
+
+ /**
+ * Sets the name of this tag.
+ *
+ * @param string $name The new name of this tag.
+ *
+ * @return $this
+ * @throws \InvalidArgumentException When an invalid tag name is provided.
+ */
+ public function setName($name)
+ {
+ if (!preg_match('/^' . self::REGEX_TAGNAME . '$/u', $name)) {
+ throw new \InvalidArgumentException(
+ 'Invalid tag name supplied: ' . $name
+ );
+ }
+
+ $this->tag = $name;
+
+ return $this;
+ }
+
+ /**
+ * Gets the content of this tag.
+ *
+ * @return string
+ */
+ public function getContent()
+ {
+ if (null === $this->content) {
+ $this->content = $this->description;
+ }
+
+ return $this->content;
+ }
+
+ /**
+ * Sets the content of this tag.
+ *
+ * @param string $content The new content of this tag.
+ *
+ * @return $this
+ */
+ public function setContent($content)
+ {
+ $this->setDescription($content);
+ $this->content = $content;
+
+ return $this;
+ }
+
+ /**
+ * Gets the description component of this tag.
+ *
+ * @return string
+ */
+ public function getDescription()
+ {
+ return $this->description;
+ }
+
+ /**
+ * Sets the description component of this tag.
+ *
+ * @param string $description The new description component of this tag.
+ *
+ * @return $this
+ */
+ public function setDescription($description)
+ {
+ $this->content = null;
+ $this->parsedDescription = null;
+ $this->description = trim($description);
+
+ return $this;
+ }
+
+ /**
+ * Gets the parsed text of this description.
+ *
+ * @return array An array of strings and tag objects, in the order they
+ * occur within the description.
+ */
+ public function getParsedDescription()
+ {
+ if (null === $this->parsedDescription) {
+ $description = new Description($this->description, $this->docblock);
+ $this->parsedDescription = $description->getParsedContents();
+ }
+ return $this->parsedDescription;
+ }
+
+ /**
+ * Gets the docblock this tag belongs to.
+ *
+ * @return DocBlock The docblock this tag belongs to.
+ */
+ public function getDocBlock()
+ {
+ return $this->docblock;
+ }
+
+ /**
+ * Sets the docblock this tag belongs to.
+ *
+ * @param DocBlock $docblock The new docblock this tag belongs to. Setting
+ * NULL removes any association.
+ *
+ * @return $this
+ */
+ public function setDocBlock(DocBlock $docblock = null)
+ {
+ $this->docblock = $docblock;
+
+ return $this;
+ }
+
+ /**
+ * Gets the location of the tag.
+ *
+ * @return Location The tag's location.
+ */
+ public function getLocation()
+ {
+ return $this->location;
+ }
+
+ /**
+ * Sets the location of the tag.
+ *
+ * @param Location $location The new location of the tag.
+ *
+ * @return $this
+ */
+ public function setLocation(Location $location = null)
+ {
+ $this->location = $location;
+
+ return $this;
+ }
+
+ /**
+ * Builds a string representation of this object.
+ *
+ * @todo determine the exact format as used by PHP Reflection and implement it.
+ *
+ * @return void
+ * @codeCoverageIgnore Not yet implemented
+ */
+ public static function export()
+ {
+ throw new \Exception('Not yet implemented');
+ }
+
+ /**
+ * Returns the tag as a serialized string
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return "@{$this->getName()} {$this->getContent()}";
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/AuthorTag.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/AuthorTag.php
new file mode 100644
index 00000000000..bacf52ebe78
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/AuthorTag.php
@@ -0,0 +1,131 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+use phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Reflection class for an @author tag in a Docblock.
+ *
+ * @author Mike van Riel
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class AuthorTag extends Tag
+{
+ /**
+ * PCRE regular expression matching any valid value for the name component.
+ */
+ const REGEX_AUTHOR_NAME = '[^\<]*';
+
+ /**
+ * PCRE regular expression matching any valid value for the email component.
+ */
+ const REGEX_AUTHOR_EMAIL = '[^\>]*';
+
+ /** @var string The name of the author */
+ protected $authorName = '';
+
+ /** @var string The email of the author */
+ protected $authorEmail = '';
+
+ public function getContent()
+ {
+ if (null === $this->content) {
+ $this->content = $this->authorName;
+ if ('' != $this->authorEmail) {
+ $this->content .= "<{$this->authorEmail}>";
+ }
+ }
+
+ return $this->content;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function setContent($content)
+ {
+ parent::setContent($content);
+ if (preg_match(
+ '/^(' . self::REGEX_AUTHOR_NAME .
+ ')(\<(' . self::REGEX_AUTHOR_EMAIL .
+ ')\>)?$/u',
+ $this->description,
+ $matches
+ )) {
+ $this->authorName = trim($matches[1]);
+ if (isset($matches[3])) {
+ $this->authorEmail = trim($matches[3]);
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Gets the author's name.
+ *
+ * @return string The author's name.
+ */
+ public function getAuthorName()
+ {
+ return $this->authorName;
+ }
+
+ /**
+ * Sets the author's name.
+ *
+ * @param string $authorName The new author name.
+ * An invalid value will set an empty string.
+ *
+ * @return $this
+ */
+ public function setAuthorName($authorName)
+ {
+ $this->content = null;
+ $this->authorName
+ = preg_match('/^' . self::REGEX_AUTHOR_NAME . '$/u', $authorName)
+ ? $authorName : '';
+
+ return $this;
+ }
+
+ /**
+ * Gets the author's email.
+ *
+ * @return string The author's email.
+ */
+ public function getAuthorEmail()
+ {
+ return $this->authorEmail;
+ }
+
+ /**
+ * Sets the author's email.
+ *
+ * @param string $authorEmail The new author email.
+ * An invalid value will set an empty string.
+ *
+ * @return $this
+ */
+ public function setAuthorEmail($authorEmail)
+ {
+ $this->authorEmail
+ = preg_match('/^' . self::REGEX_AUTHOR_EMAIL . '$/u', $authorEmail)
+ ? $authorEmail : '';
+
+ $this->content = null;
+ return $this;
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/CoversTag.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/CoversTag.php
new file mode 100644
index 00000000000..bd31b56bfc8
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/CoversTag.php
@@ -0,0 +1,24 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Reflection class for a @covers tag in a Docblock.
+ *
+ * @author Mike van Riel
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class CoversTag extends SeeTag
+{
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/DeprecatedTag.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/DeprecatedTag.php
new file mode 100644
index 00000000000..7226316b7d9
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/DeprecatedTag.php
@@ -0,0 +1,26 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+use phpDocumentor\Reflection\DocBlock\Tag\VersionTag;
+
+/**
+ * Reflection class for a @deprecated tag in a Docblock.
+ *
+ * @author Vasil Rangelov
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class DeprecatedTag extends VersionTag
+{
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ExampleTag.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ExampleTag.php
new file mode 100644
index 00000000000..0e163ea01b9
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ExampleTag.php
@@ -0,0 +1,156 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+use phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Reflection class for a @example tag in a Docblock.
+ *
+ * @author Vasil Rangelov
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class ExampleTag extends SourceTag
+{
+ /**
+ * @var string Path to a file to use as an example.
+ * May also be an absolute URI.
+ */
+ protected $filePath = '';
+
+ /**
+ * @var bool Whether the file path component represents an URI.
+ * This determines how the file portion appears at {@link getContent()}.
+ */
+ protected $isURI = false;
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getContent()
+ {
+ if (null === $this->content) {
+ $filePath = '';
+ if ($this->isURI) {
+ if (false === strpos($this->filePath, ':')) {
+ $filePath = str_replace(
+ '%2F',
+ '/',
+ rawurlencode($this->filePath)
+ );
+ } else {
+ $filePath = $this->filePath;
+ }
+ } else {
+ $filePath = '"' . $this->filePath . '"';
+ }
+
+ $this->content = $filePath . ' ' . parent::getContent();
+ }
+
+ return $this->content;
+ }
+ /**
+ * {@inheritdoc}
+ */
+ public function setContent($content)
+ {
+ Tag::setContent($content);
+ if (preg_match(
+ '/^
+ # File component
+ (?:
+ # File path in quotes
+ \"([^\"]+)\"
+ |
+ # File URI
+ (\S+)
+ )
+ # Remaining content (parsed by SourceTag)
+ (?:\s+(.*))?
+ $/sux',
+ $this->description,
+ $matches
+ )) {
+ if ('' !== $matches[1]) {
+ $this->setFilePath($matches[1]);
+ } else {
+ $this->setFileURI($matches[2]);
+ }
+
+ if (isset($matches[3])) {
+ parent::setContent($matches[3]);
+ } else {
+ $this->setDescription('');
+ }
+ $this->content = $content;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Returns the file path.
+ *
+ * @return string Path to a file to use as an example.
+ * May also be an absolute URI.
+ */
+ public function getFilePath()
+ {
+ return $this->filePath;
+ }
+
+ /**
+ * Sets the file path.
+ *
+ * @param string $filePath The new file path to use for the example.
+ *
+ * @return $this
+ */
+ public function setFilePath($filePath)
+ {
+ $this->isURI = false;
+ $this->filePath = trim($filePath);
+
+ $this->content = null;
+ return $this;
+ }
+
+ /**
+ * Sets the file path as an URI.
+ *
+ * This function is equivalent to {@link setFilePath()}, except that it
+ * convers an URI to a file path before that.
+ *
+ * There is no getFileURI(), as {@link getFilePath()} is compatible.
+ *
+ * @param type $uri The new file URI to use as an example.
+ */
+ public function setFileURI($uri)
+ {
+ $this->isURI = true;
+ if (false === strpos($uri, ':')) {
+ //Relative URL
+ $this->filePath = rawurldecode(
+ str_replace(array('/', '\\'), '%2F', $uri)
+ );
+ } else {
+ //Absolute URL or URI.
+ $this->filePath = $uri;
+ }
+
+ $this->content = null;
+ return $this;
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/LinkTag.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/LinkTag.php
new file mode 100644
index 00000000000..f79f25dd8b2
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/LinkTag.php
@@ -0,0 +1,81 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+use phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Reflection class for a @link tag in a Docblock.
+ *
+ * @author Ben Selby
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class LinkTag extends Tag
+{
+ /** @var string */
+ protected $link = '';
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getContent()
+ {
+ if (null === $this->content) {
+ $this->content = "{$this->link} {$this->description}";
+ }
+
+ return $this->content;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function setContent($content)
+ {
+ parent::setContent($content);
+ $parts = preg_split('/\s+/Su', $this->description, 2);
+
+ $this->link = $parts[0];
+
+ $this->setDescription(isset($parts[1]) ? $parts[1] : $parts[0]);
+
+ $this->content = $content;
+ return $this;
+ }
+
+ /**
+ * Gets the link
+ *
+ * @return string
+ */
+ public function getLink()
+ {
+ return $this->link;
+ }
+
+ /**
+ * Sets the link
+ *
+ * @param string $link The link
+ *
+ * @return $this
+ */
+ public function setLink($link)
+ {
+ $this->link = $link;
+
+ $this->content = null;
+ return $this;
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/MethodTag.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/MethodTag.php
new file mode 100644
index 00000000000..7a5ce790821
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/MethodTag.php
@@ -0,0 +1,209 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+use phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Reflection class for a @method in a Docblock.
+ *
+ * @author Mike van Riel
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class MethodTag extends ReturnTag
+{
+
+ /** @var string */
+ protected $method_name = '';
+
+ /** @var string */
+ protected $arguments = '';
+
+ /** @var bool */
+ protected $isStatic = false;
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getContent()
+ {
+ if (null === $this->content) {
+ $this->content = '';
+ if ($this->isStatic) {
+ $this->content .= 'static ';
+ }
+ $this->content .= $this->type .
+ " {$this->method_name}({$this->arguments}) " .
+ $this->description;
+ }
+
+ return $this->content;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function setContent($content)
+ {
+ Tag::setContent($content);
+ // 1. none or more whitespace
+ // 2. optionally the keyword "static" followed by whitespace
+ // 3. optionally a word with underscores followed by whitespace : as
+ // type for the return value
+ // 4. then optionally a word with underscores followed by () and
+ // whitespace : as method name as used by phpDocumentor
+ // 5. then a word with underscores, followed by ( and any character
+ // until a ) and whitespace : as method name with signature
+ // 6. any remaining text : as description
+ if (preg_match(
+ '/^
+ # Static keyword
+ # Declates a static method ONLY if type is also present
+ (?:
+ (static)
+ \s+
+ )?
+ # Return type
+ (?:
+ ([\w\|_\\\\]+)
+ \s+
+ )?
+ # Legacy method name (not captured)
+ (?:
+ [\w_]+\(\)\s+
+ )?
+ # Method name
+ ([\w\|_\\\\]+)
+ # Arguments
+ \(([^\)]*)\)
+ \s*
+ # Description
+ (.*)
+ $/sux',
+ $this->description,
+ $matches
+ )) {
+ list(
+ ,
+ $static,
+ $this->type,
+ $this->method_name,
+ $this->arguments,
+ $this->description
+ ) = $matches;
+ if ($static) {
+ if (!$this->type) {
+ $this->type = 'static';
+ } else {
+ $this->isStatic = true;
+ }
+ } else {
+ if (!$this->type) {
+ $this->type = 'void';
+ }
+ }
+ $this->parsedDescription = null;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Sets the name of this method.
+ *
+ * @param string $method_name The name of the method.
+ *
+ * @return $this
+ */
+ public function setMethodName($method_name)
+ {
+ $this->method_name = $method_name;
+
+ $this->content = null;
+ return $this;
+ }
+
+ /**
+ * Retrieves the method name.
+ *
+ * @return string
+ */
+ public function getMethodName()
+ {
+ return $this->method_name;
+ }
+
+ /**
+ * Sets the arguments for this method.
+ *
+ * @param string $arguments A comma-separated arguments line.
+ *
+ * @return void
+ */
+ public function setArguments($arguments)
+ {
+ $this->arguments = $arguments;
+
+ $this->content = null;
+ return $this;
+ }
+
+ /**
+ * Returns an array containing each argument as array of type and name.
+ *
+ * Please note that the argument sub-array may only contain 1 element if no
+ * type was specified.
+ *
+ * @return string[]
+ */
+ public function getArguments()
+ {
+ if (empty($this->arguments)) {
+ return array();
+ }
+
+ $arguments = explode(',', $this->arguments);
+ foreach ($arguments as $key => $value) {
+ $arguments[$key] = explode(' ', trim($value));
+ }
+
+ return $arguments;
+ }
+
+ /**
+ * Checks whether the method tag describes a static method or not.
+ *
+ * @return bool TRUE if the method declaration is for a static method, FALSE
+ * otherwise.
+ */
+ public function isStatic()
+ {
+ return $this->isStatic;
+ }
+
+ /**
+ * Sets a new value for whether the method is static or not.
+ *
+ * @param bool $isStatic The new value to set.
+ *
+ * @return $this
+ */
+ public function setIsStatic($isStatic)
+ {
+ $this->isStatic = $isStatic;
+
+ $this->content = null;
+ return $this;
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ParamTag.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ParamTag.php
new file mode 100644
index 00000000000..9bc0270dd9a
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ParamTag.php
@@ -0,0 +1,119 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+use phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Reflection class for a @param tag in a Docblock.
+ *
+ * @author Mike van Riel
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class ParamTag extends ReturnTag
+{
+ /** @var string */
+ protected $variableName = '';
+
+ /** @var bool determines whether this is a variadic argument */
+ protected $isVariadic = false;
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getContent()
+ {
+ if (null === $this->content) {
+ $this->content
+ = "{$this->type} {$this->variableName} {$this->description}";
+ }
+ return $this->content;
+ }
+ /**
+ * {@inheritdoc}
+ */
+ public function setContent($content)
+ {
+ Tag::setContent($content);
+ $parts = preg_split(
+ '/(\s+)/Su',
+ $this->description,
+ 3,
+ PREG_SPLIT_DELIM_CAPTURE
+ );
+
+ // if the first item that is encountered is not a variable; it is a type
+ if (isset($parts[0])
+ && (strlen($parts[0]) > 0)
+ && ($parts[0][0] !== '$')
+ ) {
+ $this->type = array_shift($parts);
+ array_shift($parts);
+ }
+
+ // if the next item starts with a $ or ...$ it must be the variable name
+ if (isset($parts[0])
+ && (strlen($parts[0]) > 0)
+ && ($parts[0][0] == '$' || substr($parts[0], 0, 4) === '...$')
+ ) {
+ $this->variableName = array_shift($parts);
+ array_shift($parts);
+
+ if (substr($this->variableName, 0, 3) === '...') {
+ $this->isVariadic = true;
+ $this->variableName = substr($this->variableName, 3);
+ }
+ }
+
+ $this->setDescription(implode('', $parts));
+
+ $this->content = $content;
+ return $this;
+ }
+
+ /**
+ * Returns the variable's name.
+ *
+ * @return string
+ */
+ public function getVariableName()
+ {
+ return $this->variableName;
+ }
+
+ /**
+ * Sets the variable's name.
+ *
+ * @param string $name The new name for this variable.
+ *
+ * @return $this
+ */
+ public function setVariableName($name)
+ {
+ $this->variableName = $name;
+
+ $this->content = null;
+ return $this;
+ }
+
+ /**
+ * Returns whether this tag is variadic.
+ *
+ * @return boolean
+ */
+ public function isVariadic()
+ {
+ return $this->isVariadic;
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyReadTag.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyReadTag.php
new file mode 100644
index 00000000000..33406026a11
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyReadTag.php
@@ -0,0 +1,24 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Reflection class for a @property-read tag in a Docblock.
+ *
+ * @author Mike van Riel
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class PropertyReadTag extends PropertyTag
+{
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyTag.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyTag.php
new file mode 100644
index 00000000000..288ecff872c
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyTag.php
@@ -0,0 +1,24 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Reflection class for a @property tag in a Docblock.
+ *
+ * @author Mike van Riel
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class PropertyTag extends ParamTag
+{
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyWriteTag.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyWriteTag.php
new file mode 100644
index 00000000000..ec4e866d438
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyWriteTag.php
@@ -0,0 +1,24 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Reflection class for a @property-write tag in a Docblock.
+ *
+ * @author Mike van Riel
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class PropertyWriteTag extends PropertyTag
+{
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ReturnTag.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ReturnTag.php
new file mode 100644
index 00000000000..9293db9246b
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ReturnTag.php
@@ -0,0 +1,99 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+use phpDocumentor\Reflection\DocBlock\Tag;
+use phpDocumentor\Reflection\DocBlock\Type\Collection;
+
+/**
+ * Reflection class for a @return tag in a Docblock.
+ *
+ * @author Mike van Riel
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class ReturnTag extends Tag
+{
+ /** @var string The raw type component. */
+ protected $type = '';
+
+ /** @var Collection The parsed type component. */
+ protected $types = null;
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getContent()
+ {
+ if (null === $this->content) {
+ $this->content = "{$this->type} {$this->description}";
+ }
+
+ return $this->content;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function setContent($content)
+ {
+ parent::setContent($content);
+
+ $parts = preg_split('/\s+/Su', $this->description, 2);
+
+ // any output is considered a type
+ $this->type = $parts[0];
+ $this->types = null;
+
+ $this->setDescription(isset($parts[1]) ? $parts[1] : '');
+
+ $this->content = $content;
+ return $this;
+ }
+
+ /**
+ * Returns the unique types of the variable.
+ *
+ * @return string[]
+ */
+ public function getTypes()
+ {
+ return $this->getTypesCollection()->getArrayCopy();
+ }
+
+ /**
+ * Returns the type section of the variable.
+ *
+ * @return string
+ */
+ public function getType()
+ {
+ return (string) $this->getTypesCollection();
+ }
+
+ /**
+ * Returns the type collection.
+ *
+ * @return void
+ */
+ protected function getTypesCollection()
+ {
+ if (null === $this->types) {
+ $this->types = new Collection(
+ array($this->type),
+ $this->docblock ? $this->docblock->getContext() : null
+ );
+ }
+ return $this->types;
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/SeeTag.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/SeeTag.php
new file mode 100644
index 00000000000..4f5f22ce17d
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/SeeTag.php
@@ -0,0 +1,81 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+use phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Reflection class for a @see tag in a Docblock.
+ *
+ * @author Mike van Riel
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class SeeTag extends Tag
+{
+ /** @var string */
+ protected $refers = null;
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getContent()
+ {
+ if (null === $this->content) {
+ $this->content = "{$this->refers} {$this->description}";
+ }
+ return $this->content;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function setContent($content)
+ {
+ parent::setContent($content);
+ $parts = preg_split('/\s+/Su', $this->description, 2);
+
+ // any output is considered a type
+ $this->refers = $parts[0];
+
+ $this->setDescription(isset($parts[1]) ? $parts[1] : '');
+
+ $this->content = $content;
+ return $this;
+ }
+
+ /**
+ * Gets the structural element this tag refers to.
+ *
+ * @return string
+ */
+ public function getReference()
+ {
+ return $this->refers;
+ }
+
+ /**
+ * Sets the structural element this tag refers to.
+ *
+ * @param string $refers The new type this tag refers to.
+ *
+ * @return $this
+ */
+ public function setReference($refers)
+ {
+ $this->refers = $refers;
+
+ $this->content = null;
+ return $this;
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/SinceTag.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/SinceTag.php
new file mode 100644
index 00000000000..ba009c44733
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/SinceTag.php
@@ -0,0 +1,26 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+use phpDocumentor\Reflection\DocBlock\Tag\VersionTag;
+
+/**
+ * Reflection class for a @since tag in a Docblock.
+ *
+ * @author Vasil Rangelov
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class SinceTag extends VersionTag
+{
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/SourceTag.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/SourceTag.php
new file mode 100644
index 00000000000..3400220ea7c
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/SourceTag.php
@@ -0,0 +1,137 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+use phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Reflection class for a @source tag in a Docblock.
+ *
+ * @author Vasil Rangelov
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class SourceTag extends Tag
+{
+ /**
+ * @var int The starting line, relative to the structural element's
+ * location.
+ */
+ protected $startingLine = 1;
+
+ /**
+ * @var int|null The number of lines, relative to the starting line. NULL
+ * means "to the end".
+ */
+ protected $lineCount = null;
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getContent()
+ {
+ if (null === $this->content) {
+ $this->content
+ = "{$this->startingLine} {$this->lineCount} {$this->description}";
+ }
+
+ return $this->content;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function setContent($content)
+ {
+ parent::setContent($content);
+ if (preg_match(
+ '/^
+ # Starting line
+ ([1-9]\d*)
+ \s*
+ # Number of lines
+ (?:
+ ((?1))
+ \s+
+ )?
+ # Description
+ (.*)
+ $/sux',
+ $this->description,
+ $matches
+ )) {
+ $this->startingLine = (int)$matches[1];
+ if (isset($matches[2]) && '' !== $matches[2]) {
+ $this->lineCount = (int)$matches[2];
+ }
+ $this->setDescription($matches[3]);
+ $this->content = $content;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Gets the starting line.
+ *
+ * @return int The starting line, relative to the structural element's
+ * location.
+ */
+ public function getStartingLine()
+ {
+ return $this->startingLine;
+ }
+
+ /**
+ * Sets the starting line.
+ *
+ * @param int $startingLine The new starting line, relative to the
+ * structural element's location.
+ *
+ * @return $this
+ */
+ public function setStartingLine($startingLine)
+ {
+ $this->startingLine = $startingLine;
+
+ $this->content = null;
+ return $this;
+ }
+
+ /**
+ * Returns the number of lines.
+ *
+ * @return int|null The number of lines, relative to the starting line. NULL
+ * means "to the end".
+ */
+ public function getLineCount()
+ {
+ return $this->lineCount;
+ }
+
+ /**
+ * Sets the number of lines.
+ *
+ * @param int|null $lineCount The new number of lines, relative to the
+ * starting line. NULL means "to the end".
+ *
+ * @return $this
+ */
+ public function setLineCount($lineCount)
+ {
+ $this->lineCount = $lineCount;
+
+ $this->content = null;
+ return $this;
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ThrowsTag.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ThrowsTag.php
new file mode 100644
index 00000000000..58ee44a42d2
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ThrowsTag.php
@@ -0,0 +1,24 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Reflection class for a @throws tag in a Docblock.
+ *
+ * @author Mike van Riel
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class ThrowsTag extends ReturnTag
+{
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/UsesTag.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/UsesTag.php
new file mode 100644
index 00000000000..da0d66381ec
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/UsesTag.php
@@ -0,0 +1,24 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Reflection class for a @uses tag in a Docblock.
+ *
+ * @author Mike van Riel
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class UsesTag extends SeeTag
+{
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/VarTag.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/VarTag.php
new file mode 100644
index 00000000000..236b2c8b01e
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/VarTag.php
@@ -0,0 +1,24 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Reflection class for a @var tag in a Docblock.
+ *
+ * @author Mike van Riel
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class VarTag extends ParamTag
+{
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/VersionTag.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/VersionTag.php
new file mode 100644
index 00000000000..260f6984f4d
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/VersionTag.php
@@ -0,0 +1,108 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+use phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Reflection class for a @version tag in a Docblock.
+ *
+ * @author Vasil Rangelov
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class VersionTag extends Tag
+{
+ /**
+ * PCRE regular expression matching a version vector.
+ * Assumes the "x" modifier.
+ */
+ const REGEX_VECTOR = '(?:
+ # Normal release vectors.
+ \d\S*
+ |
+ # VCS version vectors. Per PHPCS, they are expected to
+ # follow the form of the VCS name, followed by ":", followed
+ # by the version vector itself.
+ # By convention, popular VCSes like CVS, SVN and GIT use "$"
+ # around the actual version vector.
+ [^\s\:]+\:\s*\$[^\$]+\$
+ )';
+
+ /** @var string The version vector. */
+ protected $version = '';
+
+ public function getContent()
+ {
+ if (null === $this->content) {
+ $this->content = "{$this->version} {$this->description}";
+ }
+
+ return $this->content;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function setContent($content)
+ {
+ parent::setContent($content);
+
+ if (preg_match(
+ '/^
+ # The version vector
+ (' . self::REGEX_VECTOR . ')
+ \s*
+ # The description
+ (.+)?
+ $/sux',
+ $this->description,
+ $matches
+ )) {
+ $this->version = $matches[1];
+ $this->setDescription(isset($matches[2]) ? $matches[2] : '');
+ $this->content = $content;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Gets the version section of the tag.
+ *
+ * @return string The version section of the tag.
+ */
+ public function getVersion()
+ {
+ return $this->version;
+ }
+
+ /**
+ * Sets the version section of the tag.
+ *
+ * @param string $version The new version section of the tag.
+ * An invalid value will set an empty string.
+ *
+ * @return $this
+ */
+ public function setVersion($version)
+ {
+ $this->version
+ = preg_match('/^' . self::REGEX_VECTOR . '$/ux', $version)
+ ? $version
+ : '';
+
+ $this->content = null;
+ return $this;
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Type/Collection.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Type/Collection.php
new file mode 100644
index 00000000000..90ead3ff4e8
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Type/Collection.php
@@ -0,0 +1,221 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Type;
+
+use phpDocumentor\Reflection\DocBlock\Context;
+
+/**
+ * Collection
+ *
+ * @author Mike van Riel
+ * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class Collection extends \ArrayObject
+{
+ /** @var string Definition of the OR operator for types */
+ const OPERATOR_OR = '|';
+
+ /** @var string Definition of the ARRAY operator for types */
+ const OPERATOR_ARRAY = '[]';
+
+ /** @var string Definition of the NAMESPACE operator in PHP */
+ const OPERATOR_NAMESPACE = '\\';
+
+ /** @var string[] List of recognized keywords */
+ protected static $keywords = array(
+ 'string', 'int', 'integer', 'bool', 'boolean', 'float', 'double',
+ 'object', 'mixed', 'array', 'resource', 'void', 'null', 'scalar',
+ 'callback', 'callable', 'false', 'true', 'self', '$this', 'static'
+ );
+
+ /**
+ * Current invoking location.
+ *
+ * This is used to prepend to type with a relative location.
+ * May also be 'default' or 'global', in which case they are ignored.
+ *
+ * @var Context
+ */
+ protected $context = null;
+
+ /**
+ * Registers the namespace and aliases; uses that to add and expand the
+ * given types.
+ *
+ * @param string[] $types Array containing a list of types to add to this
+ * container.
+ * @param Context $location The current invoking location.
+ */
+ public function __construct(
+ array $types = array(),
+ Context $context = null
+ ) {
+ $this->context = null === $context ? new Context() : $context;
+
+ foreach ($types as $type) {
+ $this->add($type);
+ }
+ }
+
+ /**
+ * Returns the current invoking location.
+ *
+ * @return Context
+ */
+ public function getContext()
+ {
+ return $this->context;
+ }
+
+ /**
+ * Adds a new type to the collection and expands it if it contains a
+ * relative namespace.
+ *
+ * If a class in the type contains a relative namespace than this collection
+ * will try to expand that into a FQCN.
+ *
+ * @param string $type A 'Type' as defined in the phpDocumentor
+ * documentation.
+ *
+ * @throws \InvalidArgumentException if a non-string argument is passed.
+ *
+ * @see http://phpdoc.org/docs/latest/for-users/types.html for the
+ * definition of a type.
+ *
+ * @return void
+ */
+ public function add($type)
+ {
+ if (!is_string($type)) {
+ throw new \InvalidArgumentException(
+ 'A type should be represented by a string, received: '
+ .var_export($type, true)
+ );
+ }
+
+ // separate the type by the OR operator
+ $type_parts = explode(self::OPERATOR_OR, $type);
+ foreach ($type_parts as $part) {
+ $expanded_type = $this->expand($part);
+ if ($expanded_type) {
+ $this[] = $expanded_type;
+ }
+ }
+ }
+
+ /**
+ * Returns a string representation of the collection.
+ *
+ * @return string The resolved types across the collection, separated with
+ * {@link self::OPERATOR_OR}.
+ */
+ public function __toString()
+ {
+ return implode(self::OPERATOR_OR, $this->getArrayCopy());
+ }
+
+ /**
+ * Analyzes the given type and returns the FQCN variant.
+ *
+ * When a type is provided this method checks whether it is not a keyword or
+ * Fully Qualified Class Name. If so it will use the given namespace and
+ * aliases to expand the type to a FQCN representation.
+ *
+ * This method only works as expected if the namespace and aliases are set;
+ * no dynamic reflection is being performed here.
+ *
+ * @param string $type The relative or absolute type.
+ *
+ * @uses getNamespace to determine with what to prefix the type name.
+ * @uses getNamespaceAliases to check whether the first part of the relative
+ * type name should not be replaced with another namespace.
+ *
+ * @return string
+ */
+ protected function expand($type)
+ {
+ $type = trim($type);
+ if (!$type) {
+ return '';
+ }
+
+ if ($this->isTypeAnArray($type)) {
+ return $this->expand(substr($type, 0, -2)) . self::OPERATOR_ARRAY;
+ }
+
+ if ($this->isRelativeType($type) && !$this->isTypeAKeyword($type)) {
+ $type_parts = explode(self::OPERATOR_NAMESPACE, $type, 2);
+
+ $namespace_aliases = $this->context->getNamespaceAliases();
+ // if the first segment is not an alias; prepend namespace name and
+ // return
+ if (!isset($namespace_aliases[$type_parts[0]])) {
+ $namespace = $this->context->getNamespace();
+ if ('' !== $namespace) {
+ $namespace .= self::OPERATOR_NAMESPACE;
+ }
+ return self::OPERATOR_NAMESPACE . $namespace . $type;
+ }
+
+ $type_parts[0] = $namespace_aliases[$type_parts[0]];
+ $type = implode(self::OPERATOR_NAMESPACE, $type_parts);
+ }
+
+ return $type;
+ }
+
+ /**
+ * Detects whether the given type represents an array.
+ *
+ * @param string $type A relative or absolute type as defined in the
+ * phpDocumentor documentation.
+ *
+ * @return bool
+ */
+ protected function isTypeAnArray($type)
+ {
+ return substr($type, -2) === self::OPERATOR_ARRAY;
+ }
+
+ /**
+ * Detects whether the given type represents a PHPDoc keyword.
+ *
+ * @param string $type A relative or absolute type as defined in the
+ * phpDocumentor documentation.
+ *
+ * @return bool
+ */
+ protected function isTypeAKeyword($type)
+ {
+ return in_array(strtolower($type), static::$keywords, true);
+ }
+
+ /**
+ * Detects whether the given type represents a relative or absolute path.
+ *
+ * This method will detect keywords as being absolute; even though they are
+ * not preceeded by a namespace separator.
+ *
+ * @param string $type A relative or absolute type as defined in the
+ * phpDocumentor documentation.
+ *
+ * @return bool
+ */
+ protected function isRelativeType($type)
+ {
+ return ($type[0] !== self::OPERATOR_NAMESPACE)
+ || $this->isTypeAKeyword($type);
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/DescriptionTest.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/DescriptionTest.php
new file mode 100644
index 00000000000..a6ca7b37e40
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/DescriptionTest.php
@@ -0,0 +1,245 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock;
+
+/**
+ * Test class for \phpDocumentor\Reflection\DocBlock\Description
+ *
+ * @author Vasil Rangelov
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class DescriptionTest extends \PHPUnit_Framework_TestCase
+{
+ public function testConstruct()
+ {
+ $fixture = <<assertSame($fixture, $object->getContents());
+
+ $parsedContents = $object->getParsedContents();
+ $this->assertCount(1, $parsedContents);
+ $this->assertSame($fixture, $parsedContents[0]);
+ }
+
+ public function testInlineTagParsing()
+ {
+ $fixture = <<assertSame($fixture, $object->getContents());
+
+ $parsedContents = $object->getParsedContents();
+ $this->assertCount(3, $parsedContents);
+ $this->assertSame('This is text for a ', $parsedContents[0]);
+ $this->assertInstanceOf(
+ __NAMESPACE__ . '\Tag\LinkTag',
+ $parsedContents[1]
+ );
+ $this->assertSame(
+ ' that uses inline
+tags.',
+ $parsedContents[2]
+ );
+ }
+
+ public function testInlineTagAtStartParsing()
+ {
+ $fixture = <<assertSame($fixture, $object->getContents());
+
+ $parsedContents = $object->getParsedContents();
+ $this->assertCount(3, $parsedContents);
+
+ $this->assertSame('', $parsedContents[0]);
+ $this->assertInstanceOf(
+ __NAMESPACE__ . '\Tag\LinkTag',
+ $parsedContents[1]
+ );
+ $this->assertSame(
+ ' is text for a description that uses inline
+tags.',
+ $parsedContents[2]
+ );
+ }
+
+ public function testNestedInlineTagParsing()
+ {
+ $fixture = <<assertSame($fixture, $object->getContents());
+
+ $parsedContents = $object->getParsedContents();
+ $this->assertCount(3, $parsedContents);
+
+ $this->assertSame(
+ 'This is text for a description with ',
+ $parsedContents[0]
+ );
+ $this->assertInstanceOf(
+ __NAMESPACE__ . '\Tag',
+ $parsedContents[1]
+ );
+ $this->assertSame('.', $parsedContents[2]);
+
+ $parsedDescription = $parsedContents[1]->getParsedDescription();
+ $this->assertCount(3, $parsedDescription);
+ $this->assertSame("inline tag with\n", $parsedDescription[0]);
+ $this->assertInstanceOf(
+ __NAMESPACE__ . '\Tag\LinkTag',
+ $parsedDescription[1]
+ );
+ $this->assertSame(' in it', $parsedDescription[2]);
+ }
+
+ public function testLiteralOpeningDelimiter()
+ {
+ $fixture = <<assertSame($fixture, $object->getContents());
+
+ $parsedContents = $object->getParsedContents();
+ $this->assertCount(1, $parsedContents);
+ $this->assertSame($fixture, $parsedContents[0]);
+ }
+
+ public function testNestedLiteralOpeningDelimiter()
+ {
+ $fixture = <<assertSame($fixture, $object->getContents());
+
+ $parsedContents = $object->getParsedContents();
+ $this->assertCount(3, $parsedContents);
+ $this->assertSame(
+ 'This is text for a description containing ',
+ $parsedContents[0]
+ );
+ $this->assertInstanceOf(
+ __NAMESPACE__ . '\Tag',
+ $parsedContents[1]
+ );
+ $this->assertSame('.', $parsedContents[2]);
+
+ $this->assertSame(
+ array('inline tag that has { that
+is literal'),
+ $parsedContents[1]->getParsedDescription()
+ );
+ }
+
+ public function testLiteralClosingDelimiter()
+ {
+ $fixture = <<assertSame($fixture, $object->getContents());
+
+ $parsedContents = $object->getParsedContents();
+ $this->assertCount(1, $parsedContents);
+ $this->assertSame(
+ 'This is text for a description with } that is not a tag.',
+ $parsedContents[0]
+ );
+ }
+
+ public function testNestedLiteralClosingDelimiter()
+ {
+ $fixture = <<assertSame($fixture, $object->getContents());
+
+ $parsedContents = $object->getParsedContents();
+ $this->assertCount(3, $parsedContents);
+ $this->assertSame(
+ 'This is text for a description with ',
+ $parsedContents[0]
+ );
+ $this->assertInstanceOf(
+ __NAMESPACE__ . '\Tag',
+ $parsedContents[1]
+ );
+ $this->assertSame('.', $parsedContents[2]);
+
+ $this->assertSame(
+ array('inline tag with } that is not an
+inline tag'),
+ $parsedContents[1]->getParsedDescription()
+ );
+ }
+
+ public function testInlineTagEscapingSequence()
+ {
+ $fixture = <<assertSame($fixture, $object->getContents());
+
+ $parsedContents = $object->getParsedContents();
+ $this->assertCount(1, $parsedContents);
+ $this->assertSame(
+ 'This is text for a description with literal {@link}.',
+ $parsedContents[0]
+ );
+ }
+
+ public function testNestedInlineTagEscapingSequence()
+ {
+ $fixture = <<assertSame($fixture, $object->getContents());
+
+ $parsedContents = $object->getParsedContents();
+ $this->assertCount(3, $parsedContents);
+ $this->assertSame(
+ 'This is text for a description with an ',
+ $parsedContents[0]
+ );
+ $this->assertInstanceOf(
+ __NAMESPACE__ . '\Tag',
+ $parsedContents[1]
+ );
+ $this->assertSame('.', $parsedContents[2]);
+
+ $this->assertSame(
+ array('inline tag with literal
+{@link} in it'),
+ $parsedContents[1]->getParsedDescription()
+ );
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/CoversTagTest.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/CoversTagTest.php
new file mode 100644
index 00000000000..ff257aa197c
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/CoversTagTest.php
@@ -0,0 +1,86 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Test class for \phpDocumentor\Reflection\DocBlock\Tag\CoversTag
+ *
+ * @author Daniel O'Connor
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class CoversTagTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * Test that the \phpDocumentor\Reflection\DocBlock\Tag\CoversTag can create
+ * a link for the covers doc block.
+ *
+ * @param string $type
+ * @param string $content
+ * @param string $exContent
+ * @param string $exReference
+ *
+ * @covers \phpDocumentor\Reflection\DocBlock\Tag\CoversTag
+ * @dataProvider provideDataForConstuctor
+ *
+ * @return void
+ */
+ public function testConstructorParesInputsIntoCorrectFields(
+ $type,
+ $content,
+ $exContent,
+ $exDescription,
+ $exReference
+ ) {
+ $tag = new CoversTag($type, $content);
+
+ $this->assertEquals($type, $tag->getName());
+ $this->assertEquals($exContent, $tag->getContent());
+ $this->assertEquals($exDescription, $tag->getDescription());
+ $this->assertEquals($exReference, $tag->getReference());
+ }
+
+ /**
+ * Data provider for testConstructorParesInputsIntoCorrectFields
+ *
+ * @return array
+ */
+ public function provideDataForConstuctor()
+ {
+ // $type, $content, $exContent, $exDescription, $exReference
+ return array(
+ array(
+ 'covers',
+ 'Foo::bar()',
+ 'Foo::bar()',
+ '',
+ 'Foo::bar()'
+ ),
+ array(
+ 'covers',
+ 'Foo::bar() Testing',
+ 'Foo::bar() Testing',
+ 'Testing',
+ 'Foo::bar()',
+ ),
+ array(
+ 'covers',
+ 'Foo::bar() Testing comments',
+ 'Foo::bar() Testing comments',
+ 'Testing comments',
+ 'Foo::bar()',
+ ),
+ );
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/DeprecatedTagTest.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/DeprecatedTagTest.php
new file mode 100644
index 00000000000..7a75e79ce55
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/DeprecatedTagTest.php
@@ -0,0 +1,115 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Test class for \phpDocumentor\Reflection\DocBlock\Tag\DeprecatedTag
+ *
+ * @author Vasil Rangelov
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class DeprecatedTagTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * Test that the \phpDocumentor\Reflection\DocBlock\Tag\LinkTag can create
+ * a link for the @deprecated doc block.
+ *
+ * @param string $type
+ * @param string $content
+ * @param string $exContent
+ * @param string $exDescription
+ * @param string $exVersion
+ *
+ * @covers \phpDocumentor\Reflection\DocBlock\Tag\DeprecatedTag
+ * @dataProvider provideDataForConstuctor
+ *
+ * @return void
+ */
+ public function testConstructorParesInputsIntoCorrectFields(
+ $type,
+ $content,
+ $exContent,
+ $exDescription,
+ $exVersion
+ ) {
+ $tag = new DeprecatedTag($type, $content);
+
+ $this->assertEquals($type, $tag->getName());
+ $this->assertEquals($exContent, $tag->getContent());
+ $this->assertEquals($exDescription, $tag->getDescription());
+ $this->assertEquals($exVersion, $tag->getVersion());
+ }
+
+ /**
+ * Data provider for testConstructorParesInputsIntoCorrectFields
+ *
+ * @return array
+ */
+ public function provideDataForConstuctor()
+ {
+ // $type, $content, $exContent, $exDescription, $exVersion
+ return array(
+ array(
+ 'deprecated',
+ '1.0 First release.',
+ '1.0 First release.',
+ 'First release.',
+ '1.0'
+ ),
+ array(
+ 'deprecated',
+ "1.0\nFirst release.",
+ "1.0\nFirst release.",
+ 'First release.',
+ '1.0'
+ ),
+ array(
+ 'deprecated',
+ "1.0\nFirst\nrelease.",
+ "1.0\nFirst\nrelease.",
+ "First\nrelease.",
+ '1.0'
+ ),
+ array(
+ 'deprecated',
+ 'Unfinished release',
+ 'Unfinished release',
+ 'Unfinished release',
+ ''
+ ),
+ array(
+ 'deprecated',
+ '1.0',
+ '1.0',
+ '',
+ '1.0'
+ ),
+ array(
+ 'deprecated',
+ 'GIT: $Id$',
+ 'GIT: $Id$',
+ '',
+ 'GIT: $Id$'
+ ),
+ array(
+ 'deprecated',
+ 'GIT: $Id$ Dev build',
+ 'GIT: $Id$ Dev build',
+ 'Dev build',
+ 'GIT: $Id$'
+ )
+ );
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ExampleTagTest.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ExampleTagTest.php
new file mode 100644
index 00000000000..519a61b3a9f
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ExampleTagTest.php
@@ -0,0 +1,203 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Test class for \phpDocumentor\Reflection\DocBlock\Tag\ExampleTag
+ *
+ * @author Vasil Rangelov
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class ExampleTagTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * Test that the \phpDocumentor\Reflection\DocBlock\Tag\SourceTag can
+ * understand the @source DocBlock.
+ *
+ * @param string $type
+ * @param string $content
+ * @param string $exContent
+ * @param string $exStartingLine
+ * @param string $exLineCount
+ * @param string $exFilepath
+ *
+ * @covers \phpDocumentor\Reflection\DocBlock\Tag\ExampleTag
+ * @dataProvider provideDataForConstuctor
+ *
+ * @return void
+ */
+ public function testConstructorParesInputsIntoCorrectFields(
+ $type,
+ $content,
+ $exContent,
+ $exDescription,
+ $exStartingLine,
+ $exLineCount,
+ $exFilePath
+ ) {
+ $tag = new ExampleTag($type, $content);
+
+ $this->assertEquals($type, $tag->getName());
+ $this->assertEquals($exContent, $tag->getContent());
+ $this->assertEquals($exDescription, $tag->getDescription());
+ $this->assertEquals($exStartingLine, $tag->getStartingLine());
+ $this->assertEquals($exLineCount, $tag->getLineCount());
+ $this->assertEquals($exFilePath, $tag->getFilePath());
+ }
+
+ /**
+ * Data provider for testConstructorParesInputsIntoCorrectFields
+ *
+ * @return array
+ */
+ public function provideDataForConstuctor()
+ {
+ // $type,
+ // $content,
+ // $exContent,
+ // $exDescription,
+ // $exStartingLine,
+ // $exLineCount,
+ // $exFilePath
+ return array(
+ array(
+ 'example',
+ 'file.php',
+ 'file.php',
+ '',
+ 1,
+ null,
+ 'file.php'
+ ),
+ array(
+ 'example',
+ 'Testing comments',
+ 'Testing comments',
+ 'comments',
+ 1,
+ null,
+ 'Testing'
+ ),
+ array(
+ 'example',
+ 'file.php 2 Testing',
+ 'file.php 2 Testing',
+ 'Testing',
+ 2,
+ null,
+ 'file.php'
+ ),
+ array(
+ 'example',
+ 'file.php 2 3 Testing comments',
+ 'file.php 2 3 Testing comments',
+ 'Testing comments',
+ 2,
+ 3,
+ 'file.php'
+ ),
+ array(
+ 'example',
+ 'file.php 2 -1 Testing comments',
+ 'file.php 2 -1 Testing comments',
+ '-1 Testing comments',
+ 2,
+ null,
+ 'file.php'
+ ),
+ array(
+ 'example',
+ 'file.php -1 1 Testing comments',
+ 'file.php -1 1 Testing comments',
+ '-1 1 Testing comments',
+ 1,
+ null,
+ 'file.php'
+ ),
+ array(
+ 'example',
+ '"file with spaces.php" Testing comments',
+ '"file with spaces.php" Testing comments',
+ 'Testing comments',
+ 1,
+ null,
+ 'file with spaces.php'
+ ),
+ array(
+ 'example',
+ '"file with spaces.php" 2 Testing comments',
+ '"file with spaces.php" 2 Testing comments',
+ 'Testing comments',
+ 2,
+ null,
+ 'file with spaces.php'
+ ),
+ array(
+ 'example',
+ '"file with spaces.php" 2 3 Testing comments',
+ '"file with spaces.php" 2 3 Testing comments',
+ 'Testing comments',
+ 2,
+ 3,
+ 'file with spaces.php'
+ ),
+ array(
+ 'example',
+ '"file with spaces.php" 2 -3 Testing comments',
+ '"file with spaces.php" 2 -3 Testing comments',
+ '-3 Testing comments',
+ 2,
+ null,
+ 'file with spaces.php'
+ ),
+ array(
+ 'example',
+ '"file with spaces.php" -2 3 Testing comments',
+ '"file with spaces.php" -2 3 Testing comments',
+ '-2 3 Testing comments',
+ 1,
+ null,
+ 'file with spaces.php'
+ ),
+ array(
+ 'example',
+ 'file%20with%20spaces.php Testing comments',
+ 'file%20with%20spaces.php Testing comments',
+ 'Testing comments',
+ 1,
+ null,
+ 'file with spaces.php'
+ ),
+ array(
+ 'example',
+ 'folder/file%20with%20spaces.php Testing comments',
+ 'folder/file%20with%20spaces.php Testing comments',
+ 'Testing comments',
+ 1,
+ null,
+ 'folder/file with spaces.php'
+ ),
+ array(
+ 'example',
+ 'http://example.com/file%20with%20spaces.php Testing comments',
+ 'http://example.com/file%20with%20spaces.php Testing comments',
+ 'Testing comments',
+ 1,
+ null,
+ 'http://example.com/file%20with%20spaces.php'
+ )
+ );
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/LinkTagTest.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/LinkTagTest.php
new file mode 100644
index 00000000000..0c64ed086ee
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/LinkTagTest.php
@@ -0,0 +1,87 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Test class for \phpDocumentor\Reflection\DocBlock\Tag\LinkTag
+ *
+ * @author Ben Selby
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class LinkTagTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * Test that the \phpDocumentor\Reflection\DocBlock\Tag\LinkTag can create
+ * a link for the @link doc block.
+ *
+ * @param string $type
+ * @param string $content
+ * @param string $exContent
+ * @param string $exDescription
+ * @param string $exLink
+ *
+ * @covers \phpDocumentor\Reflection\DocBlock\Tag\LinkTag
+ * @dataProvider provideDataForConstuctor
+ *
+ * @return void
+ */
+ public function testConstructorParesInputsIntoCorrectFields(
+ $type,
+ $content,
+ $exContent,
+ $exDescription,
+ $exLink
+ ) {
+ $tag = new LinkTag($type, $content);
+
+ $this->assertEquals($type, $tag->getName());
+ $this->assertEquals($exContent, $tag->getContent());
+ $this->assertEquals($exDescription, $tag->getDescription());
+ $this->assertEquals($exLink, $tag->getLink());
+ }
+
+ /**
+ * Data provider for testConstructorParesInputsIntoCorrectFields
+ *
+ * @return array
+ */
+ public function provideDataForConstuctor()
+ {
+ // $type, $content, $exContent, $exDescription, $exLink
+ return array(
+ array(
+ 'link',
+ 'http://www.phpdoc.org/',
+ 'http://www.phpdoc.org/',
+ 'http://www.phpdoc.org/',
+ 'http://www.phpdoc.org/'
+ ),
+ array(
+ 'link',
+ 'http://www.phpdoc.org/ Testing',
+ 'http://www.phpdoc.org/ Testing',
+ 'Testing',
+ 'http://www.phpdoc.org/'
+ ),
+ array(
+ 'link',
+ 'http://www.phpdoc.org/ Testing comments',
+ 'http://www.phpdoc.org/ Testing comments',
+ 'Testing comments',
+ 'http://www.phpdoc.org/'
+ ),
+ );
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/MethodTagTest.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/MethodTagTest.php
new file mode 100644
index 00000000000..efc3a15b538
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/MethodTagTest.php
@@ -0,0 +1,146 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Test class for \phpDocumentor\Reflection\DocBlock\Tag\MethodTag
+ *
+ * @author Mike van Riel
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class MethodTagTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * @param string $signature The signature to test.
+ * @param bool $valid Whether the given signature is expected to
+ * be valid.
+ * @param string $expected_name The method name that is expected from this
+ * signature.
+ * @param string $expected_return The return type that is expected from this
+ * signature.
+ * @param bool $paramCount Number of parameters in the signature.
+ * @param string $description The short description mentioned in the
+ * signature.
+ *
+ * @covers \phpDocumentor\Reflection\DocBlock\Tag\MethodTag
+ * @dataProvider getTestSignatures
+ *
+ * @return void
+ */
+ public function testConstruct(
+ $signature,
+ $valid,
+ $expected_name,
+ $expected_return,
+ $expected_isStatic,
+ $paramCount,
+ $description
+ ) {
+ ob_start();
+ $tag = new MethodTag('method', $signature);
+ $stdout = ob_get_clean();
+
+ $this->assertSame(
+ $valid,
+ empty($stdout),
+ 'No error should have been output if the signature is valid'
+ );
+
+ if (!$valid) {
+ return;
+ }
+
+ $this->assertEquals($expected_name, $tag->getMethodName());
+ $this->assertEquals($expected_return, $tag->getType());
+ $this->assertEquals($description, $tag->getDescription());
+ $this->assertEquals($expected_isStatic, $tag->isStatic());
+ $this->assertCount($paramCount, $tag->getArguments());
+ }
+
+ public function getTestSignatures()
+ {
+ return array(
+ // TODO: Verify this case
+// array(
+// 'foo',
+// false, 'foo', '', false, 0, ''
+// ),
+ array(
+ 'foo()',
+ true, 'foo', 'void', false, 0, ''
+ ),
+ array(
+ 'foo() description',
+ true, 'foo', 'void', false, 0, 'description'
+ ),
+ array(
+ 'int foo()',
+ true, 'foo', 'int', false, 0, ''
+ ),
+ array(
+ 'int foo() description',
+ true, 'foo', 'int', false, 0, 'description'
+ ),
+ array(
+ 'int foo($a, $b)',
+ true, 'foo', 'int', false, 2, ''
+ ),
+ array(
+ 'int foo() foo(int $a, int $b)',
+ true, 'foo', 'int', false, 2, ''
+ ),
+ array(
+ 'int foo(int $a, int $b)',
+ true, 'foo', 'int', false, 2, ''
+ ),
+ array(
+ 'null|int foo(int $a, int $b)',
+ true, 'foo', 'null|int', false, 2, ''
+ ),
+ array(
+ 'int foo(null|int $a, int $b)',
+ true, 'foo', 'int', false, 2, ''
+ ),
+ array(
+ '\Exception foo() foo(Exception $a, Exception $b)',
+ true, 'foo', '\Exception', false, 2, ''
+ ),
+ array(
+ 'int foo() foo(Exception $a, Exception $b) description',
+ true, 'foo', 'int', false, 2, 'description'
+ ),
+ array(
+ 'int foo() foo(\Exception $a, \Exception $b) description',
+ true, 'foo', 'int', false, 2, 'description'
+ ),
+ array(
+ 'void()',
+ true, 'void', 'void', false, 0, ''
+ ),
+ array(
+ 'static foo()',
+ true, 'foo', 'static', false, 0, ''
+ ),
+ array(
+ 'static void foo()',
+ true, 'foo', 'void', true, 0, ''
+ ),
+ array(
+ 'static static foo()',
+ true, 'foo', 'static', true, 0, ''
+ )
+ );
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ParamTagTest.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ParamTagTest.php
new file mode 100644
index 00000000000..0e05382fabe
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ParamTagTest.php
@@ -0,0 +1,118 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Test class for \phpDocumentor\Reflection\DocBlock\ParamTag
+ *
+ * @author Mike van Riel
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class ParamTagTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * Test that the \phpDocumentor\Reflection\DocBlock\Tag\ParamTag can
+ * understand the @param DocBlock.
+ *
+ * @param string $type
+ * @param string $content
+ * @param string $extractedType
+ * @param string $extractedTypes
+ * @param string $extractedVarName
+ * @param string $extractedDescription
+ *
+ * @covers \phpDocumentor\Reflection\DocBlock\Tag\ParamTag
+ * @dataProvider provideDataForConstructor
+ *
+ * @return void
+ */
+ public function testConstructorParsesInputsIntoCorrectFields(
+ $type,
+ $content,
+ $extractedType,
+ $extractedTypes,
+ $extractedVarName,
+ $extractedDescription
+ ) {
+ $tag = new ParamTag($type, $content);
+
+ $this->assertEquals($type, $tag->getName());
+ $this->assertEquals($extractedType, $tag->getType());
+ $this->assertEquals($extractedTypes, $tag->getTypes());
+ $this->assertEquals($extractedVarName, $tag->getVariableName());
+ $this->assertEquals($extractedDescription, $tag->getDescription());
+ }
+
+ /**
+ * Data provider for testConstructorParsesInputsIntoCorrectFields()
+ *
+ * @return array
+ */
+ public function provideDataForConstructor()
+ {
+ return array(
+ array('param', 'int', 'int', array('int'), '', ''),
+ array('param', '$bob', '', array(), '$bob', ''),
+ array(
+ 'param',
+ 'int Number of bobs',
+ 'int',
+ array('int'),
+ '',
+ 'Number of bobs'
+ ),
+ array(
+ 'param',
+ 'int $bob',
+ 'int',
+ array('int'),
+ '$bob',
+ ''
+ ),
+ array(
+ 'param',
+ 'int $bob Number of bobs',
+ 'int',
+ array('int'),
+ '$bob',
+ 'Number of bobs'
+ ),
+ array(
+ 'param',
+ "int Description \n on multiple lines",
+ 'int',
+ array('int'),
+ '',
+ "Description \n on multiple lines"
+ ),
+ array(
+ 'param',
+ "int \n\$bob Variable name on a new line",
+ 'int',
+ array('int'),
+ '$bob',
+ "Variable name on a new line"
+ ),
+ array(
+ 'param',
+ "\nint \$bob Type on a new line",
+ 'int',
+ array('int'),
+ '$bob',
+ "Type on a new line"
+ )
+ );
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ReturnTagTest.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ReturnTagTest.php
new file mode 100644
index 00000000000..9e2aec0d190
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ReturnTagTest.php
@@ -0,0 +1,102 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Test class for \phpDocumentor\Reflection\DocBlock\ReturnTag
+ *
+ * @author Mike van Riel
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class ReturnTagTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * Test that the \phpDocumentor\Reflection\DocBlock\Tag\ReturnTag can
+ * understand the @return DocBlock.
+ *
+ * @param string $type
+ * @param string $content
+ * @param string $extractedType
+ * @param string $extractedTypes
+ * @param string $extractedDescription
+ *
+ * @covers \phpDocumentor\Reflection\DocBlock\Tag\ReturnTag
+ * @dataProvider provideDataForConstructor
+ *
+ * @return void
+ */
+ public function testConstructorParsesInputsIntoCorrectFields(
+ $type,
+ $content,
+ $extractedType,
+ $extractedTypes,
+ $extractedDescription
+ ) {
+ $tag = new ReturnTag($type, $content);
+
+ $this->assertEquals($type, $tag->getName());
+ $this->assertEquals($extractedType, $tag->getType());
+ $this->assertEquals($extractedTypes, $tag->getTypes());
+ $this->assertEquals($extractedDescription, $tag->getDescription());
+ }
+
+ /**
+ * Data provider for testConstructorParsesInputsIntoCorrectFields()
+ *
+ * @return array
+ */
+ public function provideDataForConstructor()
+ {
+ return array(
+ array('return', '', '', array(), ''),
+ array('return', 'int', 'int', array('int'), ''),
+ array(
+ 'return',
+ 'int Number of Bobs',
+ 'int',
+ array('int'),
+ 'Number of Bobs'
+ ),
+ array(
+ 'return',
+ 'int|double Number of Bobs',
+ 'int|double',
+ array('int', 'double'),
+ 'Number of Bobs'
+ ),
+ array(
+ 'return',
+ "int Number of \n Bobs",
+ 'int',
+ array('int'),
+ "Number of \n Bobs"
+ ),
+ array(
+ 'return',
+ " int Number of Bobs",
+ 'int',
+ array('int'),
+ "Number of Bobs"
+ ),
+ array(
+ 'return',
+ "int\nNumber of Bobs",
+ 'int',
+ array('int'),
+ "Number of Bobs"
+ )
+ );
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SeeTagTest.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SeeTagTest.php
new file mode 100644
index 00000000000..6829b04605b
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SeeTagTest.php
@@ -0,0 +1,86 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Test class for \phpDocumentor\Reflection\DocBlock\Tag\SeeTag
+ *
+ * @author Daniel O'Connor
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class SeeTagTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * Test that the phpDocumentor_Reflection_DocBlock_Tag_See can create a link
+ * for the @see doc block.
+ *
+ * @param string $type
+ * @param string $content
+ * @param string $exContent
+ * @param string $exReference
+ *
+ * @covers \phpDocumentor\Reflection\DocBlock\Tag\SeeTag
+ * @dataProvider provideDataForConstuctor
+ *
+ * @return void
+ */
+ public function testConstructorParesInputsIntoCorrectFields(
+ $type,
+ $content,
+ $exContent,
+ $exDescription,
+ $exReference
+ ) {
+ $tag = new SeeTag($type, $content);
+
+ $this->assertEquals($type, $tag->getName());
+ $this->assertEquals($exContent, $tag->getContent());
+ $this->assertEquals($exDescription, $tag->getDescription());
+ $this->assertEquals($exReference, $tag->getReference());
+ }
+
+ /**
+ * Data provider for testConstructorParesInputsIntoCorrectFields
+ *
+ * @return array
+ */
+ public function provideDataForConstuctor()
+ {
+ // $type, $content, $exContent, $exDescription, $exReference
+ return array(
+ array(
+ 'see',
+ 'Foo::bar()',
+ 'Foo::bar()',
+ '',
+ 'Foo::bar()'
+ ),
+ array(
+ 'see',
+ 'Foo::bar() Testing',
+ 'Foo::bar() Testing',
+ 'Testing',
+ 'Foo::bar()',
+ ),
+ array(
+ 'see',
+ 'Foo::bar() Testing comments',
+ 'Foo::bar() Testing comments',
+ 'Testing comments',
+ 'Foo::bar()',
+ ),
+ );
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SinceTagTest.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SinceTagTest.php
new file mode 100644
index 00000000000..8caf25d1cf0
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SinceTagTest.php
@@ -0,0 +1,115 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Test class for \phpDocumentor\Reflection\DocBlock\Tag\SinceTag
+ *
+ * @author Vasil Rangelov
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class SinceTagTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * Test that the \phpDocumentor\Reflection\DocBlock\Tag\LinkTag can create
+ * a link for the @since doc block.
+ *
+ * @param string $type
+ * @param string $content
+ * @param string $exContent
+ * @param string $exDescription
+ * @param string $exVersion
+ *
+ * @covers \phpDocumentor\Reflection\DocBlock\Tag\SinceTag
+ * @dataProvider provideDataForConstuctor
+ *
+ * @return void
+ */
+ public function testConstructorParesInputsIntoCorrectFields(
+ $type,
+ $content,
+ $exContent,
+ $exDescription,
+ $exVersion
+ ) {
+ $tag = new SinceTag($type, $content);
+
+ $this->assertEquals($type, $tag->getName());
+ $this->assertEquals($exContent, $tag->getContent());
+ $this->assertEquals($exDescription, $tag->getDescription());
+ $this->assertEquals($exVersion, $tag->getVersion());
+ }
+
+ /**
+ * Data provider for testConstructorParesInputsIntoCorrectFields
+ *
+ * @return array
+ */
+ public function provideDataForConstuctor()
+ {
+ // $type, $content, $exContent, $exDescription, $exVersion
+ return array(
+ array(
+ 'since',
+ '1.0 First release.',
+ '1.0 First release.',
+ 'First release.',
+ '1.0'
+ ),
+ array(
+ 'since',
+ "1.0\nFirst release.",
+ "1.0\nFirst release.",
+ 'First release.',
+ '1.0'
+ ),
+ array(
+ 'since',
+ "1.0\nFirst\nrelease.",
+ "1.0\nFirst\nrelease.",
+ "First\nrelease.",
+ '1.0'
+ ),
+ array(
+ 'since',
+ 'Unfinished release',
+ 'Unfinished release',
+ 'Unfinished release',
+ ''
+ ),
+ array(
+ 'since',
+ '1.0',
+ '1.0',
+ '',
+ '1.0'
+ ),
+ array(
+ 'since',
+ 'GIT: $Id$',
+ 'GIT: $Id$',
+ '',
+ 'GIT: $Id$'
+ ),
+ array(
+ 'since',
+ 'GIT: $Id$ Dev build',
+ 'GIT: $Id$ Dev build',
+ 'Dev build',
+ 'GIT: $Id$'
+ )
+ );
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SourceTagTest.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SourceTagTest.php
new file mode 100644
index 00000000000..2a40e0aa3bf
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SourceTagTest.php
@@ -0,0 +1,116 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Test class for \phpDocumentor\Reflection\DocBlock\Tag\SourceTag
+ *
+ * @author Vasil Rangelov
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class SourceTagTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * Test that the \phpDocumentor\Reflection\DocBlock\Tag\SourceTag can
+ * understand the @source DocBlock.
+ *
+ * @param string $type
+ * @param string $content
+ * @param string $exContent
+ * @param string $exStartingLine
+ * @param string $exLineCount
+ *
+ * @covers \phpDocumentor\Reflection\DocBlock\Tag\SourceTag
+ * @dataProvider provideDataForConstuctor
+ *
+ * @return void
+ */
+ public function testConstructorParesInputsIntoCorrectFields(
+ $type,
+ $content,
+ $exContent,
+ $exDescription,
+ $exStartingLine,
+ $exLineCount
+ ) {
+ $tag = new SourceTag($type, $content);
+
+ $this->assertEquals($type, $tag->getName());
+ $this->assertEquals($exContent, $tag->getContent());
+ $this->assertEquals($exDescription, $tag->getDescription());
+ $this->assertEquals($exStartingLine, $tag->getStartingLine());
+ $this->assertEquals($exLineCount, $tag->getLineCount());
+ }
+
+ /**
+ * Data provider for testConstructorParesInputsIntoCorrectFields
+ *
+ * @return array
+ */
+ public function provideDataForConstuctor()
+ {
+ // $type, $content, $exContent, $exDescription, $exStartingLine, $exLineCount
+ return array(
+ array(
+ 'source',
+ '2',
+ '2',
+ '',
+ 2,
+ null
+ ),
+ array(
+ 'source',
+ 'Testing',
+ 'Testing',
+ 'Testing',
+ 1,
+ null
+ ),
+ array(
+ 'source',
+ '2 Testing',
+ '2 Testing',
+ 'Testing',
+ 2,
+ null
+ ),
+ array(
+ 'source',
+ '2 3 Testing comments',
+ '2 3 Testing comments',
+ 'Testing comments',
+ 2,
+ 3
+ ),
+ array(
+ 'source',
+ '2 -1 Testing comments',
+ '2 -1 Testing comments',
+ '-1 Testing comments',
+ 2,
+ null
+ ),
+ array(
+ 'source',
+ '-1 1 Testing comments',
+ '-1 1 Testing comments',
+ '-1 1 Testing comments',
+ 1,
+ null
+ )
+ );
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ThrowsTagTest.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ThrowsTagTest.php
new file mode 100644
index 00000000000..3c669d5583c
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ThrowsTagTest.php
@@ -0,0 +1,102 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Test class for \phpDocumentor\Reflection\DocBlock\ThrowsTag
+ *
+ * @author Mike van Riel
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class ThrowsTagTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * Test that the \phpDocumentor\Reflection\DocBlock\Tag\ThrowsTag can
+ * understand the @throws DocBlock.
+ *
+ * @param string $type
+ * @param string $content
+ * @param string $extractedType
+ * @param string $extractedTypes
+ * @param string $extractedDescription
+ *
+ * @covers \phpDocumentor\Reflection\DocBlock\Tag\ThrowsTag
+ * @dataProvider provideDataForConstructor
+ *
+ * @return void
+ */
+ public function testConstructorParsesInputsIntoCorrectFields(
+ $type,
+ $content,
+ $extractedType,
+ $extractedTypes,
+ $extractedDescription
+ ) {
+ $tag = new ThrowsTag($type, $content);
+
+ $this->assertEquals($type, $tag->getName());
+ $this->assertEquals($extractedType, $tag->getType());
+ $this->assertEquals($extractedTypes, $tag->getTypes());
+ $this->assertEquals($extractedDescription, $tag->getDescription());
+ }
+
+ /**
+ * Data provider for testConstructorParsesInputsIntoCorrectFields()
+ *
+ * @return array
+ */
+ public function provideDataForConstructor()
+ {
+ return array(
+ array('throws', '', '', array(), ''),
+ array('throws', 'int', 'int', array('int'), ''),
+ array(
+ 'throws',
+ 'int Number of Bobs',
+ 'int',
+ array('int'),
+ 'Number of Bobs'
+ ),
+ array(
+ 'throws',
+ 'int|double Number of Bobs',
+ 'int|double',
+ array('int', 'double'),
+ 'Number of Bobs'
+ ),
+ array(
+ 'throws',
+ "int Number of \n Bobs",
+ 'int',
+ array('int'),
+ "Number of \n Bobs"
+ ),
+ array(
+ 'throws',
+ " int Number of Bobs",
+ 'int',
+ array('int'),
+ "Number of Bobs"
+ ),
+ array(
+ 'throws',
+ "int\nNumber of Bobs",
+ 'int',
+ array('int'),
+ "Number of Bobs"
+ )
+ );
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/UsesTagTest.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/UsesTagTest.php
new file mode 100644
index 00000000000..45868d73e93
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/UsesTagTest.php
@@ -0,0 +1,86 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Test class for \phpDocumentor\Reflection\DocBlock\Tag\UsesTag
+ *
+ * @author Daniel O'Connor
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class UsesTagTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * Test that the \phpDocumentor\Reflection\DocBlock\Tag\UsesTag can create
+ * a link for the @uses doc block.
+ *
+ * @param string $type
+ * @param string $content
+ * @param string $exContent
+ * @param string $exReference
+ *
+ * @covers \phpDocumentor\Reflection\DocBlock\Tag\UsesTag
+ * @dataProvider provideDataForConstuctor
+ *
+ * @return void
+ */
+ public function testConstructorParesInputsIntoCorrectFields(
+ $type,
+ $content,
+ $exContent,
+ $exDescription,
+ $exReference
+ ) {
+ $tag = new UsesTag($type, $content);
+
+ $this->assertEquals($type, $tag->getName());
+ $this->assertEquals($exContent, $tag->getContent());
+ $this->assertEquals($exDescription, $tag->getDescription());
+ $this->assertEquals($exReference, $tag->getReference());
+ }
+
+ /**
+ * Data provider for testConstructorParesInputsIntoCorrectFields
+ *
+ * @return array
+ */
+ public function provideDataForConstuctor()
+ {
+ // $type, $content, $exContent, $exDescription, $exReference
+ return array(
+ array(
+ 'uses',
+ 'Foo::bar()',
+ 'Foo::bar()',
+ '',
+ 'Foo::bar()'
+ ),
+ array(
+ 'uses',
+ 'Foo::bar() Testing',
+ 'Foo::bar() Testing',
+ 'Testing',
+ 'Foo::bar()',
+ ),
+ array(
+ 'uses',
+ 'Foo::bar() Testing comments',
+ 'Foo::bar() Testing comments',
+ 'Testing comments',
+ 'Foo::bar()',
+ ),
+ );
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/VarTagTest.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/VarTagTest.php
new file mode 100644
index 00000000000..9ae2aa5f7fa
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/VarTagTest.php
@@ -0,0 +1,94 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Test class for \phpDocumentor\Reflection\DocBlock\Tag\VarTag
+ *
+ * @author Daniel O'Connor
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class VarTagTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * Test that the \phpDocumentor\Reflection\DocBlock\Tag\VarTag can
+ * understand the @var doc block.
+ *
+ * @param string $type
+ * @param string $content
+ * @param string $exType
+ * @param string $exVariable
+ * @param string $exDescription
+ *
+ * @covers \phpDocumentor\Reflection\DocBlock\Tag\VarTag
+ * @dataProvider provideDataForConstuctor
+ *
+ * @return void
+ */
+ public function testConstructorParesInputsIntoCorrectFields(
+ $type,
+ $content,
+ $exType,
+ $exVariable,
+ $exDescription
+ ) {
+ $tag = new VarTag($type, $content);
+
+ $this->assertEquals($type, $tag->getName());
+ $this->assertEquals($exType, $tag->getType());
+ $this->assertEquals($exVariable, $tag->getVariableName());
+ $this->assertEquals($exDescription, $tag->getDescription());
+ }
+
+ /**
+ * Data provider for testConstructorParesInputsIntoCorrectFields
+ *
+ * @return array
+ */
+ public function provideDataForConstuctor()
+ {
+ // $type, $content, $exType, $exVariable, $exDescription
+ return array(
+ array(
+ 'var',
+ 'int',
+ 'int',
+ '',
+ ''
+ ),
+ array(
+ 'var',
+ 'int $bob',
+ 'int',
+ '$bob',
+ ''
+ ),
+ array(
+ 'var',
+ 'int $bob Number of bobs',
+ 'int',
+ '$bob',
+ 'Number of bobs'
+ ),
+ array(
+ 'var',
+ '',
+ '',
+ '',
+ ''
+ ),
+ );
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/VersionTagTest.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/VersionTagTest.php
new file mode 100644
index 00000000000..e145386d457
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/VersionTagTest.php
@@ -0,0 +1,115 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Test class for \phpDocumentor\Reflection\DocBlock\Tag\VersionTag
+ *
+ * @author Vasil Rangelov
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class VersionTagTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * Test that the \phpDocumentor\Reflection\DocBlock\Tag\LinkTag can create
+ * a link for the @version doc block.
+ *
+ * @param string $type
+ * @param string $content
+ * @param string $exContent
+ * @param string $exDescription
+ * @param string $exVersion
+ *
+ * @covers \phpDocumentor\Reflection\DocBlock\Tag\VersionTag
+ * @dataProvider provideDataForConstuctor
+ *
+ * @return void
+ */
+ public function testConstructorParesInputsIntoCorrectFields(
+ $type,
+ $content,
+ $exContent,
+ $exDescription,
+ $exVersion
+ ) {
+ $tag = new VersionTag($type, $content);
+
+ $this->assertEquals($type, $tag->getName());
+ $this->assertEquals($exContent, $tag->getContent());
+ $this->assertEquals($exDescription, $tag->getDescription());
+ $this->assertEquals($exVersion, $tag->getVersion());
+ }
+
+ /**
+ * Data provider for testConstructorParesInputsIntoCorrectFields
+ *
+ * @return array
+ */
+ public function provideDataForConstuctor()
+ {
+ // $type, $content, $exContent, $exDescription, $exVersion
+ return array(
+ array(
+ 'version',
+ '1.0 First release.',
+ '1.0 First release.',
+ 'First release.',
+ '1.0'
+ ),
+ array(
+ 'version',
+ "1.0\nFirst release.",
+ "1.0\nFirst release.",
+ 'First release.',
+ '1.0'
+ ),
+ array(
+ 'version',
+ "1.0\nFirst\nrelease.",
+ "1.0\nFirst\nrelease.",
+ "First\nrelease.",
+ '1.0'
+ ),
+ array(
+ 'version',
+ 'Unfinished release',
+ 'Unfinished release',
+ 'Unfinished release',
+ ''
+ ),
+ array(
+ 'version',
+ '1.0',
+ '1.0',
+ '',
+ '1.0'
+ ),
+ array(
+ 'version',
+ 'GIT: $Id$',
+ 'GIT: $Id$',
+ '',
+ 'GIT: $Id$'
+ ),
+ array(
+ 'version',
+ 'GIT: $Id$ Dev build',
+ 'GIT: $Id$ Dev build',
+ 'Dev build',
+ 'GIT: $Id$'
+ )
+ );
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/TagTest.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/TagTest.php
new file mode 100644
index 00000000000..9e873ecb5d7
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/TagTest.php
@@ -0,0 +1,313 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock;
+
+use phpDocumentor\Reflection\DocBlock;
+use phpDocumentor\Reflection\DocBlock\Context;
+
+/**
+ * Test class for \phpDocumentor\Reflection\DocBlock\Tag\VarTag
+ *
+ * @author Daniel O'Connor
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class TagTest extends \PHPUnit_Framework_TestCase
+{
+
+ /**
+ * @expectedException \InvalidArgumentException
+ *
+ * @return void
+ */
+ public function testInvalidTagLine()
+ {
+ Tag::createInstance('Invalid tag line');
+ }
+
+ /**
+ * @covers \phpDocumentor\Reflection\DocBlock\Tag::registerTagHandler
+ *
+ * @return void
+ */
+ public function testTagHandlerUnregistration()
+ {
+ $currentHandler = __NAMESPACE__ . '\Tag\VarTag';
+ $tagPreUnreg = Tag::createInstance('@var mixed');
+ $this->assertInstanceOf(
+ $currentHandler,
+ $tagPreUnreg
+ );
+ $this->assertInstanceOf(
+ __NAMESPACE__ . '\Tag',
+ $tagPreUnreg
+ );
+
+ Tag::registerTagHandler('var', null);
+
+ $tagPostUnreg = Tag::createInstance('@var mixed');
+ $this->assertNotInstanceOf(
+ $currentHandler,
+ $tagPostUnreg
+ );
+ $this->assertInstanceOf(
+ __NAMESPACE__ . '\Tag',
+ $tagPostUnreg
+ );
+
+ Tag::registerTagHandler('var', $currentHandler);
+ }
+
+ /**
+ * @covers \phpDocumentor\Reflection\DocBlock\Tag::registerTagHandler
+ *
+ * @return void
+ */
+ public function testTagHandlerCorrectRegistration()
+ {
+ if (0 == ini_get('allow_url_include')) {
+ $this->markTestSkipped('"data" URIs for includes are required.');
+ }
+ $currentHandler = __NAMESPACE__ . '\Tag\VarTag';
+ $tagPreReg = Tag::createInstance('@var mixed');
+ $this->assertInstanceOf(
+ $currentHandler,
+ $tagPreReg
+ );
+ $this->assertInstanceOf(
+ __NAMESPACE__ . '\Tag',
+ $tagPreReg
+ );
+
+ include 'data:text/plain;base64,'. base64_encode(
+<<assertTrue(Tag::registerTagHandler('var', '\MyTagHandler'));
+
+ $tagPostReg = Tag::createInstance('@var mixed');
+ $this->assertNotInstanceOf(
+ $currentHandler,
+ $tagPostReg
+ );
+ $this->assertInstanceOf(
+ __NAMESPACE__ . '\Tag',
+ $tagPostReg
+ );
+ $this->assertInstanceOf(
+ '\MyTagHandler',
+ $tagPostReg
+ );
+
+ $this->assertTrue(Tag::registerTagHandler('var', $currentHandler));
+ }
+
+ /**
+ * @depends testTagHandlerCorrectRegistration
+ * @covers \phpDocumentor\Reflection\DocBlock\Tag::registerTagHandler
+ * @covers \phpDocumentor\Reflection\DocBlock\Tag::createInstance
+ *
+ * @return void
+ */
+ public function testNamespacedTagHandlerCorrectRegistration()
+ {
+ $tagPreReg = Tag::createInstance('@T something');
+ $this->assertInstanceOf(
+ __NAMESPACE__ . '\Tag',
+ $tagPreReg
+ );
+ $this->assertNotInstanceOf(
+ '\MyTagHandler',
+ $tagPreReg
+ );
+
+ $this->assertTrue(
+ Tag::registerTagHandler('\MyNamespace\MyTag', '\MyTagHandler')
+ );
+
+ $tagPostReg = Tag::createInstance(
+ '@T something',
+ new DocBlock(
+ '',
+ new Context('', array('T' => '\MyNamespace\MyTag'))
+ )
+ );
+ $this->assertInstanceOf(
+ __NAMESPACE__ . '\Tag',
+ $tagPostReg
+ );
+ $this->assertInstanceOf(
+ '\MyTagHandler',
+ $tagPostReg
+ );
+
+ $this->assertTrue(
+ Tag::registerTagHandler('\MyNamespace\MyTag', null)
+ );
+ }
+
+ /**
+ * @depends testTagHandlerCorrectRegistration
+ * @covers \phpDocumentor\Reflection\DocBlock\Tag::registerTagHandler
+ * @covers \phpDocumentor\Reflection\DocBlock\Tag::createInstance
+ *
+ * @return void
+ */
+ public function testNamespacedTagHandlerIncorrectRegistration()
+ {
+ $tagPreReg = Tag::createInstance('@T something');
+ $this->assertInstanceOf(
+ __NAMESPACE__ . '\Tag',
+ $tagPreReg
+ );
+ $this->assertNotInstanceOf(
+ '\MyTagHandler',
+ $tagPreReg
+ );
+
+ $this->assertFalse(
+ Tag::registerTagHandler('MyNamespace\MyTag', '\MyTagHandler')
+ );
+
+ $tagPostReg = Tag::createInstance(
+ '@T something',
+ new DocBlock(
+ '',
+ new Context('', array('T' => '\MyNamespace\MyTag'))
+ )
+ );
+ $this->assertInstanceOf(
+ __NAMESPACE__ . '\Tag',
+ $tagPostReg
+ );
+ $this->assertNotInstanceOf(
+ '\MyTagHandler',
+ $tagPostReg
+ );
+ }
+
+ /**
+ * @covers \phpDocumentor\Reflection\DocBlock\Tag::registerTagHandler
+ *
+ * @return void
+ */
+ public function testNonExistentTagHandlerRegistration()
+ {
+ $currentHandler = __NAMESPACE__ . '\Tag\VarTag';
+ $tagPreReg = Tag::createInstance('@var mixed');
+ $this->assertInstanceOf(
+ $currentHandler,
+ $tagPreReg
+ );
+ $this->assertInstanceOf(
+ __NAMESPACE__ . '\Tag',
+ $tagPreReg
+ );
+
+ $this->assertFalse(Tag::registerTagHandler('var', 'Non existent'));
+
+ $tagPostReg = Tag::createInstance('@var mixed');
+ $this->assertInstanceOf(
+ $currentHandler,
+ $tagPostReg
+ );
+ $this->assertInstanceOf(
+ __NAMESPACE__ . '\Tag',
+ $tagPostReg
+ );
+ }
+
+ /**
+ * @covers \phpDocumentor\Reflection\DocBlock\Tag::registerTagHandler
+ *
+ * @return void
+ */
+ public function testIncompatibleTagHandlerRegistration()
+ {
+ $currentHandler = __NAMESPACE__ . '\Tag\VarTag';
+ $tagPreReg = Tag::createInstance('@var mixed');
+ $this->assertInstanceOf(
+ $currentHandler,
+ $tagPreReg
+ );
+ $this->assertInstanceOf(
+ __NAMESPACE__ . '\Tag',
+ $tagPreReg
+ );
+
+ $this->assertFalse(
+ Tag::registerTagHandler('var', __NAMESPACE__ . '\TagTest')
+ );
+
+ $tagPostReg = Tag::createInstance('@var mixed');
+ $this->assertInstanceOf(
+ $currentHandler,
+ $tagPostReg
+ );
+ $this->assertInstanceOf(
+ __NAMESPACE__ . '\Tag',
+ $tagPostReg
+ );
+ }
+
+ /**
+ * Test that the \phpDocumentor\Reflection\DocBlock\Tag\VarTag can
+ * understand the @var doc block.
+ *
+ * @param string $type
+ * @param string $content
+ * @param string $exDescription
+ *
+ * @covers \phpDocumentor\Reflection\DocBlock\Tag
+ * @dataProvider provideDataForConstuctor
+ *
+ * @return void
+ */
+ public function testConstructorParesInputsIntoCorrectFields(
+ $type,
+ $content,
+ $exDescription
+ ) {
+ $tag = new Tag($type, $content);
+
+ $this->assertEquals($type, $tag->getName());
+ $this->assertEquals($content, $tag->getContent());
+ $this->assertEquals($exDescription, $tag->getDescription());
+ }
+
+ /**
+ * Data provider for testConstructorParesInputsIntoCorrectFields
+ *
+ * @return array
+ */
+ public function provideDataForConstuctor()
+ {
+ // $type, $content, $exDescription
+ return array(
+ array(
+ 'unknown',
+ 'some content',
+ 'some content',
+ ),
+ array(
+ 'unknown',
+ '',
+ '',
+ )
+ );
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Type/CollectionTest.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Type/CollectionTest.php
new file mode 100644
index 00000000000..78c7306d607
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Type/CollectionTest.php
@@ -0,0 +1,195 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Type;
+
+use phpDocumentor\Reflection\DocBlock\Context;
+
+/**
+ * Test class for \phpDocumentor\Reflection\DocBlock\Type\Collection
+ *
+ * @covers phpDocumentor\Reflection\DocBlock\Type\Collection
+ *
+ * @author Mike van Riel
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class CollectionTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * @covers phpDocumentor\Reflection\DocBlock\Type\Collection::__construct
+ * @covers phpDocumentor\Reflection\DocBlock\Type\Collection::getContext
+ *
+ * @return void
+ */
+ public function testConstruct()
+ {
+ $collection = new Collection();
+ $this->assertCount(0, $collection);
+ $this->assertEquals('', $collection->getContext()->getNamespace());
+ $this->assertCount(0, $collection->getContext()->getNamespaceAliases());
+ }
+
+ /**
+ * @covers phpDocumentor\Reflection\DocBlock\Type\Collection::__construct
+ *
+ * @return void
+ */
+ public function testConstructWithTypes()
+ {
+ $collection = new Collection(array('integer', 'string'));
+ $this->assertCount(2, $collection);
+ }
+
+ /**
+ * @covers phpDocumentor\Reflection\DocBlock\Type\Collection::__construct
+ *
+ * @return void
+ */
+ public function testConstructWithNamespace()
+ {
+ $collection = new Collection(array(), new Context('\My\Space'));
+ $this->assertEquals('My\Space', $collection->getContext()->getNamespace());
+
+ $collection = new Collection(array(), new Context('My\Space'));
+ $this->assertEquals('My\Space', $collection->getContext()->getNamespace());
+
+ $collection = new Collection(array(), null);
+ $this->assertEquals('', $collection->getContext()->getNamespace());
+ }
+
+ /**
+ * @covers phpDocumentor\Reflection\DocBlock\Type\Collection::__construct
+ *
+ * @return void
+ */
+ public function testConstructWithNamespaceAliases()
+ {
+ $fixture = array('a' => 'b');
+ $collection = new Collection(array(), new Context(null, $fixture));
+ $this->assertEquals(
+ array('a' => '\b'),
+ $collection->getContext()->getNamespaceAliases()
+ );
+ }
+
+ /**
+ * @param string $fixture
+ * @param array $expected
+ *
+ * @dataProvider provideTypesToExpand
+ * @covers phpDocumentor\Reflection\DocBlock\Type\Collection::add
+ *
+ * @return void
+ */
+ public function testAdd($fixture, $expected)
+ {
+ $collection = new Collection(
+ array(),
+ new Context('\My\Space', array('Alias' => '\My\Space\Aliasing'))
+ );
+ $collection->add($fixture);
+
+ $this->assertSame($expected, $collection->getArrayCopy());
+ }
+
+ /**
+ * @param string $fixture
+ * @param array $expected
+ *
+ * @dataProvider provideTypesToExpandWithoutNamespace
+ * @covers phpDocumentor\Reflection\DocBlock\Type\Collection::add
+ *
+ * @return void
+ */
+ public function testAddWithoutNamespace($fixture, $expected)
+ {
+ $collection = new Collection(
+ array(),
+ new Context(null, array('Alias' => '\My\Space\Aliasing'))
+ );
+ $collection->add($fixture);
+
+ $this->assertSame($expected, $collection->getArrayCopy());
+ }
+
+ /**
+ * @covers phpDocumentor\Reflection\DocBlock\Type\Collection::add
+ * @expectedException InvalidArgumentException
+ *
+ * @return void
+ */
+ public function testAddWithInvalidArgument()
+ {
+ $collection = new Collection();
+ $collection->add(array());
+ }
+
+ /**
+ * Returns the types and their expected values to test the retrieval of
+ * types.
+ *
+ * @param string $method Name of the method consuming this data provider.
+ * @param string $namespace Name of the namespace to user as basis.
+ *
+ * @return string[]
+ */
+ public function provideTypesToExpand($method, $namespace = '\My\Space\\')
+ {
+ return array(
+ array('', array()),
+ array(' ', array()),
+ array('int', array('int')),
+ array('int ', array('int')),
+ array('string', array('string')),
+ array('DocBlock', array($namespace.'DocBlock')),
+ array('DocBlock[]', array($namespace.'DocBlock[]')),
+ array(' DocBlock ', array($namespace.'DocBlock')),
+ array('\My\Space\DocBlock', array('\My\Space\DocBlock')),
+ array('Alias\DocBlock', array('\My\Space\Aliasing\DocBlock')),
+ array(
+ 'DocBlock|Tag',
+ array($namespace .'DocBlock', $namespace .'Tag')
+ ),
+ array(
+ 'DocBlock|null',
+ array($namespace.'DocBlock', 'null')
+ ),
+ array(
+ '\My\Space\DocBlock|Tag',
+ array('\My\Space\DocBlock', $namespace.'Tag')
+ ),
+ array(
+ 'DocBlock[]|null',
+ array($namespace.'DocBlock[]', 'null')
+ ),
+ array(
+ 'DocBlock[]|int[]',
+ array($namespace.'DocBlock[]', 'int[]')
+ ),
+ );
+ }
+
+ /**
+ * Returns the types and their expected values to test the retrieval of
+ * types when no namespace is available.
+ *
+ * @param string $method Name of the method consuming this data provider.
+ *
+ * @return string[]
+ */
+ public function provideTypesToExpandWithoutNamespace($method)
+ {
+ return $this->provideTypesToExpand($method, '\\');
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlockTest.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlockTest.php
new file mode 100644
index 00000000000..30eedfc5819
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlockTest.php
@@ -0,0 +1,337 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection;
+
+use phpDocumentor\Reflection\DocBlock\Context;
+use phpDocumentor\Reflection\DocBlock\Location;
+use phpDocumentor\Reflection\DocBlock\Tag\ReturnTag;
+
+/**
+ * Test class for phpDocumentor\Reflection\DocBlock
+ *
+ * @author Mike van Riel
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class DocBlockTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * @covers \phpDocumentor\Reflection\DocBlock
+ *
+ * @return void
+ */
+ public function testConstruct()
+ {
+ $fixture = << '\phpDocumentor')),
+ new Location(2)
+ );
+ $this->assertEquals(
+ 'This is a short description',
+ $object->getShortDescription()
+ );
+ $this->assertEquals(
+ 'This is a long description',
+ $object->getLongDescription()->getContents()
+ );
+ $this->assertCount(2, $object->getTags());
+ $this->assertTrue($object->hasTag('see'));
+ $this->assertTrue($object->hasTag('return'));
+ $this->assertFalse($object->hasTag('category'));
+
+ $this->assertSame('MyNamespace', $object->getContext()->getNamespace());
+ $this->assertSame(
+ array('PHPDoc' => '\phpDocumentor'),
+ $object->getContext()->getNamespaceAliases()
+ );
+ $this->assertSame(2, $object->getLocation()->getLineNumber());
+ }
+
+ /**
+ * @covers \phpDocumentor\Reflection\DocBlock::splitDocBlock
+ *
+ * @return void
+ */
+ public function testConstructWithTagsOnly()
+ {
+ $fixture = <<assertEquals('', $object->getShortDescription());
+ $this->assertEquals('', $object->getLongDescription()->getContents());
+ $this->assertCount(2, $object->getTags());
+ $this->assertTrue($object->hasTag('see'));
+ $this->assertTrue($object->hasTag('return'));
+ $this->assertFalse($object->hasTag('category'));
+ }
+
+ /**
+ * @covers \phpDocumentor\Reflection\DocBlock::isTemplateStart
+ */
+ public function testIfStartOfTemplateIsDiscovered()
+ {
+ $fixture = <<assertEquals('', $object->getShortDescription());
+ $this->assertEquals('', $object->getLongDescription()->getContents());
+ $this->assertCount(2, $object->getTags());
+ $this->assertTrue($object->hasTag('see'));
+ $this->assertTrue($object->hasTag('return'));
+ $this->assertFalse($object->hasTag('category'));
+ $this->assertTrue($object->isTemplateStart());
+ }
+
+ /**
+ * @covers \phpDocumentor\Reflection\DocBlock::isTemplateEnd
+ */
+ public function testIfEndOfTemplateIsDiscovered()
+ {
+ $fixture = <<assertEquals('', $object->getShortDescription());
+ $this->assertEquals('', $object->getLongDescription()->getContents());
+ $this->assertTrue($object->isTemplateEnd());
+ }
+
+ /**
+ * @covers \phpDocumentor\Reflection\DocBlock::cleanInput
+ *
+ * @return void
+ */
+ public function testConstructOneLiner()
+ {
+ $fixture = '/** Short description and nothing more. */';
+ $object = new DocBlock($fixture);
+ $this->assertEquals(
+ 'Short description and nothing more.',
+ $object->getShortDescription()
+ );
+ $this->assertEquals('', $object->getLongDescription()->getContents());
+ $this->assertCount(0, $object->getTags());
+ }
+
+ /**
+ * @covers \phpDocumentor\Reflection\DocBlock::__construct
+ *
+ * @return void
+ */
+ public function testConstructFromReflector()
+ {
+ $object = new DocBlock(new \ReflectionClass($this));
+ $this->assertEquals(
+ 'Test class for phpDocumentor\Reflection\DocBlock',
+ $object->getShortDescription()
+ );
+ $this->assertEquals('', $object->getLongDescription()->getContents());
+ $this->assertCount(4, $object->getTags());
+ $this->assertTrue($object->hasTag('author'));
+ $this->assertTrue($object->hasTag('copyright'));
+ $this->assertTrue($object->hasTag('license'));
+ $this->assertTrue($object->hasTag('link'));
+ $this->assertFalse($object->hasTag('category'));
+ }
+
+ /**
+ * @expectedException \InvalidArgumentException
+ *
+ * @return void
+ */
+ public function testExceptionOnInvalidObject()
+ {
+ new DocBlock($this);
+ }
+
+ public function testDotSeperation()
+ {
+ $fixture = <<assertEquals(
+ 'This is a short description.',
+ $object->getShortDescription()
+ );
+ $this->assertEquals(
+ "This is a long description.\nThis is a continuation of the long "
+ ."description.",
+ $object->getLongDescription()->getContents()
+ );
+ }
+
+ /**
+ * @covers \phpDocumentor\Reflection\DocBlock::parseTags
+ * @expectedException \LogicException
+ *
+ * @return void
+ */
+ public function testInvalidTagBlock()
+ {
+ if (0 == ini_get('allow_url_include')) {
+ $this->markTestSkipped('"data" URIs for includes are required.');
+ }
+
+ include 'data:text/plain;base64,'. base64_encode(
+ <<assertEquals(
+ 'This is a short description.',
+ $object->getShortDescription()
+ );
+ $this->assertEquals(
+ 'This is a long description.',
+ $object->getLongDescription()->getContents()
+ );
+ $tags = $object->getTags();
+ $this->assertCount(2, $tags);
+ $this->assertTrue($object->hasTag('method'));
+ $this->assertTrue($object->hasTag('Method'));
+ $this->assertInstanceOf(
+ __NAMESPACE__ . '\DocBlock\Tag\MethodTag',
+ $tags[0]
+ );
+ $this->assertInstanceOf(
+ __NAMESPACE__ . '\DocBlock\Tag',
+ $tags[1]
+ );
+ $this->assertNotInstanceOf(
+ __NAMESPACE__ . '\DocBlock\Tag\MethodTag',
+ $tags[1]
+ );
+ }
+
+ /**
+ * @depends testConstructFromReflector
+ * @covers \phpDocumentor\Reflection\DocBlock::getTagsByName
+ *
+ * @return void
+ */
+ public function testGetTagsByNameZeroAndOneMatch()
+ {
+ $object = new DocBlock(new \ReflectionClass($this));
+ $this->assertEmpty($object->getTagsByName('category'));
+ $this->assertCount(1, $object->getTagsByName('author'));
+ }
+
+ /**
+ * @depends testConstructWithTagsOnly
+ * @covers \phpDocumentor\Reflection\DocBlock::parseTags
+ *
+ * @return void
+ */
+ public function testParseMultilineTag()
+ {
+ $fixture = <<assertCount(1, $object->getTags());
+ }
+
+ /**
+ * @depends testConstructWithTagsOnly
+ * @covers \phpDocumentor\Reflection\DocBlock::parseTags
+ *
+ * @return void
+ */
+ public function testParseMultilineTagWithLineBreaks()
+ {
+ $fixture = <<assertCount(1, $tags = $object->getTags());
+ /** @var ReturnTag $tag */
+ $tag = reset($tags);
+ $this->assertEquals("Content on\n multiple lines.\n\n One more, after the break.", $tag->getDescription());
+ }
+
+ /**
+ * @depends testConstructWithTagsOnly
+ * @covers \phpDocumentor\Reflection\DocBlock::getTagsByName
+ *
+ * @return void
+ */
+ public function testGetTagsByNameMultipleMatch()
+ {
+ $fixture = <<assertEmpty($object->getTagsByName('category'));
+ $this->assertCount(1, $object->getTagsByName('return'));
+ $this->assertCount(2, $object->getTagsByName('param'));
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/.gitignore b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/.gitignore
new file mode 100644
index 00000000000..0c39a17ed8b
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/.gitignore
@@ -0,0 +1,5 @@
+*.tgz
+*.phar
+bin
+vendor
+composer.lock
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/.travis.yml b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/.travis.yml
new file mode 100644
index 00000000000..4a6930988d9
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/.travis.yml
@@ -0,0 +1,9 @@
+language: php
+
+php: [5.3, 5.4, 5.5, hhvm, hhvm-nightly]
+
+sudo: false
+
+before_script: travis_retry composer install --no-interaction --prefer-source
+
+script: vendor/bin/phpspec run -fpretty -v
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/CHANGES.md b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/CHANGES.md
new file mode 100644
index 00000000000..fe761da9109
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/CHANGES.md
@@ -0,0 +1,110 @@
+1.4.0 / 2015-03-27
+==================
+
+ * Fixed errors in return type phpdocs (thanks @sobit)
+ * Fixed stringifying of hash containing one value (thanks @avant1)
+ * Improved clarity of method call expectation exception (thanks @dantleech)
+ * Add ability to specify which argument is returned in willReturnArgument (thanks @coderbyheart)
+ * Add more information to MethodNotFound exceptions (thanks @ciaranmcnulty)
+ * Support for mocking classes with methods that return references (thanks @edsonmedina)
+ * Improved object comparison (thanks @whatthejeff)
+ * Adopted '^' in composer dependencies (thanks @GrahamCampbell)
+ * Fixed non-typehinted arguments being treated as optional (thanks @whatthejeff)
+ * Magic methods are now filtered for keywords (thanks @seagoj)
+ * More readable errors for failure when expecting single calls (thanks @dantleech)
+
+1.3.1 / 2014-11-17
+==================
+
+ * Fix the edge case when failed predictions weren't recorded for `getCheckedPredictions()`
+
+1.3.0 / 2014-11-14
+==================
+
+ * Add a way to get checked predictions with `MethodProphecy::getCheckedPredictions()`
+ * Fix HHVM compatibility
+ * Remove dead code (thanks @stof)
+ * Add support for DirectoryIterators (thanks @shanethehat)
+
+1.2.0 / 2014-07-18
+==================
+
+ * Added support for doubling magic methods documented in the class phpdoc (thanks @armetiz)
+ * Fixed a segfault appearing in some cases (thanks @dmoreaulf)
+ * Fixed the doubling of methods with typehints on non-existent classes (thanks @gquemener)
+ * Added support for internal classes using keywords as method names (thanks @milan)
+ * Added IdenticalValueToken and Argument::is (thanks @florianv)
+ * Removed the usage of scalar typehints in HHVM as HHVM 3 does not support them anymore in PHP code (thanks @whatthejeff)
+
+1.1.2 / 2014-01-24
+==================
+
+ * Spy automatically promotes spied method call to an expected one
+
+1.1.1 / 2014-01-15
+==================
+
+ * Added support for HHVM
+
+1.1.0 / 2014-01-01
+==================
+
+ * Changed the generated class names to use a static counter instead of a random number
+ * Added a clss patch for ReflectionClass::newInstance to make its argument optional consistently (thanks @docteurklein)
+ * Fixed mirroring of classes with typehints on non-existent classes (thanks @docteurklein)
+ * Fixed the support of array callables in CallbackPromise and CallbackPrediction (thanks @ciaranmcnulty)
+ * Added support for properties in ObjectStateToken (thanks @adrienbrault)
+ * Added support for mocking classes with a final constructor (thanks @ciaranmcnulty)
+ * Added ArrayEveryEntryToken and Argument::withEveryEntry() (thanks @adrienbrault)
+ * Added an exception when trying to prophesize on a final method instead of ignoring silently (thanks @docteurklein)
+ * Added StringContainToken and Argument::containingString() (thanks @peterjmit)
+ * Added ``shouldNotHaveBeenCalled`` on the MethodProphecy (thanks @ciaranmcnulty)
+ * Fixed the comparison of objects in ExactValuetoken (thanks @sstok)
+ * Deprecated ``shouldNotBeenCalled`` in favor of ``shouldNotHaveBeenCalled``
+
+1.0.4 / 2013-08-10
+==================
+
+ * Better randomness for generated class names (thanks @sstok)
+ * Add support for interfaces into TypeToken and Argument::type() (thanks @sstok)
+ * Add support for old-style (method name === class name) constructors (thanks @l310 for report)
+
+1.0.3 / 2013-07-04
+==================
+
+ * Support callable typehints (thanks @stof)
+ * Do not attempt to autoload arrays when generating code (thanks @MarcoDeBortoli)
+ * New ArrayEntryToken (thanks @kagux)
+
+1.0.2 / 2013-05-19
+==================
+
+ * Logical `AND` token added (thanks @kagux)
+ * Logical `NOT` token added (thanks @kagux)
+ * Add support for setting custom constructor arguments
+ * Properly stringify hashes
+ * Record calls that throw exceptions
+ * Migrate spec suite to PhpSpec 2.0
+
+1.0.1 / 2013-04-30
+==================
+
+ * Fix broken UnexpectedCallException message
+ * Trim AggregateException message
+
+1.0.0 / 2013-04-29
+==================
+
+ * Improve exception messages
+
+1.0.0-BETA2 / 2013-04-03
+========================
+
+ * Add more debug information to CallTimes and Call prediction exception messages
+ * Fix MethodNotFoundException wrong namespace (thanks @gunnarlium)
+ * Fix some typos in the exception messages (thanks @pborreli)
+
+1.0.0-BETA1 / 2013-03-25
+========================
+
+ * Initial release
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/CONTRIBUTING.md b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/CONTRIBUTING.md
new file mode 100644
index 00000000000..6ea0589f497
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/CONTRIBUTING.md
@@ -0,0 +1,21 @@
+Contributing
+------------
+
+Prophecy is an open source, community-driven project. If you'd like to contribute,
+feel free to do this, but remember to follow this few simple rules:
+
+- Make your feature addition or bug fix,
+- Add either specs or examples for any changes you're making (bugfixes or additions)
+ (please look into `spec/` folder for some examples). This is important so we don't break
+ it in a future version unintentionally,
+- Commit your code, but do not mess with `CHANGES.md`,
+
+Running tests
+-------------
+
+Make sure that you don't break anything with your changes by running:
+
+```bash
+$> composer install --dev --prefer-dist
+$> vendor/bin/phpspec
+```
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/LICENSE b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/LICENSE
new file mode 100644
index 00000000000..c8b364711a5
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/LICENSE
@@ -0,0 +1,23 @@
+Copyright (c) 2013 Konstantin Kudryashov
+ Marcello Duarte
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/README.md b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/README.md
new file mode 100644
index 00000000000..639ffd06782
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/README.md
@@ -0,0 +1,389 @@
+# Prophecy
+
+[](https://travis-ci.org/phpspec/prophecy)
+
+Prophecy is a highly opinionated yet very powerful and flexible PHP object mocking
+framework. Though initially it was created to fulfil phpspec2 needs, it is flexible
+enough to be used inside any testing framework out there with minimal effort.
+
+## A simple example
+
+```php
+prophet->prophesize('App\Security\Hasher');
+ $user = new App\Entity\User($hasher->reveal());
+
+ $hasher->generateHash($user, 'qwerty')->willReturn('hashed_pass');
+
+ $user->setPassword('qwerty');
+
+ $this->assertEquals('hashed_pass', $user->getPassword());
+ }
+
+ protected function setup()
+ {
+ $this->prophet = new \Prophecy\Prophet;
+ }
+
+ protected function tearDown()
+ {
+ $this->prophet->checkPredictions();
+ }
+}
+```
+
+## Installation
+
+### Prerequisites
+
+Prophecy requires PHP 5.3.3 or greater.
+
+### Setup through composer
+
+First, add Prophecy to the list of dependencies inside your `composer.json`:
+
+```json
+{
+ "require-dev": {
+ "phpspec/prophecy": "~1.0"
+ }
+}
+```
+
+Then simply install it with composer:
+
+```bash
+$> composer install --prefer-dist
+```
+
+You can read more about Composer on its [official webpage](http://getcomposer.org).
+
+## How to use it
+
+First of all, in Prophecy every word has a logical meaning, even the name of the library
+itself (Prophecy). When you start feeling that, you'll become very fluid with this
+tool.
+
+For example, Prophecy has been named that way because it concentrates on describing the future
+behavior of objects with very limited knowledge about them. But as with any other prophecy,
+those object prophecies can't create themselves - there should be a Prophet:
+
+```php
+$prophet = new Prophecy\Prophet;
+```
+
+The Prophet creates prophecies by *prophesizing* them:
+
+```php
+$prophecy = $prophet->prophesize();
+```
+
+The result of the `prophesize()` method call is a new object of class `ObjectProphecy`. Yes,
+that's your specific object prophecy, which describes how your object would behave
+in the near future. But first, you need to specify which object you're talking about,
+right?
+
+```php
+$prophecy->willExtend('stdClass');
+$prophecy->willImplement('SessionHandlerInterface');
+```
+
+There are 2 interesting calls - `willExtend` and `willImplement`. The first one tells
+object prophecy that our object should extend specific class, the second one says that
+it should implement some interface. Obviously, objects in PHP can implement multiple
+interfaces, but extend only one parent class.
+
+### Dummies
+
+Ok, now we have our object prophecy. What can we do with it? First of all, we can get
+our object *dummy* by revealing its prophecy:
+
+```php
+$dummy = $prophecy->reveal();
+```
+
+The `$dummy` variable now holds a special dummy object. Dummy objects are objects that extend
+and/or implement preset classes/interfaces by overriding all their public methods. The key
+point about dummies is that they do not hold any logic - they just do nothing. Any method
+of the dummy will always return `null` and the dummy will never throw any exceptions.
+Dummy is your friend if you don't care about the actual behavior of this double and just need
+a token object to satisfy a method typehint.
+
+You need to understand one thing - a dummy is not a prophecy. Your object prophecy is still
+assigned to `$prophecy` variable and in order to manipulate with your expectations, you
+should work with it. `$dummy` is a dummy - a simple php object that tries to fulfil your
+prophecy.
+
+### Stubs
+
+Ok, now we know how to create basic prophecies and reveal dummies from them. That's
+awesome if we don't care about our _doubles_ (objects that reflect originals)
+interactions. If we do, we need to use *stubs* or *mocks*.
+
+A stub is an object double, which doesn't have any expectations about the object behavior,
+but when put in specific environment, behaves in specific way. Ok, I know, it's cryptic,
+but bear with me for a minute. Simply put, a stub is a dummy, which depending on the called
+method signature does different things (has logic). To create stubs in Prophecy:
+
+```php
+$prophecy->read('123')->willReturn('value');
+```
+
+Oh wow. We've just made an arbitrary call on the object prophecy? Yes, we did. And this
+call returned us a new object instance of class `MethodProphecy`. Yep, that's a specific
+method with arguments prophecy. Method prophecies give you the ability to create method
+promises or predictions. We'll talk about method predictions later in the _Mocks_ section.
+
+#### Promises
+
+Promises are logical blocks, that represent your fictional methods in prophecy terms
+and they are handled by the `MethodProphecy::will(PromiseInterface $promise)` method.
+As a matter of fact, the call that we made earlier (`willReturn('value')`) is a simple
+shortcut to:
+
+```php
+$prophecy->read('123')->will(new Prophecy\Promise\ReturnPromise(array('value')));
+```
+
+This promise will cause any call to our double's `read()` method with exactly one
+argument - `'123'` to always return `'value'`. But that's only for this
+promise, there's plenty others you can use:
+
+- `ReturnPromise` or `->willReturn(1)` - returns a value from a method call
+- `ReturnArgumentPromise` or `->willReturnArgument($index)` - returns the nth method argument from call
+- `ThrowPromise` or `->willThrow` - causes the method to throw specific exception
+- `CallbackPromise` or `->will($callback)` - gives you a quick way to define your own custom logic
+
+Keep in mind, that you can always add even more promises by implementing
+`Prophecy\Promise\PromiseInterface`.
+
+#### Method prophecies idempotency
+
+Prophecy enforces same method prophecies and, as a consequence, same promises and
+predictions for the same method calls with the same arguments. This means:
+
+```php
+$methodProphecy1 = $prophecy->read('123');
+$methodProphecy2 = $prophecy->read('123');
+$methodProphecy3 = $prophecy->read('321');
+
+$methodProphecy1 === $methodProphecy2;
+$methodProphecy1 !== $methodProphecy3;
+```
+
+That's interesting, right? Now you might ask me how would you define more complex
+behaviors where some method call changes behavior of others. In PHPUnit or Mockery
+you do that by predicting how many times your method will be called. In Prophecy,
+you'll use promises for that:
+
+```php
+$user->getName()->willReturn(null);
+
+// For PHP 5.4
+$user->setName('everzet')->will(function () {
+ $this->getName()->willReturn('everzet');
+});
+
+// For PHP 5.3
+$user->setName('everzet')->will(function ($args, $user) {
+ $user->getName()->willReturn('everzet');
+});
+
+// Or
+$user->setName('everzet')->will(function ($args) use ($user) {
+ $user->getName()->willReturn('everzet');
+});
+```
+
+And now it doesn't matter how many times or in which order your methods are called.
+What matters is their behaviors and how well you faked it.
+
+#### Arguments wildcarding
+
+The previous example is awesome (at least I hope it is for you), but that's not
+optimal enough. We hardcoded `'everzet'` in our expectation. Isn't there a better
+way? In fact there is, but it involves understanding what this `'everzet'`
+actually is.
+
+You see, even if method arguments used during method prophecy creation look
+like simple method arguments, in reality they are not. They are argument token
+wildcards. As a matter of fact, `->setName('everzet')` looks like a simple call just
+because Prophecy automatically transforms it under the hood into:
+
+```php
+$user->setName(new Prophecy\Argument\Token\ExactValueToken('everzet'));
+```
+
+Those argument tokens are simple PHP classes, that implement
+`Prophecy\Argument\Token\TokenInterface` and tell Prophecy how to compare real arguments
+with your expectations. And yes, those classnames are damn big. That's why there's a
+shortcut class `Prophecy\Argument`, which you can use to create tokens like that:
+
+```php
+use Prophecy\Argument;
+
+$user->setName(Argument::exact('everzet'));
+```
+
+`ExactValueToken` is not very useful in our case as it forced us to hardcode the username.
+That's why Prophecy comes bundled with a bunch of other tokens:
+
+- `IdenticalValueToken` or `Argument::is($value)` - checks that the argument is identical to a specific value
+- `ExactValueToken` or `Argument::exact($value)` - checks that the argument matches a specific value
+- `TypeToken` or `Argument::type($typeOrClass)` - checks that the argument matches a specific type or
+ classname
+- `ObjectStateToken` or `Argument::which($method, $value)` - checks that the argument method returns
+ a specific value
+- `CallbackToken` or `Argument::that(callback)` - checks that the argument matches a custom callback
+- `AnyValueToken` or `Argument::any()` - matches any argument
+- `AnyValuesToken` or `Argument::cetera()` - matches any arguments to the rest of the signature
+
+And you can add even more by implementing `TokenInterface` with your own custom classes.
+
+So, let's refactor our initial `{set,get}Name()` logic with argument tokens:
+
+```php
+use Prophecy\Argument;
+
+$user->getName()->willReturn(null);
+
+// For PHP 5.4
+$user->setName(Argument::type('string'))->will(function ($args) {
+ $this->getName()->willReturn($args[0]);
+});
+
+// For PHP 5.3
+$user->setName(Argument::type('string'))->will(function ($args, $user) {
+ $user->getName()->willReturn($args[0]);
+});
+
+// Or
+$user->setName(Argument::type('string'))->will(function ($args) use ($user) {
+ $user->getName()->willReturn($args[0]);
+});
+```
+
+That's it. Now our `{set,get}Name()` prophecy will work with any string argument provided to it.
+We've just described how our stub object should behave, even though the original object could have
+no behavior whatsoever.
+
+One last bit about arguments now. You might ask, what happens in case of:
+
+```php
+use Prophecy\Argument;
+
+$user->getName()->willReturn(null);
+
+// For PHP 5.4
+$user->setName(Argument::type('string'))->will(function ($args) {
+ $this->getName()->willReturn($args[0]);
+});
+
+// For PHP 5.3
+$user->setName(Argument::type('string'))->will(function ($args, $user) {
+ $user->getName()->willReturn($args[0]);
+});
+
+// Or
+$user->setName(Argument::type('string'))->will(function ($args) use ($user) {
+ $user->getName()->willReturn($args[0]);
+});
+
+$user->setName(Argument::any())->will(function () {
+});
+```
+
+Nothing. Your stub will continue behaving the way it did before. That's because of how
+arguments wildcarding works. Every argument token type has a different score level, which
+wildcard then uses to calculate the final arguments match score and use the method prophecy
+promise that has the highest score. In this case, `Argument::type()` in case of success
+scores `5` and `Argument::any()` scores `3`. So the type token wins, as does the first
+`setName()` method prophecy and its promise. The simple rule of thumb - more precise token
+always wins.
+
+#### Getting stub objects
+
+Ok, now we know how to define our prophecy method promises, let's get our stub from
+it:
+
+```php
+$stub = $prophecy->reveal();
+```
+
+As you might see, the only difference between how we get dummies and stubs is that with
+stubs we describe every object conversation instead of just agreeing with `null` returns
+(object being *dummy*). As a matter of fact, after you define your first promise
+(method call), Prophecy will force you to define all the communications - it throws
+the `UnexpectedCallException` for any call you didn't describe with object prophecy before
+calling it on a stub.
+
+### Mocks
+
+Now we know how to define doubles without behavior (dummies) and doubles with behavior, but
+no expectations (stubs). What's left is doubles for which we have some expectations. These
+are called mocks and in Prophecy they look almost exactly the same as stubs, except that
+they define *predictions* instead of *promises* on method prophecies:
+
+```php
+$entityManager->flush()->shouldBeCalled();
+```
+
+#### Predictions
+
+The `shouldBeCalled()` method here assigns `CallPrediction` to our method prophecy.
+Predictions are a delayed behavior check for your prophecies. You see, during the entire lifetime
+of your doubles, Prophecy records every single call you're making against it inside your
+code. After that, Prophecy can use this collected information to check if it matches defined
+predictions. You can assign predictions to method prophecies using the
+`MethodProphecy::should(PredictionInterface $prediction)` method. As a matter of fact,
+the `shouldBeCalled()` method we used earlier is just a shortcut to:
+
+```php
+$entityManager->flush()->should(new Prophecy\Prediction\CallPrediction());
+```
+
+It checks if your method of interest (that matches both the method name and the arguments wildcard)
+was called 1 or more times. If the prediction failed then it throws an exception. When does this
+check happen? Whenever you call `checkPredictions()` on the main Prophet object:
+
+```php
+$prophet->checkPredictions();
+```
+
+In PHPUnit, you would want to put this call into the `tearDown()` method. If no predictions
+are defined, it would do nothing. So it won't harm to call it after every test.
+
+There are plenty more predictions you can play with:
+
+- `CallPrediction` or `shouldBeCalled()` - checks that the method has been called 1 or more times
+- `NoCallsPrediction` or `shouldNotBeCalled()` - checks that the method has not been called
+- `CallTimesPrediction` or `shouldBeCalledTimes($count)` - checks that the method has been called
+ `$count` times
+- `CallbackPrediction` or `should($callback)` - checks the method against your own custom callback
+
+Of course, you can always create your own custom prediction any time by implementing
+`PredictionInterface`.
+
+### Spies
+
+The last bit of awesomeness in Prophecy is out-of-the-box spies support. As I said in the previous
+section, Prophecy records every call made during the double's entire lifetime. This means
+you don't need to record predictions in order to check them. You can also do it
+manually by using the `MethodProphecy::shouldHave(PredictionInterface $prediction)` method:
+
+```php
+$em = $prophet->prophesize('Doctrine\ORM\EntityManager');
+
+$controller->createUser($em->reveal());
+
+$em->flush()->shouldHaveBeenCalled();
+```
+
+Such manipulation with doubles is called spying. And with Prophecy it just works.
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/composer.json b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/composer.json
new file mode 100644
index 00000000000..654aaadc583
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/composer.json
@@ -0,0 +1,40 @@
+{
+ "name": "phpspec/prophecy",
+ "description": "Highly opinionated mocking framework for PHP 5.3+",
+ "keywords": ["Mock", "Stub", "Dummy", "Double", "Fake", "Spy"],
+ "homepage": "https://github.com/phpspec/prophecy",
+ "type": "library",
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "Konstantin Kudryashov",
+ "email": "ever.zet@gmail.com",
+ "homepage": "http://everzet.com"
+ },
+ {
+ "name": "Marcello Duarte",
+ "email": "marcello.duarte@gmail.com"
+ }
+ ],
+ "require": {
+ "phpdocumentor/reflection-docblock": "~2.0",
+ "sebastian/comparator": "~1.1",
+ "doctrine/instantiator": "^1.0.2"
+ },
+
+ "require-dev": {
+ "phpspec/phpspec": "~2.0"
+ },
+
+ "autoload": {
+ "psr-0": {
+ "Prophecy\\": "src/"
+ }
+ },
+
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.4.x-dev"
+ }
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Argument/ArgumentsWildcardSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Argument/ArgumentsWildcardSpec.php
new file mode 100644
index 00000000000..d96318e3618
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Argument/ArgumentsWildcardSpec.php
@@ -0,0 +1,143 @@
+beConstructedWith(array(42, 'zet', $object));
+
+ $class = get_class($object->getWrappedObject());
+ $hash = spl_object_hash($object->getWrappedObject());
+
+ $this->__toString()->shouldReturn("exact(42), exact(\"zet\"), exact($class:$hash Object (\n 'objectProphecy' => Prophecy\Prophecy\ObjectProphecy Object (*Prophecy*)\n))");
+ }
+
+ /**
+ * @param \Prophecy\Argument\Token\TokenInterface $token1
+ * @param \Prophecy\Argument\Token\TokenInterface $token2
+ * @param \Prophecy\Argument\Token\TokenInterface $token3
+ */
+ function it_generates_string_representation_from_all_tokens_imploded($token1, $token2, $token3)
+ {
+ $token1->__toString()->willReturn('token_1');
+ $token2->__toString()->willReturn('token_2');
+ $token3->__toString()->willReturn('token_3');
+
+ $this->beConstructedWith(array($token1, $token2, $token3));
+ $this->__toString()->shouldReturn('token_1, token_2, token_3');
+ }
+
+ function it_exposes_list_of_tokens(TokenInterface $token)
+ {
+ $this->beConstructedWith(array($token));
+
+ $this->getTokens()->shouldReturn(array($token));
+ }
+
+ function it_returns_score_of_1_if_there_are_no_tokens_and_arguments()
+ {
+ $this->beConstructedWith(array());
+
+ $this->scoreArguments(array())->shouldReturn(1);
+ }
+
+ /**
+ * @param \Prophecy\Argument\Token\TokenInterface $token1
+ * @param \Prophecy\Argument\Token\TokenInterface $token2
+ * @param \Prophecy\Argument\Token\TokenInterface $token3
+ */
+ function it_should_return_match_score_based_on_all_tokens_score($token1, $token2, $token3)
+ {
+ $token1->scoreArgument('one')->willReturn(3);
+ $token1->isLast()->willReturn(false);
+ $token2->scoreArgument(2)->willReturn(5);
+ $token2->isLast()->willReturn(false);
+ $token3->scoreArgument($obj = new \stdClass())->willReturn(10);
+ $token3->isLast()->willReturn(false);
+
+ $this->beConstructedWith(array($token1, $token2, $token3));
+ $this->scoreArguments(array('one', 2, $obj))->shouldReturn(18);
+ }
+
+ /**
+ * @param \Prophecy\Argument\Token\TokenInterface $token1
+ * @param \Prophecy\Argument\Token\TokenInterface $token2
+ * @param \Prophecy\Argument\Token\TokenInterface $token3
+ */
+ function it_returns_false_if_there_is_less_arguments_than_tokens($token1, $token2, $token3)
+ {
+ $token1->scoreArgument('one')->willReturn(3);
+ $token1->isLast()->willReturn(false);
+ $token2->scoreArgument(2)->willReturn(5);
+ $token2->isLast()->willReturn(false);
+ $token3->scoreArgument(null)->willReturn(false);
+ $token3->isLast()->willReturn(false);
+
+ $this->beConstructedWith(array($token1, $token2, $token3));
+ $this->scoreArguments(array('one', 2))->shouldReturn(false);
+ }
+
+ /**
+ * @param \Prophecy\Argument\Token\TokenInterface $token1
+ * @param \Prophecy\Argument\Token\TokenInterface $token2
+ * @param \Prophecy\Argument\Token\TokenInterface $token3
+ */
+ function it_returns_false_if_there_is_less_tokens_than_arguments($token1, $token2, $token3)
+ {
+ $token1->scoreArgument('one')->willReturn(3);
+ $token1->isLast()->willReturn(false);
+ $token2->scoreArgument(2)->willReturn(5);
+ $token2->isLast()->willReturn(false);
+ $token3->scoreArgument($obj = new \stdClass())->willReturn(10);
+ $token3->isLast()->willReturn(false);
+
+ $this->beConstructedWith(array($token1, $token2, $token3));
+ $this->scoreArguments(array('one', 2, $obj, 4))->shouldReturn(false);
+ }
+
+ /**
+ * @param \Prophecy\Argument\Token\TokenInterface $token1
+ * @param \Prophecy\Argument\Token\TokenInterface $token2
+ * @param \Prophecy\Argument\Token\TokenInterface $token3
+ */
+ function it_should_return_false_if_one_of_the_tokens_returns_false($token1, $token2, $token3)
+ {
+ $token1->scoreArgument('one')->willReturn(3);
+ $token1->isLast()->willReturn(false);
+ $token2->scoreArgument(2)->willReturn(false);
+ $token2->isLast()->willReturn(false);
+ $token3->scoreArgument($obj = new \stdClass())->willReturn(10);
+ $token3->isLast()->willReturn(false);
+
+ $this->beConstructedWith(array($token1, $token2, $token3));
+ $this->scoreArguments(array('one', 2, $obj))->shouldReturn(false);
+ }
+
+ /**
+ * @param \Prophecy\Argument\Token\TokenInterface $token1
+ * @param \Prophecy\Argument\Token\TokenInterface $token2
+ * @param \Prophecy\Argument\Token\TokenInterface $token3
+ */
+ function it_should_calculate_score_until_last_token($token1, $token2, $token3)
+ {
+ $token1->scoreArgument('one')->willReturn(3);
+ $token1->isLast()->willReturn(false);
+
+ $token2->scoreArgument(2)->willReturn(7);
+ $token2->isLast()->willReturn(true);
+
+ $token3->scoreArgument($obj = new \stdClass())->willReturn(10);
+ $token3->isLast()->willReturn(false);
+
+ $this->beConstructedWith(array($token1, $token2, $token3));
+ $this->scoreArguments(array('one', 2, $obj))->shouldReturn(10);
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/AnyValueTokenSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/AnyValueTokenSpec.php
new file mode 100644
index 00000000000..a43e923cf37
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/AnyValueTokenSpec.php
@@ -0,0 +1,28 @@
+shouldBeAnInstanceOf('Prophecy\Argument\Token\TokenInterface');
+ }
+
+ function it_is_not_last()
+ {
+ $this->shouldNotBeLast();
+ }
+
+ function its_string_representation_is_star()
+ {
+ $this->__toString()->shouldReturn('*');
+ }
+
+ function it_scores_any_argument_as_3()
+ {
+ $this->scoreArgument(42)->shouldReturn(3);
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/AnyValuesTokenSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/AnyValuesTokenSpec.php
new file mode 100644
index 00000000000..c29076f5935
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/AnyValuesTokenSpec.php
@@ -0,0 +1,28 @@
+shouldBeAnInstanceOf('Prophecy\Argument\Token\TokenInterface');
+ }
+
+ function it_is_last()
+ {
+ $this->shouldBeLast();
+ }
+
+ function its_string_representation_is_star_with_followup()
+ {
+ $this->__toString()->shouldReturn('* [, ...]');
+ }
+
+ function it_scores_any_argument_as_2()
+ {
+ $this->scoreArgument(42)->shouldReturn(2);
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ArrayCountTokenSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ArrayCountTokenSpec.php
new file mode 100644
index 00000000000..5d040d59c4e
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ArrayCountTokenSpec.php
@@ -0,0 +1,64 @@
+beConstructedWith(2);
+ }
+
+ function it_implements_TokenInterface()
+ {
+ $this->shouldBeAnInstanceOf('Prophecy\Argument\Token\TokenInterface');
+ }
+
+ function it_is_not_last()
+ {
+ $this->shouldNotBeLast();
+ }
+
+ function it_scores_6_if_argument_array_has_proper_count()
+ {
+ $this->scoreArgument(array(1,2))->shouldReturn(6);
+ }
+
+ /**
+ * @param \Countable $countable
+ */
+ function it_scores_6_if_argument_countable_object_has_proper_count($countable)
+ {
+ $countable->count()->willReturn(2);
+ $this->scoreArgument($countable)->shouldReturn(6);
+ }
+
+ function it_does_not_score_if_argument_is_neither_array_nor_countable_object()
+ {
+ $this->scoreArgument('string')->shouldBe(false);
+ $this->scoreArgument(5)->shouldBe(false);
+ $this->scoreArgument(new \stdClass)->shouldBe(false);
+ }
+
+ function it_does_not_score_if_argument_array_has_wrong_count()
+ {
+ $this->scoreArgument(array(1))->shouldReturn(false);
+ }
+
+ /**
+ * @param \Countable $countable
+ */
+ function it_does_not_score_if_argument_countable_object_has_wrong_count($countable)
+ {
+ $countable->count()->willReturn(3);
+ $this->scoreArgument($countable)->shouldReturn(false);
+ }
+
+ function it_has_simple_string_representation()
+ {
+ $this->__toString()->shouldBe('count(2)');
+ }
+
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ArrayEntryTokenSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ArrayEntryTokenSpec.php
new file mode 100644
index 00000000000..8ff0f158490
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ArrayEntryTokenSpec.php
@@ -0,0 +1,229 @@
+beConstructedWith($key, $value);
+ }
+
+ function it_implements_TokenInterface()
+ {
+ $this->shouldBeAnInstanceOf('Prophecy\Argument\Token\TokenInterface');
+ }
+
+ function it_is_not_last()
+ {
+ $this->shouldNotBeLast();
+ }
+
+ function it_holds_key_and_value($key, $value)
+ {
+ $this->getKey()->shouldBe($key);
+ $this->getValue()->shouldBe($value);
+ }
+
+ function its_string_representation_tells_that_its_an_array_containing_the_key_value_pair($key, $value)
+ {
+ $key->__toString()->willReturn('key');
+ $value->__toString()->willReturn('value');
+ $this->__toString()->shouldBe('[..., key => value, ...]');
+ }
+
+ /**
+ * @param \Prophecy\Argument\Token\TokenInterface $key
+ * @param \stdClass $object
+ */
+ function it_wraps_non_token_value_into_ExactValueToken($key, $object)
+ {
+ $this->beConstructedWith($key, $object);
+ $this->getValue()->shouldHaveType('\Prophecy\Argument\Token\ExactValueToken');
+ }
+
+ /**
+ * @param \stdClass $object
+ * @param \Prophecy\Argument\Token\TokenInterface $value
+ */
+ function it_wraps_non_token_key_into_ExactValueToken($object, $value)
+ {
+ $this->beConstructedWith($object, $value);
+ $this->getKey()->shouldHaveType('\Prophecy\Argument\Token\ExactValueToken');
+ }
+
+ function it_scores_array_half_of_combined_scores_from_key_and_value_tokens($key, $value)
+ {
+ $key->scoreArgument('key')->willReturn(4);
+ $value->scoreArgument('value')->willReturn(6);
+ $this->scoreArgument(array('key'=>'value'))->shouldBe(5);
+ }
+
+ /**
+ * @param \Prophecy\Argument\Token\TokenInterface $key
+ * @param \Prophecy\Argument\Token\TokenInterface $value
+ * @param \Iterator $object
+ */
+ function it_scores_traversable_object_half_of_combined_scores_from_key_and_value_tokens($key, $value, $object)
+ {
+ $object->current()->will(function () use ($object) {
+ $object->valid()->willReturn(false);
+
+ return 'value';
+ });
+ $object->key()->willReturn('key');
+ $object->rewind()->willReturn(null);
+ $object->next()->willReturn(null);
+ $object->valid()->willReturn(true);
+ $key->scoreArgument('key')->willReturn(6);
+ $value->scoreArgument('value')->willReturn(2);
+ $this->scoreArgument($object)->shouldBe(4);
+ }
+
+ /**
+ * @param \Prophecy\Argument\Token\AnyValuesToken $key
+ * @param \Prophecy\Argument\Token\TokenInterface $value
+ * @param \ArrayAccess $object
+ */
+ function it_throws_exception_during_scoring_of_array_accessible_object_if_key_is_not_ExactValueToken($key, $value, $object)
+ {
+ $key->__toString()->willReturn('any_token');
+ $this->beConstructedWith($key,$value);
+ $errorMessage = 'You can only use exact value tokens to match key of ArrayAccess object'.PHP_EOL.
+ 'But you used `any_token`.';
+ $this->shouldThrow(new InvalidArgumentException($errorMessage))->duringScoreArgument($object);
+ }
+
+ /**
+ * @param \Prophecy\Argument\Token\ExactValueToken $key
+ * @param \Prophecy\Argument\Token\TokenInterface $value
+ * @param \ArrayAccess $object
+ */
+ function it_scores_array_accessible_object_half_of_combined_scores_from_key_and_value_tokens($key, $value, $object)
+ {
+ $object->offsetExists('key')->willReturn(true);
+ $object->offsetGet('key')->willReturn('value');
+ $key->getValue()->willReturn('key');
+ $key->scoreArgument('key')->willReturn(3);
+ $value->scoreArgument('value')->willReturn(1);
+ $this->scoreArgument($object)->shouldBe(2);
+ }
+
+ /**
+ * @param \Prophecy\Argument\Token\AnyValuesToken $key
+ * @param \Prophecy\Argument\Token\TokenInterface $value
+ * @param \ArrayIterator $object
+ */
+ function it_accepts_any_key_token_type_to_score_object_that_is_both_traversable_and_array_accessible($key, $value, $object)
+ {
+ $this->beConstructedWith($key, $value);
+ $object->current()->will(function () use ($object) {
+ $object->valid()->willReturn(false);
+
+ return 'value';
+ });
+ $object->key()->willReturn('key');
+ $object->rewind()->willReturn(null);
+ $object->next()->willReturn(null);
+ $object->valid()->willReturn(true);
+ $this->shouldNotThrow(new InvalidArgumentException)->duringScoreArgument($object);
+ }
+
+ function it_does_not_score_if_argument_is_neither_array_nor_traversable_nor_array_accessible()
+ {
+ $this->scoreArgument('string')->shouldBe(false);
+ $this->scoreArgument(new \stdClass)->shouldBe(false);
+ }
+
+ function it_does_not_score_empty_array()
+ {
+ $this->scoreArgument(array())->shouldBe(false);
+ }
+
+ function it_does_not_score_array_if_key_and_value_tokens_do_not_score_same_entry($key, $value)
+ {
+ $argument = array(1 => 'foo', 2 => 'bar');
+ $key->scoreArgument(1)->willReturn(true);
+ $key->scoreArgument(2)->willReturn(false);
+ $value->scoreArgument('foo')->willReturn(false);
+ $value->scoreArgument('bar')->willReturn(true);
+ $this->scoreArgument($argument)->shouldBe(false);
+ }
+
+ /**
+ * @param \Iterator $object
+ */
+ function it_does_not_score_traversable_object_without_entries($object)
+ {
+ $object->rewind()->willReturn(null);
+ $object->next()->willReturn(null);
+ $object->valid()->willReturn(false);
+ $this->scoreArgument($object)->shouldBe(false);
+ }
+
+ /**
+ * @param \Prophecy\Argument\Token\TokenInterface $key
+ * @param \Prophecy\Argument\Token\TokenInterface $value
+ * @param \Iterator $object
+ */
+ function it_does_not_score_traversable_object_if_key_and_value_tokens_do_not_score_same_entry($key, $value, $object)
+ {
+ $object->current()->willReturn('foo');
+ $object->current()->will(function () use ($object) {
+ $object->valid()->willReturn(false);
+
+ return 'bar';
+ });
+ $object->key()->willReturn(1);
+ $object->key()->willReturn(2);
+ $object->rewind()->willReturn(null);
+ $object->next()->willReturn(null);
+ $object->valid()->willReturn(true);
+ $key->scoreArgument(1)->willReturn(true);
+ $key->scoreArgument(2)->willReturn(false);
+ $value->scoreArgument('foo')->willReturn(false);
+ $value->scoreArgument('bar')->willReturn(true);
+ $this->scoreArgument($object)->shouldBe(false);
+ }
+
+ /**
+ * @param \Prophecy\Argument\Token\ExactValueToken $key
+ * @param \ArrayAccess $object
+ */
+ function it_does_not_score_array_accessible_object_if_it_has_no_offset_with_key_token_value($key, $object)
+ {
+ $object->offsetExists('key')->willReturn(false);
+ $key->getValue()->willReturn('key');
+ $this->scoreArgument($object)->shouldBe(false);
+ }
+
+ /**
+ * @param \Prophecy\Argument\Token\ExactValueToken $key
+ * @param \Prophecy\Argument\Token\TokenInterface $value
+ * @param \ArrayAccess $object
+ */
+ function it_does_not_score_array_accessible_object_if_key_and_value_tokens_do_not_score_same_entry($key, $value, $object)
+ {
+ $object->offsetExists('key')->willReturn(true);
+ $object->offsetGet('key')->willReturn('value');
+ $key->getValue()->willReturn('key');
+ $value->scoreArgument('value')->willReturn(false);
+ $key->scoreArgument('key')->willReturn(true);
+ $this->scoreArgument($object)->shouldBe(false);
+ }
+
+ function its_score_is_capped_at_8($key, $value)
+ {
+ $key->scoreArgument('key')->willReturn(10);
+ $value->scoreArgument('value')->willReturn(10);
+ $this->scoreArgument(array('key'=>'value'))->shouldBe(8);
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ArrayEveryEntryTokenSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ArrayEveryEntryTokenSpec.php
new file mode 100644
index 00000000000..8662e7d1959
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ArrayEveryEntryTokenSpec.php
@@ -0,0 +1,109 @@
+beConstructedWith($value);
+ }
+
+ function it_implements_TokenInterface()
+ {
+ $this->shouldBeAnInstanceOf('Prophecy\Argument\Token\TokenInterface');
+ }
+
+ function it_is_not_last()
+ {
+ $this->shouldNotBeLast();
+ }
+
+ function it_holds_value($value)
+ {
+ $this->getValue()->shouldBe($value);
+ }
+
+ function its_string_representation_tells_that_its_an_array_containing_only_value($value)
+ {
+ $value->__toString()->willReturn('value');
+ $this->__toString()->shouldBe('[value, ..., value]');
+ }
+
+ /**
+ * @param \stdClass $stdClass
+ */
+ function it_wraps_non_token_value_into_ExactValueToken($stdClass)
+ {
+ $this->beConstructedWith($stdClass);
+ $this->getValue()->shouldHaveType('Prophecy\Argument\Token\ExactValueToken');
+ }
+
+ function it_does_not_score_if_argument_is_neither_array_nor_traversable()
+ {
+ $this->scoreArgument('string')->shouldBe(false);
+ $this->scoreArgument(new \stdClass)->shouldBe(false);
+ }
+
+ function it_does_not_score_empty_array()
+ {
+ $this->scoreArgument(array())->shouldBe(false);
+ }
+
+ /**
+ * @param \Iterator $object
+ */
+ function it_does_not_score_traversable_object_without_entries($object)
+ {
+ $object->rewind()->willReturn(null);
+ $object->next()->willReturn(null);
+ $object->valid()->willReturn(false);
+ $this->scoreArgument($object)->shouldBe(false);
+ }
+
+ function it_scores_avg_of_scores_from_value_tokens($value)
+ {
+ $value->scoreArgument('value1')->willReturn(6);
+ $value->scoreArgument('value2')->willReturn(3);
+ $this->scoreArgument(array('value1', 'value2'))->shouldBe(4.5);
+ }
+
+ function it_scores_false_if_entry_scores_false($value)
+ {
+ $value->scoreArgument('value1')->willReturn(6);
+ $value->scoreArgument('value2')->willReturn(false);
+ $this->scoreArgument(array('value1', 'value2'))->shouldBe(false);
+ }
+
+ function it_does_not_score_array_keys($value)
+ {
+ $value->scoreArgument('value')->willReturn(6);
+ $value->scoreArgument('key')->shouldNotBeCalled(0);
+ $this->scoreArgument(array('key' => 'value'))->shouldBe(6);
+ }
+
+ /**
+ * @param \Prophecy\Argument\Token\TokenInterface $value
+ * @param \Iterator $object
+ */
+ function it_scores_traversable_object_from_value_token($value, $object)
+ {
+ $object->current()->will(function ($args, $object) {
+ $object->valid()->willReturn(false);
+
+ return 'value';
+ });
+ $object->key()->willReturn('key');
+ $object->rewind()->willReturn(null);
+ $object->next()->willReturn(null);
+ $object->valid()->willReturn(true);
+ $value->scoreArgument('value')->willReturn(2);
+ $this->scoreArgument($object)->shouldBe(2);
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/CallbackTokenSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/CallbackTokenSpec.php
new file mode 100644
index 00000000000..4395bf097de
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/CallbackTokenSpec.php
@@ -0,0 +1,42 @@
+beConstructedWith('get_class');
+ }
+
+ function it_implements_TokenInterface()
+ {
+ $this->shouldBeAnInstanceOf('Prophecy\Argument\Token\TokenInterface');
+ }
+
+ function it_is_not_last()
+ {
+ $this->shouldNotBeLast();
+ }
+
+ function it_scores_7_if_argument_matches_callback()
+ {
+ $this->beConstructedWith(function ($argument) { return 2 === $argument; });
+
+ $this->scoreArgument(2)->shouldReturn(7);
+ }
+
+ function it_does_not_scores_if_argument_does_not_match_callback()
+ {
+ $this->beConstructedWith(function ($argument) { return 2 === $argument; });
+
+ $this->scoreArgument(5)->shouldReturn(false);
+ }
+
+ function its_string_representation_should_tell_that_its_callback()
+ {
+ $this->__toString()->shouldReturn('callback()');
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ExactValueTokenSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ExactValueTokenSpec.php
new file mode 100644
index 00000000000..9e46e021f9e
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ExactValueTokenSpec.php
@@ -0,0 +1,155 @@
+beConstructedWith(42);
+ }
+
+ function it_implements_TokenInterface()
+ {
+ $this->shouldBeAnInstanceOf('Prophecy\Argument\Token\TokenInterface');
+ }
+
+ function it_is_not_last()
+ {
+ $this->shouldNotBeLast();
+ }
+
+ function it_holds_value()
+ {
+ $this->getValue()->shouldReturn(42);
+ }
+
+ function it_scores_10_if_value_is_equal_to_argument()
+ {
+ $this->scoreArgument(42)->shouldReturn(10);
+ $this->scoreArgument('42')->shouldReturn(10);
+ }
+
+ function it_scores_10_if_value_is_an_object_and_equal_to_argument()
+ {
+ $value = new \DateTime();
+ $value2 = clone $value;
+
+ $this->beConstructedWith($value);
+ $this->scoreArgument($value2)->shouldReturn(10);
+ }
+
+ function it_does_not_scores_if_value_is_not_equal_to_argument()
+ {
+ $this->scoreArgument(50)->shouldReturn(false);
+ $this->scoreArgument(new \stdClass())->shouldReturn(false);
+ }
+
+ function it_does_not_scores_if_value_an_object_and_is_not_equal_to_argument()
+ {
+ $value = new ExactValueTokenFixtureB('ABC');
+ $value2 = new ExactValueTokenFixtureB('CBA');
+
+ $this->beConstructedWith($value);
+ $this->scoreArgument($value2)->shouldReturn(false);
+ }
+
+ function it_does_not_scores_if_value_type_and_is_not_equal_to_argument()
+ {
+ $this->beConstructedWith(false);
+ $this->scoreArgument(0)->shouldReturn(false);
+ }
+
+ function it_generates_proper_string_representation_for_integer()
+ {
+ $this->beConstructedWith(42);
+ $this->__toString()->shouldReturn('exact(42)');
+ }
+
+ function it_generates_proper_string_representation_for_string()
+ {
+ $this->beConstructedWith('some string');
+ $this->__toString()->shouldReturn('exact("some string")');
+ }
+
+ function it_generates_single_line_representation_for_multiline_string()
+ {
+ $this->beConstructedWith("some\nstring");
+ $this->__toString()->shouldReturn('exact("some\\nstring")');
+ }
+
+ function it_generates_proper_string_representation_for_double()
+ {
+ $this->beConstructedWith(42.3);
+ $this->__toString()->shouldReturn('exact(42.3)');
+ }
+
+ function it_generates_proper_string_representation_for_boolean_true()
+ {
+ $this->beConstructedWith(true);
+ $this->__toString()->shouldReturn('exact(true)');
+ }
+
+ function it_generates_proper_string_representation_for_boolean_false()
+ {
+ $this->beConstructedWith(false);
+ $this->__toString()->shouldReturn('exact(false)');
+ }
+
+ function it_generates_proper_string_representation_for_null()
+ {
+ $this->beConstructedWith(null);
+ $this->__toString()->shouldReturn('exact(null)');
+ }
+
+ function it_generates_proper_string_representation_for_empty_array()
+ {
+ $this->beConstructedWith(array());
+ $this->__toString()->shouldReturn('exact([])');
+ }
+
+ function it_generates_proper_string_representation_for_array()
+ {
+ $this->beConstructedWith(array('zet', 42));
+ $this->__toString()->shouldReturn('exact(["zet", 42])');
+ }
+
+ function it_generates_proper_string_representation_for_resource()
+ {
+ $resource = fopen(__FILE__, 'r');
+ $this->beConstructedWith($resource);
+ $this->__toString()->shouldReturn('exact(stream:'.$resource.')');
+ }
+
+ /**
+ * @param \stdClass $object
+ */
+ function it_generates_proper_string_representation_for_object($object)
+ {
+ $objHash = sprintf('%s:%s',
+ get_class($object->getWrappedObject()),
+ spl_object_hash($object->getWrappedObject())
+ );
+
+ $this->beConstructedWith($object);
+ $this->__toString()->shouldReturn("exact($objHash Object (\n 'objectProphecy' => Prophecy\Prophecy\ObjectProphecy Object (*Prophecy*)\n))");
+ }
+}
+
+class ExactValueTokenFixtureA
+{
+ public $errors;
+}
+
+class ExactValueTokenFixtureB extends ExactValueTokenFixtureA
+{
+ public $errors;
+ public $value = null;
+
+ public function __construct($value)
+ {
+ $this->value = $value;
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/IdenticalValueTokenSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/IdenticalValueTokenSpec.php
new file mode 100644
index 00000000000..00c3a2157fc
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/IdenticalValueTokenSpec.php
@@ -0,0 +1,152 @@
+beConstructedWith(42);
+ }
+
+ function it_is_initializable()
+ {
+ $this->shouldHaveType('Prophecy\Argument\Token\IdenticalValueToken');
+ }
+
+ function it_scores_11_if_string_value_is_identical_to_argument()
+ {
+ $this->beConstructedWith('foo');
+ $this->scoreArgument('foo')->shouldReturn(11);
+ }
+
+ function it_scores_11_if_boolean_value_is_identical_to_argument()
+ {
+ $this->beConstructedWith(false);
+ $this->scoreArgument(false)->shouldReturn(11);
+ }
+
+ function it_scores_11_if_integer_value_is_identical_to_argument()
+ {
+ $this->beConstructedWith(31);
+ $this->scoreArgument(31)->shouldReturn(11);
+ }
+
+ function it_scores_11_if_float_value_is_identical_to_argument()
+ {
+ $this->beConstructedWith(31.12);
+ $this->scoreArgument(31.12)->shouldReturn(11);
+ }
+
+ function it_scores_11_if_array_value_is_identical_to_argument()
+ {
+ $this->beConstructedWith(array('foo' => 'bar'));
+ $this->scoreArgument(array('foo' => 'bar'))->shouldReturn(11);
+ }
+
+ function it_scores_11_if_object_value_is_identical_to_argument()
+ {
+ $object = new \stdClass();
+
+ $this->beConstructedWith($object);
+ $this->scoreArgument($object)->shouldReturn(11);
+ }
+
+ function it_scores_false_if_value_is_not_identical_to_argument()
+ {
+ $this->beConstructedWith(new \stdClass());
+ $this->scoreArgument('foo')->shouldReturn(false);
+ }
+
+ function it_scores_false_if_object_value_is_not_the_same_instance_than_argument()
+ {
+ $this->beConstructedWith(new \stdClass());
+ $this->scoreArgument(new \stdClass())->shouldReturn(false);
+ }
+
+ function it_scores_false_if_integer_value_is_not_identical_to_boolean_argument()
+ {
+ $this->beConstructedWith(1);
+ $this->scoreArgument(true)->shouldReturn(false);
+ }
+
+ function it_is_not_last()
+ {
+ $this->shouldNotBeLast();
+ }
+
+ function it_generates_proper_string_representation_for_integer()
+ {
+ $this->beConstructedWith(42);
+ $this->__toString()->shouldReturn('identical(42)');
+ }
+
+ function it_generates_proper_string_representation_for_string()
+ {
+ $this->beConstructedWith('some string');
+ $this->__toString()->shouldReturn('identical("some string")');
+ }
+
+ function it_generates_single_line_representation_for_multiline_string()
+ {
+ $this->beConstructedWith("some\nstring");
+ $this->__toString()->shouldReturn('identical("some\\nstring")');
+ }
+
+ function it_generates_proper_string_representation_for_double()
+ {
+ $this->beConstructedWith(42.3);
+ $this->__toString()->shouldReturn('identical(42.3)');
+ }
+
+ function it_generates_proper_string_representation_for_boolean_true()
+ {
+ $this->beConstructedWith(true);
+ $this->__toString()->shouldReturn('identical(true)');
+ }
+
+ function it_generates_proper_string_representation_for_boolean_false()
+ {
+ $this->beConstructedWith(false);
+ $this->__toString()->shouldReturn('identical(false)');
+ }
+
+ function it_generates_proper_string_representation_for_null()
+ {
+ $this->beConstructedWith(null);
+ $this->__toString()->shouldReturn('identical(null)');
+ }
+
+ function it_generates_proper_string_representation_for_empty_array()
+ {
+ $this->beConstructedWith(array());
+ $this->__toString()->shouldReturn('identical([])');
+ }
+
+ function it_generates_proper_string_representation_for_array()
+ {
+ $this->beConstructedWith(array('zet', 42));
+ $this->__toString()->shouldReturn('identical(["zet", 42])');
+ }
+
+ function it_generates_proper_string_representation_for_resource()
+ {
+ $resource = fopen(__FILE__, 'r');
+ $this->beConstructedWith($resource);
+ $this->__toString()->shouldReturn('identical(stream:'.$resource.')');
+ }
+
+ function it_generates_proper_string_representation_for_object($object)
+ {
+ $objHash = sprintf('%s:%s',
+ get_class($object->getWrappedObject()),
+ spl_object_hash($object->getWrappedObject())
+ );
+
+ $this->beConstructedWith($object);
+ $this->__toString()->shouldReturn("identical($objHash Object (\n 'objectProphecy' => Prophecy\Prophecy\ObjectProphecy Object (*Prophecy*)\n))");
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/LogicalAndTokenSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/LogicalAndTokenSpec.php
new file mode 100644
index 00000000000..bb5e3840b76
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/LogicalAndTokenSpec.php
@@ -0,0 +1,78 @@
+beConstructedWith(array());
+ $this->shouldBeAnInstanceOf('Prophecy\Argument\Token\TokenInterface');
+ }
+
+ function it_is_not_last()
+ {
+ $this->beConstructedWith(array());
+ $this->shouldNotBeLast();
+ }
+
+ /**
+ * @param \Prophecy\Argument\Token\TokenInterface $token1
+ * @param \Prophecy\Argument\Token\TokenInterface $token2
+ * @param \Prophecy\Argument\Token\TokenInterface $token3
+ */
+ function it_generates_string_representation_from_all_tokens_imploded($token1, $token2, $token3)
+ {
+ $token1->__toString()->willReturn('token_1');
+ $token2->__toString()->willReturn('token_2');
+ $token3->__toString()->willReturn('token_3');
+
+ $this->beConstructedWith(array($token1, $token2, $token3));
+ $this->__toString()->shouldReturn('bool(token_1 AND token_2 AND token_3)');
+ }
+
+ function it_wraps_non_token_arguments_into_ExactValueToken()
+ {
+ $this->beConstructedWith(array(15, '1985'));
+ $this->__toString()->shouldReturn("bool(exact(15) AND exact(\"1985\"))");
+ }
+
+ /**
+ * @param \Prophecy\Argument\Token\TokenInterface $token1
+ * @param \Prophecy\Argument\Token\TokenInterface $token2
+ */
+ function it_scores_the_maximum_score_from_all_scores_returned_by_tokens($token1, $token2)
+ {
+ $token1->scoreArgument(1)->willReturn(10);
+ $token2->scoreArgument(1)->willReturn(5);
+ $this->beConstructedWith(array($token1, $token2));
+ $this->scoreArgument(1)->shouldReturn(10);
+ }
+
+ function it_does_not_score_if_there_are_no_arguments_or_tokens()
+ {
+ $this->beConstructedWith(array());
+ $this->scoreArgument('any')->shouldReturn(false);
+ }
+
+ /**
+ * @param \Prophecy\Argument\Token\TokenInterface $token1
+ * @param \Prophecy\Argument\Token\TokenInterface $token2
+ */
+ function it_does_not_score_if_either_of_tokens_does_not_score($token1, $token2)
+ {
+ $token1->scoreArgument(1)->willReturn(10);
+ $token1->scoreArgument(2)->willReturn(false);
+
+ $token2->scoreArgument(1)->willReturn(false);
+ $token2->scoreArgument(2)->willReturn(10);
+
+ $this->beConstructedWith(array($token1, $token2));
+
+ $this->scoreArgument(1)->shouldReturn(false);
+ $this->scoreArgument(2)->shouldReturn(false);
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/LogicalNotTokenSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/LogicalNotTokenSpec.php
new file mode 100644
index 00000000000..7ce7f3d8faa
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/LogicalNotTokenSpec.php
@@ -0,0 +1,65 @@
+beConstructedWith($token);
+ }
+
+ function it_implements_TokenInterface()
+ {
+ $this->shouldBeAnInstanceOf('Prophecy\Argument\Token\TokenInterface');
+ }
+
+ function it_holds_originating_token($token)
+ {
+ $this->getOriginatingToken()->shouldReturn($token);
+ }
+
+ function it_has_simple_string_representation($token)
+ {
+ $token->__toString()->willReturn('value');
+ $this->__toString()->shouldBe('not(value)');
+ }
+
+ function it_wraps_non_token_argument_into_ExactValueToken()
+ {
+ $this->beConstructedWith(5);
+ $token = $this->getOriginatingToken();
+ $token->shouldhaveType('Prophecy\Argument\Token\ExactValueToken');
+ $token->getValue()->shouldBe(5);
+ }
+
+ function it_scores_4_if_preset_token_does_not_match_the_argument($token)
+ {
+ $token->scoreArgument('argument')->willReturn(false);
+ $this->scoreArgument('argument')->shouldBe(4);
+ }
+
+ function it_does_not_score_if_preset_token_matches_argument($token)
+ {
+ $token->scoreArgument('argument')->willReturn(5);
+ $this->scoreArgument('argument')->shouldBe(false);
+ }
+
+ function it_is_last_if_preset_token_is_last($token)
+ {
+ $token->isLast()->willReturn(true);
+ $this->shouldBeLast();
+ }
+
+ function it_is_not_last_if_preset_token_is_not_last($token)
+ {
+ $token->isLast()->willReturn(false);
+ $this->shouldNotBeLast();
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ObjectStateTokenSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ObjectStateTokenSpec.php
new file mode 100644
index 00000000000..a783a15fd1e
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ObjectStateTokenSpec.php
@@ -0,0 +1,101 @@
+beConstructedWith('getName', 'stdClass');
+ }
+
+ function it_implements_TokenInterface()
+ {
+ $this->shouldBeAnInstanceOf('Prophecy\Argument\Token\TokenInterface');
+ }
+
+ function it_is_not_last()
+ {
+ $this->shouldNotBeLast();
+ }
+
+ /**
+ * @param \ReflectionClass $reflection
+ */
+ function it_scores_8_if_argument_object_has_specific_method_state($reflection)
+ {
+ $reflection->getName()->willReturn('stdClass');
+
+ $this->scoreArgument($reflection)->shouldReturn(8);
+ }
+
+ /**
+ * @param \stdClass $class
+ */
+ function it_scores_8_if_argument_object_has_specific_property_state($class)
+ {
+ $class->getName = 'stdClass';
+
+ $this->scoreArgument($class)->shouldReturn(8);
+ }
+
+ function it_does_not_score_if_argument_method_state_does_not_match()
+ {
+ $value = new ObjectStateTokenFixtureB('ABC');
+ $value2 = new ObjectStateTokenFixtureB('CBA');
+
+ $this->beConstructedWith('getSelf', $value);
+ $this->scoreArgument($value2)->shouldReturn(false);
+ }
+
+ /**
+ * @param \stdClass $class
+ */
+ function it_does_not_score_if_argument_property_state_does_not_match($class)
+ {
+ $class->getName = 'SplFileInfo';
+
+ $this->scoreArgument($class)->shouldReturn(false);
+ }
+
+ /**
+ * @param \spec\Prophecy\Argument\Token\ObjectStateTokenFixtureA $class
+ */
+ function it_does_not_score_if_argument_object_does_not_have_method_or_property($class)
+ {
+ $this->scoreArgument($class)->shouldReturn(false);
+ }
+
+ function it_does_not_score_if_argument_is_not_object()
+ {
+ $this->scoreArgument(42)->shouldReturn(false);
+ }
+
+ function it_has_simple_string_representation()
+ {
+ $this->__toString()->shouldReturn('state(getName(), "stdClass")');
+ }
+}
+
+class ObjectStateTokenFixtureA
+{
+ public $errors;
+}
+
+class ObjectStateTokenFixtureB extends ObjectStateTokenFixtureA
+{
+ public $errors;
+ public $value = null;
+
+ public function __construct($value)
+ {
+ $this->value = $value;
+ }
+
+ public function getSelf()
+ {
+ return $this;
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/StringContainsTokenSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/StringContainsTokenSpec.php
new file mode 100644
index 00000000000..c7fd2652319
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/StringContainsTokenSpec.php
@@ -0,0 +1,49 @@
+beConstructedWith('a substring');
+ }
+
+ function it_is_initializable()
+ {
+ $this->shouldHaveType('Prophecy\Argument\Token\StringContainsToken');
+ }
+
+ function it_implements_TokenInterface()
+ {
+ $this->shouldBeAnInstanceOf('Prophecy\Argument\Token\TokenInterface');
+ }
+
+ function it_holds_value()
+ {
+ $this->getValue()->shouldReturn('a substring');
+ }
+
+ function it_is_not_last()
+ {
+ $this->shouldNotBeLast();
+ }
+
+ function it_scores_6_if_the_argument_contains_the_value()
+ {
+ $this->scoreArgument('Argument containing a substring')->shouldReturn(6);
+ }
+
+ function it_does_not_score_if_the_argument_does_not_contain_the_value()
+ {
+ $this->scoreArgument('Argument will not match')->shouldReturn(false);
+ }
+
+ function its_string_representation_shows_substring()
+ {
+ $this->__toString()->shouldReturn('contains("a substring")');
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/TypeTokenSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/TypeTokenSpec.php
new file mode 100644
index 00000000000..f9a9507dd5e
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/TypeTokenSpec.php
@@ -0,0 +1,59 @@
+beConstructedWith('integer');
+ }
+
+ function it_implements_TokenInterface()
+ {
+ $this->shouldBeAnInstanceOf('Prophecy\Argument\Token\TokenInterface');
+ }
+
+ function it_is_not_last()
+ {
+ $this->shouldNotBeLast();
+ }
+
+ function it_scores_5_if_argument_matches_simple_type()
+ {
+ $this->beConstructedWith('integer');
+
+ $this->scoreArgument(42)->shouldReturn(5);
+ }
+
+ function it_does_not_scores_if_argument_does_not_match_simple_type()
+ {
+ $this->beConstructedWith('integer');
+
+ $this->scoreArgument(42.0)->shouldReturn(false);
+ }
+
+ /**
+ * @param \ReflectionObject $object
+ */
+ function it_scores_5_if_argument_is_an_instance_of_specified_class($object)
+ {
+ $this->beConstructedWith('ReflectionClass');
+
+ $this->scoreArgument($object)->shouldReturn(5);
+ }
+
+ function it_has_simple_string_representation()
+ {
+ $this->__toString()->shouldReturn('type(integer)');
+ }
+
+ function it_scores_5_if_argument_is_an_instance_of_specified_interface(\Prophecy\Argument\Token\TokenInterface $interface)
+ {
+ $this->beConstructedWith('Prophecy\Argument\Token\TokenInterface');
+
+ $this->scoreArgument($interface)->shouldReturn(5);
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/ArgumentSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/ArgumentSpec.php
new file mode 100644
index 00000000000..990aa80a34d
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/ArgumentSpec.php
@@ -0,0 +1,101 @@
+exact(42);
+ $token->shouldBeAnInstanceOf('Prophecy\Argument\Token\ExactValueToken');
+ $token->getValue()->shouldReturn(42);
+ }
+
+ function it_has_a_shortcut_for_any_argument_token()
+ {
+ $token = $this->any();
+ $token->shouldBeAnInstanceOf('Prophecy\Argument\Token\AnyValueToken');
+ }
+
+ function it_has_a_shortcut_for_multiple_arguments_token()
+ {
+ $token = $this->cetera();
+ $token->shouldBeAnInstanceOf('Prophecy\Argument\Token\AnyValuesToken');
+ }
+
+ function it_has_a_shortcut_for_type_token()
+ {
+ $token = $this->type('integer');
+ $token->shouldBeAnInstanceOf('Prophecy\Argument\Token\TypeToken');
+ }
+
+ function it_has_a_shortcut_for_callback_token()
+ {
+ $token = $this->that('get_class');
+ $token->shouldBeAnInstanceOf('Prophecy\Argument\Token\CallbackToken');
+ }
+
+ function it_has_a_shortcut_for_object_state_token()
+ {
+ $token = $this->which('getName', 'everzet');
+ $token->shouldBeAnInstanceOf('Prophecy\Argument\Token\ObjectStateToken');
+ }
+
+ function it_has_a_shortcut_for_logical_and_token()
+ {
+ $token = $this->allOf('integer', 5);
+ $token->shouldBeAnInstanceOf('Prophecy\Argument\Token\LogicalAndToken');
+ }
+
+ function it_has_a_shortcut_for_array_count_token()
+ {
+ $token = $this->size(5);
+ $token->shouldBeAnInstanceOf('Prophecy\Argument\Token\ArrayCountToken');
+ }
+
+ function it_has_a_shortcut_for_array_entry_token()
+ {
+ $token = $this->withEntry('key', 'value');
+ $token->shouldBeAnInstanceOf('Prophecy\Argument\Token\ArrayEntryToken');
+ }
+
+ function it_has_a_shortcut_for_array_every_entry_token()
+ {
+ $token = $this->withEveryEntry('value');
+ $token->shouldBeAnInstanceOf('Prophecy\Argument\Token\ArrayEveryEntryToken');
+ }
+
+ function it_has_a_shortcut_for_identical_value_token()
+ {
+ $token = $this->is('value');
+ $token->shouldBeAnInstanceOf('Prophecy\Argument\Token\IdenticalValueToken');
+ }
+
+ function it_has_a_shortcut_for_array_entry_token_matching_any_key()
+ {
+ $token = $this->containing('value');
+ $token->shouldBeAnInstanceOf('Prophecy\Argument\Token\ArrayEntryToken');
+ $token->getKey()->shouldHaveType('Prophecy\Argument\Token\AnyValueToken');
+ }
+
+ function it_has_a_shortcut_for_array_entry_token_matching_any_value()
+ {
+ $token = $this->withKey('key');
+ $token->shouldBeAnInstanceOf('Prophecy\Argument\Token\ArrayEntryToken');
+ $token->getValue()->shouldHaveType('Prophecy\Argument\Token\AnyValueToken');
+ }
+
+ function it_has_a_shortcut_for_logical_not_token()
+ {
+ $token = $this->not('kagux');
+ $token->shouldBeAnInstanceOf('Prophecy\Argument\Token\LogicalNotToken');
+ }
+
+ function it_has_a_shortcut_for_string_contains_token()
+ {
+ $token = $this->containingString('string');
+ $token->shouldBeAnInstanceOf('Prophecy\Argument\Token\StringContainsToken');
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Call/CallCenterSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Call/CallCenterSpec.php
new file mode 100644
index 00000000000..e9b91c859fc
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Call/CallCenterSpec.php
@@ -0,0 +1,188 @@
+scoreArguments(array(5, 2, 3))->willReturn(10);
+ $objectProphecy->getMethodProphecies()->willReturn(array());
+
+ $this->makeCall($objectProphecy, 'setValues', array(5, 2, 3));
+
+ $calls = $this->findCalls('setValues', $wildcard);
+ $calls->shouldHaveCount(1);
+
+ $calls[0]->shouldBeAnInstanceOf('Prophecy\Call\Call');
+ $calls[0]->getMethodName()->shouldReturn('setValues');
+ $calls[0]->getArguments()->shouldReturn(array(5, 2, 3));
+ $calls[0]->getReturnValue()->shouldReturn(null);
+ }
+
+ function it_returns_null_for_any_call_through_makeCall_if_no_method_prophecies_added(
+ $objectProphecy
+ )
+ {
+ $objectProphecy->getMethodProphecies()->willReturn(array());
+
+ $this->makeCall($objectProphecy, 'setValues', array(5, 2, 3))->shouldReturn(null);
+ }
+
+ /**
+ * @param \Prophecy\Prophecy\MethodProphecy $method1
+ * @param \Prophecy\Prophecy\MethodProphecy $method2
+ * @param \Prophecy\Prophecy\MethodProphecy $method3
+ * @param \Prophecy\Argument\ArgumentsWildcard $arguments1
+ * @param \Prophecy\Argument\ArgumentsWildcard $arguments2
+ * @param \Prophecy\Argument\ArgumentsWildcard $arguments3
+ * @param \Prophecy\Promise\PromiseInterface $promise
+ */
+ function it_executes_promise_of_method_prophecy_that_matches_signature_passed_to_makeCall(
+ $objectProphecy, $method1, $method2, $method3, $arguments1, $arguments2, $arguments3,
+ $promise
+ )
+ {
+ $method1->getMethodName()->willReturn('getName');
+ $method1->getArgumentsWildcard()->willReturn($arguments1);
+ $arguments1->scoreArguments(array('world', 'everything'))->willReturn(false);
+
+ $method2->getMethodName()->willReturn('setTitle');
+ $method2->getArgumentsWildcard()->willReturn($arguments2);
+ $arguments2->scoreArguments(array('world', 'everything'))->willReturn(false);
+
+ $method3->getMethodName()->willReturn('getName');
+ $method3->getArgumentsWildcard()->willReturn($arguments3);
+ $method3->getPromise()->willReturn($promise);
+ $arguments3->scoreArguments(array('world', 'everything'))->willReturn(200);
+
+ $objectProphecy->getMethodProphecies()->willReturn(array(
+ 'method1' => array($method1),
+ 'method2' => array($method2, $method3)
+ ));
+ $objectProphecy->getMethodProphecies('getName')->willReturn(array($method1, $method3));
+ $objectProphecy->reveal()->willReturn(new \stdClass());
+
+ $promise->execute(array('world', 'everything'), $objectProphecy->getWrappedObject(), $method3)->willReturn(42);
+
+ $this->makeCall($objectProphecy, 'getName', array('world', 'everything'))->shouldReturn(42);
+
+ $calls = $this->findCalls('getName', $arguments3);
+ $calls->shouldHaveCount(1);
+ $calls[0]->getReturnValue()->shouldReturn(42);
+ }
+
+ /**
+ * @param \Prophecy\Prophecy\MethodProphecy $method1
+ * @param \Prophecy\Prophecy\MethodProphecy $method2
+ * @param \Prophecy\Prophecy\MethodProphecy $method3
+ * @param \Prophecy\Argument\ArgumentsWildcard $arguments1
+ * @param \Prophecy\Argument\ArgumentsWildcard $arguments2
+ * @param \Prophecy\Argument\ArgumentsWildcard $arguments3
+ * @param \Prophecy\Promise\PromiseInterface $promise
+ */
+ function it_executes_promise_of_method_prophecy_that_matches_with_highest_score_to_makeCall(
+ $objectProphecy, $method1, $method2, $method3, $arguments1, $arguments2, $arguments3,
+ $promise
+ )
+ {
+ $method1->getMethodName()->willReturn('getName');
+ $method1->getArgumentsWildcard()->willReturn($arguments1);
+ $arguments1->scoreArguments(array('world', 'everything'))->willReturn(50);
+
+ $method2->getMethodName()->willReturn('getName');
+ $method2->getArgumentsWildcard()->willReturn($arguments2);
+ $method2->getPromise()->willReturn($promise);
+ $arguments2->scoreArguments(array('world', 'everything'))->willReturn(300);
+
+ $method3->getMethodName()->willReturn('getName');
+ $method3->getArgumentsWildcard()->willReturn($arguments3);
+ $arguments3->scoreArguments(array('world', 'everything'))->willReturn(200);
+
+ $objectProphecy->getMethodProphecies()->willReturn(array(
+ 'method1' => array($method1),
+ 'method2' => array($method2, $method3)
+ ));
+ $objectProphecy->getMethodProphecies('getName')->willReturn(array(
+ $method1, $method2, $method3
+ ));
+ $objectProphecy->reveal()->willReturn(new \stdClass());
+
+ $promise->execute(array('world', 'everything'), $objectProphecy->getWrappedObject(), $method2)
+ ->willReturn('second');
+
+ $this->makeCall($objectProphecy, 'getName', array('world', 'everything'))
+ ->shouldReturn('second');
+ }
+
+ /**
+ * @param \Prophecy\Prophecy\MethodProphecy $method
+ * @param \Prophecy\Argument\ArgumentsWildcard $arguments
+ */
+ function it_throws_exception_if_call_does_not_match_any_of_defined_method_prophecies(
+ $objectProphecy, $method, $arguments
+ )
+ {
+ $method->getMethodName()->willReturn('getName');
+ $method->getArgumentsWildcard()->willReturn($arguments);
+ $arguments->scoreArguments(array('world', 'everything'))->willReturn(false);
+ $arguments->__toString()->willReturn('arg1, arg2');
+
+ $objectProphecy->getMethodProphecies()->willReturn(array('method1' => array($method)));
+ $objectProphecy->getMethodProphecies('getName')->willReturn(array($method));
+
+ $this->shouldThrow('Prophecy\Exception\Call\UnexpectedCallException')
+ ->duringMakeCall($objectProphecy, 'getName', array('world', 'everything'));
+ }
+
+ /**
+ * @param \Prophecy\Prophecy\MethodProphecy $method
+ * @param \Prophecy\Argument\ArgumentsWildcard $arguments
+ */
+ function it_returns_null_if_method_prophecy_that_matches_makeCall_arguments_has_no_promise(
+ $objectProphecy, $method, $arguments
+ )
+ {
+ $method->getMethodName()->willReturn('getName');
+ $method->getArgumentsWildcard()->willReturn($arguments);
+ $method->getPromise()->willReturn(null);
+ $arguments->scoreArguments(array('world', 'everything'))->willReturn(100);
+
+ $objectProphecy->getMethodProphecies()->willReturn(array($method));
+ $objectProphecy->getMethodProphecies('getName')->willReturn(array($method));
+
+ $this->makeCall($objectProphecy, 'getName', array('world', 'everything'))
+ ->shouldReturn(null);
+ }
+
+ /**
+ * @param \Prophecy\Argument\ArgumentsWildcard $wildcard
+ */
+ function it_finds_recorded_calls_by_a_method_name_and_arguments_wildcard(
+ $objectProphecy, $wildcard
+ )
+ {
+ $objectProphecy->getMethodProphecies()->willReturn(array());
+
+ $this->makeCall($objectProphecy, 'getName', array('world'));
+ $this->makeCall($objectProphecy, 'getName', array('everything'));
+ $this->makeCall($objectProphecy, 'setName', array(42));
+
+ $wildcard->scoreArguments(array('world'))->willReturn(false);
+ $wildcard->scoreArguments(array('everything'))->willReturn(10);
+
+ $calls = $this->findCalls('getName', $wildcard);
+
+ $calls->shouldHaveCount(1);
+ $calls[0]->getMethodName()->shouldReturn('getName');
+ $calls[0]->getArguments()->shouldReturn(array('everything'));
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Call/CallSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Call/CallSpec.php
new file mode 100644
index 00000000000..d1a8539198b
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Call/CallSpec.php
@@ -0,0 +1,54 @@
+beConstructedWith('setValues', array(5, 2), 42, $exception, 'some_file.php', 23);
+ }
+
+ function it_exposes_method_name_through_getter()
+ {
+ $this->getMethodName()->shouldReturn('setValues');
+ }
+
+ function it_exposes_arguments_through_getter()
+ {
+ $this->getArguments()->shouldReturn(array(5, 2));
+ }
+
+ function it_exposes_return_value_through_getter()
+ {
+ $this->getReturnValue()->shouldReturn(42);
+ }
+
+ function it_exposes_exception_through_getter($exception)
+ {
+ $this->getException()->shouldReturn($exception);
+ }
+
+ function it_exposes_file_and_line_through_getter()
+ {
+ $this->getFile()->shouldReturn('some_file.php');
+ $this->getLine()->shouldReturn(23);
+ }
+
+ function it_returns_shortpath_to_callPlace()
+ {
+ $this->getCallPlace()->shouldReturn('some_file.php:23');
+ }
+
+ function it_returns_unknown_as_callPlace_if_no_file_or_line_provided()
+ {
+ $this->beConstructedWith('setValues', array(), 0, null, null, null);
+
+ $this->getCallPlace()->shouldReturn('unknown');
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/DisableConstructorPatchSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/DisableConstructorPatchSpec.php
new file mode 100644
index 00000000000..2d7d934dc35
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/DisableConstructorPatchSpec.php
@@ -0,0 +1,59 @@
+shouldBeAnInstanceOf('Prophecy\Doubler\ClassPatch\ClassPatchInterface');
+ }
+
+ function its_priority_is_100()
+ {
+ $this->getPriority()->shouldReturn(100);
+ }
+
+ /**
+ * @param \Prophecy\Doubler\Generator\Node\ClassNode $node
+ */
+ function it_supports_anything($node)
+ {
+ $this->supports($node)->shouldReturn(true);
+ }
+
+ /**
+ * @param \Prophecy\Doubler\Generator\Node\ClassNode $class
+ * @param \Prophecy\Doubler\Generator\Node\MethodNode $method
+ * @param \Prophecy\Doubler\Generator\Node\ArgumentNode $arg1
+ * @param \Prophecy\Doubler\Generator\Node\ArgumentNode $arg2
+ */
+ function it_makes_all_constructor_arguments_optional($class, $method, $arg1, $arg2)
+ {
+ $class->hasMethod('__construct')->willReturn(true);
+ $class->getMethod('__construct')->willReturn($method);
+ $method->getArguments()->willReturn(array($arg1, $arg2));
+
+ $arg1->setDefault(null)->shouldBeCalled();
+ $arg2->setDefault(null)->shouldBeCalled();
+
+ $method->setCode(Argument::type('string'))->shouldBeCalled();
+
+ $this->apply($class);
+ }
+
+ /**
+ * @param \Prophecy\Doubler\Generator\Node\ClassNode $class
+ */
+ function it_creates_new_constructor_if_object_has_none($class)
+ {
+ $class->hasMethod('__construct')->willReturn(false);
+ $class->addMethod(Argument::type('Prophecy\Doubler\Generator\Node\MethodNode'))
+ ->shouldBeCalled();
+
+ $this->apply($class);
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/HhvmExceptionPatchSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/HhvmExceptionPatchSpec.php
new file mode 100644
index 00000000000..8c348b86f18
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/HhvmExceptionPatchSpec.php
@@ -0,0 +1,37 @@
+shouldBeAnInstanceOf('Prophecy\Doubler\ClassPatch\ClassPatchInterface');
+ }
+
+ function its_priority_is_minus_50()
+ {
+ $this->getPriority()->shouldReturn(-50);
+ }
+
+ /**
+ * @param \Prophecy\Doubler\Generator\Node\ClassNode $node
+ * @param \Prophecy\Doubler\Generator\Node\MethodNode $method
+ * @param \Prophecy\Doubler\Generator\Node\MethodNode $getterMethod
+ */
+ function it_uses_parent_code_for_setTraceOptions($node, $method, $getterMethod)
+ {
+ $node->hasMethod('setTraceOptions')->willReturn(true);
+ $node->getMethod('setTraceOptions')->willReturn($method);
+ $node->hasMethod('getTraceOptions')->willReturn(true);
+ $node->getMethod('getTraceOptions')->willReturn($getterMethod);
+
+ $method->useParentCode()->shouldBeCalled();
+ $getterMethod->useParentCode()->shouldBeCalled();
+
+ $this->apply($node);
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/KeywordPatchSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/KeywordPatchSpec.php
new file mode 100644
index 00000000000..200d96192fe
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/KeywordPatchSpec.php
@@ -0,0 +1,44 @@
+shouldBeAnInstanceOf('Prophecy\Doubler\ClassPatch\ClassPatchInterface');
+ }
+
+ function its_priority_is_49()
+ {
+ $this->getPriority()->shouldReturn(49);
+ }
+
+ /**
+ * @param \Prophecy\Doubler\Generator\Node\ClassNode $node
+ * @param \Prophecy\Doubler\Generator\Node\MethodNode $method1
+ * @param \Prophecy\Doubler\Generator\Node\MethodNode $method2
+ * @param \Prophecy\Doubler\Generator\Node\MethodNode $method3
+ */
+ function it_will_remove_echo_and_eval_methods($node, $method1, $method2, $method3)
+ {
+ $node->removeMethod('eval')->shouldBeCalled();
+ $node->removeMethod('echo')->shouldBeCalled();
+
+ $method1->getName()->willReturn('echo');
+ $method2->getName()->willReturn('eval');
+ $method3->getName()->willReturn('notKeyword');
+
+ $node->getMethods()->willReturn(array(
+ 'echo' => $method1,
+ 'eval' => $method2,
+ 'notKeyword' => $method3,
+ ));
+
+ $this->apply($node);
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/MagicCallPatchSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/MagicCallPatchSpec.php
new file mode 100644
index 00000000000..cb1d0f0196b
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/MagicCallPatchSpec.php
@@ -0,0 +1,76 @@
+shouldBeAnInstanceOf('Prophecy\Doubler\ClassPatch\ClassPatchInterface');
+ }
+
+ /**
+ * @param \Prophecy\Doubler\Generator\Node\ClassNode $node
+ */
+ function it_supports_anything($node)
+ {
+ $this->supports($node)->shouldReturn(true);
+ }
+
+ /**
+ * @param \Prophecy\Doubler\Generator\Node\ClassNode $node
+ */
+ function it_discovers_api_using_phpdoc($node)
+ {
+ $node->getParentClass()->willReturn('spec\Prophecy\Doubler\ClassPatch\MagicalApi');
+
+ $node->addMethod(new MethodNode('undefinedMethod'))->shouldBeCalled();
+
+ $this->apply($node);
+ }
+
+ /**
+ * @param \Prophecy\Doubler\Generator\Node\ClassNode $node
+ */
+ function it_ignores_existing_methods($node)
+ {
+ $node->getParentClass()->willReturn('spec\Prophecy\Doubler\ClassPatch\MagicalApiExtended');
+
+ $node->addMethod(new MethodNode('undefinedMethod'))->shouldBeCalled();
+ $node->addMethod(new MethodNode('definedMethod'))->shouldNotBeCalled();
+
+ $this->apply($node);
+ }
+
+ function it_has_50_priority()
+ {
+ $this->getPriority()->shouldReturn(50);
+ }
+}
+
+/**
+ * @method void undefinedMethod()
+ */
+class MagicalApi
+{
+ /**
+ * @return void
+ */
+ public function definedMethod()
+ {
+
+ }
+}
+
+/**
+ * @method void undefinedMethod()
+ * @method void definedMethod()
+ */
+class MagicalApiExtended extends MagicalApi
+{
+
+}
\ No newline at end of file
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/ProphecySubjectPatchSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/ProphecySubjectPatchSpec.php
new file mode 100644
index 00000000000..c460814cf2e
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/ProphecySubjectPatchSpec.php
@@ -0,0 +1,83 @@
+shouldBeAnInstanceOf('Prophecy\Doubler\ClassPatch\ClassPatchInterface');
+ }
+
+ function it_has_priority_of_0()
+ {
+ $this->getPriority()->shouldReturn(0);
+ }
+
+ /**
+ * @param \Prophecy\Doubler\Generator\Node\ClassNode $node
+ */
+ function it_supports_any_class($node)
+ {
+ $this->supports($node)->shouldReturn(true);
+ }
+
+ /**
+ * @param \Prophecy\Doubler\Generator\Node\ClassNode $node
+ */
+ function it_forces_class_to_implement_ProphecySubjectInterface($node)
+ {
+ $node->addInterface('Prophecy\Prophecy\ProphecySubjectInterface')->shouldBeCalled();
+
+ $node->addProperty('objectProphecy', 'private')->willReturn(null);
+ $node->getMethods()->willReturn(array());
+ $node->hasMethod(Argument::any())->willReturn(false);
+ $node->addMethod(Argument::type('Prophecy\Doubler\Generator\Node\MethodNode'))->willReturn(null);
+ $node->addMethod(Argument::type('Prophecy\Doubler\Generator\Node\MethodNode'))->willReturn(null);
+
+ $this->apply($node);
+ }
+
+ /**
+ * @param \Prophecy\Doubler\Generator\Node\ClassNode $node
+ * @param \Prophecy\Doubler\Generator\Node\MethodNode $constructor
+ * @param \Prophecy\Doubler\Generator\Node\MethodNode $method1
+ * @param \Prophecy\Doubler\Generator\Node\MethodNode $method2
+ * @param \Prophecy\Doubler\Generator\Node\MethodNode $method3
+ */
+ function it_forces_all_class_methods_except_constructor_to_proxy_calls_into_prophecy_makeCall(
+ $node, $constructor, $method1, $method2, $method3
+ )
+ {
+ $node->addInterface('Prophecy\Prophecy\ProphecySubjectInterface')->willReturn(null);
+ $node->addProperty('objectProphecy', 'private')->willReturn(null);
+ $node->hasMethod(Argument::any())->willReturn(false);
+ $node->addMethod(Argument::type('Prophecy\Doubler\Generator\Node\MethodNode'))->willReturn(null);
+ $node->addMethod(Argument::type('Prophecy\Doubler\Generator\Node\MethodNode'))->willReturn(null);
+
+ $constructor->getName()->willReturn('__construct');
+ $method1->getName()->willReturn('method1');
+ $method2->getName()->willReturn('method2');
+ $method3->getName()->willReturn('method3');
+
+ $node->getMethods()->willReturn(array(
+ 'method1' => $method1,
+ 'method2' => $method2,
+ 'method3' => $method3,
+ ));
+
+ $constructor->setCode(Argument::any())->shouldNotBeCalled();
+
+ $method1->setCode('return $this->getProphecy()->makeProphecyMethodCall(__FUNCTION__, func_get_args());')
+ ->shouldBeCalled();
+ $method2->setCode('return $this->getProphecy()->makeProphecyMethodCall(__FUNCTION__, func_get_args());')
+ ->shouldBeCalled();
+ $method3->setCode('return $this->getProphecy()->makeProphecyMethodCall(__FUNCTION__, func_get_args());')
+ ->shouldBeCalled();
+
+ $this->apply($node);
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/ReflectionClassNewInstancePatchSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/ReflectionClassNewInstancePatchSpec.php
new file mode 100644
index 00000000000..4116e4dff33
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/ReflectionClassNewInstancePatchSpec.php
@@ -0,0 +1,47 @@
+shouldBeAnInstanceOf('Prophecy\Doubler\ClassPatch\ClassPatchInterface');
+ }
+
+ function its_priority_is_50()
+ {
+ $this->getPriority()->shouldReturn(50);
+ }
+
+ /**
+ * @param \Prophecy\Doubler\Generator\Node\ClassNode $reflectionClassNode
+ * @param \Prophecy\Doubler\Generator\Node\ClassNode $anotherClassNode
+ */
+ function it_supports_ReflectionClass_only($reflectionClassNode, $anotherClassNode)
+ {
+ $reflectionClassNode->getParentClass()->willReturn('ReflectionClass');
+ $anotherClassNode->getParentClass()->willReturn('stdClass');
+
+ $this->supports($reflectionClassNode)->shouldReturn(true);
+ $this->supports($anotherClassNode)->shouldReturn(false);
+ }
+
+ /**
+ * @param \Prophecy\Doubler\Generator\Node\ClassNode $class
+ * @param \Prophecy\Doubler\Generator\Node\MethodNode $method
+ * @param \Prophecy\Doubler\Generator\Node\ArgumentNode $arg1
+ * @param \Prophecy\Doubler\Generator\Node\ArgumentNode $arg2
+ */
+ function it_makes_all_newInstance_arguments_optional($class, $method, $arg1, $arg2)
+ {
+ $class->getMethod('newInstance')->willReturn($method);
+ $method->getArguments()->willReturn(array($arg1));
+ $arg1->setDefault(null)->shouldBeCalled();
+
+ $this->apply($class);
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/SplFileInfoPatchSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/SplFileInfoPatchSpec.php
new file mode 100644
index 00000000000..37fe82f639d
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/SplFileInfoPatchSpec.php
@@ -0,0 +1,91 @@
+shouldBeAnInstanceOf('Prophecy\Doubler\ClassPatch\ClassPatchInterface');
+ }
+
+ function its_priority_is_50()
+ {
+ $this->getPriority()->shouldReturn(50);
+ }
+
+ /**
+ * @param \Prophecy\Doubler\Generator\Node\ClassNode $node
+ */
+ function it_does_not_support_nodes_without_parent_class($node)
+ {
+ $node->getParentClass()->willReturn('stdClass');
+ $this->supports($node)->shouldReturn(false);
+ }
+
+ /**
+ * @param \Prophecy\Doubler\Generator\Node\ClassNode $node
+ */
+ function it_supports_nodes_with_SplFileInfo_as_parent_class($node)
+ {
+ $node->getParentClass()->willReturn('SplFileInfo');
+ $this->supports($node)->shouldReturn(true);
+ }
+
+ /**
+ * @param \Prophecy\Doubler\Generator\Node\ClassNode $node
+ */
+ function it_supports_nodes_with_derivative_of_SplFileInfo_as_parent_class($node)
+ {
+ $node->getParentClass()->willReturn('SplFileInfo');
+ $this->supports($node)->shouldReturn(true);
+ }
+
+ /**
+ * @param \Prophecy\Doubler\Generator\Node\ClassNode $node
+ */
+ function it_adds_a_method_to_node_if_not_exists($node)
+ {
+ $node->hasMethod('__construct')->willReturn(false);
+ $node->addMethod(Argument::any())->shouldBeCalled();
+ $node->getParentClass()->shouldBeCalled();
+
+ $this->apply($node);
+ }
+
+ /**
+ * @param \Prophecy\Doubler\Generator\Node\ClassNode $node
+ * @param \Prophecy\Doubler\Generator\Node\MethodNode $method
+ */
+ function it_updates_existing_method_if_found($node, $method)
+ {
+ $node->hasMethod('__construct')->willReturn(true);
+ $node->getMethod('__construct')->willReturn($method);
+ $node->getParentClass()->shouldBeCalled();
+
+ $method->useParentCode()->shouldBeCalled();
+
+ $this->apply($node);
+ }
+
+ /**
+ * @param \Prophecy\Doubler\Generator\Node\ClassNode $node
+ * @param \Prophecy\Doubler\Generator\Node\MethodNode $method
+ */
+ function it_should_not_supply_a_file_for_a_directory_iterator($node, $method)
+ {
+ $node->hasMethod('__construct')->willReturn(true);
+ $node->getMethod('__construct')->willReturn($method);
+ $node->getParentClass()->willReturn('DirectoryIterator');
+
+ $method->setCode(Argument::that(function($value) {
+ return strpos($value, '.php') === false;
+ }))->shouldBeCalled();
+
+ $this->apply($node);
+ }
+
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/TraversablePatchSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/TraversablePatchSpec.php
new file mode 100644
index 00000000000..2279b7202fc
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/TraversablePatchSpec.php
@@ -0,0 +1,61 @@
+shouldBeAnInstanceOf('Prophecy\Doubler\ClassPatch\ClassPatchInterface');
+ }
+
+ /**
+ * @param \Prophecy\Doubler\Generator\Node\ClassNode $node
+ */
+ function it_supports_class_that_implements_only_Traversable($node)
+ {
+ $node->getInterfaces()->willReturn(array('Traversable'));
+
+ $this->supports($node)->shouldReturn(true);
+ }
+
+ /**
+ * @param \Prophecy\Doubler\Generator\Node\ClassNode $node
+ */
+ function it_does_not_support_class_that_implements_Iterator($node)
+ {
+ $node->getInterfaces()->willReturn(array('Traversable', 'Iterator'));
+
+ $this->supports($node)->shouldReturn(false);
+ }
+
+ /**
+ * @param \Prophecy\Doubler\Generator\Node\ClassNode $node
+ */
+ function it_does_not_support_class_that_implements_IteratorAggregate($node)
+ {
+ $node->getInterfaces()->willReturn(array('Traversable', 'IteratorAggregate'));
+
+ $this->supports($node)->shouldReturn(false);
+ }
+
+ function it_has_100_priority()
+ {
+ $this->getPriority()->shouldReturn(100);
+ }
+
+ /**
+ * @param \Prophecy\Doubler\Generator\Node\ClassNode $node
+ */
+ function it_forces_node_to_implement_IteratorAggregate($node)
+ {
+ $node->addInterface('Iterator')->shouldBeCalled();
+
+ $node->addMethod(Argument::type('Prophecy\Doubler\Generator\Node\MethodNode'))->willReturn(null);
+
+ $this->apply($node);
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/DoublerSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/DoublerSpec.php
new file mode 100644
index 00000000000..a39fa87f9fb
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/DoublerSpec.php
@@ -0,0 +1,122 @@
+beConstructedWith($mirror, $creator, $namer);
+ }
+
+ function it_does_not_have_patches_by_default()
+ {
+ $this->getClassPatches()->shouldHaveCount(0);
+ }
+
+ /**
+ * @param \Prophecy\Doubler\ClassPatch\ClassPatchInterface $patch
+ */
+ function its_registerClassPatch_adds_a_patch_to_the_doubler($patch)
+ {
+ $this->registerClassPatch($patch);
+ $this->getClassPatches()->shouldReturn(array($patch));
+ }
+
+ /**
+ * @param \Prophecy\Doubler\ClassPatch\ClassPatchInterface $alt1
+ * @param \Prophecy\Doubler\ClassPatch\ClassPatchInterface $alt2
+ * @param \Prophecy\Doubler\ClassPatch\ClassPatchInterface $alt3
+ * @param \Prophecy\Doubler\ClassPatch\ClassPatchInterface $alt4
+ */
+ function its_getClassPatches_sorts_patches_by_priority($alt1, $alt2, $alt3, $alt4)
+ {
+ $alt1->getPriority()->willReturn(2);
+ $alt2->getPriority()->willReturn(50);
+ $alt3->getPriority()->willReturn(10);
+ $alt4->getPriority()->willReturn(0);
+
+ $this->registerClassPatch($alt1);
+ $this->registerClassPatch($alt2);
+ $this->registerClassPatch($alt3);
+ $this->registerClassPatch($alt4);
+
+ $this->getClassPatches()->shouldReturn(array($alt2, $alt3, $alt1, $alt4));
+ }
+
+ /**
+ * @param \Prophecy\Doubler\ClassPatch\ClassPatchInterface $alt1
+ * @param \Prophecy\Doubler\ClassPatch\ClassPatchInterface $alt2
+ * @param \ReflectionClass $class
+ * @param \ReflectionClass $interface1
+ * @param \ReflectionClass $interface2
+ * @param \Prophecy\Doubler\Generator\Node\ClassNode $node
+ */
+ function its_double_mirrors_alterates_and_instantiates_provided_class(
+ $mirror, $creator, $namer, $alt1, $alt2, $class, $interface1, $interface2, $node
+ )
+ {
+ $mirror->reflect($class, array($interface1, $interface2))->willReturn($node);
+ $alt1->supports($node)->willReturn(true);
+ $alt2->supports($node)->willReturn(false);
+ $alt1->getPriority()->willReturn(1);
+ $alt2->getPriority()->willReturn(2);
+ $namer->name($class, array($interface1, $interface2))->willReturn('SplStack');
+ $class->getName()->willReturn('stdClass');
+ $interface1->getName()->willReturn('ArrayAccess');
+ $interface2->getName()->willReturn('Iterator');
+
+ $alt1->apply($node)->shouldBeCalled();
+ $alt2->apply($node)->shouldNotBeCalled();
+ $creator->create('SplStack', $node)->shouldBeCalled();
+
+ $this->registerClassPatch($alt1);
+ $this->registerClassPatch($alt2);
+
+ $this->double($class, array($interface1, $interface2))
+ ->shouldReturnAnInstanceOf('SplStack');
+ }
+
+ /**
+ * @param \ReflectionClass $class
+ * @param \Prophecy\Doubler\Generator\Node\ClassNode $node
+ */
+ function it_double_instantiates_a_class_with_constructor_argument($mirror, $class, $node, $namer)
+ {
+ $class->getName()->willReturn('ReflectionClass');
+ $mirror->reflect($class, array())->willReturn($node);
+ $namer->name($class, array())->willReturn('ReflectionClass');
+
+ $double = $this->double($class, array(), array('stdClass'));
+ $double->shouldBeAnInstanceOf('ReflectionClass');
+ $double->getName()->shouldReturn('stdClass');
+ }
+
+ /**
+ * @param \ReflectionClass $class
+ * @param \Prophecy\Doubler\Generator\Node\ClassNode $node
+ */
+ function it_can_instantiate_class_with_final_constructor($mirror, $class, $node, $namer)
+ {
+ $class->getName()->willReturn('spec\Prophecy\Doubler\WithFinalConstructor');
+ $mirror->reflect($class, array())->willReturn($node);
+ $namer->name($class, array())->willReturn('spec\Prophecy\Doubler\WithFinalConstructor');
+
+ $double = $this->double($class, array());
+
+ $double->shouldBeAnInstanceOf('spec\Prophecy\Doubler\WithFinalConstructor');
+ }
+}
+
+class WithFinalConstructor
+{
+ final public function __construct() {}
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/ClassCodeGeneratorSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/ClassCodeGeneratorSpec.php
new file mode 100644
index 00000000000..1dc8cda3609
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/ClassCodeGeneratorSpec.php
@@ -0,0 +1,186 @@
+getParentClass()->willReturn('RuntimeException');
+ $class->getInterfaces()->willReturn(array(
+ 'Prophecy\Doubler\Generator\MirroredInterface', 'ArrayAccess', 'ArrayIterator'
+ ));
+ $class->getProperties()->willReturn(array('name' => 'public', 'email' => 'private'));
+ $class->getMethods()->willReturn(array($method1, $method2, $method3));
+
+ $method1->getName()->willReturn('getName');
+ $method1->getVisibility()->willReturn('public');
+ $method1->returnsReference()->willReturn(false);
+ $method1->isStatic()->willReturn(true);
+ $method1->getArguments()->willReturn(array($argument11, $argument12));
+ $method1->getCode()->willReturn('return $this->name;');
+
+ $method2->getName()->willReturn('getEmail');
+ $method2->getVisibility()->willReturn('protected');
+ $method2->returnsReference()->willReturn(false);
+ $method2->isStatic()->willReturn(false);
+ $method2->getArguments()->willReturn(array($argument21));
+ $method2->getCode()->willReturn('return $this->email;');
+
+ $method3->getName()->willReturn('getRefValue');
+ $method3->getVisibility()->willReturn('public');
+ $method3->returnsReference()->willReturn(true);
+ $method3->isStatic()->willReturn(false);
+ $method3->getArguments()->willReturn(array($argument31));
+ $method3->getCode()->willReturn('return $this->refValue;');
+
+ $argument11->getName()->willReturn('fullname');
+ $argument11->getTypeHint()->willReturn('array');
+ $argument11->isOptional()->willReturn(true);
+ $argument11->getDefault()->willReturn(null);
+ $argument11->isPassedByReference()->willReturn(false);
+
+ $argument12->getName()->willReturn('class');
+ $argument12->getTypeHint()->willReturn('ReflectionClass');
+ $argument12->isOptional()->willReturn(false);
+ $argument12->isPassedByReference()->willReturn(false);
+
+ $argument21->getName()->willReturn('default');
+ $argument21->getTypeHint()->willReturn(null);
+ $argument21->isOptional()->willReturn(true);
+ $argument21->getDefault()->willReturn('ever.zet@gmail.com');
+ $argument21->isPassedByReference()->willReturn(false);
+
+ $argument31->getName()->willReturn('refValue');
+ $argument31->getTypeHint()->willReturn(null);
+ $argument31->isOptional()->willReturn(false);
+ $argument31->getDefault()->willReturn();
+ $argument31->isPassedByReference()->willReturn(false);
+
+ $code = $this->generate('CustomClass', $class);
+ $expected = <<<'PHP'
+namespace {
+class CustomClass extends \RuntimeException implements \Prophecy\Doubler\Generator\MirroredInterface, \ArrayAccess, \ArrayIterator {
+public $name;
+private $email;
+
+public static function getName(array $fullname = NULL, \ReflectionClass $class) {
+return $this->name;
+}
+protected function getEmail( $default = 'ever.zet@gmail.com') {
+return $this->email;
+}
+public function &getRefValue( $refValue) {
+return $this->refValue;
+}
+
+}
+}
+PHP;
+ $expected = strtr($expected, array("\r\n" => "\n", "\r" => "\n"));
+ $code->shouldBe($expected);
+ }
+
+ /**
+ * @param \Prophecy\Doubler\Generator\Node\ClassNode $class
+ * @param \Prophecy\Doubler\Generator\Node\MethodNode $method
+ * @param \Prophecy\Doubler\Generator\Node\ArgumentNode $argument
+ */
+ function it_overrides_properly_methods_with_args_passed_by_reference(
+ $class, $method, $argument
+ )
+ {
+ $class->getParentClass()->willReturn('RuntimeException');
+ $class->getInterfaces()->willReturn(array('Prophecy\Doubler\Generator\MirroredInterface'));
+ $class->getProperties()->willReturn(array());
+ $class->getMethods()->willReturn(array($method));
+
+ $method->getName()->willReturn('getName');
+ $method->getVisibility()->willReturn('public');
+ $method->isStatic()->willReturn(false);
+ $method->getArguments()->willReturn(array($argument));
+ $method->returnsReference()->willReturn(false);
+ $method->getCode()->willReturn('return $this->name;');
+
+ $argument->getName()->willReturn('fullname');
+ $argument->getTypeHint()->willReturn('array');
+ $argument->isOptional()->willReturn(true);
+ $argument->getDefault()->willReturn(null);
+ $argument->isPassedByReference()->willReturn(true);
+
+ $code = $this->generate('CustomClass', $class);
+ $expected =<<<'PHP'
+namespace {
+class CustomClass extends \RuntimeException implements \Prophecy\Doubler\Generator\MirroredInterface {
+
+public function getName(array &$fullname = NULL) {
+return $this->name;
+}
+
+}
+}
+PHP;
+ $expected = strtr($expected, array("\r\n" => "\n", "\r" => "\n"));
+ $code->shouldBe($expected);
+ }
+
+ /**
+ * @param \Prophecy\Doubler\Generator\Node\ClassNode $class
+ */
+ function it_generates_empty_class_for_empty_ClassNode($class)
+ {
+ $class->getParentClass()->willReturn('stdClass');
+ $class->getInterfaces()->willReturn(array('Prophecy\Doubler\Generator\MirroredInterface'));
+ $class->getProperties()->willReturn(array());
+ $class->getMethods()->willReturn(array());
+
+ $code = $this->generate('CustomClass', $class);
+ $expected =<<<'PHP'
+namespace {
+class CustomClass extends \stdClass implements \Prophecy\Doubler\Generator\MirroredInterface {
+
+
+}
+}
+PHP;
+ $expected = strtr($expected, array("\r\n" => "\n", "\r" => "\n"));
+ $code->shouldBe($expected);
+ }
+
+ /**
+ * @param \Prophecy\Doubler\Generator\Node\ClassNode $class
+ */
+ function it_wraps_class_in_namespace_if_it_is_namespaced($class)
+ {
+ $class->getParentClass()->willReturn('stdClass');
+ $class->getInterfaces()->willReturn(array('Prophecy\Doubler\Generator\MirroredInterface'));
+ $class->getProperties()->willReturn(array());
+ $class->getMethods()->willReturn(array());
+
+ $code = $this->generate('My\Awesome\CustomClass', $class);
+ $expected =<<<'PHP'
+namespace My\Awesome {
+class CustomClass extends \stdClass implements \Prophecy\Doubler\Generator\MirroredInterface {
+
+
+}
+}
+PHP;
+ $expected = strtr($expected, array("\r\n" => "\n", "\r" => "\n"));
+ $code->shouldBe($expected);
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/ClassCreatorSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/ClassCreatorSpec.php
new file mode 100644
index 00000000000..c7b570097fb
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/ClassCreatorSpec.php
@@ -0,0 +1,44 @@
+beConstructedWith($generator);
+ }
+
+ /**
+ * @param \Prophecy\Doubler\Generator\Node\ClassNode $class
+ */
+ function it_evaluates_code_generated_by_ClassCodeGenerator($generator, $class)
+ {
+ $generator->generate('stdClass', $class)->shouldBeCalled()->willReturn(
+ 'return 42;'
+ );
+
+ $this->create('stdClass', $class)->shouldReturn(42);
+ }
+
+ /**
+ * @param \Prophecy\Doubler\Generator\Node\ClassNode $class
+ */
+ function it_throws_an_exception_if_class_does_not_exist_after_evaluation($generator, $class)
+ {
+ $generator->generate('CustomClass', $class)->shouldBeCalled()->willReturn(
+ 'return 42;'
+ );
+
+ $class->getParentClass()->willReturn('stdClass');
+ $class->getInterfaces()->willReturn(array('Interface1', 'Interface2'));
+
+ $this->shouldThrow('Prophecy\Exception\Doubler\ClassCreatorException')
+ ->duringCreate('CustomClass', $class);
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/ClassMirrorSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/ClassMirrorSpec.php
new file mode 100644
index 00000000000..dd9e9c4a3af
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/ClassMirrorSpec.php
@@ -0,0 +1,554 @@
+getName()->willReturn('Custom\ClassName');
+ $class->isInterface()->willReturn(false);
+ $class->isFinal()->willReturn(false);
+ $class->getMethods(ReflectionMethod::IS_ABSTRACT)->willReturn(array());
+ $class->getMethods(ReflectionMethod::IS_PUBLIC)->willReturn(array(
+ $method1, $method2, $method3
+ ));
+
+ $method1->getName()->willReturn('getName');
+ $method2->getName()->willReturn('isPublic');
+ $method3->getName()->willReturn('isAbstract');
+
+ $method1->isFinal()->willReturn(false);
+ $method2->isFinal()->willReturn(false);
+ $method3->isFinal()->willReturn(false);
+
+ $method1->isProtected()->willReturn(false);
+ $method2->isProtected()->willReturn(false);
+ $method3->isProtected()->willReturn(false);
+
+ $method1->isStatic()->willReturn(false);
+ $method2->isStatic()->willReturn(false);
+ $method3->isStatic()->willReturn(false);
+
+ $method1->returnsReference()->willReturn(false);
+ $method2->returnsReference()->willReturn(false);
+ $method3->returnsReference()->willReturn(false);
+
+ $method1->getParameters()->willReturn(array());
+ $method2->getParameters()->willReturn(array());
+ $method3->getParameters()->willReturn(array());
+
+ $classNode = $this->reflect($class, array());
+ $classNode->shouldBeAnInstanceOf('Prophecy\Doubler\Generator\Node\ClassNode');
+ $classNode->getParentClass()->shouldReturn('Custom\ClassName');
+
+ $methodNodes = $classNode->getMethods();
+ $methodNodes->shouldHaveCount(3);
+
+ $classNode->hasMethod('getName')->shouldReturn(true);
+ $classNode->hasMethod('isPublic')->shouldReturn(true);
+ $classNode->hasMethod('isAbstract')->shouldReturn(true);
+ }
+
+ /**
+ * @param ReflectionClass $class
+ * @param ReflectionMethod $method
+ * @param ReflectionParameter $parameter
+ */
+ function it_changes_argument_names_if_they_are_varying($class, $method, $parameter)
+ {
+
+ $class->getName()->willReturn('Custom\ClassName');
+ $class->isInterface()->willReturn(false);
+ $class->isFinal()->willReturn(false);
+ $class->getMethods(ReflectionMethod::IS_PUBLIC)->willReturn(array($method));
+ $class->getMethods(ReflectionMethod::IS_ABSTRACT)->willReturn(array());
+
+ $method->getParameters()->willReturn(array($parameter));
+ $method->getName()->willReturn('methodName');
+ $method->isFinal()->willReturn(false);
+ $method->isProtected()->willReturn(false);
+ $method->isStatic()->willReturn(false);
+ $method->returnsReference()->willReturn(false);
+
+ $parameter->getName()->willReturn('...');
+ $parameter->isDefaultValueAvailable()->willReturn(true);
+ $parameter->getDefaultValue()->willReturn(null);
+ $parameter->isPassedByReference()->willReturn(false);
+ $parameter->getClass()->willReturn($class);
+
+ $classNode = $this->reflect($class, array());
+
+ $methodNodes = $classNode->getMethods();
+
+ $argumentNodes = $methodNodes['methodName']->getArguments();
+ $argumentNode = $argumentNodes[0];
+
+ $argumentNode->getName()->shouldReturn('__dot_dot_dot__');
+ }
+
+ /**
+ * @param ReflectionClass $class
+ * @param ReflectionMethod $method
+ */
+ function it_reflects_protected_abstract_methods($class, $method)
+ {
+ $class->getName()->willReturn('Custom\ClassName');
+ $class->isInterface()->willReturn(false);
+ $class->isFinal()->willReturn(false);
+ $class->getMethods(ReflectionMethod::IS_ABSTRACT)->willReturn(array($method));
+ $class->getMethods(ReflectionMethod::IS_PUBLIC)->willReturn(array());
+
+ $method->isProtected()->willReturn(true);
+ $method->isStatic()->willReturn(false);
+ $method->getParameters()->willReturn(array());
+ $method->getName()->willReturn('innerDetail');
+ $method->returnsReference()->willReturn(false);
+
+
+ $classNode = $this->reflect($class, array());
+ $classNode->shouldBeAnInstanceOf('Prophecy\Doubler\Generator\Node\ClassNode');
+ $classNode->getParentClass()->shouldReturn('Custom\ClassName');
+
+ $methodNodes = $classNode->getMethods();
+ $methodNodes->shouldHaveCount(1);
+
+ $methodNodes['innerDetail']->getVisibility()->shouldReturn('protected');
+ }
+
+ /**
+ * @param ReflectionClass $class
+ * @param ReflectionMethod $method
+ */
+ function it_reflects_public_static_methods($class, $method)
+ {
+ $class->getName()->willReturn('Custom\ClassName');
+ $class->isInterface()->willReturn(false);
+ $class->isFinal()->willReturn(false);
+ $class->getMethods(ReflectionMethod::IS_ABSTRACT)->willReturn(array($method));
+ $class->getMethods(ReflectionMethod::IS_PUBLIC)->willReturn(array());
+
+ $method->isProtected()->willReturn(true);
+ $method->isStatic()->willReturn(true);
+ $method->getParameters()->willReturn(array());
+ $method->getName()->willReturn('innerDetail');
+ $method->returnsReference()->willReturn(false);
+
+ $classNode = $this->reflect($class, array());
+ $classNode->shouldBeAnInstanceOf('Prophecy\Doubler\Generator\Node\ClassNode');
+ $classNode->getParentClass()->shouldReturn('Custom\ClassName');
+
+ $methodNodes = $classNode->getMethods();
+ $methodNodes->shouldHaveCount(1);
+
+ $methodNodes['innerDetail']->getVisibility()->shouldReturn('protected');
+ $methodNodes['innerDetail']->isStatic()->shouldReturn(true);
+ }
+
+ /**
+ * @param ReflectionClass $class
+ * @param ReflectionMethod $method
+ * @param ReflectionParameter $param1
+ * @param ReflectionParameter $param2
+ * @param ReflectionClass $typeHint
+ * @param ReflectionParameter $param3
+ */
+ function it_properly_reads_methods_arguments_with_types(
+ $class, $method, $param1, $param2, $typeHint, $param3
+ )
+ {
+ $class->getName()->willReturn('Custom\ClassName');
+ $class->isInterface()->willReturn(false);
+ $class->isFinal()->willReturn(false);
+ $class->getMethods(ReflectionMethod::IS_ABSTRACT)->willReturn(array());
+ $class->getMethods(ReflectionMethod::IS_PUBLIC)->willReturn(array($method));
+
+ $method->getName()->willReturn('methodWithArgs');
+ $method->isFinal()->willReturn(false);
+ $method->isProtected()->willReturn(true);
+ $method->isStatic()->willReturn(false);
+ $method->returnsReference()->willReturn(false);
+ $method->getParameters()->willReturn(array($param1, $param2, $param3));
+
+ $param1->getName()->willReturn('arg_1');
+ $param1->isArray()->willReturn(true);
+ $param1->getClass()->willReturn(null);
+ $param1->isDefaultValueAvailable()->willReturn(true);
+ $param1->isPassedByReference()->willReturn(false);
+ $param1->allowsNull()->willReturn(false);
+ $param1->getDefaultValue()->willReturn(array());
+
+ $param2->getName()->willReturn('arg2');
+ $param2->isArray()->willReturn(false);
+ $param2->getClass()->willReturn($typeHint);
+ $param2->isDefaultValueAvailable()->willReturn(false);
+ $param2->isOptional()->willReturn(false);
+ $param2->isPassedByReference()->willReturn(false);
+ $param2->allowsNull()->willReturn(false);
+ $typeHint->getName()->willReturn('ArrayAccess');
+
+ $param3->getName()->willReturn('arg_3');
+ $param3->isArray()->willReturn(false);
+ if (version_compare(PHP_VERSION, '5.4', '>=')) {
+ $param3->isCallable()->willReturn(true);
+ }
+ $param3->getClass()->willReturn(null);
+ $param3->isOptional()->willReturn(false);
+ $param3->isDefaultValueAvailable()->willReturn(false);
+ $param3->isPassedByReference()->willReturn(false);
+ $param3->allowsNull()->willReturn(true);
+
+ $classNode = $this->reflect($class, array());
+ $methodNodes = $classNode->getMethods();
+ $argNodes = $methodNodes['methodWithArgs']->getArguments();
+
+ $argNodes[0]->getName()->shouldReturn('arg_1');
+ $argNodes[0]->getTypeHint()->shouldReturn('array');
+ $argNodes[0]->isOptional()->shouldReturn(true);
+ $argNodes[0]->getDefault()->shouldReturn(array());
+
+ $argNodes[1]->getName()->shouldReturn('arg2');
+ $argNodes[1]->getTypeHint()->shouldReturn('ArrayAccess');
+ $argNodes[1]->isOptional()->shouldReturn(false);
+
+ $argNodes[2]->getName()->shouldReturn('arg_3');
+ if (version_compare(PHP_VERSION, '5.4', '>=')) {
+ $argNodes[2]->getTypeHint()->shouldReturn('callable');
+ $argNodes[2]->isOptional()->shouldReturn(true);
+ $argNodes[2]->getDefault()->shouldReturn(null);
+ } else {
+ $argNodes[2]->isOptional()->shouldReturn(false);
+ }
+ }
+
+ /**
+ * @param ReflectionClass $class
+ * @param ReflectionMethod $method
+ * @param ReflectionParameter $param1
+ */
+ function it_marks_required_args_without_types_as_not_optional(
+ $class, $method, $param1
+ )
+ {
+ $class->getName()->willReturn('Custom\ClassName');
+ $class->isInterface()->willReturn(false);
+ $class->isFinal()->willReturn(false);
+ $class->getMethods(ReflectionMethod::IS_ABSTRACT)->willReturn(array());
+ $class->getMethods(ReflectionMethod::IS_PUBLIC)->willReturn(array($method));
+
+ $method->getName()->willReturn('methodWithArgs');
+ $method->isFinal()->willReturn(false);
+ $method->isProtected()->willReturn(false);
+ $method->isStatic()->willReturn(false);
+ $method->returnsReference()->willReturn(false);
+ $method->getParameters()->willReturn(array($param1));
+
+ $param1->getName()->willReturn('arg_1');
+ $param1->isArray()->willReturn(false);
+ if (version_compare(PHP_VERSION, '5.4', '>=')) {
+ $param1->isCallable()->willReturn(false);
+ }
+ $param1->getClass()->willReturn(null);
+ $param1->isDefaultValueAvailable()->willReturn(false);
+ $param1->isOptional()->willReturn(false);
+ $param1->isPassedByReference()->willReturn(false);
+ $param1->allowsNull()->willReturn(true);
+ if (defined('HHVM_VERSION')) {
+ $param1->getTypehintText()->willReturn(null);
+ }
+
+ $classNode = $this->reflect($class, array());
+ $methodNodes = $classNode->getMethods();
+ $argNodes = $methodNodes['methodWithArgs']->getArguments();
+
+ $argNodes[0]->isOptional()->shouldReturn(false);
+ }
+
+ /**
+ * @param ReflectionClass $class
+ * @param ReflectionMethod $method
+ * @param ReflectionParameter $param1
+ * @param ReflectionParameter $param2
+ * @param ReflectionClass $typeHint
+ */
+ function it_marks_passed_by_reference_args_as_passed_by_reference(
+ $class, $method, $param1, $param2, $typeHint
+ )
+ {
+ $class->getName()->willReturn('Custom\ClassName');
+ $class->isInterface()->willReturn(false);
+ $class->isFinal()->willReturn(false);
+ $class->getMethods(ReflectionMethod::IS_ABSTRACT)->willReturn(array());
+ $class->getMethods(ReflectionMethod::IS_PUBLIC)->willReturn(array($method));
+
+ $method->getName()->willReturn('methodWithArgs');
+ $method->isFinal()->willReturn(false);
+ $method->isProtected()->willReturn(false);
+ $method->isStatic()->willReturn(false);
+ $method->returnsReference()->willReturn(false);
+ $method->getParameters()->willReturn(array($param1, $param2));
+
+ $param1->getName()->willReturn('arg_1');
+ $param1->isArray()->willReturn(false);
+ if (version_compare(PHP_VERSION, '5.4', '>=')) {
+ $param1->isCallable()->willReturn(false);
+ }
+ $param1->getClass()->willReturn(null);
+ $param1->isDefaultValueAvailable()->willReturn(false);
+ $param1->isOptional()->willReturn(true);
+ $param1->isPassedByReference()->willReturn(true);
+ $param1->allowsNull()->willReturn(false);
+ if (defined('HHVM_VERSION')) {
+ $param1->getTypehintText()->willReturn(null);
+ }
+
+ $param2->getName()->willReturn('arg2');
+ $param2->isArray()->willReturn(false);
+ $param2->getClass()->willReturn($typeHint);
+ $param2->isDefaultValueAvailable()->willReturn(false);
+ $param2->isOptional()->willReturn(false);
+ $param2->isPassedByReference()->willReturn(false);
+ $param2->allowsNull()->willReturn(false);
+ $typeHint->getName()->willReturn('ArrayAccess');
+
+ $classNode = $this->reflect($class, array());
+ $methodNodes = $classNode->getMethods();
+ $argNodes = $methodNodes['methodWithArgs']->getArguments();
+
+ $argNodes[0]->isPassedByReference()->shouldReturn(true);
+ $argNodes[1]->isPassedByReference()->shouldReturn(false);
+ }
+
+ /**
+ * @param ReflectionClass $class
+ */
+ function it_throws_an_exception_if_class_is_final($class)
+ {
+ $class->isInterface()->willReturn(false);
+ $class->isFinal()->willReturn(true);
+ $class->getName()->willReturn('Custom\ClassName');
+
+ $this->shouldThrow('Prophecy\Exception\Doubler\ClassMirrorException')
+ ->duringReflect($class, array());
+ }
+
+ /**
+ * @param ReflectionClass $class
+ * @param ReflectionMethod $method
+ */
+ function it_ignores_final_methods($class, $method)
+ {
+ $class->getName()->willReturn('Custom\ClassName');
+ $class->isInterface()->willReturn(false);
+ $class->isFinal()->willReturn(false);
+ $class->getMethods(ReflectionMethod::IS_ABSTRACT)->willReturn(array());
+ $class->getMethods(ReflectionMethod::IS_PUBLIC)->willReturn(array($method));
+
+ $method->isFinal()->willReturn(true);
+ $method->getName()->willReturn('finalImplementation');
+
+ $classNode = $this->reflect($class, array());
+ $classNode->getMethods()->shouldHaveCount(0);
+ }
+
+ /**
+ * @param ReflectionClass $interface
+ */
+ function it_throws_an_exception_if_interface_provided_instead_of_class($interface)
+ {
+ $interface->isInterface()->willReturn(true);
+ $interface->getName()->willReturn('Custom\ClassName');
+
+ $this->shouldThrow('Prophecy\Exception\InvalidArgumentException')
+ ->duringReflect($interface, array());
+ }
+
+ /**
+ * @param ReflectionClass $interface1
+ * @param ReflectionClass $interface2
+ * @param ReflectionMethod $method1
+ * @param ReflectionMethod $method2
+ * @param ReflectionMethod $method3
+ */
+ function it_reflects_all_interfaces_methods(
+ $interface1, $interface2, $method1, $method2, $method3
+ )
+ {
+ $interface1->getName()->willReturn('MyInterface1');
+ $interface2->getName()->willReturn('MyInterface2');
+
+ $interface1->isInterface()->willReturn(true);
+ $interface2->isInterface()->willReturn(true);
+
+ $interface1->getMethods()->willReturn(array($method1));
+ $interface2->getMethods()->willReturn(array($method2, $method3));
+
+ $method1->getName()->willReturn('getName');
+ $method2->getName()->willReturn('isPublic');
+ $method3->getName()->willReturn('isAbstract');
+
+ $method1->isProtected()->willReturn(false);
+ $method2->isProtected()->willReturn(false);
+ $method3->isProtected()->willReturn(false);
+
+ $method1->returnsReference()->willReturn(false);
+ $method2->returnsReference()->willReturn(false);
+ $method3->returnsReference()->willReturn(false);
+
+ $method1->isStatic()->willReturn(false);
+ $method2->isStatic()->willReturn(false);
+ $method3->isStatic()->willReturn(false);
+
+ $method1->getParameters()->willReturn(array());
+ $method2->getParameters()->willReturn(array());
+ $method3->getParameters()->willReturn(array());
+
+ $classNode = $this->reflect(null, array($interface1, $interface2));
+
+ $classNode->shouldBeAnInstanceOf('Prophecy\Doubler\Generator\Node\ClassNode');
+ $classNode->getParentClass()->shouldReturn('stdClass');
+ $classNode->getInterfaces()->shouldReturn(array(
+ 'Prophecy\Doubler\Generator\ReflectionInterface', 'MyInterface2', 'MyInterface1',
+ ));
+
+ $methodNodes = $classNode->getMethods();
+ $methodNodes->shouldHaveCount(3);
+
+ $classNode->hasMethod('getName')->shouldReturn(true);
+ $classNode->hasMethod('isPublic')->shouldReturn(true);
+ $classNode->hasMethod('isAbstract')->shouldReturn(true);
+ }
+
+ /**
+ * @param ReflectionClass $class
+ * @param ReflectionMethod $method1
+ * @param ReflectionMethod $method2
+ * @param ReflectionMethod $method3
+ */
+ function it_ignores_virtually_private_methods($class, $method1, $method2, $method3)
+ {
+ $class->getName()->willReturn('SomeClass');
+ $class->isInterface()->willReturn(false);
+ $class->isFinal()->willReturn(false);
+ $class->getMethods(ReflectionMethod::IS_ABSTRACT)->willReturn(array());
+ $class->getMethods(ReflectionMethod::IS_PUBLIC)->willReturn(array($method1, $method2, $method3));
+
+ $method1->getName()->willReturn('_getName');
+ $method2->getName()->willReturn('__toString');
+ $method3->getName()->willReturn('isAbstract');
+
+ $method1->isFinal()->willReturn(false);
+ $method2->isFinal()->willReturn(false);
+ $method3->isFinal()->willReturn(false);
+
+ $method1->isProtected()->willReturn(false);
+ $method2->isProtected()->willReturn(false);
+ $method3->isProtected()->willReturn(false);
+
+ $method1->isStatic()->willReturn(false);
+ $method2->isStatic()->willReturn(false);
+ $method3->isStatic()->willReturn(false);
+
+ $method1->returnsReference()->willReturn(false);
+ $method2->returnsReference()->willReturn(false);
+ $method3->returnsReference()->willReturn(false);
+
+ $method1->getParameters()->willReturn(array());
+ $method2->getParameters()->willReturn(array());
+ $method3->getParameters()->willReturn(array());
+
+ $classNode = $this->reflect($class, array());
+ $methodNodes = $classNode->getMethods();
+ $methodNodes->shouldHaveCount(2);
+
+ $classNode->hasMethod('isAbstract')->shouldReturn(true);
+ }
+
+ /**
+ * @param ReflectionClass $class
+ * @param ReflectionMethod $method
+ */
+ function it_does_not_throw_exception_for_virtually_private_finals($class, $method)
+ {
+ $class->getName()->willReturn('SomeClass');
+ $class->isInterface()->willReturn(false);
+ $class->isFinal()->willReturn(false);
+ $class->getMethods(ReflectionMethod::IS_ABSTRACT)->willReturn(array());
+ $class->getMethods(ReflectionMethod::IS_PUBLIC)->willReturn(array($method));
+
+ $method->getName()->willReturn('__toString');
+ $method->isFinal()->willReturn(true);
+
+ $this->shouldNotThrow()->duringReflect($class, array());
+ }
+
+ /**
+ * @param ReflectionClass $class
+ */
+ function it_throws_an_exception_if_class_provided_in_interfaces_list($class)
+ {
+ $class->getName()->willReturn('MyClass');
+ $class->isInterface()->willReturn(false);
+
+ $this->shouldThrow('InvalidArgumentException')
+ ->duringReflect(null, array($class));
+ }
+
+ function it_throws_an_exception_if_not_reflection_provided_as_interface()
+ {
+ $this->shouldThrow('InvalidArgumentException')
+ ->duringReflect(null, array(null));
+ }
+
+ function it_doesnt_fail_to_typehint_nonexistent_FQCN()
+ {
+ $classNode = $this->reflect(new ReflectionClass('spec\Prophecy\Doubler\Generator\OptionalDepsClass'), array());
+ $method = $classNode->getMethod('iHaveAStrangeTypeHintedArg');
+ $arguments = $method->getArguments();
+ $arguments[0]->getTypeHint()->shouldBe('I\Simply\Am\Nonexistent');
+ }
+
+ function it_doesnt_fail_to_typehint_nonexistent_RQCN()
+ {
+ $classNode = $this->reflect(new ReflectionClass('spec\Prophecy\Doubler\Generator\OptionalDepsClass'), array());
+ $method = $classNode->getMethod('iHaveAnEvenStrangerTypeHintedArg');
+ $arguments = $method->getArguments();
+ $arguments[0]->getTypeHint()->shouldBe('I\Simply\Am\Not');
+ }
+
+ function it_doesnt_use_scalar_typehints()
+ {
+ $classNode = $this->reflect(new ReflectionClass('ReflectionMethod'), array());
+ $method = $classNode->getMethod('export');
+ $arguments = $method->getArguments();
+ $arguments[0]->getTypeHint()->shouldReturn(null);
+ $arguments[1]->getTypeHint()->shouldReturn(null);
+ $arguments[2]->getTypeHint()->shouldReturn(null);
+ }
+}
+
+class OptionalDepsClass
+{
+ public function iHaveAStrangeTypeHintedArg(\I\Simply\Am\Nonexistent $class)
+ {
+ }
+
+ public function iHaveAnEvenStrangerTypeHintedArg(Simply\Am\Not $class)
+ {
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/Node/ArgumentNodeSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/Node/ArgumentNodeSpec.php
new file mode 100644
index 00000000000..cea578fa1be
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/Node/ArgumentNodeSpec.php
@@ -0,0 +1,62 @@
+beConstructedWith('name');
+ }
+
+ function it_is_not_be_passed_by_reference_by_default()
+ {
+ $this->shouldNotBePassedByReference();
+ }
+
+ function it_is_passed_by_reference_if_marked()
+ {
+ $this->setAsPassedByReference();
+ $this->shouldBePassedByReference();
+ }
+
+ function it_has_name_with_which_it_was_been_constructed()
+ {
+ $this->getName()->shouldReturn('name');
+ }
+
+ function it_has_no_typehint_by_default()
+ {
+ $this->getTypeHint()->shouldReturn(null);
+ }
+
+ function its_typeHint_is_mutable()
+ {
+ $this->setTypeHint('array');
+ $this->getTypeHint()->shouldReturn('array');
+ }
+
+ function it_does_not_have_default_value_by_default()
+ {
+ $this->getDefault()->shouldReturn(null);
+ }
+
+ function it_is_not_optional_by_default()
+ {
+ $this->isOptional()->shouldReturn(false);
+ }
+
+ function its_default_is_mutable()
+ {
+ $this->setDefault(array());
+ $this->getDefault()->shouldReturn(array());
+ }
+
+ function it_is_marked_as_optional_when_default_is_set()
+ {
+ $this->setDefault(null);
+ $this->isOptional()->shouldReturn(true);
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/Node/ClassNodeSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/Node/ClassNodeSpec.php
new file mode 100644
index 00000000000..18f0e1cc934
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/Node/ClassNodeSpec.php
@@ -0,0 +1,154 @@
+getParentClass()->shouldReturn('stdClass');
+ }
+
+ function its_parentClass_is_mutable()
+ {
+ $this->setParentClass('Exception');
+ $this->getParentClass()->shouldReturn('Exception');
+ }
+
+ function its_parentClass_is_set_to_stdClass_if_user_set_null()
+ {
+ $this->setParentClass(null);
+ $this->getParentClass()->shouldReturn('stdClass');
+ }
+
+ function it_does_not_implement_any_interface_by_default()
+ {
+ $this->getInterfaces()->shouldHaveCount(0);
+ }
+
+ function its_addInterface_adds_item_to_the_list_of_implemented_interfaces()
+ {
+ $this->addInterface('MyInterface');
+ $this->getInterfaces()->shouldHaveCount(1);
+ }
+
+ function its_hasInterface_returns_true_if_class_implements_interface()
+ {
+ $this->addInterface('MyInterface');
+ $this->hasInterface('MyInterface')->shouldReturn(true);
+ }
+
+ function its_hasInterface_returns_false_if_class_does_not_implements_interface()
+ {
+ $this->hasInterface('MyInterface')->shouldReturn(false);
+ }
+
+ function it_supports_implementation_of_multiple_interfaces()
+ {
+ $this->addInterface('MyInterface');
+ $this->addInterface('MySecondInterface');
+ $this->getInterfaces()->shouldHaveCount(2);
+ }
+
+ function it_ignores_same_interfaces_added_twice()
+ {
+ $this->addInterface('MyInterface');
+ $this->addInterface('MyInterface');
+
+ $this->getInterfaces()->shouldHaveCount(1);
+ $this->getInterfaces()->shouldReturn(array('MyInterface'));
+ }
+
+ function it_does_not_have_methods_by_default()
+ {
+ $this->getMethods()->shouldHaveCount(0);
+ }
+
+ /**
+ * @param \Prophecy\Doubler\Generator\Node\MethodNode $method1
+ * @param \Prophecy\Doubler\Generator\Node\MethodNode $method2
+ */
+ function it_can_has_methods($method1, $method2)
+ {
+ $method1->getName()->willReturn('__construct');
+ $method2->getName()->willReturn('getName');
+
+ $this->addMethod($method1);
+ $this->addMethod($method2);
+
+ $this->getMethods()->shouldReturn(array(
+ '__construct' => $method1,
+ 'getName' => $method2
+ ));
+ }
+
+ /**
+ * @param \Prophecy\Doubler\Generator\Node\MethodNode $method
+ */
+ function its_hasMethod_returns_true_if_method_exists($method)
+ {
+ $method->getName()->willReturn('getName');
+
+ $this->addMethod($method);
+
+ $this->hasMethod('getName')->shouldReturn(true);
+ }
+
+ /**
+ * @param \Prophecy\Doubler\Generator\Node\MethodNode $method
+ */
+ function its_getMethod_returns_method_by_name($method)
+ {
+ $method->getName()->willReturn('getName');
+
+ $this->addMethod($method);
+
+ $this->getMethod('getName')->shouldReturn($method);
+ }
+
+ function its_hasMethod_returns_false_if_method_does_not_exists()
+ {
+ $this->hasMethod('getName')->shouldReturn(false);
+ }
+
+ /**
+ * @param \Prophecy\Doubler\Generator\Node\MethodNode $method
+ */
+ function its_hasMethod_returns_false_if_method_has_been_removed($method)
+ {
+ $method->getName()->willReturn('getName');
+ $this->addMethod($method);
+ $this->removeMethod('getName');
+
+ $this->hasMethod('getName')->shouldReturn(false);
+ }
+
+
+ function it_does_not_have_properties_by_default()
+ {
+ $this->getProperties()->shouldHaveCount(0);
+ }
+
+ function it_is_able_to_have_properties()
+ {
+ $this->addProperty('title');
+ $this->addProperty('text', 'private');
+ $this->getProperties()->shouldReturn(array(
+ 'title' => 'public',
+ 'text' => 'private'
+ ));
+ }
+
+ function its_addProperty_does_not_accept_unsupported_visibility()
+ {
+ $this->shouldThrow('InvalidArgumentException')->duringAddProperty('title', 'town');
+ }
+
+ function its_addProperty_lowercases_visibility_before_setting()
+ {
+ $this->addProperty('text', 'PRIVATE');
+ $this->getProperties()->shouldReturn(array('text' => 'private'));
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/Node/MethodNodeSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/Node/MethodNodeSpec.php
new file mode 100644
index 00000000000..7582706ed40
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/Node/MethodNodeSpec.php
@@ -0,0 +1,123 @@
+beConstructedWith('getTitle');
+ }
+
+ function it_has_a_name()
+ {
+ $this->getName()->shouldReturn('getTitle');
+ }
+
+ function it_has_public_visibility_by_default()
+ {
+ $this->getVisibility()->shouldReturn('public');
+ }
+
+ function its_visibility_is_mutable()
+ {
+ $this->setVisibility('private');
+ $this->getVisibility()->shouldReturn('private');
+ }
+
+ function it_is_not_static_by_default()
+ {
+ $this->shouldNotBeStatic();
+ }
+
+ function it_does_not_return_a_reference_by_default()
+ {
+ $this->returnsReference()->shouldReturn(false);
+ }
+
+ function it_should_be_settable_as_returning_a_reference_through_setter()
+ {
+ $this->setReturnsReference();
+ $this->returnsReference()->shouldReturn(true);
+ }
+
+ function it_should_be_settable_as_static_through_setter()
+ {
+ $this->setStatic();
+ $this->shouldBeStatic();
+ }
+
+ function it_accepts_only_supported_visibilities()
+ {
+ $this->shouldThrow('InvalidArgumentException')->duringSetVisibility('stealth');
+ }
+
+ function it_lowercases_visibility_before_setting_it()
+ {
+ $this->setVisibility('Public');
+ $this->getVisibility()->shouldReturn('public');
+ }
+
+ /**
+ * @param \Prophecy\Doubler\Generator\Node\ArgumentNode $argument1
+ * @param \Prophecy\Doubler\Generator\Node\ArgumentNode $argument2
+ */
+ function its_useParentCode_causes_method_to_call_parent($argument1, $argument2)
+ {
+ $argument1->getName()->willReturn('objectName');
+ $argument2->getName()->willReturn('default');
+
+ $this->addArgument($argument1);
+ $this->addArgument($argument2);
+
+ $this->useParentCode();
+
+ $this->getCode()->shouldReturn(
+ 'return parent::getTitle($objectName, $default);'
+ );
+ }
+
+ function its_code_is_mutable()
+ {
+ $this->setCode('echo "code";');
+ $this->getCode()->shouldReturn('echo "code";');
+ }
+
+ function its_reference_returning_methods_will_generate_exceptions()
+ {
+ $this->setCode('echo "code";');
+ $this->setReturnsReference();
+ $this->getCode()->shouldReturn("throw new \Prophecy\Exception\Doubler\ReturnByReferenceException('Returning by reference not supported', get_class(\$this), 'getTitle');");
+ }
+
+ function its_setCode_provided_with_null_cleans_method_body()
+ {
+ $this->setCode(null);
+ $this->getCode()->shouldReturn('');
+ }
+
+ function it_is_constructable_with_code()
+ {
+ $this->beConstructedWith('getTitle', 'die();');
+ $this->getCode()->shouldReturn('die();');
+ }
+
+ function it_does_not_have_arguments_by_default()
+ {
+ $this->getArguments()->shouldHaveCount(0);
+ }
+
+ /**
+ * @param \Prophecy\Doubler\Generator\Node\ArgumentNode $argument1
+ * @param \Prophecy\Doubler\Generator\Node\ArgumentNode $argument2
+ */
+ function it_supports_adding_arguments($argument1, $argument2)
+ {
+ $this->addArgument($argument1);
+ $this->addArgument($argument2);
+
+ $this->getArguments()->shouldReturn(array($argument1, $argument2));
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/LazyDoubleSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/LazyDoubleSpec.php
new file mode 100644
index 00000000000..7026126ffe9
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/LazyDoubleSpec.php
@@ -0,0 +1,96 @@
+beConstructedWith($doubler);
+ }
+
+ /**
+ * @param \Prophecy\Prophecy\ProphecySubjectInterface $double
+ */
+ function it_returns_anonymous_double_instance_by_default($doubler, $double)
+ {
+ $doubler->double(null, array())->willReturn($double);
+
+ $this->getInstance()->shouldReturn($double);
+ }
+
+ /**
+ * @param \Prophecy\Prophecy\ProphecySubjectInterface $double
+ * @param \ReflectionClass $class
+ */
+ function it_returns_class_double_instance_if_set($doubler, $double, $class)
+ {
+ $doubler->double($class, array())->willReturn($double);
+
+ $this->setParentClass($class);
+
+ $this->getInstance()->shouldReturn($double);
+ }
+
+ /**
+ * @param \Prophecy\Prophecy\ProphecySubjectInterface $double1
+ * @param \Prophecy\Prophecy\ProphecySubjectInterface $double2
+ */
+ function it_returns_same_double_instance_if_called_2_times(
+ $doubler, $double1, $double2
+ )
+ {
+ $doubler->double(null, array())->willReturn($double1);
+ $doubler->double(null, array())->willReturn($double2);
+
+ $this->getInstance()->shouldReturn($double2);
+ $this->getInstance()->shouldReturn($double2);
+ }
+
+ function its_setParentClass_throws_ClassNotFoundException_if_class_not_found()
+ {
+ $this->shouldThrow('Prophecy\Exception\Doubler\ClassNotFoundException')
+ ->duringSetParentClass('SomeUnexistingClass');
+ }
+
+ /**
+ * @param \Prophecy\Prophecy\ProphecySubjectInterface $double
+ */
+ function its_setParentClass_throws_exception_if_prophecy_is_already_created(
+ $doubler, $double
+ )
+ {
+ $doubler->double(null, array())->willReturn($double);
+
+ $this->getInstance();
+
+ $this->shouldThrow('Prophecy\Exception\Doubler\DoubleException')
+ ->duringSetParentClass('stdClass');
+ }
+
+ function its_addInterface_throws_InterfaceNotFoundException_if_no_interface_found()
+ {
+ $this->shouldThrow('Prophecy\Exception\Doubler\InterfaceNotFoundException')
+ ->duringAddInterface('SomeUnexistingInterface');
+ }
+
+ /**
+ * @param \Prophecy\Prophecy\ProphecySubjectInterface $double
+ */
+ function its_addInterface_throws_exception_if_prophecy_is_already_created(
+ $doubler, $double
+ )
+ {
+ $doubler->double(null, array())->willReturn($double);
+
+ $this->getInstance();
+
+ $this->shouldThrow('Prophecy\Exception\Doubler\DoubleException')
+ ->duringAddInterface('ArrayAccess');
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/NameGeneratorSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/NameGeneratorSpec.php
new file mode 100644
index 00000000000..a3e74919753
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Doubler/NameGeneratorSpec.php
@@ -0,0 +1,72 @@
+getName()->willReturn('stdClass');
+ $this->name($class, array())->shouldStartWith('Double\stdClass\\');
+ }
+
+ /**
+ * @param \ReflectionClass $class
+ */
+ function its_name_generates_name_based_on_namespaced_class_reflection($class)
+ {
+ $class->getName()->willReturn('Some\Custom\Class');
+ $this->name($class, array())->shouldStartWith('Double\Some\Custom\Class\P');
+ }
+
+ /**
+ * @param \ReflectionClass $interface1
+ * @param \ReflectionClass $interface2
+ */
+ function its_name_generates_name_based_on_interface_shortnames($interface1, $interface2)
+ {
+ $interface1->getShortName()->willReturn('HandlerInterface');
+ $interface2->getShortName()->willReturn('LoaderInterface');
+
+ $this->name(null, array($interface1, $interface2))->shouldStartWith(
+ 'Double\HandlerInterface\LoaderInterface\P'
+ );
+ }
+
+ function it_generates_proper_name_for_no_class_and_interfaces_list()
+ {
+ $this->name(null, array())->shouldStartWith('Double\stdClass\P');
+ }
+
+ /**
+ * @param \ReflectionClass $class
+ * @param \ReflectionClass $interface1
+ * @param \ReflectionClass $interface2
+ */
+ function its_name_generates_name_based_only_on_class_if_its_available(
+ $class, $interface1, $interface2
+ )
+ {
+ $class->getName()->willReturn('Some\Custom\Class');
+ $interface1->getShortName()->willReturn('HandlerInterface');
+ $interface2->getShortName()->willReturn('LoaderInterface');
+
+ $this->name($class, array($interface1, $interface2))->shouldStartWith(
+ 'Double\Some\Custom\Class\P'
+ );
+ }
+
+ public function getMatchers()
+ {
+ return array(
+ 'startWith' => function ($subject, $string) {
+ return 0 === strpos($subject, $string);
+ },
+ );
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Exception/Call/UnexpectedCallExceptionSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Exception/Call/UnexpectedCallExceptionSpec.php
new file mode 100644
index 00000000000..6fd1a5c3f70
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Exception/Call/UnexpectedCallExceptionSpec.php
@@ -0,0 +1,32 @@
+beConstructedWith('msg', $objectProphecy, 'getName', array('arg1', 'arg2'));
+ }
+
+ function it_is_prophecy_exception()
+ {
+ $this->shouldBeAnInstanceOf('Prophecy\Exception\Prophecy\ObjectProphecyException');
+ }
+
+ function it_exposes_method_name_through_getter()
+ {
+ $this->getMethodName()->shouldReturn('getName');
+ }
+
+ function it_exposes_arguments_through_getter()
+ {
+ $this->getArguments()->shouldReturn(array('arg1', 'arg2'));
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/ClassCreatorExceptionSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/ClassCreatorExceptionSpec.php
new file mode 100644
index 00000000000..58241385ecb
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/ClassCreatorExceptionSpec.php
@@ -0,0 +1,28 @@
+beConstructedWith('', $node);
+ }
+
+ function it_is_a_prophecy_exception()
+ {
+ $this->shouldBeAnInstanceOf('Prophecy\Exception\Exception');
+ $this->shouldBeAnInstanceOf('Prophecy\Exception\Doubler\DoublerException');
+ }
+
+ function it_contains_a_reflected_node($node)
+ {
+ $this->getClassNode()->shouldReturn($node);
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/ClassMirrorExceptionSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/ClassMirrorExceptionSpec.php
new file mode 100644
index 00000000000..21e31a344dc
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/ClassMirrorExceptionSpec.php
@@ -0,0 +1,27 @@
+beConstructedWith('', $class);
+ }
+
+ function it_is_a_prophecy_exception()
+ {
+ $this->shouldBeAnInstanceOf('Prophecy\Exception\Exception');
+ $this->shouldBeAnInstanceOf('Prophecy\Exception\Doubler\DoublerException');
+ }
+
+ function it_contains_a_reflected_class_link($class)
+ {
+ $this->getReflectedClass()->shouldReturn($class);
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/ClassNotFoundExceptionSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/ClassNotFoundExceptionSpec.php
new file mode 100644
index 00000000000..251512b9bb6
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/ClassNotFoundExceptionSpec.php
@@ -0,0 +1,25 @@
+beConstructedWith('msg', 'CustomClass');
+ }
+
+ function it_is_a_prophecy_exception()
+ {
+ $this->shouldBeAnInstanceOf('Prophecy\Exception\Exception');
+ $this->shouldBeAnInstanceOf('Prophecy\Exception\Doubler\DoubleException');
+ }
+
+ function its_getClassname_returns_classname()
+ {
+ $this->getClassname()->shouldReturn('CustomClass');
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/DoubleExceptionSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/DoubleExceptionSpec.php
new file mode 100644
index 00000000000..6fe5a19aeb4
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/DoubleExceptionSpec.php
@@ -0,0 +1,14 @@
+shouldBeAnInstanceOf('RuntimeException');
+ $this->shouldBeAnInstanceOf('Prophecy\Exception\Doubler\DoublerException');
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/InterfaceNotFoundExceptionSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/InterfaceNotFoundExceptionSpec.php
new file mode 100644
index 00000000000..ad1a439e77c
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/InterfaceNotFoundExceptionSpec.php
@@ -0,0 +1,24 @@
+beConstructedWith('msg', 'CustomInterface');
+ }
+
+ function it_extends_ClassNotFoundException()
+ {
+ $this->shouldBeAnInstanceOf('Prophecy\Exception\Doubler\ClassNotFoundException');
+ }
+
+ function its_getClassname_returns_classname()
+ {
+ $this->getClassname()->shouldReturn('CustomInterface');
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/MethodNotFoundExceptionSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/MethodNotFoundExceptionSpec.php
new file mode 100644
index 00000000000..a889dd7ef45
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/MethodNotFoundExceptionSpec.php
@@ -0,0 +1,40 @@
+beConstructedWith('', 'User', 'getName', array(1, 2, 3));
+ }
+
+ function it_is_DoubleException()
+ {
+ $this->shouldHaveType('Prophecy\Exception\Doubler\DoubleException');
+ }
+
+ function it_has_MethodName()
+ {
+ $this->getMethodName()->shouldReturn('getName');
+ }
+
+ function it_has_classnamej()
+ {
+ $this->getClassname()->shouldReturn('User');
+ }
+
+ function it_has_an_arguments_list()
+ {
+ $this->getArguments()->shouldReturn(array(1, 2, 3));
+ }
+
+ function it_has_a_default_null_argument_list()
+ {
+ $this->beConstructedWith('', 'User', 'getName');
+ $this->getArguments()->shouldReturn(null);
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prediction/AggregateExceptionSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prediction/AggregateExceptionSpec.php
new file mode 100644
index 00000000000..22a5ebdbfa8
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prediction/AggregateExceptionSpec.php
@@ -0,0 +1,57 @@
+beConstructedWith(null);
+ }
+
+ function it_is_prediction_exception()
+ {
+ $this->shouldBeAnInstanceOf('RuntimeException');
+ $this->shouldBeAnInstanceOf('Prophecy\Exception\Prediction\PredictionException');
+ }
+
+ /**
+ * @param \Prophecy\Prophecy\ObjectProphecy $object
+ */
+ function it_can_store_objectProphecy_link($object)
+ {
+ $this->setObjectProphecy($object);
+ $this->getObjectProphecy()->shouldReturn($object);
+ }
+
+ function it_should_not_have_exceptions_at_the_beginning()
+ {
+ $this->getExceptions()->shouldHaveCount(0);
+ }
+
+ /**
+ * @param \Prophecy\Exception\Prediction\PredictionException $exception
+ */
+ function it_should_append_exception_through_append_method($exception)
+ {
+ $exception->getMessage()->willReturn('Exception #1');
+
+ $this->append($exception);
+
+ $this->getExceptions()->shouldReturn(array($exception));
+ }
+
+ /**
+ * @param \Prophecy\Exception\Prediction\PredictionException $exception
+ */
+ function it_should_update_message_during_append($exception)
+ {
+ $exception->getMessage()->willReturn('Exception #1');
+
+ $this->append($exception);
+
+ $this->getMessage()->shouldReturn(" Exception #1");
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prediction/NoCallsExceptionSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prediction/NoCallsExceptionSpec.php
new file mode 100644
index 00000000000..473f1a2dab8
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prediction/NoCallsExceptionSpec.php
@@ -0,0 +1,29 @@
+getObjectProphecy()->willReturn($objectProphecy);
+
+ $this->beConstructedWith('message', $methodProphecy);
+ }
+
+ function it_is_PredictionException()
+ {
+ $this->shouldHaveType('Prophecy\Exception\Prediction\PredictionException');
+ }
+
+ function it_extends_MethodProphecyException()
+ {
+ $this->shouldHaveType('Prophecy\Exception\Prophecy\MethodProphecyException');
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prediction/UnexpectedCallsCountExceptionSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prediction/UnexpectedCallsCountExceptionSpec.php
new file mode 100644
index 00000000000..adad975ba1b
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prediction/UnexpectedCallsCountExceptionSpec.php
@@ -0,0 +1,31 @@
+getObjectProphecy()->willReturn($objectProphecy);
+
+ $this->beConstructedWith('message', $methodProphecy, 5, array($call1, $call2));
+ }
+
+ function it_extends_UnexpectedCallsException()
+ {
+ $this->shouldBeAnInstanceOf('Prophecy\Exception\Prediction\UnexpectedCallsException');
+ }
+
+ function it_should_expose_expectedCount_through_getter()
+ {
+ $this->getExpectedCount()->shouldReturn(5);
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prediction/UnexpectedCallsExceptionSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prediction/UnexpectedCallsExceptionSpec.php
new file mode 100644
index 00000000000..c0fe24d777b
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prediction/UnexpectedCallsExceptionSpec.php
@@ -0,0 +1,36 @@
+getObjectProphecy()->willReturn($objectProphecy);
+
+ $this->beConstructedWith('message', $methodProphecy, array($call1, $call2));
+ }
+
+ function it_is_PredictionException()
+ {
+ $this->shouldHaveType('Prophecy\Exception\Prediction\PredictionException');
+ }
+
+ function it_extends_MethodProphecyException()
+ {
+ $this->shouldHaveType('Prophecy\Exception\Prophecy\MethodProphecyException');
+ }
+
+ function it_should_expose_calls_list_through_getter($call1, $call2)
+ {
+ $this->getCalls()->shouldReturn(array($call1, $call2));
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prophecy/MethodProphecyExceptionSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prophecy/MethodProphecyExceptionSpec.php
new file mode 100644
index 00000000000..97cf9e1094b
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prophecy/MethodProphecyExceptionSpec.php
@@ -0,0 +1,30 @@
+getObjectProphecy()->willReturn($objectProphecy);
+
+ $this->beConstructedWith('message', $methodProphecy);
+ }
+
+ function it_extends_DoubleException()
+ {
+ $this->shouldBeAnInstanceOf('Prophecy\Exception\Prophecy\ObjectProphecyException');
+ }
+
+ function it_holds_a_stub_reference($methodProphecy)
+ {
+ $this->getMethodProphecy()->shouldReturn($methodProphecy);
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prophecy/ObjectProphecyExceptionSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prophecy/ObjectProphecyExceptionSpec.php
new file mode 100644
index 00000000000..bcacfedcb14
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prophecy/ObjectProphecyExceptionSpec.php
@@ -0,0 +1,27 @@
+beConstructedWith('message', $objectProphecy);
+ }
+
+ function it_should_be_a_prophecy_exception()
+ {
+ $this->shouldBeAnInstanceOf('Prophecy\Exception\Prophecy\ProphecyException');
+ }
+
+ function it_holds_double_reference($objectProphecy)
+ {
+ $this->getObjectProphecy()->shouldReturn($objectProphecy);
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Prediction/CallPredictionSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Prediction/CallPredictionSpec.php
new file mode 100644
index 00000000000..3da8c599036
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Prediction/CallPredictionSpec.php
@@ -0,0 +1,42 @@
+shouldHaveType('Prophecy\Prediction\PredictionInterface');
+ }
+
+ /**
+ * @param \Prophecy\Prophecy\ObjectProphecy $object
+ * @param \Prophecy\Prophecy\MethodProphecy $method
+ * @param \Prophecy\Call\Call $call
+ */
+ function it_does_nothing_if_there_is_more_than_one_call_been_made($object, $method, $call)
+ {
+ $this->check(array($call), $object, $method)->shouldReturn(null);
+ }
+
+ /**
+ * @param \Prophecy\Prophecy\ObjectProphecy $object
+ * @param \Prophecy\Prophecy\MethodProphecy $method
+ * @param \Prophecy\Argument\ArgumentsWildcard $arguments
+ */
+ function it_throws_NoCallsException_if_no_calls_found($object, $method, $arguments)
+ {
+ $method->getObjectProphecy()->willReturn($object);
+ $method->getMethodName()->willReturn('getName');
+ $method->getArgumentsWildcard()->willReturn($arguments);
+ $arguments->__toString()->willReturn('123');
+ $object->reveal()->willReturn(new \stdClass());
+ $object->findProphecyMethodCalls('getName', Argument::any())->willReturn(array());
+
+ $this->shouldThrow('Prophecy\Exception\Prediction\NoCallsException')
+ ->duringCheck(array(), $object, $method);
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Prediction/CallTimesPredictionSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Prediction/CallTimesPredictionSpec.php
new file mode 100644
index 00000000000..c6708927fb1
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Prediction/CallTimesPredictionSpec.php
@@ -0,0 +1,54 @@
+beConstructedWith(2);
+ }
+
+ function it_is_prediction()
+ {
+ $this->shouldHaveType('Prophecy\Prediction\PredictionInterface');
+ }
+
+ /**
+ * @param \Prophecy\Prophecy\ObjectProphecy $object
+ * @param \Prophecy\Prophecy\MethodProphecy $method
+ * @param \Prophecy\Call\Call $call1
+ * @param \Prophecy\Call\Call $call2
+ */
+ function it_does_nothing_if_there_were_exact_amount_of_calls_being_made(
+ $object, $method, $call1, $call2
+ )
+ {
+ $this->check(array($call1, $call2), $object, $method)->shouldReturn(null);
+ }
+
+ /**
+ * @param \Prophecy\Prophecy\ObjectProphecy $object
+ * @param \Prophecy\Prophecy\MethodProphecy $method
+ * @param \Prophecy\Call\Call $call
+ * @param \Prophecy\Argument\ArgumentsWildcard $arguments
+ */
+ function it_throws_UnexpectedCallsCountException_if_calls_found(
+ $object, $method, $call, $arguments
+ )
+ {
+ $method->getObjectProphecy()->willReturn($object);
+ $method->getMethodName()->willReturn('getName');
+ $method->getArgumentsWildcard()->willReturn($arguments);
+ $arguments->__toString()->willReturn('123');
+
+ $call->getMethodName()->willReturn('getName');
+ $call->getArguments()->willReturn(array(5, 4, 'three'));
+ $call->getCallPlace()->willReturn('unknown');
+
+ $this->shouldThrow('Prophecy\Exception\Prediction\UnexpectedCallsCountException')
+ ->duringCheck(array($call), $object, $method);
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Prediction/CallbackPredictionSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Prediction/CallbackPredictionSpec.php
new file mode 100644
index 00000000000..7fe475ef1fb
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Prediction/CallbackPredictionSpec.php
@@ -0,0 +1,36 @@
+beConstructedWith('get_class');
+ }
+
+ function it_is_prediction()
+ {
+ $this->shouldHaveType('Prophecy\Prediction\PredictionInterface');
+ }
+
+ /**
+ * @param \Prophecy\Prophecy\ObjectProphecy $object
+ * @param \Prophecy\Prophecy\MethodProphecy $method
+ * @param \Prophecy\Call\Call $call
+ */
+ function it_proxies_call_to_callback($object, $method, $call)
+ {
+ $returnFirstCallCallback = function ($calls, $object, $method) {
+ throw new RuntimeException;
+ };
+
+ $this->beConstructedWith($returnFirstCallCallback);
+
+ $this->shouldThrow('RuntimeException')->duringCheck(array($call), $object, $method);
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Prediction/NoCallsPredictionSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Prediction/NoCallsPredictionSpec.php
new file mode 100644
index 00000000000..a3ef9bcb3ea
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Prediction/NoCallsPredictionSpec.php
@@ -0,0 +1,43 @@
+shouldHaveType('Prophecy\Prediction\PredictionInterface');
+ }
+
+ /**
+ * @param \Prophecy\Prophecy\ObjectProphecy $object
+ * @param \Prophecy\Prophecy\MethodProphecy $method
+ */
+ function it_does_nothing_if_there_is_no_calls_made($object, $method)
+ {
+ $this->check(array(), $object, $method)->shouldReturn(null);
+ }
+
+ /**
+ * @param \Prophecy\Prophecy\ObjectProphecy $object
+ * @param \Prophecy\Prophecy\MethodProphecy $method
+ * @param \Prophecy\Call\Call $call
+ * @param \Prophecy\Argument\ArgumentsWildcard $arguments
+ */
+ function it_throws_UnexpectedCallsException_if_calls_found($object, $method, $call, $arguments)
+ {
+ $method->getObjectProphecy()->willReturn($object);
+ $method->getMethodName()->willReturn('getName');
+ $method->getArgumentsWildcard()->willReturn($arguments);
+ $arguments->__toString()->willReturn('123');
+
+ $call->getMethodName()->willReturn('getName');
+ $call->getArguments()->willReturn(array(5, 4, 'three'));
+ $call->getCallPlace()->willReturn('unknown');
+
+ $this->shouldThrow('Prophecy\Exception\Prediction\UnexpectedCallsException')
+ ->duringCheck(array($call), $object, $method);
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Promise/CallbackPromiseSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Promise/CallbackPromiseSpec.php
new file mode 100644
index 00000000000..5d99b1b1ce7
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Promise/CallbackPromiseSpec.php
@@ -0,0 +1,110 @@
+beConstructedWith('get_class');
+ }
+
+ function it_is_promise()
+ {
+ $this->shouldBeAnInstanceOf('Prophecy\Promise\PromiseInterface');
+ }
+
+ /**
+ * @param \Prophecy\Prophecy\ObjectProphecy $object
+ * @param \Prophecy\Prophecy\MethodProphecy $method
+ */
+ function it_should_execute_closure_callback($object, $method)
+ {
+ $firstArgumentCallback = function ($args) {
+ return $args[0];
+ };
+
+ $this->beConstructedWith($firstArgumentCallback);
+
+ $this->execute(array('one', 'two'), $object, $method)->shouldReturn('one');
+ }
+
+ /**
+ * @param \Prophecy\Prophecy\ObjectProphecy $object
+ * @param \Prophecy\Prophecy\MethodProphecy $method
+ */
+ function it_should_execute_static_array_callback($object, $method)
+ {
+ $firstArgumentCallback = array('spec\Prophecy\Promise\ClassCallback', 'staticCallbackMethod');
+
+ $this->beConstructedWith($firstArgumentCallback);
+
+ $this->execute(array('one', 'two'), $object, $method)->shouldReturn('one');
+ }
+
+ /**
+ * @param \Prophecy\Prophecy\ObjectProphecy $object
+ * @param \Prophecy\Prophecy\MethodProphecy $method
+ */
+ function it_should_execute_instance_array_callback($object, $method)
+ {
+ $class = new ClassCallback();
+ $firstArgumentCallback = array($class, 'callbackMethod');
+
+ $this->beConstructedWith($firstArgumentCallback);
+
+ $this->execute(array('one', 'two'), $object, $method)->shouldReturn('one');
+ }
+
+ /**
+ * @param \Prophecy\Prophecy\ObjectProphecy $object
+ * @param \Prophecy\Prophecy\MethodProphecy $method
+ */
+ function it_should_execute_string_function_callback($object, $method)
+ {
+ $firstArgumentCallback = 'spec\Prophecy\Promise\functionCallbackFirstArgument';
+
+ $this->beConstructedWith($firstArgumentCallback);
+
+ $this->execute(array('one', 'two'), $object, $method)->shouldReturn('one');
+ }
+
+}
+
+/**
+ * Class used to test callbackpromise
+ *
+ * @param array
+ * @return string
+ */
+class ClassCallback
+{
+ /**
+ * @param array $args
+ */
+ function callbackMethod($args)
+ {
+ return $args[0];
+ }
+
+ /**
+ * @param array $args
+ */
+ static function staticCallbackMethod($args)
+ {
+ return $args[0];
+ }
+}
+
+/**
+ * Callback function used to test callbackpromise
+ *
+ * @param array
+ * @return string
+ */
+function functionCallbackFirstArgument($args)
+{
+ return $args[0];
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Promise/ReturnArgumentPromiseSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Promise/ReturnArgumentPromiseSpec.php
new file mode 100644
index 00000000000..4acb7bb0aa0
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Promise/ReturnArgumentPromiseSpec.php
@@ -0,0 +1,41 @@
+shouldBeAnInstanceOf('Prophecy\Promise\PromiseInterface');
+ }
+
+ /**
+ * @param \Prophecy\Prophecy\ObjectProphecy $object
+ * @param \Prophecy\Prophecy\MethodProphecy $method
+ */
+ function it_should_return_first_argument_if_provided($object, $method)
+ {
+ $this->execute(array('one', 'two'), $object, $method)->shouldReturn('one');
+ }
+
+ /**
+ * @param \Prophecy\Prophecy\ObjectProphecy $object
+ * @param \Prophecy\Prophecy\MethodProphecy $method
+ */
+ function it_should_return_null_if_no_arguments_provided($object, $method)
+ {
+ $this->execute(array(), $object, $method)->shouldReturn(null);
+ }
+
+ /**
+ * @param \Prophecy\Prophecy\ObjectProphecy $object
+ * @param \Prophecy\Prophecy\MethodProphecy $method
+ */
+ function it_should_return_nth_argument_if_provided($object, $method)
+ {
+ $this->beConstructedWith(1);
+ $this->execute(array('one', 'two'), $object, $method)->shouldReturn('two');
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Promise/ReturnPromiseSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Promise/ReturnPromiseSpec.php
new file mode 100644
index 00000000000..18bfd87aa09
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Promise/ReturnPromiseSpec.php
@@ -0,0 +1,61 @@
+beConstructedWith(array(42));
+ }
+
+ function it_is_promise()
+ {
+ $this->shouldBeAnInstanceOf('Prophecy\Promise\PromiseInterface');
+ }
+
+ /**
+ * @param \Prophecy\Prophecy\ObjectProphecy $object
+ * @param \Prophecy\Prophecy\MethodProphecy $method
+ */
+ function it_returns_value_it_was_constructed_with($object, $method)
+ {
+ $this->execute(array(), $object, $method)->shouldReturn(42);
+ }
+
+ /**
+ * @param \Prophecy\Prophecy\ObjectProphecy $object
+ * @param \Prophecy\Prophecy\MethodProphecy $method
+ */
+ function it_always_returns_last_value_left_in_the_return_values($object, $method)
+ {
+ $this->execute(array(), $object, $method)->shouldReturn(42);
+ $this->execute(array(), $object, $method)->shouldReturn(42);
+ }
+
+ /**
+ * @param \Prophecy\Prophecy\ObjectProphecy $object
+ * @param \Prophecy\Prophecy\MethodProphecy $method
+ */
+ function it_consequently_returns_multiple_values_it_was_constructed_with($object, $method)
+ {
+ $this->beConstructedWith(array(42, 24, 12));
+
+ $this->execute(array(), $object, $method)->shouldReturn(42);
+ $this->execute(array(), $object, $method)->shouldReturn(24);
+ $this->execute(array(), $object, $method)->shouldReturn(12);
+ }
+
+ /**
+ * @param \Prophecy\Prophecy\ObjectProphecy $object
+ * @param \Prophecy\Prophecy\MethodProphecy $method
+ */
+ function it_returns_null_if_constructed_with_empty_array($object, $method)
+ {
+ $this->beConstructedWith(array());
+
+ $this->execute(array(), $object, $method)->shouldReturn(null);
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Promise/ThrowPromiseSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Promise/ThrowPromiseSpec.php
new file mode 100644
index 00000000000..5f448979a1b
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Promise/ThrowPromiseSpec.php
@@ -0,0 +1,58 @@
+beConstructedWith('RuntimeException');
+ }
+
+ function it_is_promise()
+ {
+ $this->shouldBeAnInstanceOf('Prophecy\Promise\PromiseInterface');
+ }
+
+ /**
+ * @param \Prophecy\Prophecy\ObjectProphecy $object
+ * @param \Prophecy\Prophecy\MethodProphecy $method
+ */
+ function it_instantiates_and_throws_exception_from_provided_classname($object, $method)
+ {
+ $this->beConstructedWith('InvalidArgumentException');
+
+ $this->shouldThrow('InvalidArgumentException')
+ ->duringExecute(array(), $object, $method);
+ }
+
+ /**
+ * @param \Prophecy\Prophecy\ObjectProphecy $object
+ * @param \Prophecy\Prophecy\MethodProphecy $method
+ */
+ function it_instantiates_exceptions_with_required_arguments($object, $method)
+ {
+ $this->beConstructedWith('spec\Prophecy\Promise\RequiredArgumentException');
+
+ $this->shouldThrow('spec\Prophecy\Promise\RequiredArgumentException')
+ ->duringExecute(array(), $object, $method);
+ }
+
+ /**
+ * @param \Prophecy\Prophecy\ObjectProphecy $object
+ * @param \Prophecy\Prophecy\MethodProphecy $method
+ */
+ function it_throws_provided_exception($object, $method)
+ {
+ $this->beConstructedWith($exc = new \RuntimeException('Some exception'));
+
+ $this->shouldThrow($exc)->duringExecute(array(), $object, $method);
+ }
+}
+
+class RequiredArgumentException extends \Exception
+{
+ final public function __construct($message, $code) {}
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Prophecy/MethodProphecySpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Prophecy/MethodProphecySpec.php
new file mode 100644
index 00000000000..d8299a78ed2
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Prophecy/MethodProphecySpec.php
@@ -0,0 +1,381 @@
+reveal()->willReturn($reflection);
+
+ $this->beConstructedWith($objectProphecy, 'getName', null);
+ }
+
+ function it_is_initializable()
+ {
+ $this->shouldHaveType('Prophecy\Prophecy\MethodProphecy');
+ }
+
+ function its_constructor_throws_MethodNotFoundException_for_unexisting_method($objectProphecy)
+ {
+ $this->shouldThrow('Prophecy\Exception\Doubler\MethodNotFoundException')->during(
+ '__construct', array($objectProphecy, 'getUnexisting', null)
+ );
+ }
+
+ function its_constructor_throws_MethodProphecyException_for_final_methods($objectProphecy, ClassWithFinalMethod $subject)
+ {
+ $objectProphecy->reveal()->willReturn($subject);
+
+ $this->shouldThrow('Prophecy\Exception\Prophecy\MethodProphecyException')->during(
+ '__construct', array($objectProphecy, 'finalMethod', null)
+ );
+ }
+
+ function its_constructor_transforms_array_passed_as_3rd_argument_to_ArgumentsWildcard(
+ $objectProphecy
+ )
+ {
+ $this->beConstructedWith($objectProphecy, 'getName', array(42, 33));
+
+ $wildcard = $this->getArgumentsWildcard();
+ $wildcard->shouldNotBe(null);
+ $wildcard->__toString()->shouldReturn('exact(42), exact(33)');
+ }
+
+ function its_constructor_does_not_touch_third_argument_if_it_is_null($objectProphecy)
+ {
+ $this->beConstructedWith($objectProphecy, 'getName', null);
+
+ $wildcard = $this->getArgumentsWildcard();
+ $wildcard->shouldBe(null);
+ }
+
+ /**
+ * @param \Prophecy\Promise\PromiseInterface $promise
+ */
+ function it_records_promise_through_will_method($promise, $objectProphecy)
+ {
+ $objectProphecy->addMethodProphecy($this)->willReturn(null);
+
+ $this->will($promise);
+ $this->getPromise()->shouldReturn($promise);
+ }
+
+ /**
+ * @param \Prophecy\Promise\PromiseInterface $promise
+ */
+ function it_adds_itself_to_ObjectProphecy_during_call_to_will($objectProphecy, $promise)
+ {
+ $objectProphecy->addMethodProphecy($this)->shouldBeCalled();
+
+ $this->will($promise);
+ }
+
+ function it_adds_ReturnPromise_during_willReturn_call($objectProphecy)
+ {
+ $objectProphecy->addMethodProphecy($this)->willReturn(null);
+
+ $this->willReturn(42);
+ $this->getPromise()->shouldBeAnInstanceOf('Prophecy\Promise\ReturnPromise');
+ }
+
+ function it_adds_ThrowPromise_during_willThrow_call($objectProphecy)
+ {
+ $objectProphecy->addMethodProphecy($this)->willReturn(null);
+
+ $this->willThrow('RuntimeException');
+ $this->getPromise()->shouldBeAnInstanceOf('Prophecy\Promise\ThrowPromise');
+ }
+
+ function it_adds_ReturnArgumentPromise_during_willReturnArgument_call($objectProphecy)
+ {
+ $objectProphecy->addMethodProphecy($this)->willReturn(null);
+
+ $this->willReturnArgument();
+ $this->getPromise()->shouldBeAnInstanceOf('Prophecy\Promise\ReturnArgumentPromise');
+ }
+
+ function it_adds_ReturnArgumentPromise_during_willReturnArgument_call_with_index_argument($objectProphecy)
+ {
+ $objectProphecy->addMethodProphecy($this)->willReturn(null);
+
+ $this->willReturnArgument(1);
+ $promise = $this->getPromise();
+ $promise->shouldBeAnInstanceOf('Prophecy\Promise\ReturnArgumentPromise');
+ $promise->execute(array('one', 'two'), $objectProphecy, $this)->shouldReturn('two');
+ }
+
+ function it_adds_CallbackPromise_during_will_call_with_callback_argument($objectProphecy)
+ {
+ $objectProphecy->addMethodProphecy($this)->willReturn(null);
+
+ $callback = function () {};
+
+ $this->will($callback);
+ $this->getPromise()->shouldBeAnInstanceOf('Prophecy\Promise\CallbackPromise');
+ }
+
+ /**
+ * @param \Prophecy\Prediction\PredictionInterface $prediction
+ */
+ function it_records_prediction_through_should_method($prediction, $objectProphecy)
+ {
+ $objectProphecy->addMethodProphecy($this)->willReturn(null);
+
+ $this->callOnWrappedObject('should', array($prediction));
+ $this->getPrediction()->shouldReturn($prediction);
+ }
+
+ function it_adds_CallbackPrediction_during_should_call_with_callback_argument($objectProphecy)
+ {
+ $objectProphecy->addMethodProphecy($this)->willReturn(null);
+
+ $callback = function () {};
+
+ $this->callOnWrappedObject('should', array($callback));
+ $this->getPrediction()->shouldBeAnInstanceOf('Prophecy\Prediction\CallbackPrediction');
+ }
+
+ /**
+ * @param \Prophecy\Prediction\PredictionInterface $prediction
+ */
+ function it_adds_itself_to_ObjectProphecy_during_call_to_should($objectProphecy, $prediction)
+ {
+ $objectProphecy->addMethodProphecy($this)->shouldBeCalled();
+
+ $this->callOnWrappedObject('should', array($prediction));
+ }
+
+ function it_adds_CallPrediction_during_shouldBeCalled_call($objectProphecy)
+ {
+ $objectProphecy->addMethodProphecy($this)->willReturn(null);
+
+ $this->callOnWrappedObject('shouldBeCalled', array());
+ $this->getPrediction()->shouldBeAnInstanceOf('Prophecy\Prediction\CallPrediction');
+ }
+
+ function it_adds_NoCallsPrediction_during_shouldNotBeCalled_call($objectProphecy)
+ {
+ $objectProphecy->addMethodProphecy($this)->willReturn(null);
+
+ $this->callOnWrappedObject('shouldNotBeCalled', array());
+ $this->getPrediction()->shouldBeAnInstanceOf('Prophecy\Prediction\NoCallsPrediction');
+ }
+
+ function it_adds_CallTimesPrediction_during_shouldBeCalledTimes_call($objectProphecy)
+ {
+ $objectProphecy->addMethodProphecy($this)->willReturn(null);
+
+ $this->callOnWrappedObject('shouldBeCalledTimes', array(5));
+ $this->getPrediction()->shouldBeAnInstanceOf('Prophecy\Prediction\CallTimesPrediction');
+ }
+
+ /**
+ * @param \Prophecy\Argument\ArgumentsWildcard $arguments
+ * @param \Prophecy\Prediction\PredictionInterface $prediction
+ * @param \Prophecy\Call\Call $call1
+ * @param \Prophecy\Call\Call $call2
+ */
+ function it_checks_prediction_via_shouldHave_method_call(
+ $objectProphecy, $arguments, $prediction, $call1, $call2
+ )
+ {
+ $objectProphecy->addMethodProphecy($this)->willReturn(null);
+ $prediction->check(array($call1, $call2), $objectProphecy->getWrappedObject(), $this)->shouldBeCalled();
+ $objectProphecy->findProphecyMethodCalls('getName', $arguments)->willReturn(array($call1, $call2));
+
+ $this->withArguments($arguments);
+ $this->callOnWrappedObject('shouldHave', array($prediction));
+ }
+
+ /**
+ * @param \Prophecy\Argument\ArgumentsWildcard $arguments
+ * @param \Prophecy\Prediction\PredictionInterface $prediction
+ * @param \Prophecy\Call\Call $call1
+ * @param \Prophecy\Call\Call $call2
+ */
+ function it_sets_return_promise_during_shouldHave_call_if_none_was_set_before(
+ $objectProphecy, $arguments, $prediction, $call1, $call2
+ )
+ {
+ $objectProphecy->addMethodProphecy($this)->willReturn(null);
+ $prediction->check(array($call1, $call2), $objectProphecy->getWrappedObject(), $this)->shouldBeCalled();
+ $objectProphecy->findProphecyMethodCalls('getName', $arguments)->willReturn(array($call1, $call2));
+
+ $this->withArguments($arguments);
+ $this->callOnWrappedObject('shouldHave', array($prediction));
+
+ $this->getPromise()->shouldReturnAnInstanceOf('Prophecy\Promise\ReturnPromise');
+ }
+
+ /**
+ * @param \Prophecy\Argument\ArgumentsWildcard $arguments
+ * @param \Prophecy\Prediction\PredictionInterface $prediction
+ * @param \Prophecy\Call\Call $call1
+ * @param \Prophecy\Call\Call $call2
+ * @param \Prophecy\Promise\PromiseInterface $promise
+ */
+ function it_does_not_set_return_promise_during_shouldHave_call_if_it_was_set_before(
+ $objectProphecy, $arguments, $prediction, $call1, $call2, $promise
+ )
+ {
+ $objectProphecy->addMethodProphecy($this)->willReturn(null);
+ $prediction->check(array($call1, $call2), $objectProphecy->getWrappedObject(), $this)->shouldBeCalled();
+ $objectProphecy->findProphecyMethodCalls('getName', $arguments)->willReturn(array($call1, $call2));
+
+ $this->will($promise);
+ $this->withArguments($arguments);
+ $this->callOnWrappedObject('shouldHave', array($prediction));
+
+ $this->getPromise()->shouldReturn($promise);
+ }
+
+ /**
+ * @param \Prophecy\Argument\ArgumentsWildcard $arguments
+ * @param \Prophecy\Prediction\PredictionInterface $prediction1
+ * @param \Prophecy\Prediction\PredictionInterface $prediction2
+ * @param \Prophecy\Call\Call $call1
+ * @param \Prophecy\Call\Call $call2
+ * @param \Prophecy\Promise\PromiseInterface $promise
+ */
+ function it_records_checked_predictions(
+ $objectProphecy, $arguments, $prediction1, $prediction2, $call1, $call2, $promise
+ )
+ {
+ $objectProphecy->addMethodProphecy($this)->willReturn(null);
+ $prediction1->check(array($call1, $call2), $objectProphecy->getWrappedObject(), $this)->willReturn();
+ $prediction2->check(array($call1, $call2), $objectProphecy->getWrappedObject(), $this)->willReturn();
+ $objectProphecy->findProphecyMethodCalls('getName', $arguments)->willReturn(array($call1, $call2));
+
+ $this->will($promise);
+ $this->withArguments($arguments);
+ $this->callOnWrappedObject('shouldHave', array($prediction1));
+ $this->callOnWrappedObject('shouldHave', array($prediction2));
+
+ $this->getCheckedPredictions()->shouldReturn(array($prediction1, $prediction2));
+ }
+
+ /**
+ * @param \Prophecy\Argument\ArgumentsWildcard $arguments
+ * @param \Prophecy\Prediction\PredictionInterface $prediction
+ * @param \Prophecy\Call\Call $call1
+ * @param \Prophecy\Call\Call $call2
+ * @param \Prophecy\Promise\PromiseInterface $promise
+ */
+ function it_records_even_failed_checked_predictions(
+ $objectProphecy, $arguments, $prediction, $call1, $call2, $promise
+ )
+ {
+ $objectProphecy->addMethodProphecy($this)->willReturn(null);
+ $prediction->check(array($call1, $call2), $objectProphecy->getWrappedObject(), $this)->willThrow(new \RuntimeException());
+ $objectProphecy->findProphecyMethodCalls('getName', $arguments)->willReturn(array($call1, $call2));
+
+ $this->will($promise);
+ $this->withArguments($arguments);
+
+ try {
+ $this->callOnWrappedObject('shouldHave', array($prediction));
+ } catch (\Exception $e) {}
+
+ $this->getCheckedPredictions()->shouldReturn(array($prediction));
+ }
+
+ /**
+ * @param \Prophecy\Argument\ArgumentsWildcard $arguments
+ * @param \Prophecy\Prediction\PredictionInterface $prediction
+ * @param \Prophecy\Call\Call $call1
+ * @param \Prophecy\Call\Call $call2
+ */
+ function it_checks_prediction_via_shouldHave_method_call_with_callback(
+ $objectProphecy, $arguments, $prediction, $call1, $call2
+ )
+ {
+ $callback = function ($calls, $object, $method) {
+ throw new \RuntimeException;
+ };
+ $objectProphecy->findProphecyMethodCalls('getName', $arguments)->willReturn(array($call1, $call2));
+
+ $this->withArguments($arguments);
+ $this->shouldThrow('RuntimeException')->duringShouldHave($callback);
+ }
+
+ function it_does_nothing_during_checkPrediction_if_no_prediction_set()
+ {
+ $this->checkPrediction()->shouldReturn(null);
+ }
+
+ /**
+ * @param \Prophecy\Argument\ArgumentsWildcard $arguments
+ * @param \Prophecy\Prediction\PredictionInterface $prediction
+ * @param \Prophecy\Call\Call $call1
+ * @param \Prophecy\Call\Call $call2
+ */
+ function it_checks_set_prediction_during_checkPrediction(
+ $objectProphecy, $arguments, $prediction, $call1, $call2
+ )
+ {
+ $prediction->check(array($call1, $call2), $objectProphecy->getWrappedObject(), $this)->shouldBeCalled();
+ $objectProphecy->findProphecyMethodCalls('getName', $arguments)->willReturn(array($call1, $call2));
+ $objectProphecy->addMethodProphecy($this)->willReturn(null);
+
+ $this->withArguments($arguments);
+ $this->callOnWrappedObject('should', array($prediction));
+ $this->checkPrediction();
+ }
+
+ function it_links_back_to_ObjectProphecy_through_getter($objectProphecy)
+ {
+ $this->getObjectProphecy()->shouldReturn($objectProphecy);
+ }
+
+ function it_has_MethodName()
+ {
+ $this->getMethodName()->shouldReturn('getName');
+ }
+
+ /**
+ * @param \Prophecy\Argument\ArgumentsWildcard $wildcard
+ */
+ function it_contains_ArgumentsWildcard_it_was_constructed_with($objectProphecy, $wildcard)
+ {
+ $this->beConstructedWith($objectProphecy, 'getName', $wildcard);
+
+ $this->getArgumentsWildcard()->shouldReturn($wildcard);
+ }
+
+ /**
+ * @param \Prophecy\Argument\ArgumentsWildcard $wildcard
+ */
+ function its_ArgumentWildcard_is_mutable_through_setter($wildcard)
+ {
+ $this->withArguments($wildcard);
+
+ $this->getArgumentsWildcard()->shouldReturn($wildcard);
+ }
+
+ function its_withArguments_transforms_passed_array_into_ArgumentsWildcard()
+ {
+ $this->withArguments(array(42, 33));
+
+ $wildcard = $this->getArgumentsWildcard();
+ $wildcard->shouldNotBe(null);
+ $wildcard->__toString()->shouldReturn('exact(42), exact(33)');
+ }
+
+ function its_withArguments_throws_exception_if_wrong_arguments_provided()
+ {
+ $this->shouldThrow('Prophecy\Exception\InvalidArgumentException')->duringWithArguments(42);
+ }
+}
+
+class ClassWithFinalMethod
+{
+ final public function finalMethod() {}
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Prophecy/ObjectProphecySpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Prophecy/ObjectProphecySpec.php
new file mode 100644
index 00000000000..00f57fe1a65
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Prophecy/ObjectProphecySpec.php
@@ -0,0 +1,305 @@
+beConstructedWith($lazyDouble);
+
+ $lazyDouble->getInstance()->willReturn($double);
+ }
+
+ function it_implements_ProphecyInterface()
+ {
+ $this->shouldBeAnInstanceOf('Prophecy\Prophecy\ProphecyInterface');
+ }
+
+ function it_sets_parentClass_during_willExtend_call($lazyDouble)
+ {
+ $lazyDouble->setParentClass('123')->shouldBeCalled();
+
+ $this->willExtend('123');
+ }
+
+ function it_adds_interface_during_willImplement_call($lazyDouble)
+ {
+ $lazyDouble->addInterface('222')->shouldBeCalled();
+
+ $this->willImplement('222');
+ }
+
+ function it_sets_constructor_arguments_during_willBeConstructedWith_call($lazyDouble)
+ {
+ $lazyDouble->setArguments(array(1, 2, 5))->shouldBeCalled();
+
+ $this->willBeConstructedWith(array(1, 2, 5));
+ }
+
+ function it_does_not_have_method_prophecies_by_default()
+ {
+ $this->getMethodProphecies()->shouldHaveCount(0);
+ }
+
+ /**
+ * @param \Prophecy\Prophecy\MethodProphecy $method1
+ * @param \Prophecy\Prophecy\MethodProphecy $method2
+ * @param \Prophecy\Argument\ArgumentsWildcard $arguments
+ */
+ function it_should_get_method_prophecies_by_method_name($method1, $method2, $arguments)
+ {
+ $method1->getMethodName()->willReturn('getName');
+ $method1->getArgumentsWildcard()->willReturn($arguments);
+ $method2->getMethodName()->willReturn('setName');
+ $method2->getArgumentsWildcard()->willReturn($arguments);
+
+ $this->addMethodProphecy($method1);
+ $this->addMethodProphecy($method2);
+
+ $methods = $this->getMethodProphecies('setName');
+ $methods->shouldHaveCount(1);
+ $methods[0]->getMethodName()->shouldReturn('setName');
+ }
+
+ function it_should_return_empty_array_if_no_method_prophecies_found()
+ {
+ $methods = $this->getMethodProphecies('setName');
+ $methods->shouldHaveCount(0);
+ }
+
+ /**
+ * @param \Prophecy\Call\CallCenter $callCenter
+ */
+ function it_should_proxy_makeProphecyMethodCall_to_CallCenter($lazyDouble, $callCenter)
+ {
+ $this->beConstructedWith($lazyDouble, $callCenter);
+
+ $callCenter->makeCall($this->getWrappedObject(), 'setName', array('everzet'))->willReturn(42);
+
+ $this->makeProphecyMethodCall('setName', array('everzet'))->shouldReturn(42);
+ }
+
+ /**
+ * @param \Prophecy\Call\CallCenter $callCenter
+ * @param \Prophecy\Prophecy\RevealerInterface $revealer
+ */
+ function it_should_reveal_arguments_and_return_values_from_callCenter(
+ $lazyDouble, $callCenter, $revealer
+ )
+ {
+ $this->beConstructedWith($lazyDouble, $callCenter, $revealer);
+
+ $revealer->reveal(array('question'))->willReturn(array('life'));
+ $revealer->reveal('answer')->willReturn(42);
+
+ $callCenter->makeCall($this->getWrappedObject(), 'setName', array('life'))->willReturn('answer');
+
+ $this->makeProphecyMethodCall('setName', array('question'))->shouldReturn(42);
+ }
+
+ /**
+ * @param \Prophecy\Call\CallCenter $callCenter
+ * @param \Prophecy\Argument\ArgumentsWildcard $wildcard
+ * @param \Prophecy\Call\Call $call
+ */
+ function it_should_proxy_getProphecyMethodCalls_to_CallCenter(
+ $lazyDouble, $callCenter, $wildcard, $call
+ )
+ {
+ $this->beConstructedWith($lazyDouble, $callCenter);
+
+ $callCenter->findCalls('setName', $wildcard)->willReturn(array($call));
+
+ $this->findProphecyMethodCalls('setName', $wildcard)->shouldReturn(array($call));
+ }
+
+ /**
+ * @param \Prophecy\Prophecy\MethodProphecy $methodProphecy
+ * @param \Prophecy\Argument\ArgumentsWildcard $argumentsWildcard
+ */
+ function its_addMethodProphecy_adds_method_prophecy(
+ $methodProphecy, $argumentsWildcard
+ )
+ {
+ $methodProphecy->getArgumentsWildcard()->willReturn($argumentsWildcard);
+ $methodProphecy->getMethodName()->willReturn('getUsername');
+
+ $this->addMethodProphecy($methodProphecy);
+
+ $this->getMethodProphecies()->shouldReturn(array(
+ 'getUsername' => array($methodProphecy)
+ ));
+ }
+
+ /**
+ * @param \Prophecy\Prophecy\MethodProphecy $methodProphecy1
+ * @param \Prophecy\Prophecy\MethodProphecy $methodProphecy2
+ * @param \Prophecy\Argument\ArgumentsWildcard $argumentsWildcard1
+ * @param \Prophecy\Argument\ArgumentsWildcard $argumentsWildcard2
+ */
+ function its_addMethodProphecy_handles_prophecies_with_different_arguments(
+ $methodProphecy1, $methodProphecy2, $argumentsWildcard1, $argumentsWildcard2
+ )
+ {
+ $methodProphecy1->getArgumentsWildcard()->willReturn($argumentsWildcard1);
+ $methodProphecy1->getMethodName()->willReturn('getUsername');
+
+ $methodProphecy2->getArgumentsWildcard()->willReturn($argumentsWildcard2);
+ $methodProphecy2->getMethodName()->willReturn('getUsername');
+
+ $this->addMethodProphecy($methodProphecy1);
+ $this->addMethodProphecy($methodProphecy2);
+
+ $this->getMethodProphecies()->shouldReturn(array(
+ 'getUsername' => array(
+ $methodProphecy1,
+ $methodProphecy2,
+ )
+ ));
+ }
+
+ /**
+ * @param \Prophecy\Prophecy\MethodProphecy $methodProphecy1
+ * @param \Prophecy\Prophecy\MethodProphecy $methodProphecy2
+ * @param \Prophecy\Argument\ArgumentsWildcard $argumentsWildcard1
+ * @param \Prophecy\Argument\ArgumentsWildcard $argumentsWildcard2
+ */
+ function its_addMethodProphecy_handles_prophecies_for_different_methods(
+ $methodProphecy1, $methodProphecy2, $argumentsWildcard1, $argumentsWildcard2
+ )
+ {
+ $methodProphecy1->getArgumentsWildcard()->willReturn($argumentsWildcard1);
+ $methodProphecy1->getMethodName()->willReturn('getUsername');
+
+ $methodProphecy2->getArgumentsWildcard()->willReturn($argumentsWildcard2);
+ $methodProphecy2->getMethodName()->willReturn('isUsername');
+
+ $this->addMethodProphecy($methodProphecy1);
+ $this->addMethodProphecy($methodProphecy2);
+
+ $this->getMethodProphecies()->shouldReturn(array(
+ 'getUsername' => array(
+ $methodProphecy1
+ ),
+ 'isUsername' => array(
+ $methodProphecy2
+ )
+ ));
+ }
+
+ /**
+ * @param \Prophecy\Prophecy\MethodProphecy $methodProphecy
+ */
+ function its_addMethodProphecy_throws_exception_when_method_has_no_ArgumentsWildcard(
+ $methodProphecy
+ )
+ {
+ $methodProphecy->getArgumentsWildcard()->willReturn(null);
+ $methodProphecy->getObjectProphecy()->willReturn($this);
+ $methodProphecy->getMethodName()->willReturn('getTitle');
+
+ $this->shouldThrow('Prophecy\Exception\Prophecy\MethodProphecyException')->duringAddMethodProphecy(
+ $methodProphecy
+ );
+ }
+
+ function it_returns_null_after_checkPredictions_call_if_there_is_no_method_prophecies()
+ {
+ $this->checkProphecyMethodsPredictions()->shouldReturn(null);
+ }
+
+ /**
+ * @param \Prophecy\Prophecy\MethodProphecy $methodProphecy1
+ * @param \Prophecy\Prophecy\MethodProphecy $methodProphecy2
+ * @param \Prophecy\Argument\ArgumentsWildcard $argumentsWildcard1
+ * @param \Prophecy\Argument\ArgumentsWildcard $argumentsWildcard2
+ */
+ function it_throws_AggregateException_during_checkPredictions_if_predictions_fail(
+ $methodProphecy1, $methodProphecy2, $argumentsWildcard1, $argumentsWildcard2
+ )
+ {
+ $methodProphecy1->getMethodName()->willReturn('getName');
+ $methodProphecy1->getArgumentsWildcard()->willReturn($argumentsWildcard1);
+ $methodProphecy1->checkPrediction()
+ ->willThrow('Prophecy\Exception\Prediction\AggregateException');
+
+ $methodProphecy2->getMethodName()->willReturn('setName');
+ $methodProphecy2->getArgumentsWildcard()->willReturn($argumentsWildcard2);
+ $methodProphecy2->checkPrediction()
+ ->willThrow('Prophecy\Exception\Prediction\AggregateException');
+
+ $this->addMethodProphecy($methodProphecy1);
+ $this->addMethodProphecy($methodProphecy2);
+
+ $this->shouldThrow('Prophecy\Exception\Prediction\AggregateException')
+ ->duringCheckProphecyMethodsPredictions();
+ }
+
+ /**
+ * @param \Prophecy\Doubler\Doubler $doubler
+ * @param \Prophecy\Prophecy\ProphecySubjectInterface $reflection
+ */
+ function it_returns_new_MethodProphecy_instance_for_arbitrary_call($doubler, $reflection)
+ {
+ $doubler->double(Argument::any())->willReturn($reflection);
+
+ $return = $this->getProphecy();
+ $return->shouldBeAnInstanceOf('Prophecy\Prophecy\MethodProphecy');
+ $return->getMethodName()->shouldReturn('getProphecy');
+ }
+
+ /**
+ * @param \Prophecy\Doubler\Doubler $doubler
+ * @param \Prophecy\Prophecy\ProphecySubjectInterface $reflection
+ */
+ function it_returns_same_MethodProphecy_for_same_registered_signature($doubler, $reflection)
+ {
+ $doubler->double(Argument::any())->willReturn($reflection);
+
+ $this->addMethodProphecy($methodProphecy1 = $this->getProphecy(1, 2, 3));
+ $methodProphecy2 = $this->getProphecy(1, 2, 3);
+
+ $methodProphecy2->shouldBe($methodProphecy1);
+ }
+
+ /**
+ * @param \Prophecy\Doubler\Doubler $doubler
+ * @param \Prophecy\Prophecy\ProphecySubjectInterface $reflection
+ */
+ function it_returns_new_MethodProphecy_for_different_signatures($doubler, $reflection)
+ {
+ $doubler->double(Argument::any())->willReturn($reflection);
+
+ $value = new ObjectProphecySpecFixtureB('ABC');
+ $value2 = new ObjectProphecySpecFixtureB('CBA');
+
+ $this->addMethodProphecy($methodProphecy1 = $this->getProphecy(1, 2, 3, $value));
+ $methodProphecy2 = $this->getProphecy(1, 2, 3, $value2);
+
+ $methodProphecy2->shouldNotBe($methodProphecy1);
+ }
+}
+
+class ObjectProphecySpecFixtureA
+{
+ public $errors;
+}
+
+class ObjectProphecySpecFixtureB extends ObjectProphecySpecFixtureA
+{
+ public $errors;
+ public $value = null;
+
+ public function __construct($value)
+ {
+ $this->value = $value;
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Prophecy/RevealerSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Prophecy/RevealerSpec.php
new file mode 100644
index 00000000000..4d83d739659
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Prophecy/RevealerSpec.php
@@ -0,0 +1,51 @@
+shouldBeAnInstanceOf('Prophecy\Prophecy\RevealerInterface');
+ }
+
+ /**
+ * @param \Prophecy\Prophecy\ProphecyInterface $prophecy
+ * @param \stdClass $object
+ */
+ function it_reveals_single_instance_of_ProphecyInterface($prophecy, $object)
+ {
+ $prophecy->reveal()->willReturn($object);
+
+ $this->reveal($prophecy)->shouldReturn($object);
+ }
+
+ /**
+ * @param \Prophecy\Prophecy\ProphecyInterface $prophecy1
+ * @param \Prophecy\Prophecy\ProphecyInterface $prophecy2
+ * @param \stdClass $object1
+ * @param \stdClass $object2
+ */
+ function it_reveals_instances_of_ProphecyInterface_inside_array(
+ $prophecy1, $prophecy2, $object1, $object2
+ )
+ {
+ $prophecy1->reveal()->willReturn($object1);
+ $prophecy2->reveal()->willReturn($object2);
+
+ $this->reveal(array(
+ array('item' => $prophecy2),
+ $prophecy1
+ ))->shouldReturn(array(
+ array('item' => $object2),
+ $object1
+ ));
+ }
+
+ function it_does_not_touch_non_prophecy_interface()
+ {
+ $this->reveal(42)->shouldReturn(42);
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/ProphetSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/ProphetSpec.php
new file mode 100644
index 00000000000..74d5976a606
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/ProphetSpec.php
@@ -0,0 +1,91 @@
+double(null, array())->willReturn($double);
+
+ $this->beConstructedWith($doubler);
+ }
+
+ function it_constructs_new_prophecy_on_prophesize_call()
+ {
+ $prophecy = $this->prophesize();
+ $prophecy->shouldBeAnInstanceOf('Prophecy\Prophecy\ObjectProphecy');
+ }
+
+ /**
+ * @param \Prophecy\Prophecy\ProphecySubjectInterface $newDouble
+ */
+ function it_constructs_new_prophecy_with_parent_class_if_specified($doubler, $newDouble)
+ {
+ $doubler->double(Argument::any(), array())->willReturn($newDouble);
+
+ $this->prophesize('Prophecy\Prophet')->reveal()->shouldReturn($newDouble);
+ }
+
+ /**
+ * @param \Prophecy\Prophecy\ProphecySubjectInterface $newDouble
+ */
+ function it_constructs_new_prophecy_with_interface_if_specified($doubler, $newDouble)
+ {
+ $doubler->double(null, Argument::any())->willReturn($newDouble);
+
+ $this->prophesize('ArrayAccess')->reveal()->shouldReturn($newDouble);
+ }
+
+ function it_exposes_all_created_prophecies_through_getter()
+ {
+ $prophecy1 = $this->prophesize();
+ $prophecy2 = $this->prophesize();
+
+ $this->getProphecies()->shouldReturn(array($prophecy1, $prophecy2));
+ }
+
+ function it_does_nothing_during_checkPredictions_call_if_no_predictions_defined()
+ {
+ $this->checkPredictions()->shouldReturn(null);
+ }
+
+ /**
+ * @param \Prophecy\Prophecy\MethodProphecy $method1
+ * @param \Prophecy\Prophecy\MethodProphecy $method2
+ * @param \Prophecy\Argument\ArgumentsWildcard $arguments1
+ * @param \Prophecy\Argument\ArgumentsWildcard $arguments2
+ */
+ function it_throws_AggregateException_if_defined_predictions_fail(
+ $method1, $method2, $arguments1, $arguments2
+ )
+ {
+ $method1->getMethodName()->willReturn('getName');
+ $method1->getArgumentsWildcard()->willReturn($arguments1);
+ $method1->checkPrediction()->willReturn(null);
+
+ $method2->getMethodName()->willReturn('isSet');
+ $method2->getArgumentsWildcard()->willReturn($arguments2);
+ $method2->checkPrediction()->willThrow(
+ 'Prophecy\Exception\Prediction\AggregateException'
+ );
+
+ $this->prophesize()->addMethodProphecy($method1);
+ $this->prophesize()->addMethodProphecy($method2);
+
+ $this->shouldThrow('Prophecy\Exception\Prediction\AggregateException')
+ ->duringCheckPredictions();
+ }
+
+ function it_exposes_doubler_through_getter($doubler)
+ {
+ $this->getDoubler()->shouldReturn($doubler);
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Util/StringUtilSpec.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Util/StringUtilSpec.php
new file mode 100644
index 00000000000..a4eef59f9f7
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/spec/Prophecy/Util/StringUtilSpec.php
@@ -0,0 +1,97 @@
+stringify(42)->shouldReturn('42');
+ }
+
+ function it_generates_proper_string_representation_for_string()
+ {
+ $this->stringify('some string')->shouldReturn('"some string"');
+ }
+
+ function it_generates_single_line_representation_for_multiline_string()
+ {
+ $this->stringify("some\nstring")->shouldReturn('"some\\nstring"');
+ }
+
+ function it_generates_proper_string_representation_for_double()
+ {
+ $this->stringify(42.3)->shouldReturn('42.3');
+ }
+
+ function it_generates_proper_string_representation_for_boolean_true()
+ {
+ $this->stringify(true)->shouldReturn('true');
+ }
+
+ function it_generates_proper_string_representation_for_boolean_false()
+ {
+ $this->stringify(false)->shouldReturn('false');
+ }
+
+ function it_generates_proper_string_representation_for_null()
+ {
+ $this->stringify(null)->shouldReturn('null');
+ }
+
+ function it_generates_proper_string_representation_for_empty_array()
+ {
+ $this->stringify(array())->shouldReturn('[]');
+ }
+
+ function it_generates_proper_string_representation_for_array()
+ {
+ $this->stringify(array('zet', 42))->shouldReturn('["zet", 42]');
+ }
+
+ function it_generates_proper_string_representation_for_hash_containing_one_value()
+ {
+ $this->stringify(array('ever' => 'zet'))->shouldReturn('["ever" => "zet"]');
+ }
+
+ function it_generates_proper_string_representation_for_hash()
+ {
+ $this->stringify(array('ever' => 'zet', 52 => 'hey', 'num' => 42))->shouldReturn(
+ '["ever" => "zet", 52 => "hey", "num" => 42]'
+ );
+ }
+
+ function it_generates_proper_string_representation_for_resource()
+ {
+ $resource = fopen(__FILE__, 'r');
+ $this->stringify($resource)->shouldReturn('stream:'.$resource);
+ }
+
+ /**
+ * @param \stdClass $object
+ */
+ function it_generates_proper_string_representation_for_object($object)
+ {
+ $objHash = sprintf('%s:%s',
+ get_class($object->getWrappedObject()),
+ spl_object_hash($object->getWrappedObject())
+ ) . " Object (\n 'objectProphecy' => Prophecy\Prophecy\ObjectProphecy Object (*Prophecy*)\n)";
+
+ $this->stringify($object)->shouldReturn("$objHash");
+ }
+
+ /**
+ * @param stdClass $object
+ */
+ function it_generates_proper_string_representation_for_object_without_exporting($object)
+ {
+ $objHash = sprintf('%s:%s',
+ get_class($object->getWrappedObject()),
+ spl_object_hash($object->getWrappedObject())
+ );
+
+ $this->stringify($object, false)->shouldReturn("$objHash");
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Argument.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Argument.php
new file mode 100644
index 00000000000..f2b33648543
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Argument.php
@@ -0,0 +1,198 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy;
+
+use Prophecy\Argument\Token;
+
+/**
+ * Argument tokens shortcuts.
+ *
+ * @author Konstantin Kudryashov
+ */
+class Argument
+{
+ /**
+ * Checks that argument is exact value or object.
+ *
+ * @param mixed $value
+ *
+ * @return Token\ExactValueToken
+ */
+ public static function exact($value)
+ {
+ return new Token\ExactValueToken($value);
+ }
+
+ /**
+ * Checks that argument is of specific type or instance of specific class.
+ *
+ * @param string $type Type name (`integer`, `string`) or full class name
+ *
+ * @return Token\TypeToken
+ */
+ public static function type($type)
+ {
+ return new Token\TypeToken($type);
+ }
+
+ /**
+ * Checks that argument object has specific state.
+ *
+ * @param string $methodName
+ * @param mixed $value
+ *
+ * @return Token\ObjectStateToken
+ */
+ public static function which($methodName, $value)
+ {
+ return new Token\ObjectStateToken($methodName, $value);
+ }
+
+ /**
+ * Checks that argument matches provided callback.
+ *
+ * @param callable $callback
+ *
+ * @return Token\CallbackToken
+ */
+ public static function that($callback)
+ {
+ return new Token\CallbackToken($callback);
+ }
+
+ /**
+ * Matches any single value.
+ *
+ * @return Token\AnyValueToken
+ */
+ public static function any()
+ {
+ return new Token\AnyValueToken;
+ }
+
+ /**
+ * Matches all values to the rest of the signature.
+ *
+ * @return Token\AnyValuesToken
+ */
+ public static function cetera()
+ {
+ return new Token\AnyValuesToken;
+ }
+
+ /**
+ * Checks that argument matches all tokens
+ *
+ * @param mixed ... a list of tokens
+ *
+ * @return Token\LogicalAndToken
+ */
+ public static function allOf()
+ {
+ return new Token\LogicalAndToken(func_get_args());
+ }
+
+ /**
+ * Checks that argument array or countable object has exact number of elements.
+ *
+ * @param integer $value array elements count
+ *
+ * @return Token\ArrayCountToken
+ */
+ public static function size($value)
+ {
+ return new Token\ArrayCountToken($value);
+ }
+
+ /**
+ * Checks that argument array contains (key, value) pair
+ *
+ * @param mixed $key exact value or token
+ * @param mixed $value exact value or token
+ *
+ * @return Token\ArrayEntryToken
+ */
+ public static function withEntry($key, $value)
+ {
+ return new Token\ArrayEntryToken($key, $value);
+ }
+
+ /**
+ * Checks that arguments array entries all match value
+ *
+ * @param mixed $value
+ *
+ * @return Token\ArrayEveryEntryToken
+ */
+ public static function withEveryEntry($value)
+ {
+ return new Token\ArrayEveryEntryToken($value);
+ }
+
+ /**
+ * Checks that argument array contains value
+ *
+ * @param mixed $value
+ *
+ * @return Token\ArrayEntryToken
+ */
+ public static function containing($value)
+ {
+ return new Token\ArrayEntryToken(self::any(), $value);
+ }
+
+ /**
+ * Checks that argument array has key
+ *
+ * @param mixed $key exact value or token
+ *
+ * @return Token\ArrayEntryToken
+ */
+ public static function withKey($key)
+ {
+ return new Token\ArrayEntryToken($key, self::any());
+ }
+
+ /**
+ * Checks that argument does not match the value|token.
+ *
+ * @param mixed $value either exact value or argument token
+ *
+ * @return Token\LogicalNotToken
+ */
+ public static function not($value)
+ {
+ return new Token\LogicalNotToken($value);
+ }
+
+ /**
+ * @param string $value
+ *
+ * @return Token\StringContainsToken
+ */
+ public static function containingString($value)
+ {
+ return new Token\StringContainsToken($value);
+ }
+
+ /**
+ * Checks that argument is identical value.
+ *
+ * @param mixed $value
+ *
+ * @return Token\IdenticalValueToken
+ */
+ public static function is($value)
+ {
+ return new Token\IdenticalValueToken($value);
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Argument/ArgumentsWildcard.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Argument/ArgumentsWildcard.php
new file mode 100644
index 00000000000..a088f21d21d
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Argument/ArgumentsWildcard.php
@@ -0,0 +1,101 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Argument;
+
+/**
+ * Arguments wildcarding.
+ *
+ * @author Konstantin Kudryashov
+ */
+class ArgumentsWildcard
+{
+ /**
+ * @var Token\TokenInterface[]
+ */
+ private $tokens = array();
+ private $string;
+
+ /**
+ * Initializes wildcard.
+ *
+ * @param array $arguments Array of argument tokens or values
+ */
+ public function __construct(array $arguments)
+ {
+ foreach ($arguments as $argument) {
+ if (!$argument instanceof Token\TokenInterface) {
+ $argument = new Token\ExactValueToken($argument);
+ }
+
+ $this->tokens[] = $argument;
+ }
+ }
+
+ /**
+ * Calculates wildcard match score for provided arguments.
+ *
+ * @param array $arguments
+ *
+ * @return false|int False OR integer score (higher - better)
+ */
+ public function scoreArguments(array $arguments)
+ {
+ if (0 == count($arguments) && 0 == count($this->tokens)) {
+ return 1;
+ }
+
+ $arguments = array_values($arguments);
+ $totalScore = 0;
+ foreach ($this->tokens as $i => $token) {
+ $argument = isset($arguments[$i]) ? $arguments[$i] : null;
+ if (1 >= $score = $token->scoreArgument($argument)) {
+ return false;
+ }
+
+ $totalScore += $score;
+
+ if (true === $token->isLast()) {
+ return $totalScore;
+ }
+ }
+
+ if (count($arguments) > count($this->tokens)) {
+ return false;
+ }
+
+ return $totalScore;
+ }
+
+ /**
+ * Returns string representation for wildcard.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ if (null === $this->string) {
+ $this->string = implode(', ', array_map(function ($token) {
+ return (string) $token;
+ }, $this->tokens));
+ }
+
+ return $this->string;
+ }
+
+ /**
+ * @return array
+ */
+ public function getTokens()
+ {
+ return $this->tokens;
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/AnyValueToken.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/AnyValueToken.php
new file mode 100644
index 00000000000..50988112c5a
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/AnyValueToken.php
@@ -0,0 +1,52 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Argument\Token;
+
+/**
+ * Any single value token.
+ *
+ * @author Konstantin Kudryashov
+ */
+class AnyValueToken implements TokenInterface
+{
+ /**
+ * Always scores 3 for any argument.
+ *
+ * @param $argument
+ *
+ * @return int
+ */
+ public function scoreArgument($argument)
+ {
+ return 3;
+ }
+
+ /**
+ * Returns false.
+ *
+ * @return bool
+ */
+ public function isLast()
+ {
+ return false;
+ }
+
+ /**
+ * Returns string representation for token.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return '*';
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/AnyValuesToken.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/AnyValuesToken.php
new file mode 100644
index 00000000000..f76b17bc0ba
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/AnyValuesToken.php
@@ -0,0 +1,52 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Argument\Token;
+
+/**
+ * Any values token.
+ *
+ * @author Konstantin Kudryashov
+ */
+class AnyValuesToken implements TokenInterface
+{
+ /**
+ * Always scores 2 for any argument.
+ *
+ * @param $argument
+ *
+ * @return int
+ */
+ public function scoreArgument($argument)
+ {
+ return 2;
+ }
+
+ /**
+ * Returns true to stop wildcard from processing other tokens.
+ *
+ * @return bool
+ */
+ public function isLast()
+ {
+ return true;
+ }
+
+ /**
+ * Returns string representation for token.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return '* [, ...]';
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ArrayCountToken.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ArrayCountToken.php
new file mode 100644
index 00000000000..96b4befd7f5
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ArrayCountToken.php
@@ -0,0 +1,86 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Argument\Token;
+
+/**
+ * Array elements count token.
+ *
+ * @author Boris Mikhaylov
+ */
+
+class ArrayCountToken implements TokenInterface
+{
+ private $count;
+
+ /**
+ * @param integer $value
+ */
+ public function __construct($value)
+ {
+ $this->count = $value;
+ }
+
+ /**
+ * Scores 6 when argument has preset number of elements.
+ *
+ * @param $argument
+ *
+ * @return bool|int
+ */
+ public function scoreArgument($argument)
+ {
+ return $this->isCountable($argument) && $this->hasProperCount($argument) ? 6 : false;
+ }
+
+ /**
+ * Returns false.
+ *
+ * @return boolean
+ */
+ public function isLast()
+ {
+ return false;
+ }
+
+ /**
+ * Returns string representation for token.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return sprintf('count(%s)', $this->count);
+ }
+
+ /**
+ * Returns true if object is either array or instance of \Countable
+ *
+ * @param $argument
+ * @return bool
+ */
+ private function isCountable($argument)
+ {
+ return (is_array($argument) || $argument instanceof \Countable);
+ }
+
+ /**
+ * Returns true if $argument has expected number of elements
+ *
+ * @param array|\Countable $argument
+ *
+ * @return bool
+ */
+ private function hasProperCount($argument)
+ {
+ return $this->count === count($argument);
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ArrayEntryToken.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ArrayEntryToken.php
new file mode 100644
index 00000000000..0305fc7207c
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ArrayEntryToken.php
@@ -0,0 +1,143 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Argument\Token;
+
+use Prophecy\Exception\InvalidArgumentException;
+
+/**
+ * Array entry token.
+ *
+ * @author Boris Mikhaylov
+ */
+class ArrayEntryToken implements TokenInterface
+{
+ /** @var \Prophecy\Argument\Token\TokenInterface */
+ private $key;
+ /** @var \Prophecy\Argument\Token\TokenInterface */
+ private $value;
+
+ /**
+ * @param mixed $key exact value or token
+ * @param mixed $value exact value or token
+ */
+ public function __construct($key, $value)
+ {
+ $this->key = $this->wrapIntoExactValueToken($key);
+ $this->value = $this->wrapIntoExactValueToken($value);
+ }
+
+ /**
+ * Scores half of combined scores from key and value tokens for same entry. Capped at 8.
+ * If argument implements \ArrayAccess without \Traversable, then key token is restricted to ExactValueToken.
+ *
+ * @param array|\ArrayAccess|\Traversable $argument
+ *
+ * @throws \Prophecy\Exception\InvalidArgumentException
+ * @return bool|int
+ */
+ public function scoreArgument($argument)
+ {
+ if ($argument instanceof \Traversable) {
+ $argument = iterator_to_array($argument);
+ }
+
+ if ($argument instanceof \ArrayAccess) {
+ $argument = $this->convertArrayAccessToEntry($argument);
+ }
+
+ if (!is_array($argument) || empty($argument)) {
+ return false;
+ }
+
+ $keyScores = array_map(array($this->key,'scoreArgument'), array_keys($argument));
+ $valueScores = array_map(array($this->value,'scoreArgument'), $argument);
+ $scoreEntry = function ($value, $key) {
+ return $value && $key ? min(8, ($key + $value) / 2) : false;
+ };
+
+ return max(array_map($scoreEntry, $valueScores, $keyScores));
+ }
+
+ /**
+ * Returns false.
+ *
+ * @return boolean
+ */
+ public function isLast()
+ {
+ return false;
+ }
+
+ /**
+ * Returns string representation for token.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return sprintf('[..., %s => %s, ...]', $this->key, $this->value);
+ }
+
+ /**
+ * Returns key
+ *
+ * @return TokenInterface
+ */
+ public function getKey()
+ {
+ return $this->key;
+ }
+
+ /**
+ * Returns value
+ *
+ * @return TokenInterface
+ */
+ public function getValue()
+ {
+ return $this->value;
+ }
+
+ /**
+ * Wraps non token $value into ExactValueToken
+ *
+ * @param $value
+ * @return TokenInterface
+ */
+ private function wrapIntoExactValueToken($value)
+ {
+ return $value instanceof TokenInterface ? $value : new ExactValueToken($value);
+ }
+
+ /**
+ * Converts instance of \ArrayAccess to key => value array entry
+ *
+ * @param \ArrayAccess $object
+ *
+ * @return array|null
+ * @throws \Prophecy\Exception\InvalidArgumentException
+ */
+ private function convertArrayAccessToEntry(\ArrayAccess $object)
+ {
+ if (!$this->key instanceof ExactValueToken) {
+ throw new InvalidArgumentException(sprintf(
+ 'You can only use exact value tokens to match key of ArrayAccess object'.PHP_EOL.
+ 'But you used `%s`.',
+ $this->key
+ ));
+ }
+
+ $key = $this->key->getValue();
+
+ return $object->offsetExists($key) ? array($key => $object[$key]) : array();
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ArrayEveryEntryToken.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ArrayEveryEntryToken.php
new file mode 100644
index 00000000000..5d41fa487c4
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ArrayEveryEntryToken.php
@@ -0,0 +1,82 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Argument\Token;
+
+/**
+ * Array every entry token.
+ *
+ * @author Adrien Brault
+ */
+class ArrayEveryEntryToken implements TokenInterface
+{
+ /**
+ * @var TokenInterface
+ */
+ private $value;
+
+ /**
+ * @param mixed $value exact value or token
+ */
+ public function __construct($value)
+ {
+ if (!$value instanceof TokenInterface) {
+ $value = new ExactValueToken($value);
+ }
+
+ $this->value = $value;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function scoreArgument($argument)
+ {
+ if (!$argument instanceof \Traversable && !is_array($argument)) {
+ return false;
+ }
+
+ $scores = array();
+ foreach ($argument as $key => $argumentEntry) {
+ $scores[] = $this->value->scoreArgument($argumentEntry);
+ }
+
+ if (empty($scores) || in_array(false, $scores, true)) {
+ return false;
+ }
+
+ return array_sum($scores) / count($scores);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function isLast()
+ {
+ return false;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function __toString()
+ {
+ return sprintf('[%s, ..., %s]', $this->value, $this->value);
+ }
+
+ /**
+ * @return TokenInterface
+ */
+ public function getValue()
+ {
+ return $this->value;
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/CallbackToken.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/CallbackToken.php
new file mode 100644
index 00000000000..f45ba20becd
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/CallbackToken.php
@@ -0,0 +1,75 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Argument\Token;
+
+use Prophecy\Exception\InvalidArgumentException;
+
+/**
+ * Callback-verified token.
+ *
+ * @author Konstantin Kudryashov
+ */
+class CallbackToken implements TokenInterface
+{
+ private $callback;
+
+ /**
+ * Initializes token.
+ *
+ * @param callable $callback
+ *
+ * @throws \Prophecy\Exception\InvalidArgumentException
+ */
+ public function __construct($callback)
+ {
+ if (!is_callable($callback)) {
+ throw new InvalidArgumentException(sprintf(
+ 'Callable expected as an argument to CallbackToken, but got %s.',
+ gettype($callback)
+ ));
+ }
+
+ $this->callback = $callback;
+ }
+
+ /**
+ * Scores 7 if callback returns true, false otherwise.
+ *
+ * @param $argument
+ *
+ * @return bool|int
+ */
+ public function scoreArgument($argument)
+ {
+ return call_user_func($this->callback, $argument) ? 7 : false;
+ }
+
+ /**
+ * Returns false.
+ *
+ * @return bool
+ */
+ public function isLast()
+ {
+ return false;
+ }
+
+ /**
+ * Returns string representation for token.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return 'callback()';
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ExactValueToken.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ExactValueToken.php
new file mode 100644
index 00000000000..ba895ab9759
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ExactValueToken.php
@@ -0,0 +1,116 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Argument\Token;
+
+use SebastianBergmann\Comparator\Factory as ComparatorFactory;
+use SebastianBergmann\Comparator\ComparisonFailure;
+use Prophecy\Util\StringUtil;
+
+/**
+ * Exact value token.
+ *
+ * @author Konstantin Kudryashov
+ */
+class ExactValueToken implements TokenInterface
+{
+ private $value;
+ private $string;
+ private $util;
+ private $comparatorFactory;
+
+ /**
+ * Initializes token.
+ *
+ * @param mixed $value
+ * @param StringUtil $util
+ * @param ComparatorFactory $comparatorFactory
+ */
+ public function __construct($value, StringUtil $util = null, ComparatorFactory $comparatorFactory = null)
+ {
+ $this->value = $value;
+ $this->util = $util ?: new StringUtil();
+
+ $this->comparatorFactory = $comparatorFactory ?: ComparatorFactory::getInstance();
+ }
+
+ /**
+ * Scores 10 if argument matches preset value.
+ *
+ * @param $argument
+ *
+ * @return bool|int
+ */
+ public function scoreArgument($argument)
+ {
+ if (is_object($argument) && is_object($this->value)) {
+ $comparator = $this->comparatorFactory->getComparatorFor(
+ $argument, $this->value
+ );
+
+ try {
+ $comparator->assertEquals($argument, $this->value);
+ return 10;
+ } catch (ComparisonFailure $failure) {}
+ }
+
+ // If either one is an object it should castable to a string
+ if (is_object($argument) xor is_object($this->value)) {
+ if (is_object($argument) && !method_exists($argument, '__toString')) {
+ return false;
+ }
+
+ if (is_object($this->value) && !method_exists($this->value, '__toString')) {
+ return false;
+ }
+ } elseif (is_numeric($argument) && is_numeric($this->value)) {
+ // noop
+ } elseif (gettype($argument) !== gettype($this->value)) {
+ return false;
+ }
+
+ return $argument == $this->value ? 10 : false;
+ }
+
+ /**
+ * Returns preset value against which token checks arguments.
+ *
+ * @return mixed
+ */
+ public function getValue()
+ {
+ return $this->value;
+ }
+
+ /**
+ * Returns false.
+ *
+ * @return bool
+ */
+ public function isLast()
+ {
+ return false;
+ }
+
+ /**
+ * Returns string representation for token.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ if (null === $this->string) {
+ $this->string = sprintf('exact(%s)', $this->util->stringify($this->value));
+ }
+
+ return $this->string;
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/IdenticalValueToken.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/IdenticalValueToken.php
new file mode 100644
index 00000000000..0b6d23ab667
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/IdenticalValueToken.php
@@ -0,0 +1,74 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Argument\Token;
+
+use Prophecy\Util\StringUtil;
+
+/**
+ * Identical value token.
+ *
+ * @author Florian Voutzinos
+ */
+class IdenticalValueToken implements TokenInterface
+{
+ private $value;
+ private $string;
+ private $util;
+
+ /**
+ * Initializes token.
+ *
+ * @param mixed $value
+ * @param StringUtil $util
+ */
+ public function __construct($value, StringUtil $util = null)
+ {
+ $this->value = $value;
+ $this->util = $util ?: new StringUtil();
+ }
+
+ /**
+ * Scores 11 if argument matches preset value.
+ *
+ * @param $argument
+ *
+ * @return bool|int
+ */
+ public function scoreArgument($argument)
+ {
+ return $argument === $this->value ? 11 : false;
+ }
+
+ /**
+ * Returns false.
+ *
+ * @return bool
+ */
+ public function isLast()
+ {
+ return false;
+ }
+
+ /**
+ * Returns string representation for token.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ if (null === $this->string) {
+ $this->string = sprintf('identical(%s)', $this->util->stringify($this->value));
+ }
+
+ return $this->string;
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/LogicalAndToken.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/LogicalAndToken.php
new file mode 100644
index 00000000000..4ee1b25e11f
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/LogicalAndToken.php
@@ -0,0 +1,80 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Argument\Token;
+
+/**
+ * Logical AND token.
+ *
+ * @author Boris Mikhaylov
+ */
+class LogicalAndToken implements TokenInterface
+{
+ private $tokens = array();
+
+ /**
+ * @param array $arguments exact values or tokens
+ */
+ public function __construct(array $arguments)
+ {
+ foreach ($arguments as $argument) {
+ if (!$argument instanceof TokenInterface) {
+ $argument = new ExactValueToken($argument);
+ }
+ $this->tokens[] = $argument;
+ }
+ }
+
+ /**
+ * Scores maximum score from scores returned by tokens for this argument if all of them score.
+ *
+ * @param $argument
+ *
+ * @return bool|int
+ */
+ public function scoreArgument($argument)
+ {
+ if (0 === count($this->tokens)) {
+ return false;
+ }
+
+ $maxScore = 0;
+ foreach ($this->tokens as $token) {
+ $score = $token->scoreArgument($argument);
+ if (false === $score) {
+ return false;
+ }
+ $maxScore = max($score, $maxScore);
+ }
+
+ return $maxScore;
+ }
+
+ /**
+ * Returns false.
+ *
+ * @return boolean
+ */
+ public function isLast()
+ {
+ return false;
+ }
+
+ /**
+ * Returns string representation for token.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return sprintf('bool(%s)', implode(' AND ', $this->tokens));
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/LogicalNotToken.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/LogicalNotToken.php
new file mode 100644
index 00000000000..623efa57a7f
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/LogicalNotToken.php
@@ -0,0 +1,73 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Argument\Token;
+
+/**
+ * Logical NOT token.
+ *
+ * @author Boris Mikhaylov
+ */
+class LogicalNotToken implements TokenInterface
+{
+ /** @var \Prophecy\Argument\Token\TokenInterface */
+ private $token;
+
+ /**
+ * @param mixed $value exact value or token
+ */
+ public function __construct($value)
+ {
+ $this->token = $value instanceof TokenInterface? $value : new ExactValueToken($value);
+ }
+
+ /**
+ * Scores 4 when preset token does not match the argument.
+ *
+ * @param $argument
+ *
+ * @return bool|int
+ */
+ public function scoreArgument($argument)
+ {
+ return false === $this->token->scoreArgument($argument) ? 4 : false;
+ }
+
+ /**
+ * Returns true if preset token is last.
+ *
+ * @return bool|int
+ */
+ public function isLast()
+ {
+ return $this->token->isLast();
+ }
+
+ /**
+ * Returns originating token.
+ *
+ * @return TokenInterface
+ */
+ public function getOriginatingToken()
+ {
+ return $this->token;
+ }
+
+ /**
+ * Returns string representation for token.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return sprintf('not(%s)', $this->token);
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ObjectStateToken.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ObjectStateToken.php
new file mode 100644
index 00000000000..ea38fe16027
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ObjectStateToken.php
@@ -0,0 +1,104 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Argument\Token;
+
+use SebastianBergmann\Comparator\Factory as ComparatorFactory;
+use SebastianBergmann\Comparator\ComparisonFailure;
+use Prophecy\Util\StringUtil;
+
+/**
+ * Object state-checker token.
+ *
+ * @author Konstantin Kudryashov
+ */
+class ObjectStateToken implements TokenInterface
+{
+ private $name;
+ private $value;
+ private $util;
+ private $comparatorFactory;
+
+ /**
+ * Initializes token.
+ *
+ * @param string $methodName
+ * @param mixed $value Expected return value
+ * @param null|StringUtil $util
+ * @param ComparatorFactory $comparatorFactory
+ */
+ public function __construct(
+ $methodName,
+ $value,
+ StringUtil $util = null,
+ ComparatorFactory $comparatorFactory = null
+ ) {
+ $this->name = $methodName;
+ $this->value = $value;
+ $this->util = $util ?: new StringUtil;
+
+ $this->comparatorFactory = $comparatorFactory ?: ComparatorFactory::getInstance();
+ }
+
+ /**
+ * Scores 8 if argument is an object, which method returns expected value.
+ *
+ * @param mixed $argument
+ *
+ * @return bool|int
+ */
+ public function scoreArgument($argument)
+ {
+ if (is_object($argument) && method_exists($argument, $this->name)) {
+ $actual = call_user_func(array($argument, $this->name));
+
+ $comparator = $this->comparatorFactory->getComparatorFor(
+ $actual, $this->value
+ );
+
+ try {
+ $comparator->assertEquals($actual, $this->value);
+ return 8;
+ } catch (ComparisonFailure $failure) {
+ return false;
+ }
+ }
+
+ if (is_object($argument) && property_exists($argument, $this->name)) {
+ return $argument->{$this->name} === $this->value ? 8 : false;
+ }
+
+ return false;
+ }
+
+ /**
+ * Returns false.
+ *
+ * @return bool
+ */
+ public function isLast()
+ {
+ return false;
+ }
+
+ /**
+ * Returns string representation for token.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return sprintf('state(%s(), %s)',
+ $this->name,
+ $this->util->stringify($this->value)
+ );
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/StringContainsToken.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/StringContainsToken.php
new file mode 100644
index 00000000000..24ff8c2ecf5
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/StringContainsToken.php
@@ -0,0 +1,67 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Argument\Token;
+
+/**
+ * String contains token.
+ *
+ * @author Peter Mitchell
+ */
+class StringContainsToken implements TokenInterface
+{
+ private $value;
+
+ /**
+ * Initializes token.
+ *
+ * @param string $value
+ */
+ public function __construct($value)
+ {
+ $this->value = $value;
+ }
+
+ public function scoreArgument($argument)
+ {
+ return strpos($argument, $this->value) !== false ? 6 : false;
+ }
+
+ /**
+ * Returns preset value against which token checks arguments.
+ *
+ * @return mixed
+ */
+ public function getValue()
+ {
+ return $this->value;
+ }
+
+ /**
+ * Returns false.
+ *
+ * @return bool
+ */
+ public function isLast()
+ {
+ return false;
+ }
+
+ /**
+ * Returns string representation for token.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return sprintf('contains("%s")', $this->value);
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/TokenInterface.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/TokenInterface.php
new file mode 100644
index 00000000000..625d3bad22f
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/TokenInterface.php
@@ -0,0 +1,43 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Argument\Token;
+
+/**
+ * Argument token interface.
+ *
+ * @author Konstantin Kudryashov
+ */
+interface TokenInterface
+{
+ /**
+ * Calculates token match score for provided argument.
+ *
+ * @param $argument
+ *
+ * @return bool|int
+ */
+ public function scoreArgument($argument);
+
+ /**
+ * Returns true if this token prevents check of other tokens (is last one).
+ *
+ * @return bool|int
+ */
+ public function isLast();
+
+ /**
+ * Returns string representation for token.
+ *
+ * @return string
+ */
+ public function __toString();
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/TypeToken.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/TypeToken.php
new file mode 100644
index 00000000000..cb65132ca0e
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/TypeToken.php
@@ -0,0 +1,76 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Argument\Token;
+
+use Prophecy\Exception\InvalidArgumentException;
+
+/**
+ * Value type token.
+ *
+ * @author Konstantin Kudryashov
+ */
+class TypeToken implements TokenInterface
+{
+ private $type;
+
+ /**
+ * @param string $type
+ */
+ public function __construct($type)
+ {
+ $checker = "is_{$type}";
+ if (!function_exists($checker) && !interface_exists($type) && !class_exists($type)) {
+ throw new InvalidArgumentException(sprintf(
+ 'Type or class name expected as an argument to TypeToken, but got %s.', $type
+ ));
+ }
+
+ $this->type = $type;
+ }
+
+ /**
+ * Scores 5 if argument has the same type this token was constructed with.
+ *
+ * @param $argument
+ *
+ * @return bool|int
+ */
+ public function scoreArgument($argument)
+ {
+ $checker = "is_{$this->type}";
+ if (function_exists($checker)) {
+ return call_user_func($checker, $argument) ? 5 : false;
+ }
+
+ return $argument instanceof $this->type ? 5 : false;
+ }
+
+ /**
+ * Returns false.
+ *
+ * @return bool
+ */
+ public function isLast()
+ {
+ return false;
+ }
+
+ /**
+ * Returns string representation for token.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return sprintf('type(%s)', $this->type);
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Call/Call.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Call/Call.php
new file mode 100644
index 00000000000..2f3fbadb1a6
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Call/Call.php
@@ -0,0 +1,127 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Call;
+
+use Exception;
+
+/**
+ * Call object.
+ *
+ * @author Konstantin Kudryashov
+ */
+class Call
+{
+ private $methodName;
+ private $arguments;
+ private $returnValue;
+ private $exception;
+ private $file;
+ private $line;
+
+ /**
+ * Initializes call.
+ *
+ * @param string $methodName
+ * @param array $arguments
+ * @param mixed $returnValue
+ * @param Exception $exception
+ * @param null|string $file
+ * @param null|int $line
+ */
+ public function __construct($methodName, array $arguments, $returnValue,
+ Exception $exception = null, $file, $line)
+ {
+ $this->methodName = $methodName;
+ $this->arguments = $arguments;
+ $this->returnValue = $returnValue;
+ $this->exception = $exception;
+
+ if ($file) {
+ $this->file = $file;
+ $this->line = intval($line);
+ }
+ }
+
+ /**
+ * Returns called method name.
+ *
+ * @return string
+ */
+ public function getMethodName()
+ {
+ return $this->methodName;
+ }
+
+ /**
+ * Returns called method arguments.
+ *
+ * @return array
+ */
+ public function getArguments()
+ {
+ return $this->arguments;
+ }
+
+ /**
+ * Returns called method return value.
+ *
+ * @return null|mixed
+ */
+ public function getReturnValue()
+ {
+ return $this->returnValue;
+ }
+
+ /**
+ * Returns exception that call thrown.
+ *
+ * @return null|Exception
+ */
+ public function getException()
+ {
+ return $this->exception;
+ }
+
+ /**
+ * Returns callee filename.
+ *
+ * @return string
+ */
+ public function getFile()
+ {
+ return $this->file;
+ }
+
+ /**
+ * Returns callee line number.
+ *
+ * @return int
+ */
+ public function getLine()
+ {
+ return $this->line;
+ }
+
+ /**
+ * Returns short notation for callee place.
+ *
+ * @return string
+ */
+ public function getCallPlace()
+ {
+ if (null === $this->file) {
+ return 'unknown';
+ }
+
+ return sprintf('%s:%d', $this->file, $this->line);
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Call/CallCenter.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Call/CallCenter.php
new file mode 100644
index 00000000000..749585510b7
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Call/CallCenter.php
@@ -0,0 +1,152 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Call;
+
+use Prophecy\Prophecy\MethodProphecy;
+use Prophecy\Prophecy\ObjectProphecy;
+use Prophecy\Argument\ArgumentsWildcard;
+use Prophecy\Util\StringUtil;
+use Prophecy\Exception\Call\UnexpectedCallException;
+
+/**
+ * Calls receiver & manager.
+ *
+ * @author Konstantin Kudryashov
+ */
+class CallCenter
+{
+ private $util;
+
+ /**
+ * @var Call[]
+ */
+ private $recordedCalls = array();
+
+ /**
+ * Initializes call center.
+ *
+ * @param StringUtil $util
+ */
+ public function __construct(StringUtil $util = null)
+ {
+ $this->util = $util ?: new StringUtil;
+ }
+
+ /**
+ * Makes and records specific method call for object prophecy.
+ *
+ * @param ObjectProphecy $prophecy
+ * @param string $methodName
+ * @param array $arguments
+ *
+ * @return mixed Returns null if no promise for prophecy found or promise return value.
+ *
+ * @throws \Prophecy\Exception\Call\UnexpectedCallException If no appropriate method prophecy found
+ */
+ public function makeCall(ObjectProphecy $prophecy, $methodName, array $arguments)
+ {
+ $backtrace = debug_backtrace();
+
+ $file = $line = null;
+ if (isset($backtrace[2]) && isset($backtrace[2]['file'])) {
+ $file = $backtrace[2]['file'];
+ $line = $backtrace[2]['line'];
+ }
+
+ // If no method prophecies defined, then it's a dummy, so we'll just return null
+ if ('__destruct' === $methodName || 0 == count($prophecy->getMethodProphecies())) {
+ $this->recordedCalls[] = new Call($methodName, $arguments, null, null, $file, $line);
+
+ return null;
+ }
+
+ // There are method prophecies, so it's a fake/stub. Searching prophecy for this call
+ $matches = array();
+ foreach ($prophecy->getMethodProphecies($methodName) as $methodProphecy) {
+ if (0 < $score = $methodProphecy->getArgumentsWildcard()->scoreArguments($arguments)) {
+ $matches[] = array($score, $methodProphecy);
+ }
+ }
+
+ // If fake/stub doesn't have method prophecy for this call - throw exception
+ if (!count($matches)) {
+ throw $this->createUnexpectedCallException($prophecy, $methodName, $arguments);
+ }
+
+ // Sort matches by their score value
+ @usort($matches, function ($match1, $match2) { return $match2[0] - $match1[0]; });
+
+ // If Highest rated method prophecy has a promise - execute it or return null instead
+ $returnValue = null;
+ $exception = null;
+ if ($promise = $matches[0][1]->getPromise()) {
+ try {
+ $returnValue = $promise->execute($arguments, $prophecy, $matches[0][1]);
+ } catch (\Exception $e) {
+ $exception = $e;
+ }
+ }
+
+ $this->recordedCalls[] = new Call(
+ $methodName, $arguments, $returnValue, $exception, $file, $line
+ );
+
+ if (null !== $exception) {
+ throw $exception;
+ }
+
+ return $returnValue;
+ }
+
+ /**
+ * Searches for calls by method name & arguments wildcard.
+ *
+ * @param string $methodName
+ * @param ArgumentsWildcard $wildcard
+ *
+ * @return Call[]
+ */
+ public function findCalls($methodName, ArgumentsWildcard $wildcard)
+ {
+ return array_values(
+ array_filter($this->recordedCalls, function (Call $call) use ($methodName, $wildcard) {
+ return $methodName === $call->getMethodName()
+ && 0 < $wildcard->scoreArguments($call->getArguments())
+ ;
+ })
+ );
+ }
+
+ private function createUnexpectedCallException(ObjectProphecy $prophecy, $methodName,
+ array $arguments)
+ {
+ $classname = get_class($prophecy->reveal());
+ $argstring = implode(', ', array_map(array($this->util, 'stringify'), $arguments));
+ $expected = implode("\n", array_map(function (MethodProphecy $methodProphecy) {
+ return sprintf(' - %s(%s)',
+ $methodProphecy->getMethodName(),
+ $methodProphecy->getArgumentsWildcard()
+ );
+ }, call_user_func_array('array_merge', $prophecy->getMethodProphecies())));
+
+ return new UnexpectedCallException(
+ sprintf(
+ "Method call:\n".
+ " - %s(%s)\n".
+ "on %s was not expected, expected calls were:\n%s",
+
+ $methodName, $argstring, $classname, $expected
+ ),
+ $prophecy, $methodName, $arguments
+ );
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Doubler/CachedDoubler.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Doubler/CachedDoubler.php
new file mode 100644
index 00000000000..d6b6b1a9e08
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Doubler/CachedDoubler.php
@@ -0,0 +1,68 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Doubler;
+
+use ReflectionClass;
+
+/**
+ * Cached class doubler.
+ * Prevents mirroring/creation of the same structure twice.
+ *
+ * @author Konstantin Kudryashov
+ */
+class CachedDoubler extends Doubler
+{
+ private $classes = array();
+
+ /**
+ * {@inheritdoc}
+ */
+ public function registerClassPatch(ClassPatch\ClassPatchInterface $patch)
+ {
+ $this->classes[] = array();
+
+ parent::registerClassPatch($patch);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function createDoubleClass(ReflectionClass $class = null, array $interfaces)
+ {
+ $classId = $this->generateClassId($class, $interfaces);
+ if (isset($this->classes[$classId])) {
+ return $this->classes[$classId];
+ }
+
+ return $this->classes[$classId] = parent::createDoubleClass($class, $interfaces);
+ }
+
+ /**
+ * @param ReflectionClass $class
+ * @param ReflectionClass[] $interfaces
+ *
+ * @return string
+ */
+ private function generateClassId(ReflectionClass $class = null, array $interfaces)
+ {
+ $parts = array();
+ if (null !== $class) {
+ $parts[] = $class->getName();
+ }
+ foreach ($interfaces as $interface) {
+ $parts[] = $interface->getName();
+ }
+ sort($parts);
+
+ return md5(implode('', $parts));
+ }
+}
diff --git a/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/ClassPatchInterface.php b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/ClassPatchInterface.php
new file mode 100644
index 00000000000..d6d196850c7
--- /dev/null
+++ b/samples/client/petstore/php/SwaggerPetstore-php/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/ClassPatchInterface.php
@@ -0,0 +1,48 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Doubler\ClassPatch;
+
+use Prophecy\Doubler\Generator\Node\ClassNode;
+
+/**
+ * Class patch interface.
+ * Class patches extend doubles functionality or help
+ * Prophecy to avoid some internal PHP bugs.
+ *
+ * @author Konstantin Kudryashov