diff --git a/core/.gitignore b/core/.gitignore index 91bd4cd..bd50526 100644 --- a/core/.gitignore +++ b/core/.gitignore @@ -1,16 +1,2 @@ -# SimpleTest breaks with the following files, so avoid adding them. -vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1-1.php -vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/php5.4/traits.php -vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services11.php - -# The resources for the Validator component are not required. -vendor/symfony/validator/Symfony/Component/Validator/Resources - -# Symfony Validator depends on Symfony Translation but only requires the -# TranslatorInterface. Thus, we add only the required interface from Symfony -# Translation by ignoring everything except the interface. -vendor/symfony/translation/Symfony/Component/Translation/* -!vendor/symfony/translation/Symfony/Component/Translation/TranslatorInterface.php - -# PHPUnit provides some binary dependencies that are already available. -vendor/phpunit/phpunit/build/dependencies +# Vendor should not be included in git +vendor diff --git a/core/scripts/run-tests.sh b/core/scripts/run-tests.sh index 174f14d..0d19525 100755 --- a/core/scripts/run-tests.sh +++ b/core/scripts/run-tests.sh @@ -5,6 +5,9 @@ * This script runs Drupal tests from command line. */ +// Install Composer +shell_exec('curl -sS https://getcomposer.org/installer | php && php composer.phar install'); + use Drupal\Component\Utility\Timer; use Drupal\Component\Uuid\Php; use Drupal\Core\Database\Database; diff --git a/core/vendor/autoload.php b/core/vendor/autoload.php deleted file mode 100644 index 5111b1b..0000000 --- a/core/vendor/autoload.php +++ /dev/null @@ -1,7 +0,0 @@ - - -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/core/vendor/behat/mink-browserkit-driver/README.md b/core/vendor/behat/mink-browserkit-driver/README.md deleted file mode 100755 index fc36e41..0000000 --- a/core/vendor/behat/mink-browserkit-driver/README.md +++ /dev/null @@ -1,54 +0,0 @@ -Mink BrowserKit Driver -====================== - -[![Latest Stable Version](https://poser.pugx.org/behat/mink-browserkit-driver/v/stable.png)](https://packagist.org/packages/behat/mink-browserkit-driver) -[![Latest Unstable Version](https://poser.pugx.org/behat/mink-browserkit-driver/v/unstable.svg)](https://packagist.org/packages/behat/mink-browserkit-driver) -[![Total Downloads](https://poser.pugx.org/behat/mink-browserkit-driver/downloads.png)](https://packagist.org/packages/behat/mink-browserkit-driver) -[![Build Status](https://travis-ci.org/Behat/MinkBrowserKitDriver.svg?branch=master)](https://travis-ci.org/Behat/MinkBrowserKitDriver) -[![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/Behat/MinkBrowserKitDriver/badges/quality-score.png?s=0443d284940e099ea560eb39b6b2fcdc5d4e7f29)](https://scrutinizer-ci.com/g/Behat/MinkBrowserKitDriver/) -[![Code Coverage](https://scrutinizer-ci.com/g/Behat/MinkBrowserKitDriver/badges/coverage.png?s=48960c4495488ab0b7d310b62322f017497f5bfa)](https://scrutinizer-ci.com/g/Behat/MinkBrowserKitDriver/) -[![License](https://poser.pugx.org/behat/mink-browserkit-driver/license.svg)](https://packagist.org/packages/behat/mink-browserkit-driver) - -Usage Example -------------- - -``` php - new Session(new BrowserKitDriver(new Client($app))), -)); - -$mink->getSession('silex')->getPage()->findLink('Chat')->click(); -``` - -Installation ------------- - -``` json -{ - "require": { - "behat/mink": "~1.5", - "behat/mink-browserkit-driver": "~1.1" - } -} -``` - -``` bash -$> curl -sS https://getcomposer.org/installer | php -$> php composer.phar install -``` - -Maintainers ------------ - -* Konstantin Kudryashov [everzet](http://github.com/everzet) -* Other [awesome developers](https://github.com/Behat/MinkBrowserKitDriver/graphs/contributors) diff --git a/core/vendor/behat/mink-browserkit-driver/composer.json b/core/vendor/behat/mink-browserkit-driver/composer.json deleted file mode 100644 index c0c5df9..0000000 --- a/core/vendor/behat/mink-browserkit-driver/composer.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "behat/mink-browserkit-driver", - "description": "Symfony2 BrowserKit driver for Mink framework", - "keywords": ["Symfony2", "Mink", "testing", "browser"], - "homepage": "http://mink.behat.org/", - "type": "mink-driver", - "license": "MIT", - - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - } - ], - - "require": { - "php": ">=5.3.1", - "behat/mink": "~1.6@dev", - "symfony/browser-kit": "~2.0", - "symfony/dom-crawler": "~2.0" - }, - - "require-dev": { - "silex/silex": "~1.2" - }, - - "autoload": { - "psr-0": { - "Behat\\Mink\\Driver": "src/" - } - }, - - "autoload-dev": { - "psr-4": { - "Behat\\Mink\\Tests\\Driver\\": "tests" - } - }, - - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - } -} diff --git a/core/vendor/behat/mink-browserkit-driver/phpunit.xml.dist b/core/vendor/behat/mink-browserkit-driver/phpunit.xml.dist deleted file mode 100644 index 4f9b932..0000000 --- a/core/vendor/behat/mink-browserkit-driver/phpunit.xml.dist +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - tests - vendor/behat/mink/driver-testsuite/tests/Basic - vendor/behat/mink/driver-testsuite/tests/Form - - - - - - ./src/Behat/Mink/Driver - - - diff --git a/core/vendor/behat/mink-browserkit-driver/src/Behat/Mink/Driver/BrowserKitDriver.php b/core/vendor/behat/mink-browserkit-driver/src/Behat/Mink/Driver/BrowserKitDriver.php deleted file mode 100644 index 28b99dc..0000000 --- a/core/vendor/behat/mink-browserkit-driver/src/Behat/Mink/Driver/BrowserKitDriver.php +++ /dev/null @@ -1,949 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Behat\Mink\Driver; - -use Behat\Mink\Element\NodeElement; -use Behat\Mink\Exception\DriverException; -use Behat\Mink\Exception\UnsupportedDriverActionException; -use Behat\Mink\Session; -use Symfony\Component\BrowserKit\Client; -use Symfony\Component\BrowserKit\Cookie; -use Symfony\Component\BrowserKit\Request; -use Symfony\Component\BrowserKit\Response; -use Symfony\Component\DomCrawler\Crawler; -use Symfony\Component\DomCrawler\Field\ChoiceFormField; -use Symfony\Component\DomCrawler\Field\FileFormField; -use Symfony\Component\DomCrawler\Field\FormField; -use Symfony\Component\DomCrawler\Field\InputFormField; -use Symfony\Component\DomCrawler\Field\TextareaFormField; -use Symfony\Component\DomCrawler\Form; -use Symfony\Component\HttpFoundation\Request as HttpFoundationRequest; -use Symfony\Component\HttpFoundation\Response as HttpFoundationResponse; -use Symfony\Component\HttpKernel\Client as HttpKernelClient; - -/** - * Symfony2 BrowserKit driver. - * - * @author Konstantin Kudryashov - */ -class BrowserKitDriver extends CoreDriver -{ - private $session; - private $client; - - /** - * @var Form[] - */ - private $forms = array(); - private $serverParameters = array(); - private $started = false; - private $removeScriptFromUrl = false; - private $removeHostFromUrl = false; - - /** - * Initializes BrowserKit driver. - * - * @param Client $client BrowserKit client instance - * @param string|null $baseUrl Base URL for HttpKernel clients - */ - public function __construct(Client $client, $baseUrl = null) - { - $this->client = $client; - $this->client->followRedirects(true); - - if ($baseUrl !== null && $client instanceof HttpKernelClient) { - $client->setServerParameter('SCRIPT_FILENAME', parse_url($baseUrl, PHP_URL_PATH)); - } - } - - /** - * Returns BrowserKit HTTP client instance. - * - * @return Client - */ - public function getClient() - { - return $this->client; - } - - /** - * {@inheritdoc} - */ - public function setSession(Session $session) - { - $this->session = $session; - } - - /** - * Tells driver to remove hostname from URL. - * - * @param Boolean $remove - * - * @deprecated Deprecated as of 1.2, to be removed in 2.0. Pass the base url in the constructor instead. - */ - public function setRemoveHostFromUrl($remove = true) - { - trigger_error( - 'setRemoveHostFromUrl() is deprecated as of 1.2 and will be removed in 2.0. Pass the base url in the constructor instead.', - E_USER_DEPRECATED - ); - $this->removeHostFromUrl = (bool) $remove; - } - - /** - * Tells driver to remove script name from URL. - * - * @param Boolean $remove - * - * @deprecated Deprecated as of 1.2, to be removed in 2.0. Pass the base url in the constructor instead. - */ - public function setRemoveScriptFromUrl($remove = true) - { - trigger_error( - 'setRemoveScriptFromUrl() is deprecated as of 1.2 and will be removed in 2.0. Pass the base url in the constructor instead.', - E_USER_DEPRECATED - ); - $this->removeScriptFromUrl = (bool) $remove; - } - - /** - * {@inheritdoc} - */ - public function start() - { - $this->started = true; - } - - /** - * {@inheritdoc} - */ - public function isStarted() - { - return $this->started; - } - - /** - * {@inheritdoc} - */ - public function stop() - { - $this->reset(); - $this->started = false; - } - - /** - * {@inheritdoc} - */ - public function reset() - { - // Restarting the client resets the cookies and the history - $this->client->restart(); - $this->forms = array(); - $this->serverParameters = array(); - } - - /** - * {@inheritdoc} - */ - public function visit($url) - { - $this->client->request('GET', $this->prepareUrl($url), array(), array(), $this->serverParameters); - $this->forms = array(); - } - - /** - * {@inheritdoc} - */ - public function getCurrentUrl() - { - if (method_exists($this->client, 'getInternalRequest')) { - $request = $this->client->getInternalRequest(); - } else { - // BC layer for BrowserKit 2.2.x and older - $request = $this->client->getRequest(); - - if (null !== $request && !$request instanceof Request && !$request instanceof HttpFoundationRequest) { - throw new DriverException(sprintf( - 'The BrowserKit client returned an unsupported request implementation: %s. Please upgrade your BrowserKit package to 2.3 or newer.', - get_class($request) - )); - } - } - - if ($request === null) { - throw new DriverException('Unable to access the request before visiting a page'); - } - - return $request->getUri(); - } - - /** - * {@inheritdoc} - */ - public function reload() - { - $this->client->reload(); - $this->forms = array(); - } - - /** - * {@inheritdoc} - */ - public function forward() - { - $this->client->forward(); - $this->forms = array(); - } - - /** - * {@inheritdoc} - */ - public function back() - { - $this->client->back(); - $this->forms = array(); - } - - /** - * {@inheritdoc} - */ - public function setBasicAuth($user, $password) - { - if (false === $user) { - unset($this->serverParameters['PHP_AUTH_USER'], $this->serverParameters['PHP_AUTH_PW']); - - return; - } - - $this->serverParameters['PHP_AUTH_USER'] = $user; - $this->serverParameters['PHP_AUTH_PW'] = $password; - } - - /** - * {@inheritdoc} - */ - public function setRequestHeader($name, $value) - { - $contentHeaders = array('CONTENT_LENGTH' => true, 'CONTENT_MD5' => true, 'CONTENT_TYPE' => true); - $name = str_replace('-', '_', strtoupper($name)); - - // CONTENT_* are not prefixed with HTTP_ in PHP when building $_SERVER - if (!isset($contentHeaders[$name])) { - $name = 'HTTP_' . $name; - } - - $this->serverParameters[$name] = $value; - } - - /** - * {@inheritdoc} - */ - public function getResponseHeaders() - { - return $this->getResponse()->getHeaders(); - } - - /** - * {@inheritdoc} - */ - public function setCookie($name, $value = null) - { - if (null === $value) { - $this->deleteCookie($name); - - return; - } - - $jar = $this->client->getCookieJar(); - $jar->set(new Cookie($name, $value)); - } - - /** - * Deletes a cookie by name. - * - * @param string $name Cookie name. - */ - private function deleteCookie($name) - { - $path = $this->getCookiePath(); - $jar = $this->client->getCookieJar(); - - do { - if (null !== $jar->get($name, $path)) { - $jar->expire($name, $path); - } - - $path = preg_replace('/.$/', '', $path); - } while ($path); - } - - /** - * Returns current cookie path. - * - * @return string - */ - private function getCookiePath() - { - $path = dirname(parse_url($this->getCurrentUrl(), PHP_URL_PATH)); - - if ('\\' === DIRECTORY_SEPARATOR) { - $path = str_replace('\\', '/', $path); - } - - return $path; - } - - /** - * {@inheritdoc} - */ - public function getCookie($name) - { - // Note that the following doesn't work well because - // Symfony\Component\BrowserKit\CookieJar stores cookies by name, - // path, AND domain and if you don't fill them all in correctly then - // you won't get the value that you're expecting. - // - // $jar = $this->client->getCookieJar(); - // - // if (null !== $cookie = $jar->get($name)) { - // return $cookie->getValue(); - // } - - $allValues = $this->client->getCookieJar()->allValues($this->getCurrentUrl()); - - if (isset($allValues[$name])) { - return $allValues[$name]; - } - - return null; - } - - /** - * {@inheritdoc} - */ - public function getStatusCode() - { - return $this->getResponse()->getStatus(); - } - - /** - * {@inheritdoc} - */ - public function getContent() - { - return $this->getResponse()->getContent(); - } - - /** - * {@inheritdoc} - */ - public function find($xpath) - { - $nodes = $this->getCrawler()->filterXPath($xpath); - - $elements = array(); - foreach ($nodes as $i => $node) { - $elements[] = new NodeElement(sprintf('(%s)[%d]', $xpath, $i + 1), $this->session); - } - - return $elements; - } - - /** - * {@inheritdoc} - */ - public function getTagName($xpath) - { - return $this->getCrawlerNode($this->getFilteredCrawler($xpath))->nodeName; - } - - /** - * {@inheritdoc} - */ - public function getText($xpath) - { - $text = $this->getFilteredCrawler($xpath)->text(); - $text = str_replace("\n", ' ', $text); - $text = preg_replace('/ {2,}/', ' ', $text); - - return trim($text); - } - - /** - * {@inheritdoc} - */ - public function getHtml($xpath) - { - // cut the tag itself (making innerHTML out of outerHTML) - return preg_replace('/^\<[^\>]+\>|\<[^\>]+\>$/', '', $this->getOuterHtml($xpath)); - } - - /** - * {@inheritdoc} - */ - public function getOuterHtml($xpath) - { - $node = $this->getCrawlerNode($this->getFilteredCrawler($xpath)); - - return $node->ownerDocument->saveXML($node); - } - - /** - * {@inheritdoc} - */ - public function getAttribute($xpath, $name) - { - $node = $this->getFilteredCrawler($xpath); - - if ($this->getCrawlerNode($node)->hasAttribute($name)) { - return $node->attr($name); - } - - return null; - } - - /** - * {@inheritdoc} - */ - public function getValue($xpath) - { - if (in_array($this->getAttribute($xpath, 'type'), array('submit', 'image', 'button'))) { - return $this->getAttribute($xpath, 'value'); - } - - $node = $this->getCrawlerNode($this->getFilteredCrawler($xpath)); - - if ('option' === $node->tagName) { - return $this->getOptionValue($node); - } - - try { - $field = $this->getFormField($xpath); - } catch (\InvalidArgumentException $e) { - return $this->getAttribute($xpath, 'value'); - } - - return $field->getValue(); - } - - /** - * {@inheritdoc} - */ - public function setValue($xpath, $value) - { - $this->getFormField($xpath)->setValue($value); - } - - /** - * {@inheritdoc} - */ - public function check($xpath) - { - $this->getCheckboxField($xpath)->tick(); - } - - /** - * {@inheritdoc} - */ - public function uncheck($xpath) - { - $this->getCheckboxField($xpath)->untick(); - } - - /** - * {@inheritdoc} - */ - public function selectOption($xpath, $value, $multiple = false) - { - $field = $this->getFormField($xpath); - - if (!$field instanceof ChoiceFormField) { - throw new DriverException(sprintf('Impossible to select an option on the element with XPath "%s" as it is not a select or radio input', $xpath)); - } - - if ($multiple) { - $oldValue = (array) $field->getValue(); - $oldValue[] = $value; - $value = $oldValue; - } - - $field->select($value); - } - - /** - * {@inheritdoc} - */ - public function isSelected($xpath) - { - $optionValue = $this->getOptionValue($this->getCrawlerNode($this->getFilteredCrawler($xpath))); - $selectField = $this->getFormField('(' . $xpath . ')/ancestor-or-self::*[local-name()="select"]'); - $selectValue = $selectField->getValue(); - - return is_array($selectValue) ? in_array($optionValue, $selectValue) : $optionValue == $selectValue; - } - - /** - * {@inheritdoc} - */ - public function click($xpath) - { - $node = $this->getFilteredCrawler($xpath); - $crawlerNode = $this->getCrawlerNode($node); - $tagName = $crawlerNode->nodeName; - - if ('a' === $tagName) { - $this->client->click($node->link()); - $this->forms = array(); - } elseif ($this->canSubmitForm($crawlerNode)) { - $this->submit($node->form()); - } elseif ($this->canResetForm($crawlerNode)) { - $this->resetForm($crawlerNode); - } else { - $message = sprintf('%%s supports clicking on links and buttons only. But "%s" provided', $tagName); - - throw new UnsupportedDriverActionException($message, $this); - } - } - - /** - * {@inheritdoc} - */ - public function isChecked($xpath) - { - $field = $this->getFormField($xpath); - - if (!$field instanceof ChoiceFormField || 'select' === $field->getType()) { - throw new DriverException(sprintf('Impossible to get the checked state of the element with XPath "%s" as it is not a checkbox or radio input', $xpath)); - } - - if ('checkbox' === $field->getType()) { - return $field->hasValue(); - } - - $radio = $this->getCrawlerNode($this->getFilteredCrawler($xpath)); - - return $radio->getAttribute('value') === $field->getValue(); - } - - /** - * {@inheritdoc} - */ - public function attachFile($xpath, $path) - { - $field = $this->getFormField($xpath); - - if (!$field instanceof FileFormField) { - throw new DriverException(sprintf('Impossible to attach a file on the element with XPath "%s" as it is not a file input', $xpath)); - } - - $field->upload($path); - } - - /** - * {@inheritdoc} - */ - public function submitForm($xpath) - { - $crawler = $this->getFilteredCrawler($xpath); - - $this->submit($crawler->form()); - } - - /** - * @return Response - * - * @throws DriverException If there is not response yet - */ - protected function getResponse() - { - if (!method_exists($this->client, 'getInternalResponse')) { - $implementationResponse = $this->client->getResponse(); - - if (null === $implementationResponse) { - throw new DriverException('Unable to access the response before visiting a page'); - } - - return $this->convertImplementationResponse($implementationResponse); - } - - $response = $this->client->getInternalResponse(); - - if (null === $response) { - throw new DriverException('Unable to access the response before visiting a page'); - } - - return $response; - } - - /** - * Gets the BrowserKit Response for legacy BrowserKit versions. - * - * Before 2.3.0, there was no Client::getInternalResponse method, and the - * return value of Client::getResponse can be anything when the implementation - * uses Client::filterResponse because of a bad choice done in BrowserKit and - * kept for BC reasons (the Client::getInternalResponse method has been added - * to solve it). - * - * This implementation supports client which don't rely Client::filterResponse - * and clients which use an HttpFoundation Response (like the HttpKernel client). - * - * @param object $response the response specific to the BrowserKit implementation - * - * @return Response - * - * @throws DriverException If the response cannot be converted to a BrowserKit response - */ - private function convertImplementationResponse($response) - { - if ($response instanceof Response) { - return $response; - } - - // due to a bug, the HttpKernel client implementation returns the HttpFoundation response - // The conversion logic is copied from Symfony\Component\HttpKernel\Client::filterResponse - if ($response instanceof HttpFoundationResponse) { - $headers = $response->headers->all(); - if ($response->headers->getCookies()) { - $cookies = array(); - foreach ($response->headers->getCookies() as $cookie) { - $cookies[] = new Cookie( - $cookie->getName(), - $cookie->getValue(), - $cookie->getExpiresTime(), - $cookie->getPath(), - $cookie->getDomain(), - $cookie->isSecure(), - $cookie->isHttpOnly() - ); - } - $headers['Set-Cookie'] = $cookies; - } - - // this is needed to support StreamedResponse - ob_start(); - $response->sendContent(); - $content = ob_get_clean(); - - return new Response($content, $response->getStatusCode(), $headers); - } - - throw new DriverException(sprintf( - 'The BrowserKit client returned an unsupported response implementation: %s. Please upgrade your BrowserKit package to 2.3 or newer.', - get_class($response) - )); - } - - /** - * Prepares URL for visiting. - * Removes "*.php/" from urls and then passes it to BrowserKitDriver::visit(). - * - * @param string $url - * - * @return string - */ - protected function prepareUrl($url) - { - $replacement = ($this->removeHostFromUrl ? '' : '$1') . ($this->removeScriptFromUrl ? '' : '$2'); - - return preg_replace('#(https?\://[^/]+)(/[^/\.]+\.php)?#', $replacement, $url); - } - - /** - * Returns form field from XPath query. - * - * @param string $xpath - * - * @return FormField - * - * @throws DriverException - */ - protected function getFormField($xpath) - { - $fieldNode = $this->getCrawlerNode($this->getFilteredCrawler($xpath)); - $fieldName = str_replace('[]', '', $fieldNode->getAttribute('name')); - - $formNode = $this->getFormNode($fieldNode); - $formId = $this->getFormNodeId($formNode); - - if (!isset($this->forms[$formId])) { - $this->forms[$formId] = new Form($formNode, $this->getCurrentUrl()); - } - - if (is_array($this->forms[$formId][$fieldName])) { - return $this->forms[$formId][$fieldName][$this->getFieldPosition($fieldNode)]; - } - - return $this->forms[$formId][$fieldName]; - } - - /** - * Returns the checkbox field from xpath query, ensuring it is valid. - * - * @param string $xpath - * - * @return ChoiceFormField - * - * @throws DriverException when the field is not a checkbox - */ - private function getCheckboxField($xpath) - { - $field = $this->getFormField($xpath); - - if (!$field instanceof ChoiceFormField) { - throw new DriverException(sprintf('Impossible to check the element with XPath "%s" as it is not a checkbox', $xpath)); - } - - return $field; - } - - /** - * @param \DOMElement $element - * - * @return \DOMElement - * - * @throws DriverException if the form node cannot be found - */ - private function getFormNode(\DOMElement $element) - { - if ($element->hasAttribute('form')) { - $formId = $element->getAttribute('form'); - $formNode = $element->ownerDocument->getElementById($formId); - - if (null === $formNode || 'form' !== $formNode->nodeName) { - throw new DriverException(sprintf('The selected node has an invalid form attribute (%s).', $formId)); - } - - return $formNode; - } - - $formNode = $element; - - do { - // use the ancestor form element - if (null === $formNode = $formNode->parentNode) { - throw new DriverException('The selected node does not have a form ancestor.'); - } - } while ('form' !== $formNode->nodeName); - - return $formNode; - } - - /** - * Gets the position of the field node among elements with the same name - * - * BrowserKit uses the field name as index to find the field in its Form object. - * When multiple fields have the same name (checkboxes for instance), it will return - * an array of elements in the order they appear in the DOM. - * - * @param \DOMElement $fieldNode - * - * @return integer - */ - private function getFieldPosition(\DOMElement $fieldNode) - { - $elements = $this->getCrawler()->filterXPath('//*[@name=\''.$fieldNode->getAttribute('name').'\']'); - - if (count($elements) > 1) { - // more than one element contains this name ! - // so we need to find the position of $fieldNode - foreach ($elements as $key => $element) { - /** @var \DOMElement $element */ - if ($element->getNodePath() === $fieldNode->getNodePath()) { - return $key; - } - } - } - - return 0; - } - - private function submit(Form $form) - { - $formId = $this->getFormNodeId($form->getFormNode()); - - if (isset($this->forms[$formId])) { - $this->mergeForms($form, $this->forms[$formId]); - } - - // remove empty file fields from request - foreach ($form->getFiles() as $name => $field) { - if (empty($field['name']) && empty($field['tmp_name'])) { - $form->remove($name); - } - } - - foreach ($form->all() as $field) { - // Add a fix for https://github.com/symfony/symfony/pull/10733 to support Symfony versions which are not fixed - if ($field instanceof TextareaFormField && null === $field->getValue()) { - $field->setValue(''); - } - } - - $this->client->submit($form); - - $this->forms = array(); - } - - private function resetForm(\DOMElement $fieldNode) - { - $formNode = $this->getFormNode($fieldNode); - $formId = $this->getFormNodeId($formNode); - unset($this->forms[$formId]); - } - - /** - * Determines if a node can submit a form. - * - * @param \DOMElement $node Node. - * - * @return boolean - */ - private function canSubmitForm(\DOMElement $node) - { - $type = $node->hasAttribute('type') ? $node->getAttribute('type') : null; - - if ('input' == $node->nodeName && in_array($type, array('submit', 'image'))) { - return true; - } - - return 'button' == $node->nodeName && (null === $type || 'submit' == $type); - } - - /** - * Determines if a node can reset a form. - * - * @param \DOMElement $node Node. - * - * @return boolean - */ - private function canResetForm(\DOMElement $node) - { - $type = $node->hasAttribute('type') ? $node->getAttribute('type') : null; - - return in_array($node->nodeName, array('input', 'button')) && 'reset' == $type; - } - - /** - * Returns form node unique identifier. - * - * @param \DOMElement $form - * - * @return string - */ - private function getFormNodeId(\DOMElement $form) - { - return md5($form->getLineNo() . $form->getNodePath() . $form->nodeValue); - } - - /** - * Gets the value of an option element - * - * @param \DOMElement $option - * - * @return string - * - * @see \Symfony\Component\DomCrawler\Field\ChoiceFormField::buildOptionValue - */ - private function getOptionValue(\DOMElement $option) - { - if ($option->hasAttribute('value')) { - return $option->getAttribute('value'); - } - - if (!empty($option->nodeValue)) { - return $option->nodeValue; - } - - return '1'; // DomCrawler uses 1 by default if there is no text in the option - } - - /** - * Merges second form values into first one. - * - * @param Form $to merging target - * @param Form $from merging source - */ - private function mergeForms(Form $to, Form $from) - { - foreach ($from->all() as $name => $field) { - $fieldReflection = new \ReflectionObject($field); - $nodeReflection = $fieldReflection->getProperty('node'); - $valueReflection = $fieldReflection->getProperty('value'); - - $nodeReflection->setAccessible(true); - $valueReflection->setAccessible(true); - - if (!($field instanceof InputFormField && in_array( - $nodeReflection->getValue($field)->getAttribute('type'), - array('submit', 'button', 'image') - ))) { - $valueReflection->setValue($to[$name], $valueReflection->getValue($field)); - } - } - } - - /** - * Returns DOMElement from crawler instance. - * - * @param Crawler $crawler - * - * @return \DOMElement - * - * @throws DriverException when the node does not exist - */ - private function getCrawlerNode(Crawler $crawler) - { - $crawler->rewind(); - $node = $crawler->current(); - - if (null !== $node) { - return $node; - } - - throw new DriverException('The element does not exist'); - } - - /** - * Returns a crawler filtered for the given XPath, requiring at least 1 result. - * - * @param string $xpath - * - * @return Crawler - * - * @throws DriverException when no matching elements are found - */ - private function getFilteredCrawler($xpath) - { - if (!count($crawler = $this->getCrawler()->filterXPath($xpath))) { - throw new DriverException(sprintf('There is no element matching XPath "%s"', $xpath)); - } - - return $crawler; - } - - /** - * Returns crawler instance (got from client). - * - * @return Crawler - * - * @throws DriverException - */ - private function getCrawler() - { - $crawler = $this->client->getCrawler(); - - if (null === $crawler) { - throw new DriverException('Unable to access the response content before visiting a page'); - } - - return $crawler; - } -} diff --git a/core/vendor/behat/mink-browserkit-driver/tests/BrowserKitConfig.php b/core/vendor/behat/mink-browserkit-driver/tests/BrowserKitConfig.php deleted file mode 100644 index b80a2fb..0000000 --- a/core/vendor/behat/mink-browserkit-driver/tests/BrowserKitConfig.php +++ /dev/null @@ -1,37 +0,0 @@ -visit('http://localhost/foo/index.html'); - $this->assertEquals(200, $session->getStatusCode()); - $this->assertEquals('http://localhost/foo/index.html', $session->getCurrentUrl()); - } -} diff --git a/core/vendor/behat/mink-browserkit-driver/tests/Custom/ErrorHandlingTest.php b/core/vendor/behat/mink-browserkit-driver/tests/Custom/ErrorHandlingTest.php deleted file mode 100644 index 32335c5..0000000 --- a/core/vendor/behat/mink-browserkit-driver/tests/Custom/ErrorHandlingTest.php +++ /dev/null @@ -1,181 +0,0 @@ -client = new TestClient(); - } - - public function testGetClient() - { - $this->assertSame($this->client, $this->getDriver()->getClient()); - } - - /** - * @expectedException \Behat\Mink\Exception\DriverException - * @expectedExceptionMessage Unable to access the response before visiting a page - */ - public function testGetResponseHeaderWithoutVisit() - { - $this->getDriver()->getResponseHeaders(); - } - - /** - * @expectedException \Behat\Mink\Exception\DriverException - * @expectedExceptionMessage Unable to access the response content before visiting a page - */ - public function testFindWithoutVisit() - { - $this->getDriver()->find('//html'); - } - - /** - * @expectedException \Behat\Mink\Exception\DriverException - * @expectedExceptionMessage Unable to access the request before visiting a page - */ - public function testGetCurrentUrlWithoutVisit() - { - $this->getDriver()->getCurrentUrl(); - } - - /** - * @expectedException \Behat\Mink\Exception\DriverException - * @expectedExceptionMessage The selected node has an invalid form attribute (foo) - */ - public function testNotMatchingHtml5FormId() - { - $html = <<<'HTML' - - -
- - -
- - -HTML; - - $this->client->setNextResponse(new Response($html)); - - $driver = $this->getDriver(); - $driver->visit('/index.php'); - $driver->setValue('//input[./@name="test"]', 'bar'); - } - - /** - * @expectedException \Behat\Mink\Exception\DriverException - * @expectedExceptionMessage The selected node has an invalid form attribute (foo) - */ - public function testInvalidHtml5FormId() - { - $html = <<<'HTML' - - -
- - -
-
- - -HTML; - - $this->client->setNextResponse(new Response($html)); - - $driver = $this->getDriver(); - $driver->visit('/index.php'); - $driver->setValue('//input[./@name="test"]', 'bar'); - } - - /** - * @expectedException \Behat\Mink\Exception\DriverException - * @expectedExceptionMessage The selected node does not have a form ancestor. - */ - public function testManipulateInputWithoutForm() - { - $html = <<<'HTML' - - -
- -
-
- -
- - -HTML; - - $this->client->setNextResponse(new Response($html)); - - $driver = $this->getDriver(); - $driver->visit('/index.php'); - $driver->setValue('//input[./@name="test"]', 'bar'); - } - - /** - * @expectedException \Behat\Mink\Exception\DriverException - * @expectedExceptionMessage Behat\Mink\Driver\BrowserKitDriver supports clicking on links and buttons only. But "div" provided - */ - public function testClickOnUnsupportedElement() - { - $html = <<<'HTML' - - -
- - -HTML; - - $this->client->setNextResponse(new Response($html)); - - $driver = $this->getDriver(); - $driver->visit('/index.php'); - $driver->click('//div'); - } - - private function getDriver() - { - return new BrowserKitDriver($this->client); - } -} - -class TestClient extends Client -{ - protected $nextResponse = null; - protected $nextScript = null; - - public function setNextResponse(Response $response) - { - $this->nextResponse = $response; - } - - public function setNextScript($script) - { - $this->nextScript = $script; - } - - protected function doRequest($request) - { - if (null === $this->nextResponse) { - return new Response(); - } - - $response = $this->nextResponse; - $this->nextResponse = null; - - return $response; - } -} diff --git a/core/vendor/behat/mink-browserkit-driver/tests/app.php b/core/vendor/behat/mink-browserkit-driver/tests/app.php deleted file mode 100644 index d3f1236..0000000 --- a/core/vendor/behat/mink-browserkit-driver/tests/app.php +++ /dev/null @@ -1,37 +0,0 @@ -register(new \Silex\Provider\SessionServiceProvider()); - -$def = realpath(__DIR__.'/../vendor/behat/mink/driver-testsuite/web-fixtures'); -$ovr = realpath(__DIR__.'/web-fixtures'); -$cbk = function ($file) use ($app, $def, $ovr) { - $file = str_replace('.file', '.php', $file); - $path = file_exists($ovr.'/'.$file) ? $ovr.'/'.$file : $def.'/'.$file; - $resp = null; - - ob_start(); - include($path); - $content = ob_get_clean(); - - if ($resp) { - if ('' === $resp->getContent()) { - $resp->setContent($content); - } - - return $resp; - } - - return $content; -}; - -$app->get('/{file}', $cbk)->assert('file', '.*'); -$app->post('/{file}', $cbk)->assert('file', '.*'); - -$app['debug'] = true; -$app['exception_handler']->disable(); -$app['session.test'] = true; - -return $app; diff --git a/core/vendor/behat/mink-browserkit-driver/tests/web-fixtures/404.php b/core/vendor/behat/mink-browserkit-driver/tests/web-fixtures/404.php deleted file mode 100644 index 2ae1ff9..0000000 --- a/core/vendor/behat/mink-browserkit-driver/tests/web-fixtures/404.php +++ /dev/null @@ -1,3 +0,0 @@ - - - - Advanced form save - - - -request->all(); -$FILES = $request->files->all(); - -if (isset($POST['select_multiple_numbers']) && false !== strpos($POST['select_multiple_numbers'][0], ',')) { - $POST['select_multiple_numbers'] = explode(',', $POST['select_multiple_numbers'][0]); -} - -// checkbox can have any value and will be successful in case "on" -// http://www.w3.org/TR/html401/interact/forms.html#checkbox -$POST['agreement'] = isset($POST['agreement']) ? 'on' : 'off'; -ksort($POST); -echo str_replace('>', '', var_export($POST, true)) . "\n"; -if (isset($FILES['about']) && file_exists($FILES['about']->getPathname())) { - echo $FILES['about']->getClientOriginalName() . "\n"; - echo file_get_contents($FILES['about']->getPathname()); -} else { - echo "no file"; -} -?> - - diff --git a/core/vendor/behat/mink-browserkit-driver/tests/web-fixtures/basic_auth.php b/core/vendor/behat/mink-browserkit-driver/tests/web-fixtures/basic_auth.php deleted file mode 100644 index 48132b6..0000000 --- a/core/vendor/behat/mink-browserkit-driver/tests/web-fixtures/basic_auth.php +++ /dev/null @@ -1,15 +0,0 @@ -server->all(); - -$username = isset($SERVER['PHP_AUTH_USER']) ? $SERVER['PHP_AUTH_USER'] : false; -$password = isset($SERVER['PHP_AUTH_PW']) ? $SERVER['PHP_AUTH_PW'] : false; - -if ($username == 'mink-user' && $password == 'mink-password') { - echo 'is authenticated'; -} else { - $resp = new \Symfony\Component\HttpFoundation\Response(); - $resp->setStatusCode(401); - $resp->headers->set('WWW-Authenticate', 'Basic realm="Mink Testing Area"'); - - echo 'is not authenticated'; -} diff --git a/core/vendor/behat/mink-browserkit-driver/tests/web-fixtures/basic_form_post.php b/core/vendor/behat/mink-browserkit-driver/tests/web-fixtures/basic_form_post.php deleted file mode 100644 index 1efe45e..0000000 --- a/core/vendor/behat/mink-browserkit-driver/tests/web-fixtures/basic_form_post.php +++ /dev/null @@ -1,14 +0,0 @@ - - - - - Basic Form Saving - - - -

Anket for request->get('first_name') ?>

- - Firstname: request->get('first_name') ?> - Lastname: request->get('last_name') ?> - - diff --git a/core/vendor/behat/mink-browserkit-driver/tests/web-fixtures/basic_get_form.php b/core/vendor/behat/mink-browserkit-driver/tests/web-fixtures/basic_get_form.php deleted file mode 100644 index fd2817d..0000000 --- a/core/vendor/behat/mink-browserkit-driver/tests/web-fixtures/basic_get_form.php +++ /dev/null @@ -1,23 +0,0 @@ - - - - Basic Get Form - - - -

Basic Get Form Page

- -
- query->all(); - echo isset($GET['q']) && $GET['q'] ? $GET['q'] : 'No search query' - ?> -
- -
- - - -
- - diff --git a/core/vendor/behat/mink-browserkit-driver/tests/web-fixtures/cookie_page1.php b/core/vendor/behat/mink-browserkit-driver/tests/web-fixtures/cookie_page1.php deleted file mode 100644 index a928b2f..0000000 --- a/core/vendor/behat/mink-browserkit-driver/tests/web-fixtures/cookie_page1.php +++ /dev/null @@ -1,17 +0,0 @@ -headers->setCookie($cook); -?> - - - - basic form - - - - - basic page with cookie set from server side - - diff --git a/core/vendor/behat/mink-browserkit-driver/tests/web-fixtures/cookie_page2.php b/core/vendor/behat/mink-browserkit-driver/tests/web-fixtures/cookie_page2.php deleted file mode 100644 index ab54243..0000000 --- a/core/vendor/behat/mink-browserkit-driver/tests/web-fixtures/cookie_page2.php +++ /dev/null @@ -1,14 +0,0 @@ - - - - Basic Form - - - - - Previous cookie: cookies->has('srvr_cookie') ? $app['request']->cookies->get('srvr_cookie') : 'NO'; - ?> - - diff --git a/core/vendor/behat/mink-browserkit-driver/tests/web-fixtures/cookie_page3.php b/core/vendor/behat/mink-browserkit-driver/tests/web-fixtures/cookie_page3.php deleted file mode 100644 index f24d587..0000000 --- a/core/vendor/behat/mink-browserkit-driver/tests/web-fixtures/cookie_page3.php +++ /dev/null @@ -1,20 +0,0 @@ -cookies->has('foo'); -$resp = new Symfony\Component\HttpFoundation\Response(); -$cook = new Symfony\Component\HttpFoundation\Cookie('foo', 'bar'); -$resp->headers->setCookie($cook); - -?> - - - - HttpOnly Cookie Test - - - - - - - diff --git a/core/vendor/behat/mink-browserkit-driver/tests/web-fixtures/headers.php b/core/vendor/behat/mink-browserkit-driver/tests/web-fixtures/headers.php deleted file mode 100644 index b829425..0000000 --- a/core/vendor/behat/mink-browserkit-driver/tests/web-fixtures/headers.php +++ /dev/null @@ -1,10 +0,0 @@ - - - - Headers page - - - - server->all()); ?> - - diff --git a/core/vendor/behat/mink-browserkit-driver/tests/web-fixtures/issue130.php b/core/vendor/behat/mink-browserkit-driver/tests/web-fixtures/issue130.php deleted file mode 100644 index 2079673..0000000 --- a/core/vendor/behat/mink-browserkit-driver/tests/web-fixtures/issue130.php +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - query->get('p')) { - echo 'Go to 2'; - } else { - echo ''.$app['request']->headers->get('referer').''; - } - ?> - diff --git a/core/vendor/behat/mink-browserkit-driver/tests/web-fixtures/issue140.php b/core/vendor/behat/mink-browserkit-driver/tests/web-fixtures/issue140.php deleted file mode 100644 index 42d8437..0000000 --- a/core/vendor/behat/mink-browserkit-driver/tests/web-fixtures/issue140.php +++ /dev/null @@ -1,20 +0,0 @@ - - - - - -isMethod('POST')) { - $resp = new Symfony\Component\HttpFoundation\Response(); - $cook = new Symfony\Component\HttpFoundation\Cookie('tc', $app['request']->request->get('cookie_value')); - $resp->headers->setCookie($cook); -} elseif ($app['request']->query->has('show_value')) { - echo $app['request']->cookies->get('tc'); - return; -} -?> -
- - -
- diff --git a/core/vendor/behat/mink-browserkit-driver/tests/web-fixtures/print_cookies.php b/core/vendor/behat/mink-browserkit-driver/tests/web-fixtures/print_cookies.php deleted file mode 100644 index ac6f078..0000000 --- a/core/vendor/behat/mink-browserkit-driver/tests/web-fixtures/print_cookies.php +++ /dev/null @@ -1,25 +0,0 @@ - - - - Cookies page - - - - cookies->all(); - unset($cookies['MOCKSESSID']); - - if (isset($cookies['srvr_cookie'])) { - $srvrCookie = $cookies['srvr_cookie']; - unset($cookies['srvr_cookie']); - $cookies['_SESS'] = ''; - $cookies['srvr_cookie'] = $srvrCookie; - } - - foreach ($cookies as $name => $val) { - $cookies[$name] = (string)$val; - } - echo str_replace(array('>'), '', var_export($cookies, true)); - ?> - - diff --git a/core/vendor/behat/mink-browserkit-driver/tests/web-fixtures/redirector.php b/core/vendor/behat/mink-browserkit-driver/tests/web-fixtures/redirector.php deleted file mode 100644 index 39e8a53..0000000 --- a/core/vendor/behat/mink-browserkit-driver/tests/web-fixtures/redirector.php +++ /dev/null @@ -1,3 +0,0 @@ -headers->set('X-Mink-Test', 'response-headers'); -?> - - - - Response headers - - - -

Response headers

- - - diff --git a/core/vendor/behat/mink-browserkit-driver/tests/web-fixtures/session_test.php b/core/vendor/behat/mink-browserkit-driver/tests/web-fixtures/session_test.php deleted file mode 100644 index 58576e3..0000000 --- a/core/vendor/behat/mink-browserkit-driver/tests/web-fixtures/session_test.php +++ /dev/null @@ -1,19 +0,0 @@ -getSession(); - -if ($app['request']->query->has('login')) { - $session->migrate(); -} -?> - - - - Session Test - - - - -
getId() ?>
- - diff --git a/core/vendor/behat/mink-browserkit-driver/tests/web-fixtures/sub-folder/cookie_page1.php b/core/vendor/behat/mink-browserkit-driver/tests/web-fixtures/sub-folder/cookie_page1.php deleted file mode 100644 index 807c23e..0000000 --- a/core/vendor/behat/mink-browserkit-driver/tests/web-fixtures/sub-folder/cookie_page1.php +++ /dev/null @@ -1,18 +0,0 @@ -server->get('REQUEST_URI'); - $resp = new Symfony\Component\HttpFoundation\Response(); - $cook = new Symfony\Component\HttpFoundation\Cookie('srvr_cookie', 'srv_var_is_set_sub_folder', 0, dirname($requestUri)); - $resp->headers->setCookie($cook); -?> - - - - basic form - - - - - basic page with cookie set from server side - - diff --git a/core/vendor/behat/mink-browserkit-driver/tests/web-fixtures/sub-folder/cookie_page2.php b/core/vendor/behat/mink-browserkit-driver/tests/web-fixtures/sub-folder/cookie_page2.php deleted file mode 100644 index 22a7dab..0000000 --- a/core/vendor/behat/mink-browserkit-driver/tests/web-fixtures/sub-folder/cookie_page2.php +++ /dev/null @@ -1,18 +0,0 @@ - - - - Basic Form - - - - - Previous cookie: cookies->has('srvr_cookie')) { - echo $app['request']->cookies->get('srvr_cookie'); - } else { - echo 'NO'; - } - ?> - - diff --git a/core/vendor/behat/mink-goutte-driver/.gitignore b/core/vendor/behat/mink-goutte-driver/.gitignore deleted file mode 100644 index 1d034f4..0000000 --- a/core/vendor/behat/mink-goutte-driver/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -vendor -composer.phar -composer.lock -phpunit.xml diff --git a/core/vendor/behat/mink-goutte-driver/.travis.yml b/core/vendor/behat/mink-goutte-driver/.travis.yml deleted file mode 100644 index b09e457..0000000 --- a/core/vendor/behat/mink-goutte-driver/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -language: php - -php: [5.3, 5.4, 5.5, 5.6, hhvm] - -before_script: - - export WEB_FIXTURES_HOST=http://localhost - - - composer install --dev --prefer-source - - - sudo apt-get update - - sudo apt-get install -y --force-yes apache2 libapache2-mod-php5 - - sudo sed -i -e "s,/var/www,$(pwd)/vendor/behat/mink/driver-testsuite/web-fixtures,g" /etc/apache2/sites-available/default - - sudo /etc/init.d/apache2 restart - -script: phpunit -v --coverage-clover=coverage.clover - -after_script: - - wget https://scrutinizer-ci.com/ocular.phar - - php ocular.phar code-coverage:upload --format=php-clover coverage.clover diff --git a/core/vendor/behat/mink-goutte-driver/CHANGELOG.md b/core/vendor/behat/mink-goutte-driver/CHANGELOG.md deleted file mode 100644 index fcaa7f0..0000000 --- a/core/vendor/behat/mink-goutte-driver/CHANGELOG.md +++ /dev/null @@ -1,20 +0,0 @@ -1.1.0 / 2014-10-09 -================== - -The driver now relies on BrowserKitDriver 1.2.x, so all changes of this driver are relevant. -The changes below only describe the changes related to GoutteDriver specifically. - -New features: - -* Added the possibility to use a normal Goutte client instead of requiring to use an extended one -* Added the support of Goutte 2.0 as well - -Bug fixes: - -* Fixed the support of disabling basic auth -* Fixed the resetting of the driver to reset the basic auth - -Testing: - -* Updated the testsuite to use the new Mink 1.6 driver testsuite -* Added testing on HHVM diff --git a/core/vendor/behat/mink-goutte-driver/LICENSE b/core/vendor/behat/mink-goutte-driver/LICENSE deleted file mode 100644 index 3365ae6..0000000 --- a/core/vendor/behat/mink-goutte-driver/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2012-2013 Konstantin Kudryashov - -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/core/vendor/behat/mink-goutte-driver/README.md b/core/vendor/behat/mink-goutte-driver/README.md deleted file mode 100755 index c7877c5..0000000 --- a/core/vendor/behat/mink-goutte-driver/README.md +++ /dev/null @@ -1,53 +0,0 @@ -Mink Goutte Driver -================== - -[![Latest Stable Version](https://poser.pugx.org/behat/mink-goutte-driver/v/stable.svg)](https://packagist.org/packages/behat/mink-goutte-driver) -[![Latest Unstable Version](https://poser.pugx.org/behat/mink-goutte-driver/v/unstable.svg)](https://packagist.org/packages/behat/mink-goutte-driver) -[![Total Downloads](https://poser.pugx.org/behat/mink-goutte-driver/downloads.svg)](https://packagist.org/packages/behat/mink-goutte-driver) -[![Build Status](https://travis-ci.org/Behat/MinkGoutteDriver.svg?branch=master)](https://travis-ci.org/Behat/MinkGoutteDriver) -[![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/Behat/MinkGoutteDriver/badges/quality-score.png?s=ca141bb2cad18e74cf3d3b132b1a6aa0f3f004a5)](https://scrutinizer-ci.com/g/Behat/MinkGoutteDriver/) -[![Code Coverage](https://scrutinizer-ci.com/g/Behat/MinkGoutteDriver/badges/coverage.png?s=ca2d17a948660bfaeb4a95bf1a709644305c54f3)](https://scrutinizer-ci.com/g/Behat/MinkGoutteDriver/) -[![License](https://poser.pugx.org/behat/mink-goutte-driver/license.svg)](https://packagist.org/packages/behat/mink-goutte-driver) - -Usage Example -------------- - -``` php - new Session(new GoutteDriver(new GoutteClient($startUrl))), -)); - -$mink->getSession('goutte')->getPage()->findLink('Chat')->click(); -``` - -Installation ------------- - -``` json -{ - "require": { - "behat/mink": "~1.5", - "behat/mink-goutte-driver": "~1.0" - } -} -``` - -``` bash -$> curl -sS https://getcomposer.org/installer | php -$> php composer.phar install -``` - -Maintainers ------------ - -* Konstantin Kudryashov [everzet](http://github.com/everzet) -* Other [awesome developers](https://github.com/Behat/MinkGoutteDriver/graphs/contributors) diff --git a/core/vendor/behat/mink-goutte-driver/composer.json b/core/vendor/behat/mink-goutte-driver/composer.json deleted file mode 100644 index 7444a50..0000000 --- a/core/vendor/behat/mink-goutte-driver/composer.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "behat/mink-goutte-driver", - "description": "Goutte driver for Mink framework", - "keywords": ["goutte", "headless", "testing", "browser"], - "homepage": "http://mink.behat.org/", - "type": "mink-driver", - "license": "MIT", - - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - } - ], - - "require": { - "php": ">=5.3.1", - "behat/mink": "~1.6@dev", - "behat/mink-browserkit-driver": "~1.2@dev", - "fabpot/goutte": "~1.0.4|~2.0" - }, - - "autoload": { - "psr-0": { - "Behat\\Mink\\Driver": "src/" - } - }, - - "autoload-dev": { - "psr-4": { - "Behat\\Mink\\Tests\\Driver\\": "tests" - } - }, - - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } - } -} diff --git a/core/vendor/behat/mink-goutte-driver/phpunit.xml.dist b/core/vendor/behat/mink-goutte-driver/phpunit.xml.dist deleted file mode 100644 index f374c53..0000000 --- a/core/vendor/behat/mink-goutte-driver/phpunit.xml.dist +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - tests - vendor/behat/mink/driver-testsuite/tests/Basic - vendor/behat/mink/driver-testsuite/tests/Form - - - - - - - - - - - - ./src/Behat/Mink/Driver - - - diff --git a/core/vendor/behat/mink-goutte-driver/src/Behat/Mink/Driver/Goutte/Client.php b/core/vendor/behat/mink-goutte-driver/src/Behat/Mink/Driver/Goutte/Client.php deleted file mode 100644 index 9d64be7..0000000 --- a/core/vendor/behat/mink-goutte-driver/src/Behat/Mink/Driver/Goutte/Client.php +++ /dev/null @@ -1,43 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Behat\Mink\Driver\Goutte; - -use Goutte\Client as BaseClient; -use Symfony\Component\BrowserKit\Response; - -/** - * Client overrides to support Mink functionality. - */ -class Client extends BaseClient -{ - /** - * Reads response meta tags to guess content-type charset. - * - * @param Response $response - * - * @return Response - */ - protected function filterResponse($response) - { - $contentType = $response->getHeader('Content-Type'); - - if (!$contentType || false === strpos($contentType, 'charset=')) { - if (preg_match('/\]+charset *= *["\']?([a-zA-Z\-0-9]+)/i', $response->getContent(), $matches)) { - $headers = $response->getHeaders(); - $headers['Content-Type'] = $contentType.';charset='.$matches[1]; - - $response = new Response($response->getContent(), $response->getStatus(), $headers); - } - } - - return parent::filterResponse($response); - } -} diff --git a/core/vendor/behat/mink-goutte-driver/src/Behat/Mink/Driver/GoutteDriver.php b/core/vendor/behat/mink-goutte-driver/src/Behat/Mink/Driver/GoutteDriver.php deleted file mode 100644 index a42d5a2..0000000 --- a/core/vendor/behat/mink-goutte-driver/src/Behat/Mink/Driver/GoutteDriver.php +++ /dev/null @@ -1,75 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Behat\Mink\Driver; - -use Behat\Mink\Driver\Goutte\Client as ExtendedClient; -use Goutte\Client; - -/** - * Goutte driver. - * - * @author Konstantin Kudryashov - */ -class GoutteDriver extends BrowserKitDriver -{ - /** - * Initializes Goutte driver. - * - * @param Client $client Goutte client instance - */ - public function __construct(Client $client = null) - { - parent::__construct($client ?: new ExtendedClient()); - } - - /** - * {@inheritdoc} - */ - public function setBasicAuth($user, $password) - { - if (false === $user) { - $this->getClient()->resetAuth(); - - return; - } - - $this->getClient()->setAuth($user, $password); - } - - /** - * Gets the Goutte client. - * - * The method is overwritten only to provide the appropriate return type hint. - * - * @return Client - */ - public function getClient() - { - return parent::getClient(); - } - - /** - * {@inheritdoc} - */ - public function reset() - { - parent::reset(); - $this->getClient()->resetAuth(); - } - - /** - * {@inheritdoc} - */ - protected function prepareUrl($url) - { - return $url; - } -} diff --git a/core/vendor/behat/mink-goutte-driver/tests/Custom/InstantiationTest.php b/core/vendor/behat/mink-goutte-driver/tests/Custom/InstantiationTest.php deleted file mode 100644 index db75a18..0000000 --- a/core/vendor/behat/mink-goutte-driver/tests/Custom/InstantiationTest.php +++ /dev/null @@ -1,27 +0,0 @@ -getMockBuilder('Goutte\Client')->disableOriginalConstructor()->getMock(); - $client->expects($this->once()) - ->method('followRedirects') - ->with(true); - - $driver = new GoutteDriver($client); - - $this->assertSame($client, $driver->getClient()); - } - - public function testInstantiateWithoutClient() - { - $driver = new GoutteDriver(); - - $this->assertInstanceOf('Behat\Mink\Driver\Goutte\Client', $driver->getClient()); - } -} diff --git a/core/vendor/behat/mink-goutte-driver/tests/GoutteConfig.php b/core/vendor/behat/mink-goutte-driver/tests/GoutteConfig.php deleted file mode 100644 index bbe90f7..0000000 --- a/core/vendor/behat/mink-goutte-driver/tests/GoutteConfig.php +++ /dev/null @@ -1,26 +0,0 @@ -` is selected - * Added `NodeElement::submitForm` to allow submitting a form without using a button - * Added assertions about the value of an attribute - * Added the anchor in the assertion on the URL in `WebAssert` - -1.5.0 / 2013-04-14 -================== - - * Add `CoreDriver` to simplify future drivers improvements - * Add `Mink::isSessionStarted()` method - * Fix multibite string `preg_replace` bugs - * Fix handling of whitespaces in `WebAssert::pageText...()` methods - -1.4.3 / 2013-03-02 -================== - - * Bump dependencies constraints - -1.4.2 / 2013-02-13 -================== - - * Fix wrong test case to ensure that core drivers work as expected - -1.4.1 / 2013-02-10 -================== - - * Update dependencies - * Add ElementException to element actions - * Rel attribute support for named selectors - * Add hasClass() helper to traversable elements - * Add getScreenshot() method to session - * Name attr support in named selector for button - * Fix for bunch of bugs - -1.4.0 / 2012-05-40 -================== - - * New `Session::selectWindow()` and `Session::selectIFrame()` methods - * New built-in `WebAssert` class - * Fixed DocBlocks (autocompletion in any IDE now should just work) - * Moved Behat-related code into `Behat\MinkExtension` - * Removed PHPUnit test case class - * Updated composer dependencies to not require custom repository anymore - * All drivers moved into separate packages - -1.3.3 / 2012-03-23 -================== - - * Prevent exceptions in `__toString()` - * Added couple of useful step definitions for Behat - * Fixed issues #168, #211, #212, #208 - * Lot of small bug fixes and improvements - * Fixed dependencies and composer installation routine - -1.3.2 / 2011-12-21 -================== - - * Fixed webdriver registration in MinkContext - -1.3.1 / 2011-12-21 -================== - - * Fixed Composer package - -1.3.0 / 2011-12-21 -================== - - * Brand new Selenium2Driver (webdriver session) - * Multiselect bugfixes - * ZombieDriver back in the business - * Composer now manages dependencies - * Some MinkContext steps got fixes - * Lots of bug fixes and cleanup - -1.2.0 / 2011-11-04 -================== - - * Brand new SeleniumDriver (thanks @alexandresalome) - * Multiselect support (multiple options selection), including new Behat steps - * Ability to select option by it's text (in addition to value) - * ZombieDriver updates - * Use SuiteHooks to populate parameters (no need to call parent __construct anymore) - * Updated Goutte and all vendors - * Lot of bugfixes and new tests - -1.1.1 / 2011-08-12 -================== - - * Fixed Zombie.js server termination on Linux - * Fixed base_url usage for external URLs - -1.1.0 / 2011-08-08 -================== - - * Added Zombie.js driver (thanks @b00giZm) - * Added pt translation (thanks Daniel Gomes) - * Refactored MinkContext and MinkTestCase - -1.0.3 / 2011-08-02 -================== - - * File uploads for empty fields fixed (GoutteDriver) - * Lazy sessions restart - * `show_tmp_dir` option in MinkContext - * Updated to stable Symfony2 components - * SahiClient connection limit bumped to 60 seconds - * Dutch language support - -1.0.2 / 2011-07-22 -================== - - * ElementHtmlException fixed (thanks @Stof) - -1.0.1 / 2011-07-21 -================== - - * Fixed buggy assertions in MinkContext - -1.0.0 / 2011-07-20 -================== - - * Added missing tests for almost everything - * Hude speedup for SahiDriver - * Support for Behat 2.0 contexts - * Bundled PHPUnit TestCase - * Deep element traversing - * Correct behavior of getText() method - * New getHtml() method - * Basic HTTP auth support - * Soft and hard session resetting - * Cookies management - * Browser history interactions (reload(), back(), forward()) - * Weaverryan'd exception messages - * Huge amount of bugfixes and small additions - -0.3.2 / 2011-06-20 -================== - - * Fixed file uploads in Goutte driver - * Fixed setting of long texts into fields - * Added getPlainText() (returns text without tags and whitespaces) method to the element's API - * Start_url is now optional parameter - * Default session (if needed) name now need to be always specified by hands with setDefaultSessionName() - * default_driver => default_session - * Updated Symfony Components - -0.3.1 / 2011-05-17 -================== - - * Small SahiClient update (it generates SID now if no provided) - * setActiveSessionName => setDefaultSessionName method rename - -0.3.0 / 2011-05-17 -================== - - * Rewritten from scratch Mink drivers handler. Now it's sessions handler. And Mink now - sessions-centric tool. See examples in readme. Much cleaner API now. - -0.2.4 / 2011-05-12 -================== - - * Fixed wrong url locator function - * Fixed wrong regex in `should see` step - * Fixed delimiters use in `should see` step - * Added url-match step for checking urls against regex - -0.2.3 / 2011-05-01 -================== - - * Updated SahiClient with new version, which is faster and cleaner with it's exceptions - -0.2.2 / 2011-05-01 -================== - - * Ability to use already started browser as SahiDriver aim - * Added japanese translation for bundled steps (thanks @hidenorigoto) - * 10 seconds limit for browser connection in SahiDriver - -0.2.1 / 2011-04-21 -================== - - * Fixed some bundled step definitions - -0.2.0 / 2011-04-21 -================== - - * Additional step definitions - * Support for extended drivers configuration through behat.yml environment parameters - * Lots of new named selectors - * Bug fixes - * Small improvements - -0.1.2 / 2011-04-08 -================== - - * Fixed Sahi url escaping - -0.1.1 / 2011-04-06 -================== - - * Fixed should/should_not steps - * Added spanish translation - * Fixed forms to use element - * Fixed small UnsupportedByDriverException issue - -0.1.0 / 2011-04-04 -================== - - * Initial release diff --git a/core/vendor/behat/mink/CONTRIBUTING.md b/core/vendor/behat/mink/CONTRIBUTING.md deleted file mode 100644 index 5db4d85..0000000 --- a/core/vendor/behat/mink/CONTRIBUTING.md +++ /dev/null @@ -1,22 +0,0 @@ -# Contributing -Mink is an open source, community-driven project. If you'd like to contribute, feel free to do this, but remember to follow these few simple rules: - -## Submitting an issues -- __Driver-related__ issues must be reported in the corresponding driver repository -- A reproducible example is required for every bug report, otherwise it will most probably be __closed without warning__ -- If you are going to make a big, substantial change, let's discuss it first - -## Working with Pull Requests -1. Create your feature addition or a bug fix branch based on `master` branch in your repository's fork. -2. Make necessary changes, but __don't mix__ code reformatting with code changes on topic. -3. Add tests for those changes (please look into `tests/` folder for some examples). This is important so we don't break it in a future version unintentionally. -4. Commit your code, but do not mess with `CHANGES.md`. -5. Squash your commits by topic to preserve a clean and readable log. -6. Create Pull Request. - -# Running tests -Make sure that you don't break anything with your changes by running: - -```bash -$> phpunit -``` diff --git a/core/vendor/behat/mink/LICENSE b/core/vendor/behat/mink/LICENSE deleted file mode 100644 index 14f15e8..0000000 --- a/core/vendor/behat/mink/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2011-2013 Konstantin Kudryashov - -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/core/vendor/behat/mink/README.md b/core/vendor/behat/mink/README.md deleted file mode 100644 index 2299506..0000000 --- a/core/vendor/behat/mink/README.md +++ /dev/null @@ -1,74 +0,0 @@ -Mink -==== -[![Latest Stable Version](https://poser.pugx.org/behat/mink/v/stable.svg)](https://packagist.org/packages/behat/mink) -[![Latest Unstable Version](https://poser.pugx.org/behat/mink/v/unstable.svg)](https://packagist.org/packages/behat/mink) -[![Total Downloads](https://poser.pugx.org/behat/mink/downloads.svg)](https://packagist.org/packages/behat/mink) -[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/minkphp/Mink/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/minkphp/Mink/?branch=master) -[![Code Coverage](https://scrutinizer-ci.com/g/minkphp/Mink/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/minkphp/Mink/) -[![Build Status](https://travis-ci.org/minkphp/Mink.svg?branch=master)](https://travis-ci.org/minkphp/Mink) -[![SensioLabsInsight](https://insight.sensiolabs.com/projects/5bb8fab0-978f-428a-ae23-44ee4e129fbc/mini.png)](https://insight.sensiolabs.com/projects/5bb8fab0-978f-428a-ae23-44ee4e129fbc) -[![License](https://poser.pugx.org/behat/mink/license.svg)](https://packagist.org/packages/behat/mink) - - -Useful Links ------------- - -- The main website with documentation is at [http://mink.behat.org](http://mink.behat.org) -- Official Google Group is at [http://groups.google.com/group/behat](http://groups.google.com/group/behat) -- IRC channel on [#freenode](http://freenode.net/) is `#behat` -- [Note on Patches/Pull Requests](CONTRIBUTING.md) - -Usage Example -------------- - -``` php - new Session(new GoutteDriver(new GoutteClient())), - 'goutte2' => new Session(new GoutteDriver(new GoutteClient())), - 'custom' => new Session(new MyCustomDriver($startUrl)) -)); - -// set the default session name -$mink->setDefaultSessionName('goutte2'); - -// visit a page -$mink->getSession()->visit($startUrl); - -// call to getSession() without argument will always return a default session if has one (goutte2 here) -$mink->getSession()->getPage()->findLink('Downloads')->click(); -echo $mink->getSession()->getPage()->getContent(); - -// call to getSession() with argument will return session by its name -$mink->getSession('custom')->getPage()->findLink('Downloads')->click(); -echo $mink->getSession('custom')->getPage()->getContent(); - -// this all is done to make possible mixing sessions -$mink->getSession('goutte1')->getPage()->findLink('Chat')->click(); -$mink->getSession('goutte2')->getPage()->findLink('Chat')->click(); -``` - -Install Dependencies --------------------- - -``` bash -$> curl -sS https://getcomposer.org/installer | php -$> php composer.phar install -``` - -Contributors ------------- - -* Konstantin Kudryashov [everzet](https://github.com/everzet) [lead developer] -* Christophe Coevoet [stof](https://github.com/stof) [lead developer] -* Alexander Obuhovich [aik099](https://github.com/aik099) [lead developer] -* Other [awesome developers](https://github.com/minkphp/Mink/graphs/contributors) diff --git a/core/vendor/behat/mink/composer.json b/core/vendor/behat/mink/composer.json deleted file mode 100644 index 7a8723f..0000000 --- a/core/vendor/behat/mink/composer.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "name": "behat/mink", - "description": "Browser controller/emulator abstraction for PHP", - "keywords": ["web", "testing", "browser"], - "homepage": "http://mink.behat.org/", - "type": "library", - "license": "MIT", - - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - } - ], - - "require": { - "php": ">=5.3.1", - "symfony/css-selector": "~2.0" - }, - - "suggest": { - "behat/mink-browserkit-driver": "extremely fast headless driver for Symfony\\Kernel-based apps (Sf2, Silex)", - "behat/mink-goutte-driver": "fast headless driver for any app without JS emulation", - "behat/mink-selenium2-driver": "slow, but JS-enabled driver for any app (requires Selenium2)", - "behat/mink-zombie-driver": "fast and JS-enabled headless driver for any app (requires node.js)" - }, - - "autoload": { - "psr-4": { - "Behat\\Mink\\": "src/" - } - }, - - "autoload-dev": { - "psr-4": { - "Behat\\Mink\\Tests\\": "tests" - } - }, - - "extra": { - "branch-alias": { - "dev-master": "1.6.x-dev" - } - } -} diff --git a/core/vendor/behat/mink/driver-testsuite/README.md b/core/vendor/behat/mink/driver-testsuite/README.md deleted file mode 100644 index f2af9a8..0000000 --- a/core/vendor/behat/mink/driver-testsuite/README.md +++ /dev/null @@ -1,96 +0,0 @@ -Mink Driver testsuite -===================== - -This is the common testsuite for Mink drivers to ensure consistency among implementations. - -Usage ------ - -The testsuite of a driver should be based as follow: - -```json -{ - "require": { - "behat/mink": "~1.6@dev" - }, - - "autoload-dev": { - "psr-4": { - "Acme\\MyDriver\\Tests\\": "tests" - } - } -} -``` - -```xml - - - - - - - - - - - - - vendor/behat/mink/driver-testsuite/tests - - - - ./tests/ - - - - - - ./src - - - -``` - -Then create the driver config for the testsuite: - -```php -// tests/Config.php - -namespace Acme\MyDriver\Tests; - -use Behat\Mink\Tests\Driver\AbstractConfig; - -class Config extends AbstractConfig -{ - /** - * Creates an instance of the config. - * - * This is the callable registered as a php variable in the phpunit.xml config file. - * It could be outside the class but this is convenient. - */ - public static function getInstance() - { - return new self(); - } - - /** - * Creates driver instance. - * - * @return \Behat\Mink\Driver\DriverInterface - */ - public function createDriver() - { - return new \Acme\MyDriver\MyDriver(); - } -} -``` - -Some other methods are available in the AbstractConfig which can be overwritten to adapt the testsuite to -the needs of the driver (skipping some tests for instance). - -Adding Driver-specific Tests ----------------------------- - -When adding extra test cases specific to the driver, either use your own namespace or put them in the -``Behat\Mink\Tests\Driver\Custom`` subnamespace to ensure that you will not create conflicts with test cases -added in the driver testsuite in the future. diff --git a/core/vendor/behat/mink/driver-testsuite/bootstrap.php b/core/vendor/behat/mink/driver-testsuite/bootstrap.php deleted file mode 100644 index f69a45b..0000000 --- a/core/vendor/behat/mink/driver-testsuite/bootstrap.php +++ /dev/null @@ -1,28 +0,0 @@ -addPsr4('Behat\Mink\Tests\Driver\\', __DIR__.'/tests'); - -// Clean the global variables -unset($file); -unset($loader); - -// Check the definition of the driverLoaderFactory - -if (!isset($GLOBALS['driver_config_factory'])) { - echo PHP_EOL.'The "driver_config_factory" global variable must be set.'.PHP_EOL; - exit(1); -} -if (!is_callable($GLOBALS['driver_config_factory'])) { - echo PHP_EOL.'The "driver_config_factory" global variable must be a callable.'.PHP_EOL; - exit(1); -} diff --git a/core/vendor/behat/mink/driver-testsuite/tests/AbstractConfig.php b/core/vendor/behat/mink/driver-testsuite/tests/AbstractConfig.php deleted file mode 100644 index f654297..0000000 --- a/core/vendor/behat/mink/driver-testsuite/tests/AbstractConfig.php +++ /dev/null @@ -1,83 +0,0 @@ -supportsCss() && 0 === strpos($testCase, 'Behat\Mink\Tests\Driver\Css\\')) { - return 'This driver does not support CSS.'; - } - - if (!$this->supportsJs() && 0 === strpos($testCase, 'Behat\Mink\Tests\Driver\Js\\')) { - return 'This driver does not support JavaScript.'; - } - - return null; - } - - /** - * Whether the JS tests should run or no. - * - * @return bool - */ - protected function supportsJs() - { - return true; - } - - /** - * Whether the CSS tests should run or no. - * - * @return bool - */ - protected function supportsCss() - { - return false; - } -} diff --git a/core/vendor/behat/mink/driver-testsuite/tests/Basic/BasicAuthTest.php b/core/vendor/behat/mink/driver-testsuite/tests/Basic/BasicAuthTest.php deleted file mode 100644 index 40d932d..0000000 --- a/core/vendor/behat/mink/driver-testsuite/tests/Basic/BasicAuthTest.php +++ /dev/null @@ -1,64 +0,0 @@ -getSession(); - - $session->setBasicAuth($user, $pass); - - $session->visit($this->pathTo('/basic_auth.php')); - - $this->assertContains($pageText, $session->getPage()->getContent()); - } - - public function setBasicAuthDataProvider() - { - return array( - array('mink-user', 'mink-password', 'is authenticated'), - array('', '', 'is not authenticated'), - ); - } - - public function testResetBasicAuth() - { - $session = $this->getSession(); - - $session->setBasicAuth('mink-user', 'mink-password'); - - $session->visit($this->pathTo('/basic_auth.php')); - - $this->assertContains('is authenticated', $session->getPage()->getContent()); - - $session->setBasicAuth(false); - - $session->visit($this->pathTo('/headers.php')); - - $this->assertNotContains('PHP_AUTH_USER', $session->getPage()->getContent()); - } - - public function testResetWithBasicAuth() - { - $session = $this->getSession(); - - $session->setBasicAuth('mink-user', 'mink-password'); - - $session->visit($this->pathTo('/basic_auth.php')); - - $this->assertContains('is authenticated', $session->getPage()->getContent()); - - $session->reset(); - - $session->visit($this->pathTo('/headers.php')); - - $this->assertNotContains('PHP_AUTH_USER', $session->getPage()->getContent()); - } -} diff --git a/core/vendor/behat/mink/driver-testsuite/tests/Basic/ContentTest.php b/core/vendor/behat/mink/driver-testsuite/tests/Basic/ContentTest.php deleted file mode 100644 index 6f516e8..0000000 --- a/core/vendor/behat/mink/driver-testsuite/tests/Basic/ContentTest.php +++ /dev/null @@ -1,74 +0,0 @@ -getSession()->visit($this->pathTo('/index.html')); - - $element = $this->getAssertSession()->elementExists('css', '.travers'); - - $this->assertEquals( - "
\n
el1
\n". - "
el2
\n
\n". - " some deep url\n". - "
\n
", - $element->getOuterHtml() - ); - } - - /** - * @dataProvider getAttributeDataProvider - */ - public function testGetAttribute($attributeName, $attributeValue) - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $element = $this->getSession()->getPage()->findById('attr-elem['.$attributeName.']'); - - $this->assertNotNull($element); - $this->assertSame($attributeValue, $element->getAttribute($attributeName)); - } - - public function getAttributeDataProvider() - { - return array( - array('with-value', 'some-value'), - array('without-value', ''), - array('with-empty-value', ''), - array('with-missing', null), - ); - } - - public function testJson() - { - $this->getSession()->visit($this->pathTo('/json.php')); - $this->assertContains( - '{"key1":"val1","key2":234,"key3":[1,2,3]}', - $this->getSession()->getPage()->getContent() - ); - } - - public function testHtmlDecodingNotPerformed() - { - $session = $this->getSession(); - $webAssert = $this->getAssertSession(); - $session->visit($this->pathTo('/html_decoding.html')); - $page = $session->getPage(); - - $span = $webAssert->elementExists('css', 'span'); - $input = $webAssert->elementExists('css', 'input'); - - $expectedHtml = 'some text'; - $this->assertContains($expectedHtml, $page->getHtml(), '.innerHTML is returned as-is'); - $this->assertContains($expectedHtml, $page->getContent(), '.outerHTML is returned as-is'); - - $this->assertEquals('&', $span->getAttribute('custom-attr'), '.getAttribute value is decoded'); - $this->assertEquals('&', $input->getAttribute('value'), '.getAttribute value is decoded'); - $this->assertEquals('&', $input->getValue(), 'node value is decoded'); - } -} diff --git a/core/vendor/behat/mink/driver-testsuite/tests/Basic/CookieTest.php b/core/vendor/behat/mink/driver-testsuite/tests/Basic/CookieTest.php deleted file mode 100644 index 355dd71..0000000 --- a/core/vendor/behat/mink/driver-testsuite/tests/Basic/CookieTest.php +++ /dev/null @@ -1,167 +0,0 @@ -getSession()->visit($this->pathTo('/issue140.php')); - - $this->getSession()->getPage()->fillField('cookie_value', 'some:value;'); - $this->getSession()->getPage()->pressButton('Set cookie'); - - $this->getSession()->visit($this->pathTo('/issue140.php?show_value')); - $this->assertEquals('some:value;', $this->getSession()->getCookie('tc')); - $this->assertEquals('some:value;', $this->getSession()->getPage()->getText()); - } - - public function testCookie() - { - $this->getSession()->visit($this->pathTo('/cookie_page2.php')); - $this->assertContains('Previous cookie: NO', $this->getSession()->getPage()->getText()); - $this->assertNull($this->getSession()->getCookie('srvr_cookie')); - - $this->getSession()->setCookie('srvr_cookie', 'client cookie set'); - $this->getSession()->reload(); - $this->assertContains('Previous cookie: client cookie set', $this->getSession()->getPage()->getText()); - $this->assertEquals('client cookie set', $this->getSession()->getCookie('srvr_cookie')); - - $this->getSession()->setCookie('srvr_cookie', null); - $this->getSession()->reload(); - $this->assertContains('Previous cookie: NO', $this->getSession()->getPage()->getText()); - - $this->getSession()->visit($this->pathTo('/cookie_page1.php')); - $this->getSession()->visit($this->pathTo('/cookie_page2.php')); - - $this->assertContains('Previous cookie: srv_var_is_set', $this->getSession()->getPage()->getText()); - $this->getSession()->setCookie('srvr_cookie', null); - $this->getSession()->reload(); - $this->assertContains('Previous cookie: NO', $this->getSession()->getPage()->getText()); - } - - /** - * @dataProvider cookieWithPathsDataProvider - */ - public function testCookieWithPaths($cookieRemovalMode) - { - // start clean - $session = $this->getSession(); - $session->visit($this->pathTo('/sub-folder/cookie_page2.php')); - $this->assertContains('Previous cookie: NO', $session->getPage()->getText()); - - // cookie from root path is accessible in sub-folder - $session->visit($this->pathTo('/cookie_page1.php')); - $session->visit($this->pathTo('/sub-folder/cookie_page2.php')); - $this->assertContains('Previous cookie: srv_var_is_set', $session->getPage()->getText()); - - // cookie from sub-folder overrides cookie from root path - $session->visit($this->pathTo('/sub-folder/cookie_page1.php')); - $session->visit($this->pathTo('/sub-folder/cookie_page2.php')); - $this->assertContains('Previous cookie: srv_var_is_set_sub_folder', $session->getPage()->getText()); - - if ($cookieRemovalMode == 'session_reset') { - $session->reset(); - } elseif ($cookieRemovalMode == 'cookie_delete') { - $session->setCookie('srvr_cookie', null); - } - - // cookie is removed from all paths - $session->visit($this->pathTo('/sub-folder/cookie_page2.php')); - $this->assertContains('Previous cookie: NO', $session->getPage()->getText()); - } - - public function cookieWithPathsDataProvider() - { - return array( - array('session_reset'), - array('cookie_delete'), - ); - } - - public function testReset() - { - $this->getSession()->visit($this->pathTo('/cookie_page1.php')); - $this->getSession()->visit($this->pathTo('/cookie_page2.php')); - $this->assertContains('Previous cookie: srv_var_is_set', $this->getSession()->getPage()->getText()); - - $this->getSession()->reset(); - $this->getSession()->visit($this->pathTo('/cookie_page2.php')); - - $this->assertContains('Previous cookie: NO', $this->getSession()->getPage()->getText()); - - $this->getSession()->setCookie('srvr_cookie', 'test_cookie'); - $this->getSession()->visit($this->pathTo('/cookie_page2.php')); - $this->assertContains('Previous cookie: test_cookie', $this->getSession()->getPage()->getText()); - $this->getSession()->reset(); - $this->getSession()->visit($this->pathTo('/cookie_page2.php')); - $this->assertContains('Previous cookie: NO', $this->getSession()->getPage()->getText()); - - $this->getSession()->setCookie('client_cookie1', 'some_val'); - $this->getSession()->setCookie('client_cookie2', 123); - $this->getSession()->visit($this->pathTo('/session_test.php')); - $this->getSession()->visit($this->pathTo('/cookie_page1.php')); - - $this->getSession()->visit($this->pathTo('/print_cookies.php')); - $this->assertContains( - "'client_cookie1' = 'some_val'", - $this->getSession()->getPage()->getText() - ); - $this->assertContains( - "'client_cookie2' = '123'", - $this->getSession()->getPage()->getText() - ); - $this->assertContains( - "_SESS' = ", - $this->getSession()->getPage()->getText() - ); - $this->assertContains( - " 'srvr_cookie' = 'srv_var_is_set'", - $this->getSession()->getPage()->getText() - ); - - $this->getSession()->reset(); - $this->getSession()->visit($this->pathTo('/print_cookies.php')); - $this->assertContains('array ( )', $this->getSession()->getPage()->getText()); - } - - public function testHttpOnlyCookieIsDeleted() - { - $this->getSession()->restart(); - $this->getSession()->visit($this->pathTo('/cookie_page3.php')); - $this->assertEquals('Has Cookie: false', $this->findById('cookie-status')->getText()); - - $this->getSession()->reload(); - $this->assertEquals('Has Cookie: true', $this->findById('cookie-status')->getText()); - - $this->getSession()->restart(); - $this->getSession()->visit($this->pathTo('/cookie_page3.php')); - $this->assertEquals('Has Cookie: false', $this->findById('cookie-status')->getText()); - } - - public function testSessionPersistsBetweenRequests() - { - $this->getSession()->visit($this->pathTo('/session_test.php')); - $webAssert = $this->getAssertSession(); - $node = $webAssert->elementExists('css', '#session-id'); - $sessionId = $node->getText(); - - $this->getSession()->visit($this->pathTo('/session_test.php')); - $node = $webAssert->elementExists('css', '#session-id'); - $this->assertEquals($sessionId, $node->getText()); - - $this->getSession()->visit($this->pathTo('/session_test.php?login')); - $node = $webAssert->elementExists('css', '#session-id'); - $this->assertNotEquals($sessionId, $newSessionId = $node->getText()); - - $this->getSession()->visit($this->pathTo('/session_test.php')); - $node = $webAssert->elementExists('css', '#session-id'); - $this->assertEquals($newSessionId, $node->getText()); - } -} diff --git a/core/vendor/behat/mink/driver-testsuite/tests/Basic/ErrorHandlingTest.php b/core/vendor/behat/mink/driver-testsuite/tests/Basic/ErrorHandlingTest.php deleted file mode 100644 index 440585a..0000000 --- a/core/vendor/behat/mink/driver-testsuite/tests/Basic/ErrorHandlingTest.php +++ /dev/null @@ -1,262 +0,0 @@ -getSession()->visit($this->pathTo('/500.php')); - - $this->assertContains( - 'Sorry, a server error happened', - $this->getSession()->getPage()->getContent(), - 'Drivers allow loading pages with a 500 status code' - ); - } - - public function testCheckInvalidElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - $element = $this->findById('user-name'); - - $this->setExpectedException(self::INVALID_EXCEPTION); - $this->getSession()->getDriver()->check($element->getXpath()); - } - - public function testCheckNotFoundElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $this->setExpectedException(self::NOT_FOUND_EXCEPTION); - $this->getSession()->getDriver()->check(self::NOT_FOUND_XPATH); - } - - public function testUncheckInvalidElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - $element = $this->findById('user-name'); - - $this->setExpectedException(self::INVALID_EXCEPTION); - $this->getSession()->getDriver()->uncheck($element->getXpath()); - } - - public function testUncheckNotFoundElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $this->setExpectedException(self::NOT_FOUND_EXCEPTION); - $this->getSession()->getDriver()->uncheck(self::NOT_FOUND_XPATH); - } - - public function testSelectOptionInvalidElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - $element = $this->findById('user-name'); - - $this->setExpectedException(self::INVALID_EXCEPTION); - $this->getSession()->getDriver()->selectOption($element->getXpath(), 'test'); - } - - public function testSelectOptionNotFoundElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $this->setExpectedException(self::NOT_FOUND_EXCEPTION); - $this->getSession()->getDriver()->selectOption(self::NOT_FOUND_XPATH, 'test'); - } - - public function testAttachFileInvalidElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - $element = $this->findById('user-name'); - - $this->setExpectedException(self::INVALID_EXCEPTION); - $this->getSession()->getDriver()->attachFile($element->getXpath(), __FILE__); - } - - public function testAttachFileNotFoundElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $this->setExpectedException(self::NOT_FOUND_EXCEPTION); - $this->getSession()->getDriver()->attachFile(self::NOT_FOUND_XPATH, __FILE__); - } - - public function testSubmitFormInvalidElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - $element = $this->findById('core'); - - $this->setExpectedException(self::INVALID_EXCEPTION); - $this->getSession()->getDriver()->submitForm($element->getXpath()); - } - - public function testSubmitFormNotFoundElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $this->setExpectedException(self::NOT_FOUND_EXCEPTION); - $this->getSession()->getDriver()->submitForm(self::NOT_FOUND_XPATH); - } - - public function testGetTagNameNotFoundElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $this->setExpectedException(self::NOT_FOUND_EXCEPTION); - $this->getSession()->getDriver()->getTagName(self::NOT_FOUND_XPATH); - } - - public function testGetTextNotFoundElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $this->setExpectedException(self::NOT_FOUND_EXCEPTION); - $this->getSession()->getDriver()->getText(self::NOT_FOUND_XPATH); - } - - public function testGetHtmlNotFoundElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $this->setExpectedException(self::NOT_FOUND_EXCEPTION); - $this->getSession()->getDriver()->getHtml(self::NOT_FOUND_XPATH); - } - - public function testGetOuterHtmlNotFoundElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $this->setExpectedException(self::NOT_FOUND_EXCEPTION); - $this->getSession()->getDriver()->getOuterHtml(self::NOT_FOUND_XPATH); - } - - public function testGetValueNotFoundElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $this->setExpectedException(self::NOT_FOUND_EXCEPTION); - $this->getSession()->getDriver()->getValue(self::NOT_FOUND_XPATH); - } - - public function testSetValueNotFoundElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $this->setExpectedException(self::NOT_FOUND_EXCEPTION); - $this->getSession()->getDriver()->setValue(self::NOT_FOUND_XPATH, 'test'); - } - - public function testIsSelectedNotFoundElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $this->setExpectedException(self::NOT_FOUND_EXCEPTION); - $this->getSession()->getDriver()->isSelected(self::NOT_FOUND_XPATH); - } - - public function testIsCheckedNotFoundElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $this->setExpectedException(self::NOT_FOUND_EXCEPTION); - $this->getSession()->getDriver()->isChecked(self::NOT_FOUND_XPATH); - } - - public function testIsVisibleNotFoundElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $this->setExpectedException(self::NOT_FOUND_EXCEPTION); - $this->getSession()->getDriver()->isVisible(self::NOT_FOUND_XPATH); - } - - public function testClickNotFoundElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $this->setExpectedException(self::NOT_FOUND_EXCEPTION); - $this->getSession()->getDriver()->click(self::NOT_FOUND_XPATH); - } - - public function testDoubleClickNotFoundElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $this->setExpectedException(self::NOT_FOUND_EXCEPTION); - $this->getSession()->getDriver()->doubleClick(self::NOT_FOUND_XPATH); - } - - public function testRightClickNotFoundElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $this->setExpectedException(self::NOT_FOUND_EXCEPTION); - $this->getSession()->getDriver()->rightClick(self::NOT_FOUND_XPATH); - } - - public function testGetAttributeNotFoundElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $this->setExpectedException(self::NOT_FOUND_EXCEPTION); - $this->getSession()->getDriver()->getAttribute(self::NOT_FOUND_XPATH, 'id'); - } - - public function testMouseOverNotFoundElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $this->setExpectedException(self::NOT_FOUND_EXCEPTION); - $this->getSession()->getDriver()->mouseOver(self::NOT_FOUND_XPATH); - } - - public function testFocusNotFoundElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $this->setExpectedException(self::NOT_FOUND_EXCEPTION); - $this->getSession()->getDriver()->focus(self::NOT_FOUND_XPATH); - } - - public function testBlurNotFoundElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $this->setExpectedException(self::NOT_FOUND_EXCEPTION); - $this->getSession()->getDriver()->blur(self::NOT_FOUND_XPATH); - } - - public function testKeyPressNotFoundElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $this->setExpectedException(self::NOT_FOUND_EXCEPTION); - $this->getSession()->getDriver()->keyPress(self::NOT_FOUND_XPATH, 'a'); - } - - public function testKeyDownNotFoundElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $this->setExpectedException(self::NOT_FOUND_EXCEPTION); - $this->getSession()->getDriver()->keyDown(self::NOT_FOUND_XPATH, 'a'); - } - - public function testKeyUpNotFoundElement() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $this->setExpectedException(self::NOT_FOUND_EXCEPTION); - $this->getSession()->getDriver()->keyUp(self::NOT_FOUND_XPATH, 'a'); - } -} diff --git a/core/vendor/behat/mink/driver-testsuite/tests/Basic/HeaderTest.php b/core/vendor/behat/mink/driver-testsuite/tests/Basic/HeaderTest.php deleted file mode 100644 index 0288ff1..0000000 --- a/core/vendor/behat/mink/driver-testsuite/tests/Basic/HeaderTest.php +++ /dev/null @@ -1,77 +0,0 @@ -getSession()->visit($this->pathTo('/issue130.php?p=1')); - $page = $this->getSession()->getPage(); - - $page->clickLink('Go to 2'); - $this->assertEquals($this->pathTo('/issue130.php?p=1'), $page->getText()); - } - - public function testHeaders() - { - $this->getSession()->setRequestHeader('Accept-Language', 'fr'); - $this->getSession()->visit($this->pathTo('/headers.php')); - - $this->assertContains('[HTTP_ACCEPT_LANGUAGE] => fr', $this->getSession()->getPage()->getContent()); - } - - public function testSetUserAgent() - { - $session = $this->getSession(); - - $session->setRequestHeader('user-agent', 'foo bar'); - $session->visit($this->pathTo('/headers.php')); - $this->assertContains('[HTTP_USER_AGENT] => foo bar', $session->getPage()->getContent()); - } - - public function testResetHeaders() - { - $session = $this->getSession(); - - $session->setRequestHeader('X-Mink-Test', 'test'); - $session->visit($this->pathTo('/headers.php')); - - $this->assertContains( - '[HTTP_X_MINK_TEST] => test', - $session->getPage()->getContent(), - 'The custom header should be sent', - true - ); - - $session->reset(); - $session->visit($this->pathTo('/headers.php')); - - $this->assertNotContains( - '[HTTP_X_MINK_TEST] => test', - $session->getPage()->getContent(), - 'The custom header should not be sent after resetting', - true - ); - } - - public function testResponseHeaders() - { - $this->getSession()->visit($this->pathTo('/response_headers.php')); - - $headers = $this->getSession()->getResponseHeaders(); - - $lowercasedHeaders = array(); - foreach ($headers as $name => $value) { - $lowercasedHeaders[str_replace('_', '-', strtolower($name))] = $value; - } - - $this->assertArrayHasKey('x-mink-test', $lowercasedHeaders); - } -} diff --git a/core/vendor/behat/mink/driver-testsuite/tests/Basic/IFrameTest.php b/core/vendor/behat/mink/driver-testsuite/tests/Basic/IFrameTest.php deleted file mode 100644 index 0ed0f9e..0000000 --- a/core/vendor/behat/mink/driver-testsuite/tests/Basic/IFrameTest.php +++ /dev/null @@ -1,27 +0,0 @@ -getSession()->visit($this->pathTo('/iframe.html')); - $webAssert = $this->getAssertSession(); - - $el = $webAssert->elementExists('css', '#text'); - $this->assertSame('Main window div text', $el->getText()); - - $this->getSession()->switchToIFrame('subframe'); - - $el = $webAssert->elementExists('css', '#text'); - $this->assertSame('iFrame div text', $el->getText()); - - $this->getSession()->switchToIFrame(); - - $el = $webAssert->elementExists('css', '#text'); - $this->assertSame('Main window div text', $el->getText()); - } -} diff --git a/core/vendor/behat/mink/driver-testsuite/tests/Basic/NavigationTest.php b/core/vendor/behat/mink/driver-testsuite/tests/Basic/NavigationTest.php deleted file mode 100644 index 8ecb139..0000000 --- a/core/vendor/behat/mink/driver-testsuite/tests/Basic/NavigationTest.php +++ /dev/null @@ -1,69 +0,0 @@ -getSession()->visit($this->pathTo('/redirector.php')); - $this->assertEquals($this->pathTo('/redirect_destination.html'), $this->getSession()->getCurrentUrl()); - } - - public function testPageControlls() - { - $this->getSession()->visit($this->pathTo('/randomizer.php')); - $number1 = $this->getSession()->getPage()->find('css', '#number')->getText(); - - $this->getSession()->reload(); - $number2 = $this->getSession()->getPage()->find('css', '#number')->getText(); - - $this->assertNotEquals($number1, $number2); - - $this->getSession()->visit($this->pathTo('/links.html')); - $this->getSession()->getPage()->clickLink('Random number page'); - - $this->assertEquals($this->pathTo('/randomizer.php'), $this->getSession()->getCurrentUrl()); - - $this->getSession()->back(); - $this->assertEquals($this->pathTo('/links.html'), $this->getSession()->getCurrentUrl()); - - $this->getSession()->forward(); - $this->assertEquals($this->pathTo('/randomizer.php'), $this->getSession()->getCurrentUrl()); - } - - public function testLinks() - { - $this->getSession()->visit($this->pathTo('/links.html')); - $page = $this->getSession()->getPage(); - $link = $page->findLink('Redirect me to'); - - $this->assertNotNull($link); - $this->assertRegExp('/redirector\.php$/', $link->getAttribute('href')); - $link->click(); - - $this->assertEquals($this->pathTo('/redirect_destination.html'), $this->getSession()->getCurrentUrl()); - - $this->getSession()->visit($this->pathTo('/links.html')); - $page = $this->getSession()->getPage(); - $link = $page->findLink('basic form image'); - - $this->assertNotNull($link); - $this->assertRegExp('/basic_form\.html$/', $link->getAttribute('href')); - $link->click(); - - $this->assertEquals($this->pathTo('/basic_form.html'), $this->getSession()->getCurrentUrl()); - - $this->getSession()->visit($this->pathTo('/links.html')); - $page = $this->getSession()->getPage(); - $link = $page->findLink("Link with a "); - - $this->assertNotNull($link); - $this->assertRegExp('/links\.html\?quoted$/', $link->getAttribute('href')); - $link->click(); - - $this->assertEquals($this->pathTo('/links.html?quoted'), $this->getSession()->getCurrentUrl()); - } -} diff --git a/core/vendor/behat/mink/driver-testsuite/tests/Basic/ScreenshotTest.php b/core/vendor/behat/mink/driver-testsuite/tests/Basic/ScreenshotTest.php deleted file mode 100644 index 329f2d3..0000000 --- a/core/vendor/behat/mink/driver-testsuite/tests/Basic/ScreenshotTest.php +++ /dev/null @@ -1,30 +0,0 @@ -markTestSkipped('Testing screenshots requires the GD extension'); - } - - $this->getSession()->visit($this->pathTo('/index.html')); - - $screenShot = $this->getSession()->getScreenshot(); - - $this->assertInternalType('string', $screenShot); - $this->assertFalse(base64_decode($screenShot, true), 'The returned screenshot should not be base64-encoded'); - - $img = imagecreatefromstring($screenShot); - - if (false === $img) { - $this->fail('The screenshot should be a valid image'); - } - - imagedestroy($img); - } -} diff --git a/core/vendor/behat/mink/driver-testsuite/tests/Basic/StatusCodeTest.php b/core/vendor/behat/mink/driver-testsuite/tests/Basic/StatusCodeTest.php deleted file mode 100644 index 34ca7f0..0000000 --- a/core/vendor/behat/mink/driver-testsuite/tests/Basic/StatusCodeTest.php +++ /dev/null @@ -1,22 +0,0 @@ -getSession()->visit($this->pathTo('/index.html')); - - $this->assertEquals(200, $this->getSession()->getStatusCode()); - $this->assertEquals($this->pathTo('/index.html'), $this->getSession()->getCurrentUrl()); - - $this->getSession()->visit($this->pathTo('/404.php')); - - $this->assertEquals($this->pathTo('/404.php'), $this->getSession()->getCurrentUrl()); - $this->assertEquals(404, $this->getSession()->getStatusCode()); - $this->assertEquals('Sorry, page not found', $this->getSession()->getPage()->getContent()); - } -} diff --git a/core/vendor/behat/mink/driver-testsuite/tests/Basic/TraversingTest.php b/core/vendor/behat/mink/driver-testsuite/tests/Basic/TraversingTest.php deleted file mode 100644 index 3bcb7ac..0000000 --- a/core/vendor/behat/mink/driver-testsuite/tests/Basic/TraversingTest.php +++ /dev/null @@ -1,139 +0,0 @@ -getSession()->visit($this->pathTo('/issue211.html')); - $field = $this->getSession()->getPage()->findField('Téléphone'); - - $this->assertNotNull($field); - } - - public function testElementsTraversing() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $page = $this->getSession()->getPage(); - - $this->assertNotNull($page->find('css', 'h1')); - $this->assertEquals('Extremely useless page', $page->find('css', 'h1')->getText()); - $this->assertEquals('h1', $page->find('css', 'h1')->getTagName()); - - $this->assertNotNull($page->find('xpath', '//div/strong[3]')); - $this->assertEquals('pariatur', $page->find('xpath', '//div/strong[3]')->getText()); - $this->assertEquals('super-duper', $page->find('xpath', '//div/strong[3]')->getAttribute('class')); - $this->assertTrue($page->find('xpath', '//div/strong[3]')->hasAttribute('class')); - - $this->assertNotNull($page->find('xpath', '//div/strong[2]')); - $this->assertEquals('veniam', $page->find('xpath', '//div/strong[2]')->getText()); - $this->assertEquals('strong', $page->find('xpath', '//div/strong[2]')->getTagName()); - $this->assertNull($page->find('xpath', '//div/strong[2]')->getAttribute('class')); - $this->assertFalse($page->find('xpath', '//div/strong[2]')->hasAttribute('class')); - - $strongs = $page->findAll('css', 'div#core > strong'); - $this->assertCount(3, $strongs); - $this->assertEquals('Lorem', $strongs[0]->getText()); - $this->assertEquals('pariatur', $strongs[2]->getText()); - - $element = $page->find('css', '#some-element'); - - $this->assertEquals('some very interesting text', $element->getText()); - $this->assertEquals( - "\n some
very\n
\n". - "interesting text\n ", - $element->getHtml() - ); - - $this->assertTrue($element->hasAttribute('data-href')); - $this->assertFalse($element->hasAttribute('data-url')); - $this->assertEquals('http://mink.behat.org', $element->getAttribute('data-href')); - $this->assertNull($element->getAttribute('data-url')); - $this->assertEquals('div', $element->getTagName()); - } - - public function testVeryDeepElementsTraversing() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $page = $this->getSession()->getPage(); - - $footer = $page->find('css', 'footer'); - $this->assertNotNull($footer); - - $searchForm = $footer->find('css', 'form#search-form'); - $this->assertNotNull($searchForm); - $this->assertEquals('search-form', $searchForm->getAttribute('id')); - - $searchInput = $searchForm->findField('Search site...'); - $this->assertNotNull($searchInput); - $this->assertEquals('text', $searchInput->getAttribute('type')); - - $searchInput = $searchForm->findField('Search site...'); - $this->assertNotNull($searchInput); - $this->assertEquals('text', $searchInput->getAttribute('type')); - - $profileForm = $footer->find('css', '#profile'); - $this->assertNotNull($profileForm); - - $profileFormDiv = $profileForm->find('css', 'div'); - $this->assertNotNull($profileFormDiv); - - $profileFormDivLabel = $profileFormDiv->find('css', 'label'); - $this->assertNotNull($profileFormDivLabel); - - $profileFormDivParent = $profileFormDivLabel->getParent(); - $this->assertNotNull($profileFormDivParent); - - $profileFormDivParent = $profileFormDivLabel->getParent(); - $this->assertEquals('something', $profileFormDivParent->getAttribute('data-custom')); - - $profileFormInput = $profileFormDivLabel->findField('user-name'); - $this->assertNotNull($profileFormInput); - $this->assertEquals('username', $profileFormInput->getAttribute('name')); - } - - public function testDeepTraversing() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $traversDiv = $this->getSession()->getPage()->findAll('css', 'div.travers'); - - $this->assertCount(1, $traversDiv); - $traversDiv = $traversDiv[0]; - - $subDivs = $traversDiv->findAll('css', 'div.sub'); - $this->assertCount(3, $subDivs); - - $this->assertTrue($subDivs[2]->hasLink('some deep url')); - $this->assertFalse($subDivs[2]->hasLink('come deep url')); - $subUrl = $subDivs[2]->findLink('some deep url'); - $this->assertNotNull($subUrl); - - $this->assertRegExp('/some_url$/', $subUrl->getAttribute('href')); - $this->assertEquals('some deep url', $subUrl->getText()); - $this->assertEquals('some deep url', $subUrl->getHtml()); - - $this->assertTrue($subUrl->has('css', 'strong')); - $this->assertFalse($subUrl->has('css', 'em')); - $this->assertEquals('deep', $subUrl->find('css', 'strong')->getText()); - } - - public function testFindingChild() - { - $this->getSession()->visit($this->pathTo('/index.html')); - - $form = $this->getSession()->getPage()->find('css', 'footer form'); - $this->assertNotNull($form); - - $this->assertCount(1, $form->findAll('css', 'input'), 'Elements are searched only in the element, not in all previous matches'); - } -} diff --git a/core/vendor/behat/mink/driver-testsuite/tests/Basic/VisibilityTest.php b/core/vendor/behat/mink/driver-testsuite/tests/Basic/VisibilityTest.php deleted file mode 100644 index b3daf31..0000000 --- a/core/vendor/behat/mink/driver-testsuite/tests/Basic/VisibilityTest.php +++ /dev/null @@ -1,20 +0,0 @@ -getSession()->visit($this->pathTo('/js_test.html')); - $webAssert = $this->getAssertSession(); - - $clicker = $webAssert->elementExists('css', '.elements div#clicker'); - $invisible = $webAssert->elementExists('css', '#invisible'); - - $this->assertFalse($invisible->isVisible()); - $this->assertTrue($clicker->isVisible()); - } -} diff --git a/core/vendor/behat/mink/driver-testsuite/tests/Css/HoverTest.php b/core/vendor/behat/mink/driver-testsuite/tests/Css/HoverTest.php deleted file mode 100644 index 87041d4..0000000 --- a/core/vendor/behat/mink/driver-testsuite/tests/Css/HoverTest.php +++ /dev/null @@ -1,76 +0,0 @@ -getSession()->visit($this->pathTo('/css_mouse_events.html')); - - $this->findById('reset-square')->mouseOver(); - $this->assertActionSquareHeight(100); - - $this->findById('action-square')->mouseOver(); - $this->assertActionSquareHeight(200); - } - - /** - * @group mouse-events - * @depends testMouseOverHover - */ - public function testClickHover() - { - $this->getSession()->visit($this->pathTo('/css_mouse_events.html')); - - $this->findById('reset-square')->mouseOver(); - $this->assertActionSquareHeight(100); - - $this->findById('action-square')->click(); - $this->assertActionSquareHeight(200); - } - - /** - * @group mouse-events - * @depends testMouseOverHover - */ - public function testDoubleClickHover() - { - $this->getSession()->visit($this->pathTo('/css_mouse_events.html')); - - $this->findById('reset-square')->mouseOver(); - $this->assertActionSquareHeight(100); - - $this->findById('action-square')->doubleClick(); - $this->assertActionSquareHeight(200); - } - - /** - * @group mouse-events - * @depends testMouseOverHover - */ - public function testRightClickHover() - { - $this->getSession()->visit($this->pathTo('/css_mouse_events.html')); - - $this->findById('reset-square')->mouseOver(); - $this->assertActionSquareHeight(100); - - $this->findById('action-square')->rightClick(); - $this->assertActionSquareHeight(200); - } - - private function assertActionSquareHeight($expected) - { - $this->assertEquals( - $expected, - $this->getSession()->evaluateScript("return window.$('#action-square').height();"), - 'Mouse is located over the object when mouse-related action is performed' - ); - } -} diff --git a/core/vendor/behat/mink/driver-testsuite/tests/Form/CheckboxTest.php b/core/vendor/behat/mink/driver-testsuite/tests/Form/CheckboxTest.php deleted file mode 100644 index e1ce4ab..0000000 --- a/core/vendor/behat/mink/driver-testsuite/tests/Form/CheckboxTest.php +++ /dev/null @@ -1,73 +0,0 @@ -getSession()->visit($this->pathTo('advanced_form.html')); - - $checkbox = $this->getAssertSession()->fieldExists('agreement'); - - $this->assertNull($checkbox->getValue()); - $this->assertFalse($checkbox->isChecked()); - - $checkbox->check(); - - $this->assertEquals('yes', $checkbox->getValue()); - $this->assertTrue($checkbox->isChecked()); - - $checkbox->uncheck(); - - $this->assertNull($checkbox->getValue()); - $this->assertFalse($checkbox->isChecked()); - } - - public function testSetValue() - { - $this->getSession()->visit($this->pathTo('advanced_form.html')); - - $checkbox = $this->getAssertSession()->fieldExists('agreement'); - - $this->assertNull($checkbox->getValue()); - $this->assertFalse($checkbox->isChecked()); - - $checkbox->setValue(true); - - $this->assertEquals('yes', $checkbox->getValue()); - $this->assertTrue($checkbox->isChecked()); - - $checkbox->setValue(false); - - $this->assertNull($checkbox->getValue()); - $this->assertFalse($checkbox->isChecked()); - } - - public function testCheckboxMultiple() - { - $this->getSession()->visit($this->pathTo('/multicheckbox_form.html')); - $webAssert = $this->getAssertSession(); - - $this->assertEquals('Multicheckbox Test', $webAssert->elementExists('css', 'h1')->getText()); - - $updateMail = $webAssert->elementExists('css', '[name="mail_types[]"][value="update"]'); - $spamMail = $webAssert->elementExists('css', '[name="mail_types[]"][value="spam"]'); - - $this->assertEquals('update', $updateMail->getValue()); - $this->assertNull($spamMail->getValue()); - - $this->assertTrue($updateMail->isChecked()); - $this->assertFalse($spamMail->isChecked()); - - $updateMail->uncheck(); - $this->assertFalse($updateMail->isChecked()); - $this->assertFalse($spamMail->isChecked()); - - $spamMail->check(); - $this->assertFalse($updateMail->isChecked()); - $this->assertTrue($spamMail->isChecked()); - } -} diff --git a/core/vendor/behat/mink/driver-testsuite/tests/Form/GeneralTest.php b/core/vendor/behat/mink/driver-testsuite/tests/Form/GeneralTest.php deleted file mode 100644 index f15f266..0000000 --- a/core/vendor/behat/mink/driver-testsuite/tests/Form/GeneralTest.php +++ /dev/null @@ -1,312 +0,0 @@ -getSession(); - - $session->visit($this->pathTo('/issue212.html')); - - $field = $this->findById('poney-button'); - $this->assertEquals('poney', $field->getValue()); - } - - public function testBasicForm() - { - $this->getSession()->visit($this->pathTo('/basic_form.html')); - - $webAssert = $this->getAssertSession(); - $page = $this->getSession()->getPage(); - $this->assertEquals('Basic Form Page', $webAssert->elementExists('css', 'h1')->getText()); - - $firstname = $webAssert->fieldExists('first_name'); - $lastname = $webAssert->fieldExists('lastn'); - - $this->assertEquals('Firstname', $firstname->getValue()); - $this->assertEquals('Lastname', $lastname->getValue()); - - $firstname->setValue('Konstantin'); - $page->fillField('last_name', 'Kudryashov'); - - $this->assertEquals('Konstantin', $firstname->getValue()); - $this->assertEquals('Kudryashov', $lastname->getValue()); - - $page->findButton('Reset')->click(); - - $this->assertEquals('Firstname', $firstname->getValue()); - $this->assertEquals('Lastname', $lastname->getValue()); - - $firstname->setValue('Konstantin'); - $page->fillField('last_name', 'Kudryashov'); - - $page->findButton('Save')->click(); - - if ($this->safePageWait(5000, 'document.getElementById("first") !== null')) { - $this->assertEquals('Anket for Konstantin', $webAssert->elementExists('css', 'h1')->getText()); - $this->assertEquals('Firstname: Konstantin', $webAssert->elementExists('css', '#first')->getText()); - $this->assertEquals('Lastname: Kudryashov', $webAssert->elementExists('css', '#last')->getText()); - } - } - - /** - * @dataProvider formSubmitWaysDataProvider - */ - public function testFormSubmitWays($submitVia) - { - $session = $this->getSession(); - $session->visit($this->pathTo('/basic_form.html')); - $page = $session->getPage(); - $webAssert = $this->getAssertSession(); - - $firstname = $webAssert->fieldExists('first_name'); - $firstname->setValue('Konstantin'); - - $page->findButton($submitVia)->click(); - - if ($this->safePageWait(5000, 'document.getElementById("first") !== null')) { - $this->assertEquals('Firstname: Konstantin', $webAssert->elementExists('css', '#first')->getText()); - } else { - $this->fail('Form was never submitted'); - } - } - - public function formSubmitWaysDataProvider() - { - return array( - array('Save'), - array('input-type-image'), - array('button-without-type'), - array('button-type-submit'), - ); - } - - public function testFormSubmit() - { - $session = $this->getSession(); - $session->visit($this->pathTo('/basic_form.html')); - - $webAssert = $this->getAssertSession(); - $webAssert->fieldExists('first_name')->setValue('Konstantin'); - - $webAssert->elementExists('xpath', 'descendant-or-self::form[1]')->submit(); - - if ($this->safePageWait(5000, 'document.getElementById("first") !== null')) { - $this->assertEquals('Firstname: Konstantin', $webAssert->elementExists('css', '#first')->getText()); - }; - } - - public function testFormSubmitWithoutButton() - { - $session = $this->getSession(); - $session->visit($this->pathTo('/form_without_button.html')); - - $webAssert = $this->getAssertSession(); - $webAssert->fieldExists('first_name')->setValue('Konstantin'); - - $webAssert->elementExists('xpath', 'descendant-or-self::form[1]')->submit(); - - if ($this->safePageWait(5000, 'document.getElementById("first") !== null')) { - $this->assertEquals('Firstname: Konstantin', $webAssert->elementExists('css', '#first')->getText()); - }; - } - - public function testBasicGetForm() - { - $this->getSession()->visit($this->pathTo('/basic_get_form.php')); - $webAssert = $this->getAssertSession(); - - $page = $this->getSession()->getPage(); - $this->assertEquals('Basic Get Form Page', $webAssert->elementExists('css', 'h1')->getText()); - - $search = $webAssert->fieldExists('q'); - $search->setValue('some#query'); - $page->pressButton('Find'); - - $div = $webAssert->elementExists('css', 'div'); - $this->assertEquals('some#query', $div->getText()); - } - - public function testAdvancedForm() - { - $this->getSession()->visit($this->pathTo('/advanced_form.html')); - $page = $this->getSession()->getPage(); - - $page->fillField('first_name', 'ever'); - $page->fillField('last_name', 'zet'); - - $page->pressButton('Register'); - - $this->assertContains('no file', $page->getContent()); - - $this->getSession()->visit($this->pathTo('/advanced_form.html')); - - $webAssert = $this->getAssertSession(); - $page = $this->getSession()->getPage(); - $this->assertEquals('ADvanced Form Page', $webAssert->elementExists('css', 'h1')->getText()); - - $firstname = $webAssert->fieldExists('first_name'); - $lastname = $webAssert->fieldExists('lastn'); - $email = $webAssert->fieldExists('Your email:'); - $select = $webAssert->fieldExists('select_number'); - $sex = $webAssert->fieldExists('sex'); - $maillist = $webAssert->fieldExists('mail_list'); - $agreement = $webAssert->fieldExists('agreement'); - $notes = $webAssert->fieldExists('notes'); - $about = $webAssert->fieldExists('about'); - - $this->assertEquals('Firstname', $firstname->getValue()); - $this->assertEquals('Lastname', $lastname->getValue()); - $this->assertEquals('your@email.com', $email->getValue()); - $this->assertEquals('20', $select->getValue()); - $this->assertEquals('w', $sex->getValue()); - $this->assertEquals('original notes', $notes->getValue()); - - $this->assertEquals('on', $maillist->getValue()); - $this->assertNull($agreement->getValue()); - - $this->assertTrue($maillist->isChecked()); - $this->assertFalse($agreement->isChecked()); - - $agreement->check(); - $this->assertTrue($agreement->isChecked()); - - $maillist->uncheck(); - $this->assertFalse($maillist->isChecked()); - - $select->selectOption('thirty'); - $this->assertEquals('30', $select->getValue()); - - $sex->selectOption('m'); - $this->assertEquals('m', $sex->getValue()); - - $notes->setValue('new notes'); - $this->assertEquals('new notes', $notes->getValue()); - - $about->attachFile($this->mapRemoteFilePath(__DIR__.'/../../web-fixtures/some_file.txt')); - - $button = $page->findButton('Register'); - $this->assertNotNull($button); - - $page->fillField('first_name', 'Foo "item"'); - $page->fillField('last_name', 'Bar'); - $page->fillField('Your email:', 'ever.zet@gmail.com'); - - $this->assertEquals('Foo "item"', $firstname->getValue()); - $this->assertEquals('Bar', $lastname->getValue()); - - $button->press(); - - if ($this->safePageWait(5000, 'document.getElementsByTagName("title") !== null')) { - $out = <<assertContains($out, $page->getContent()); - } - } - - public function testMultiInput() - { - $this->getSession()->visit($this->pathTo('/multi_input_form.html')); - $page = $this->getSession()->getPage(); - $webAssert = $this->getAssertSession(); - $this->assertEquals('Multi input Test', $webAssert->elementExists('css', 'h1')->getText()); - - $first = $webAssert->fieldExists('First'); - $second = $webAssert->fieldExists('Second'); - $third = $webAssert->fieldExists('Third'); - - $this->assertEquals('tag1', $first->getValue()); - $this->assertSame('tag2', $second->getValue()); - $this->assertEquals('tag1', $third->getValue()); - - $first->setValue('tag2'); - $this->assertEquals('tag2', $first->getValue()); - $this->assertSame('tag2', $second->getValue()); - $this->assertEquals('tag1', $third->getValue()); - - $second->setValue('one'); - - $this->assertEquals('tag2', $first->getValue()); - $this->assertSame('one', $second->getValue()); - - $third->setValue('tag3'); - - $this->assertEquals('tag2', $first->getValue()); - $this->assertSame('one', $second->getValue()); - $this->assertEquals('tag3', $third->getValue()); - - $button = $page->findButton('Register'); - $this->assertNotNull($button); - $button->press(); - - $space = ' '; - $out = <<assertContains($out, $page->getContent()); - } - - public function testAdvancedFormSecondSubmit() - { - $this->getSession()->visit($this->pathTo('/advanced_form.html')); - $page = $this->getSession()->getPage(); - - $button = $page->findButton('Login'); - $this->assertNotNull($button); - $button->press(); - - $toSearch = array( - "'agreement' = 'off',", - "'submit' = 'Login',", - 'no file', - ); - - $pageContent = $page->getContent(); - - foreach ($toSearch as $searchString) { - $this->assertContains($searchString, $pageContent); - } - } - - public function testSubmitEmptyTextarea() - { - $this->getSession()->visit($this->pathTo('/empty_textarea.html')); - $page = $this->getSession()->getPage(); - - $page->pressButton('Save'); - - $toSearch = array( - "'textarea' = '',", - "'submit' = 'Save',", - 'no file', - ); - - $pageContent = $page->getContent(); - - foreach ($toSearch as $searchString) { - $this->assertContains($searchString, $pageContent); - } - } -} diff --git a/core/vendor/behat/mink/driver-testsuite/tests/Form/Html5Test.php b/core/vendor/behat/mink/driver-testsuite/tests/Form/Html5Test.php deleted file mode 100644 index b7f4716..0000000 --- a/core/vendor/behat/mink/driver-testsuite/tests/Form/Html5Test.php +++ /dev/null @@ -1,128 +0,0 @@ -getSession()->visit($this->pathTo('/html5_form.html')); - $page = $this->getSession()->getPage(); - $webAssert = $this->getAssertSession(); - - $firstName = $webAssert->fieldExists('first_name'); - $lastName = $webAssert->fieldExists('last_name'); - - $this->assertEquals('not set', $lastName->getValue()); - $firstName->setValue('John'); - $lastName->setValue('Doe'); - - $this->assertEquals('Doe', $lastName->getValue()); - - $page->pressButton('Submit in form'); - - if ($this->safePageWait(5000, 'document.getElementsByTagName("title") !== null')) { - $out = <<assertContains($out, $page->getContent()); - $this->assertNotContains('other_field', $page->getContent()); - } - } - - public function testHtml5FormRadioAttribute() - { - $this->getSession()->visit($this->pathTo('html5_radio.html')); - $page = $this->getSession()->getPage(); - - $radio = $this->findById('sex_f'); - $otherRadio = $this->findById('sex_invalid'); - - $this->assertEquals('f', $radio->getValue()); - $this->assertEquals('invalid', $otherRadio->getValue()); - - $radio->selectOption('m'); - - $this->assertEquals('m', $radio->getValue()); - $this->assertEquals('invalid', $otherRadio->getValue()); - - $page->pressButton('Submit in form'); - - $out = <<assertContains($out, $page->getContent()); - } - - public function testHtml5FormButtonAttribute() - { - $this->getSession()->visit($this->pathTo('/html5_form.html')); - $page = $this->getSession()->getPage(); - $webAssert = $this->getAssertSession(); - - $firstName = $webAssert->fieldExists('first_name'); - $lastName = $webAssert->fieldExists('last_name'); - - $firstName->setValue('John'); - $lastName->setValue('Doe'); - - $page->pressButton('Submit outside form'); - - if ($this->safePageWait(5000, 'document.getElementsByTagName("title") !== null')) { - $out = <<assertContains($out, $page->getContent()); - } - } - - public function testHtml5FormOutside() - { - $this->getSession()->visit($this->pathTo('/html5_form.html')); - $page = $this->getSession()->getPage(); - - $page->fillField('other_field', 'hello'); - - $page->pressButton('Submit separate form'); - - if ($this->safePageWait(5000, 'document.getElementsByTagName("title") !== null')) { - $out = <<assertContains($out, $page->getContent()); - $this->assertNotContains('first_name', $page->getContent()); - } - } - - public function testHtml5Types() - { - $this->getSession()->visit($this->pathTo('html5_types.html')); - $page = $this->getSession()->getPage(); - - $page->fillField('url', 'http://mink.behat.org/'); - $page->fillField('email', 'mink@example.org'); - $page->fillField('number', '6'); - $page->fillField('search', 'mink'); - $page->fillField('date', '2014-05-19'); - $page->fillField('color', '#ff00aa'); - - $page->pressButton('Submit'); - - $out = <<assertContains($out, $page->getContent()); - } -} diff --git a/core/vendor/behat/mink/driver-testsuite/tests/Form/RadioTest.php b/core/vendor/behat/mink/driver-testsuite/tests/Form/RadioTest.php deleted file mode 100644 index b21ab7d..0000000 --- a/core/vendor/behat/mink/driver-testsuite/tests/Form/RadioTest.php +++ /dev/null @@ -1,84 +0,0 @@ -getSession()->visit($this->pathTo('radio.html')); - } - - public function testIsChecked() - { - $option = $this->findById('first'); - $option2 = $this->findById('second'); - - $this->assertTrue($option->isChecked()); - $this->assertFalse($option2->isChecked()); - - $option2->selectOption('updated'); - - $this->assertFalse($option->isChecked()); - $this->assertTrue($option2->isChecked()); - } - - public function testSelectOption() - { - $option = $this->findById('first'); - - $this->assertEquals('set', $option->getValue()); - - $option->selectOption('updated'); - - $this->assertEquals('updated', $option->getValue()); - - $option->selectOption('set'); - - $this->assertEquals('set', $option->getValue()); - } - - public function testSetValue() - { - $option = $this->findById('first'); - - $this->assertEquals('set', $option->getValue()); - - $option->setValue('updated'); - - $this->assertEquals('updated', $option->getValue()); - $this->assertFalse($option->isChecked()); - } - - public function testSameNameInMultipleForms() - { - $option1 = $this->findById('reused_form1'); - $option2 = $this->findById('reused_form2'); - - $this->assertEquals('test2', $option1->getValue()); - $this->assertEquals('test3', $option2->getValue()); - - $option1->selectOption('test'); - - $this->assertEquals('test', $option1->getValue()); - $this->assertEquals('test3', $option2->getValue()); - } - - /** - * @see https://github.com/Behat/MinkSahiDriver/issues/32 - */ - public function testSetValueXPathEscaping() - { - $session = $this->getSession(); - $session->visit($this->pathTo('/advanced_form.html')); - $page = $session->getPage(); - - $sex = $page->find('xpath', '//*[@name = "sex"]'."\n|\n".'//*[@id = "sex"]'); - $this->assertNotNull($sex, 'xpath with line ending works'); - - $sex->setValue('m'); - $this->assertEquals('m', $sex->getValue(), 'no double xpath escaping during radio button value change'); - } -} diff --git a/core/vendor/behat/mink/driver-testsuite/tests/Form/SelectTest.php b/core/vendor/behat/mink/driver-testsuite/tests/Form/SelectTest.php deleted file mode 100644 index 492625a..0000000 --- a/core/vendor/behat/mink/driver-testsuite/tests/Form/SelectTest.php +++ /dev/null @@ -1,135 +0,0 @@ -getSession()->visit($this->pathTo('/multiselect_form.html')); - $webAssert = $this->getAssertSession(); - $page = $this->getSession()->getPage(); - $this->assertEquals('Multiselect Test', $webAssert->elementExists('css', 'h1')->getText()); - - $select = $webAssert->fieldExists('select_number'); - $multiSelect = $webAssert->fieldExists('select_multiple_numbers[]'); - $secondMultiSelect = $webAssert->fieldExists('select_multiple_values[]'); - - $this->assertEquals('20', $select->getValue()); - $this->assertSame(array(), $multiSelect->getValue()); - $this->assertSame(array('2', '3'), $secondMultiSelect->getValue()); - - $select->selectOption('thirty'); - $this->assertEquals('30', $select->getValue()); - - $multiSelect->selectOption('one', true); - - $this->assertSame(array('1'), $multiSelect->getValue()); - - $multiSelect->selectOption('three', true); - - $this->assertEquals(array('1', '3'), $multiSelect->getValue()); - - $secondMultiSelect->selectOption('two'); - $this->assertSame(array('2'), $secondMultiSelect->getValue()); - - $button = $page->findButton('Register'); - $this->assertNotNull($button); - $button->press(); - - $space = ' '; - $out = <<assertContains($out, $page->getContent()); - } - - /** - * @dataProvider testElementSelectedStateCheckDataProvider - */ - public function testElementSelectedStateCheck($selectName, $optionValue, $optionText) - { - $session = $this->getSession(); - $webAssert = $this->getAssertSession(); - $session->visit($this->pathTo('/multiselect_form.html')); - $select = $webAssert->fieldExists($selectName); - - $optionValueEscaped = $session->getSelectorsHandler()->xpathLiteral($optionValue); - $option = $webAssert->elementExists('named', array('option', $optionValueEscaped)); - - $this->assertFalse($option->isSelected()); - $select->selectOption($optionText); - $this->assertTrue($option->isSelected()); - } - - public function testElementSelectedStateCheckDataProvider() - { - return array( - array('select_number', '30', 'thirty'), - array('select_multiple_numbers[]', '2', 'two'), - ); - } - - public function testSetValueSingleSelect() - { - $session = $this->getSession(); - $session->visit($this->pathTo('/multiselect_form.html')); - $select = $this->getAssertSession()->fieldExists('select_number'); - - $select->setValue('10'); - $this->assertEquals('10', $select->getValue()); - } - - public function testSetValueMultiSelect() - { - $session = $this->getSession(); - $session->visit($this->pathTo('/multiselect_form.html')); - $select = $this->getAssertSession()->fieldExists('select_multiple_values[]'); - - $select->setValue(array('1', '2')); - $this->assertEquals(array('1', '2'), $select->getValue()); - } - - /** - * @see https://github.com/Behat/Mink/issues/193 - */ - public function testOptionWithoutValue() - { - $session = $this->getSession(); - $session->visit($this->pathTo('/issue193.html')); - - $session->getPage()->selectFieldOption('options-without-values', 'Two'); - $this->assertEquals('Two', $this->findById('options-without-values')->getValue()); - - $this->assertTrue($this->findById('two')->isSelected()); - $this->assertFalse($this->findById('one')->isSelected()); - - $session->getPage()->selectFieldOption('options-with-values', 'two'); - $this->assertEquals('two', $this->findById('options-with-values')->getValue()); - } - - /** - * @see https://github.com/Behat/Mink/issues/131 - */ - public function testAccentuatedOption() - { - $this->getSession()->visit($this->pathTo('/issue131.html')); - $page = $this->getSession()->getPage(); - - $page->selectFieldOption('foobar', 'Gimme some accentués characters'); - - $this->assertEquals('1', $page->findField('foobar')->getValue()); - } -} diff --git a/core/vendor/behat/mink/driver-testsuite/tests/Js/ChangeEventTest.php b/core/vendor/behat/mink/driver-testsuite/tests/Js/ChangeEventTest.php deleted file mode 100644 index d1fd3f1..0000000 --- a/core/vendor/behat/mink/driver-testsuite/tests/Js/ChangeEventTest.php +++ /dev/null @@ -1,152 +0,0 @@ - in a - - - - - - - - - - - - - - - - - - - diff --git a/core/vendor/behat/mink/driver-testsuite/web-fixtures/advanced_form_post.php b/core/vendor/behat/mink/driver-testsuite/web-fixtures/advanced_form_post.php deleted file mode 100644 index 755806d..0000000 --- a/core/vendor/behat/mink/driver-testsuite/web-fixtures/advanced_form_post.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - Advanced form save - - - -', '', var_export($_POST, true)) . "\n"; -if (isset($_FILES['about']) && file_exists($_FILES['about']['tmp_name'])) { - echo $_FILES['about']['name'] . "\n"; - echo file_get_contents($_FILES['about']['tmp_name']); -} else { - echo "no file"; -} -?> - - diff --git a/core/vendor/behat/mink/driver-testsuite/web-fixtures/aria_roles.html b/core/vendor/behat/mink/driver-testsuite/web-fixtures/aria_roles.html deleted file mode 100644 index 7074e85..0000000 --- a/core/vendor/behat/mink/driver-testsuite/web-fixtures/aria_roles.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - ARIA roles test - - - - This page tests selected ARIA roles
- (see http://www.w3.org/TR/wai-aria/) - -
Toggle
- - - - - - - - - diff --git a/core/vendor/behat/mink/driver-testsuite/web-fixtures/basic_auth.php b/core/vendor/behat/mink/driver-testsuite/web-fixtures/basic_auth.php deleted file mode 100644 index 9620a0e..0000000 --- a/core/vendor/behat/mink/driver-testsuite/web-fixtures/basic_auth.php +++ /dev/null @@ -1,12 +0,0 @@ - - - - Basic Form - - - -

Basic Form Page

- -
- - - - - - - - - -
- - diff --git a/core/vendor/behat/mink/driver-testsuite/web-fixtures/basic_form_post.php b/core/vendor/behat/mink/driver-testsuite/web-fixtures/basic_form_post.php deleted file mode 100644 index 8a5e340..0000000 --- a/core/vendor/behat/mink/driver-testsuite/web-fixtures/basic_form_post.php +++ /dev/null @@ -1,13 +0,0 @@ - - - - Basic Form Saving - - - -

Anket for

- - Firstname: - Lastname: - - diff --git a/core/vendor/behat/mink/driver-testsuite/web-fixtures/basic_get_form.php b/core/vendor/behat/mink/driver-testsuite/web-fixtures/basic_get_form.php deleted file mode 100644 index a0b3516..0000000 --- a/core/vendor/behat/mink/driver-testsuite/web-fixtures/basic_get_form.php +++ /dev/null @@ -1,20 +0,0 @@ - - - - Basic Get Form - - - -

Basic Get Form Page

- -
- -
- -
- - - -
- - diff --git a/core/vendor/behat/mink/driver-testsuite/web-fixtures/cookie_page1.php b/core/vendor/behat/mink/driver-testsuite/web-fixtures/cookie_page1.php deleted file mode 100644 index 7f128ca..0000000 --- a/core/vendor/behat/mink/driver-testsuite/web-fixtures/cookie_page1.php +++ /dev/null @@ -1,21 +0,0 @@ - - - - - Basic Form - - - - Basic Page With Cookie Set from Server Side - - diff --git a/core/vendor/behat/mink/driver-testsuite/web-fixtures/cookie_page2.php b/core/vendor/behat/mink/driver-testsuite/web-fixtures/cookie_page2.php deleted file mode 100644 index 22bcd1b..0000000 --- a/core/vendor/behat/mink/driver-testsuite/web-fixtures/cookie_page2.php +++ /dev/null @@ -1,10 +0,0 @@ - - - - Basic Form - - - - Previous cookie: - - diff --git a/core/vendor/behat/mink/driver-testsuite/web-fixtures/cookie_page3.php b/core/vendor/behat/mink/driver-testsuite/web-fixtures/cookie_page3.php deleted file mode 100644 index caa28bc..0000000 --- a/core/vendor/behat/mink/driver-testsuite/web-fixtures/cookie_page3.php +++ /dev/null @@ -1,16 +0,0 @@ - - - - - HttpOnly Cookie Test - - - - - - diff --git a/core/vendor/behat/mink/driver-testsuite/web-fixtures/css_mouse_events.html b/core/vendor/behat/mink/driver-testsuite/web-fixtures/css_mouse_events.html deleted file mode 100644 index 750ca54..0000000 --- a/core/vendor/behat/mink/driver-testsuite/web-fixtures/css_mouse_events.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - CSS Mouse Events Testing - - - - - - -
-
reset
-
mouse action
-
- - - diff --git a/core/vendor/behat/mink/driver-testsuite/web-fixtures/element_change_detector.html b/core/vendor/behat/mink/driver-testsuite/web-fixtures/element_change_detector.html deleted file mode 100644 index af3032a..0000000 --- a/core/vendor/behat/mink/driver-testsuite/web-fixtures/element_change_detector.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - ADvanced Form - - - - -

ADvanced Form Page

- -
- - - - - - - - - - - - - - -
- -
    -
  • for easy element location
  • -
- - - - diff --git a/core/vendor/behat/mink/driver-testsuite/web-fixtures/empty_textarea.html b/core/vendor/behat/mink/driver-testsuite/web-fixtures/empty_textarea.html deleted file mode 100644 index f0779ee..0000000 --- a/core/vendor/behat/mink/driver-testsuite/web-fixtures/empty_textarea.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - Empty textarea submission - - - -

Empty textarea submission

-
- - -
- - diff --git a/core/vendor/behat/mink/driver-testsuite/web-fixtures/form_without_button.html b/core/vendor/behat/mink/driver-testsuite/web-fixtures/form_without_button.html deleted file mode 100644 index 8063026..0000000 --- a/core/vendor/behat/mink/driver-testsuite/web-fixtures/form_without_button.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - Form submission without button test - - -
- - -
- - diff --git a/core/vendor/behat/mink/driver-testsuite/web-fixtures/headers.php b/core/vendor/behat/mink/driver-testsuite/web-fixtures/headers.php deleted file mode 100644 index 25d9b90..0000000 --- a/core/vendor/behat/mink/driver-testsuite/web-fixtures/headers.php +++ /dev/null @@ -1,10 +0,0 @@ - - - - Headers page - - - - - - diff --git a/core/vendor/behat/mink/driver-testsuite/web-fixtures/html5_form.html b/core/vendor/behat/mink/driver-testsuite/web-fixtures/html5_form.html deleted file mode 100644 index 9070353..0000000 --- a/core/vendor/behat/mink/driver-testsuite/web-fixtures/html5_form.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - HTML5 form attribute test - - -
- - - - -
- - -
- - diff --git a/core/vendor/behat/mink/driver-testsuite/web-fixtures/html5_radio.html b/core/vendor/behat/mink/driver-testsuite/web-fixtures/html5_radio.html deleted file mode 100644 index fd54c2d..0000000 --- a/core/vendor/behat/mink/driver-testsuite/web-fixtures/html5_radio.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - - HTML5 form attribute test - - -
- - - -
- -
- - diff --git a/core/vendor/behat/mink/driver-testsuite/web-fixtures/html5_types.html b/core/vendor/behat/mink/driver-testsuite/web-fixtures/html5_types.html deleted file mode 100644 index bd46cfa..0000000 --- a/core/vendor/behat/mink/driver-testsuite/web-fixtures/html5_types.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - HTML5 form attribute test - - -
- - - - - - - -
- - diff --git a/core/vendor/behat/mink/driver-testsuite/web-fixtures/html_decoding.html b/core/vendor/behat/mink/driver-testsuite/web-fixtures/html_decoding.html deleted file mode 100644 index 341f226..0000000 --- a/core/vendor/behat/mink/driver-testsuite/web-fixtures/html_decoding.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - HTML Decoding Test - - -
- some text - -
- - - -
-
- - diff --git a/core/vendor/behat/mink/driver-testsuite/web-fixtures/iframe.html b/core/vendor/behat/mink/driver-testsuite/web-fixtures/iframe.html deleted file mode 100644 index c54797f..0000000 --- a/core/vendor/behat/mink/driver-testsuite/web-fixtures/iframe.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - -
- Main window div text -
- - - diff --git a/core/vendor/behat/mink/driver-testsuite/web-fixtures/iframe_inner.html b/core/vendor/behat/mink/driver-testsuite/web-fixtures/iframe_inner.html deleted file mode 100644 index 512f058..0000000 --- a/core/vendor/behat/mink/driver-testsuite/web-fixtures/iframe_inner.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - -
- iFrame div text -
- - - diff --git a/core/vendor/behat/mink/driver-testsuite/web-fixtures/index.html b/core/vendor/behat/mink/driver-testsuite/web-fixtures/index.html deleted file mode 100644 index 6bb379c..0000000 --- a/core/vendor/behat/mink/driver-testsuite/web-fixtures/index.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - Index page - - - -

Extremely useless page

-
- Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. - -
- some
very -
-interesting text -
- -
- - - - -
- -
-
el1
-
el2
- -
- -
el4
- -
- -
-
- -
-
-
- -
- -
-
- - diff --git a/core/vendor/behat/mink/driver-testsuite/web-fixtures/issue130.php b/core/vendor/behat/mink/driver-testsuite/web-fixtures/issue130.php deleted file mode 100644 index 201d982..0000000 --- a/core/vendor/behat/mink/driver-testsuite/web-fixtures/issue130.php +++ /dev/null @@ -1,11 +0,0 @@ - - - - Go to 2'; - } else { - echo ''.$_SERVER['HTTP_REFERER'].''; - } - ?> - diff --git a/core/vendor/behat/mink/driver-testsuite/web-fixtures/issue131.html b/core/vendor/behat/mink/driver-testsuite/web-fixtures/issue131.html deleted file mode 100644 index fa3427a..0000000 --- a/core/vendor/behat/mink/driver-testsuite/web-fixtures/issue131.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - Issue 131 - - - -

There is a non breaking space

-
Some accentués characters
-
- - -
- - diff --git a/core/vendor/behat/mink/driver-testsuite/web-fixtures/issue140.php b/core/vendor/behat/mink/driver-testsuite/web-fixtures/issue140.php deleted file mode 100644 index 04a4caf..0000000 --- a/core/vendor/behat/mink/driver-testsuite/web-fixtures/issue140.php +++ /dev/null @@ -1,16 +0,0 @@ - - - - -
- - -
- diff --git a/core/vendor/behat/mink/driver-testsuite/web-fixtures/issue178.html b/core/vendor/behat/mink/driver-testsuite/web-fixtures/issue178.html deleted file mode 100644 index 3efc743..0000000 --- a/core/vendor/behat/mink/driver-testsuite/web-fixtures/issue178.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - - Index page - - - -
-
- -
-
- -
- - - \ No newline at end of file diff --git a/core/vendor/behat/mink/driver-testsuite/web-fixtures/issue193.html b/core/vendor/behat/mink/driver-testsuite/web-fixtures/issue193.html deleted file mode 100644 index e722a43..0000000 --- a/core/vendor/behat/mink/driver-testsuite/web-fixtures/issue193.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - Index page - - - - -
- - - -
- - - diff --git a/core/vendor/behat/mink/driver-testsuite/web-fixtures/issue211.html b/core/vendor/behat/mink/driver-testsuite/web-fixtures/issue211.html deleted file mode 100644 index bb977ec..0000000 --- a/core/vendor/behat/mink/driver-testsuite/web-fixtures/issue211.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - Index page - - - - -
-

- - -

-

- - -

- - -
- - - diff --git a/core/vendor/behat/mink/driver-testsuite/web-fixtures/issue212.html b/core/vendor/behat/mink/driver-testsuite/web-fixtures/issue212.html deleted file mode 100644 index 24ae62f..0000000 --- a/core/vendor/behat/mink/driver-testsuite/web-fixtures/issue212.html +++ /dev/null @@ -1,9 +0,0 @@ - - - -
- - -
- - diff --git a/core/vendor/behat/mink/driver-testsuite/web-fixtures/issue215.html b/core/vendor/behat/mink/driver-testsuite/web-fixtures/issue215.html deleted file mode 100644 index adff3fb..0000000 --- a/core/vendor/behat/mink/driver-testsuite/web-fixtures/issue215.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - Index page - - - -
- -
- - - \ No newline at end of file diff --git a/core/vendor/behat/mink/driver-testsuite/web-fixtures/issue225.html b/core/vendor/behat/mink/driver-testsuite/web-fixtures/issue225.html deleted file mode 100644 index 2178bba..0000000 --- a/core/vendor/behat/mink/driver-testsuite/web-fixtures/issue225.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - Index page - - - - - - - -
- - - - diff --git a/core/vendor/behat/mink/driver-testsuite/web-fixtures/issue255.html b/core/vendor/behat/mink/driver-testsuite/web-fixtures/issue255.html deleted file mode 100644 index d56a427..0000000 --- a/core/vendor/behat/mink/driver-testsuite/web-fixtures/issue255.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - Issue 255 - - - - -
- - - - -

-

-
- - - - diff --git a/core/vendor/behat/mink/driver-testsuite/web-fixtures/js/jquery-1.6.2-min.js b/core/vendor/behat/mink/driver-testsuite/web-fixtures/js/jquery-1.6.2-min.js deleted file mode 100644 index 8cdc80e..0000000 --- a/core/vendor/behat/mink/driver-testsuite/web-fixtures/js/jquery-1.6.2-min.js +++ /dev/null @@ -1,18 +0,0 @@ -/*! - * jQuery JavaScript Library v1.6.2 - * http://jquery.com/ - * - * Copyright 2011, John Resig - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * Includes Sizzle.js - * http://sizzlejs.com/ - * Copyright 2011, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * - * Date: Thu Jun 30 14:16:56 2011 -0400 - */ -(function(a,b){function cv(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cs(a){if(!cg[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ch||(ch=c.createElement("iframe"),ch.frameBorder=ch.width=ch.height=0),b.appendChild(ch);if(!ci||!ch.createElement)ci=(ch.contentWindow||ch.contentDocument).document,ci.write((c.compatMode==="CSS1Compat"?"":"")+""),ci.close();d=ci.createElement(a),ci.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ch)}cg[a]=e}return cg[a]}function cr(a,b){var c={};f.each(cm.concat.apply([],cm.slice(0,b)),function(){c[this]=a});return c}function cq(){cn=b}function cp(){setTimeout(cq,0);return cn=f.now()}function cf(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ce(){try{return new a.XMLHttpRequest}catch(b){}}function b$(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){c!=="border"&&f.each(e,function(){c||(d-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?d+=parseFloat(f.css(a,c+this))||0:d-=parseFloat(f.css(a,"border"+this+"Width"))||0});return d+"px"}d=bx(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0,c&&f.each(e,function(){d+=parseFloat(f.css(a,"padding"+this))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+this+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+this))||0)});return d+"px"}function bm(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(be,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bl(a){f.nodeName(a,"input")?bk(a):"getElementsByTagName"in a&&f.grep(a.getElementsByTagName("input"),bk)}function bk(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bj(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function bi(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bh(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c=f.expando,d=f.data(a),e=f.data(b,d);if(d=d[c]){var g=d.events;e=e[c]=f.extend({},d);if(g){delete e.handle,e.events={};for(var h in g)for(var i=0,j=g[h].length;i=0===c})}function V(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function N(a,b){return(a&&a!=="*"?a+".":"")+b.replace(z,"`").replace(A,"&")}function M(a){var b,c,d,e,g,h,i,j,k,l,m,n,o,p=[],q=[],r=f._data(this,"events");if(!(a.liveFired===this||!r||!r.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var s=r.live.slice(0);for(i=0;ic)break;a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments);if(o===!1||a.isPropagationStopped()){c=e.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function K(a,c,d){var e=f.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function E(){return!0}function D(){return!1}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);i&&(d==="queue"||!f.data(a,g,b,!0))&&(d==="mark"||!f.data(a,h,b,!0))&&setTimeout(function(){!f.data(a,g,b,!0)&&!f.data(a,h,b,!0)&&(f.removeData(a,e,!0),i.resolve())},0)}function l(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function k(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(j,"$1-$2").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d)}catch(g){}f.data(a,c,d)}else d=b}return d}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=/-([a-z])/ig,x=function(a,b){return b.toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=n.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.6.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!A){A=e._Deferred();if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNaN:function(a){return a==null||!m.test(a)||isNaN(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a);return c===b||D.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(o.test(b.replace(p,"@").replace(q,"]").replace(r,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(b,c,d){a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),d=c.documentElement,(!d||!d.nodeName||d.nodeName==="parsererror")&&e.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0))}}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred();if(d>1){for(;c
a",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=a.getElementsByTagName("input")[0],k={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55$/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,k.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,k.optDisabled=!h.disabled;try{delete a.test}catch(v){k.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function(){k.noCloneEvent=!1}),a.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),k.radioValue=i.value==="t",i.setAttribute("checked","checked"),a.appendChild(i),l=c.createDocumentFragment(),l.appendChild(a.firstChild),k.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",m=c.getElementsByTagName("body")[0],o=c.createElement(m?"div":"body"),p={visibility:"hidden",width:0,height:0,border:0,margin:0},m&&f.extend(p,{position:"absolute",left:-1e3,top:-1e3});for(t in p)o.style[t]=p[t];o.appendChild(a),n=m||b,n.insertBefore(o,n.firstChild),k.appendChecked=i.checked,k.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,k.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="
",k.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="
t
",q=a.getElementsByTagName("td"),u=q[0].offsetHeight===0,q[0].style.display="",q[1].style.display="none",k.reliableHiddenOffsets=u&&q[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",a.appendChild(j),k.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0),o.innerHTML="",n.removeChild(o);if(a.attachEvent)for(t in{submit:1,change:1,focusin:1})s="on"+t,u=s in a,u||(a.setAttribute(s,"return;"),u=typeof a[s]=="function"),k[t+"Bubbles"]=u;o=l=g=h=m=j=a=i=null;return k}(),f.boxModel=f.support.boxModel;var i=/^(?:\{.*\}|\[.*\])$/,j=/([a-z])([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!l(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g=f.expando,h=typeof c=="string",i,j=a.nodeType,k=j?f.cache:a,l=j?a[f.expando]:a[f.expando]&&f.expando;if((!l||e&&l&&!k[l][g])&&h&&d===b)return;l||(j?a[f.expando]=l=++f.uuid:l=f.expando),k[l]||(k[l]={},j||(k[l].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?k[l][g]=f.extend(k[l][g],c):k[l]=f.extend(k[l],c);i=k[l],e&&(i[g]||(i[g]={}),i=i[g]),d!==b&&(i[f.camelCase(c)]=d);if(c==="events"&&!i[c])return i[g]&&i[g].events;return h?i[f.camelCase(c)]||i[c]:i}},removeData:function(b,c,d){if(!!f.acceptData(b)){var e=f.expando,g=b.nodeType,h=g?f.cache:b,i=g?b[f.expando]:f.expando;if(!h[i])return;if(c){var j=d?h[i][e]:h[i];if(j){delete j[c];if(!l(j))return}}if(d){delete h[i][e];if(!l(h[i]))return}var k=h[i][e];f.support.deleteExpando||h!=a?delete h[i]:h[i]=null,k?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=k):g&&(f.support.deleteExpando?delete b[f.expando]:b.removeAttribute?b.removeAttribute(f.expando):b[f.expando]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d=null;if(typeof a=="undefined"){if(this.length){d=f.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,g;for(var h=0,i=e.length;h-1)return!0;return!1},val:function(a){var c,d,e=this[0];if(!arguments.length){if(e){c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type];if(c&&"get"in c&&(d=c.get(e,"value"))!==b)return d;d=e.value;return typeof d=="string"?d.replace(p,""):d==null?"":d}return b}var g=f.isFunction(a);return this.each(function(d){var e=f(this),h;if(this.nodeType===1){g?h=a.call(this,d,e.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c=a.selectedIndex,d=[],e=a.options,g=a.type==="select-one";if(c<0)return null;for(var h=g?c:0,i=g?c+1:e.length;h=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var g=a.nodeType;if(!a||g===3||g===8||g===2)return b;if(e&&c in f.attrFn)return f(a)[c](d);if(!("getAttribute"in a))return f.prop(a,c,d);var h,i,j=g!==1||!f.isXMLDoc(a);j&&(c=f.attrFix[c]||c,i=f.attrHooks[c],i||(t.test(c)?i=w:v&&c!=="className"&&(f.nodeName(a,"form")||u.test(c))&&(i=v)));if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(i&&"set"in i&&j&&(h=i.set(a,d,c))!==b)return h;a.setAttribute(c,""+d);return d}if(i&&"get"in i&&j&&(h=i.get(a,c))!==null)return h;h=a.getAttribute(c);return h===null?b:h},removeAttr:function(a,b){var c;a.nodeType===1&&(b=f.attrFix[b]||b,f.support.getSetAttribute?a.removeAttribute(b):(f.attr(a,b,""),a.removeAttributeNode(a.getAttributeNode(b))),t.test(b)&&(c=f.propFix[b]||b)in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(q.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},tabIndex:{get:function(a){var c=a.getAttributeNode("tabIndex");return c&&c.specified?parseInt(c.value,10):r.test(a.nodeName)||s.test(a.nodeName)&&a.href?0:b}},value:{get:function(a,b){if(v&&f.nodeName(a,"button"))return v.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(v&&f.nodeName(a,"button"))return v.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e=a.nodeType;if(!a||e===3||e===8||e===2)return b;var g,h,i=e!==1||!f.isXMLDoc(a);i&&(c=f.propFix[c]||c,h=f.propHooks[c]);return d!==b?h&&"set"in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get"in h&&(g=h.get(a,c))!==b?g:a[c]},propHooks:{}}),w={get:function(a,c){return f.prop(a,c)?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},f.support.getSetAttribute||(f.attrFix=f.propFix,v=f.attrHooks.name=f.attrHooks.title=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&d.nodeValue!==""?d.nodeValue:b},set:function(a,b,c){var d=a.getAttributeNode(c);if(d){d.nodeValue=b;return b}}},f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})})),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}})),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var x=/\.(.*)$/,y=/^(?:textarea|input|select)$/i,z=/\./g,A=/ /g,B=/[^\w\s.|`]/g,C=function(a){return a.replace(B,"\\$&")};f.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1)d=D;else if(!d)return;var g,h;d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);var i=f._data(a);if(!i)return;var j=i.events,k=i.handle;j||(i.events=j={}),k||(i.handle=k=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.handle.apply(k.elem,arguments):b}),k.elem=a,c=c.split(" ");var l,m=0,n;while(l=c[m++]){h=g?f.extend({},g):{handler:d,data:e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);var o=j[l],p=f.event.special[l]||{};if(!o){o=j[l]=[];if(!p.setup||p.setup.call(a,e,n,k)===!1)a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k)}p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0}a=null}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=D);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=f.hasData(a)&&f._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(h in t)f.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),C).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!d){for(j=0;j=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i. -shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!e)c.preventDefault(),c.stopPropagation();if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem)});return}if(e.nodeType===3||e.nodeType===8)return;c.result=b,c.target=e,d=d!=null?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())}catch(p){}n&&(e[l]=n),f.event.triggered=b}}return c.result}},handle:function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;h-1?f.map(a.options,function(a){return a.selected}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex);return c},J=function(c){var d=c.target,e,g;if(!!y.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=I(d),(c.type!=="focusout"||d.type!=="radio")&&f._data(d,"_change_data",g);if(e===b||g===e)return;if(e!=null||g)c.type="change",c.liveFired=b,f.event.trigger(c,arguments[1],d)}};f.event.special.change={filters:{focusout:J,beforedeactivate:J,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&J.call(this,a)},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&J.call(this,a)},beforeactivate:function(a){var b=a.target;f._data(b,"_change_data",I(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in H)f.event.add(this,c+".specialChange",H[c]);return y.test(this.nodeName)},teardown:function(a){f.event.remove(this,".specialChange");return y.test(this.nodeName)}},H=f.event.special.change.filters,H.focus=H.beforeactivate}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;if(typeof a=="object"){for(var h in a)this[c](h,d,a[h],e);return this}if(arguments.length===2||d===!1)e=d,d=b;c==="one"?(g=function(a){f(this).unbind(a,g);return e.apply(this,arguments)},g.guid=e.guid||f.guid++):g=e;if(a==="unload"&&c!=="one")this.one(a,d,e);else for(var i=0,j=this.length;i0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,f,g){f=f||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return f;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(e.call(n)==="[object Array]")if(!u)f.push.apply(f,n);else if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&f.push(j[t]);else p(n,f);o&&(k(o,h,f,g),k.uniqueSort(f));return f};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=d++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(e.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var f=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g0)for(h=g;h0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(d=0,e=a.length;d-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=T.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a||typeof a=="string")return f.inArray(this[0],a?f(a):this.parent().children());return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(V(c[0])||V(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=S.call(arguments);O.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!U[a]?f.unique(e):e,(this.length>1||Q.test(d))&&P.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var X=/ jQuery\d+="(?:\d+|null)"/g,Y=/^\s+/,Z=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,$=/<([\w:]+)/,_=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]};bf.optgroup=bf.option,bf.tbody=bf.tfoot=bf.colgroup=bf.caption=bf.thead,bf.th=bf.td,f.support.htmlSerialize||(bf._default=[1,"div
","
"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){f(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(X,""):null;if(typeof a=="string"&&!bb.test(a)&&(f.support.leadingWhitespace||!Y.test(a))&&!bf[($.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Z,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j -)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bi(a,d),e=bj(a),g=bj(d);for(h=0;e[h];++h)bi(e[h],g[h])}if(b){bh(a,d);if(c){e=bj(a),g=bj(d);for(h=0;e[h];++h)bh(e[h],g[h])}}e=g=null;return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!ba.test(k))k=b.createTextNode(k);else{k=k.replace(Z,"<$1>");var l=($.exec(k)||["",""])[1].toLowerCase(),m=bf[l]||bf._default,n=m[0],o=b.createElement("div");o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=_.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&Y.test(k)&&o.insertBefore(b.createTextNode(Y.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bo.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle;c.zoom=1;var e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";c.filter=bn.test(g)?g.replace(bn,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bx(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(by=function(a,c){var d,e,g;c=c.replace(bp,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bz=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bq.test(d)&&br.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bx=by||bz,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bB=/%20/g,bC=/\[\]$/,bD=/\r?\n/g,bE=/#.*$/,bF=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bG=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bH=/^(?:about|app|app\-storage|.+\-extension|file|widget):$/,bI=/^(?:GET|HEAD)$/,bJ=/^\/\//,bK=/\?/,bL=/)<[^<]*)*<\/script>/gi,bM=/^(?:select|textarea)/i,bN=/\s+/,bO=/([?&])_=[^&]*/,bP=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bQ=f.fn.load,bR={},bS={},bT,bU;try{bT=e.href}catch(bV){bT=c.createElement("a"),bT.href="",bT=bT.href}bU=bP.exec(bT.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bQ)return bQ.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bL,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bM.test(this.nodeName)||bG.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bD,"\r\n")}}):{name:b.name,value:c.replace(bD,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?f.extend(!0,a,f.ajaxSettings,b):(b=a,a=f.extend(!0,f.ajaxSettings,b));for(var c in{context:1,url:1})c in b?a[c]=b[c]:c in f.ajaxSettings&&(a[c]=f.ajaxSettings[c]);return a},ajaxSettings:{url:bT,isLocal:bH.test(bU[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML}},ajaxPrefilter:bW(bR),ajaxTransport:bW(bS),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a?4:0;var o,r,u,w=l?bZ(d,v,l):b,x,y;if(a>=200&&a<300||a===304){if(d.ifModified){if(x=v.getResponseHeader("Last-Modified"))f.lastModified[k]=x;if(y=v.getResponseHeader("Etag"))f.etag[k]=y}if(a===304)c="notmodified",o=!0;else try{r=b$(d,w),c="success",o=!0}catch(z){c="parsererror",u=z}}else{u=c;if(!c||a)c="error",a<0&&(a=0)}v.status=a,v.statusText=c,o?h.resolveWith(e,[r,c,v]):h.rejectWith(e,[v,c,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,c]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f._Deferred(),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bF.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.done,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bE,"").replace(bJ,bU[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bN),d.crossDomain==null&&(r=bP.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bU[1]&&r[2]==bU[2]&&(r[3]||(r[1]==="http:"?80:443))==(bU[3]||(bU[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bX(bR,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bI.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bK.test(d.url)?"&":"?")+d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bO,"$1_="+x);d.url=y+(y===d.url?(bK.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", */*; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bX(bS,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){status<2?w(-1,z):f.error(z)}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)bY(g,a[g],c,e);return d.join("&").replace(bB,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var b_=f.now(),ca=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+b_++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ca.test(b.url)||e&&ca.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ca,l),b.url===j&&(e&&(k=k.replace(ca,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cb=a.ActiveXObject?function(){for(var a in cd)cd[a](0,1)}:!1,cc=0,cd;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ce()||cf()}:ce,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cb&&delete cd[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cc,cb&&(cd||(cd={},f(a).unload(cb)),cd[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cg={},ch,ci,cj=/^(?:toggle|show|hide)$/,ck=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cl,cm=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cn,co=a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cr("show",3),a,b,c);for(var g=0,h=this.length;g=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(g in e.animatedProperties)e.animatedProperties[g]!==!0&&(c=!1);if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&f(d).hide();if(e.hide||e.show)for(var i in e.animatedProperties)f.style(d,i,e.orig[i]);e.complete.call(d)}return!1}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;b
";f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.offset.initialize(),f.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cu.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cu.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cv(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cv(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a&&a.style?parseFloat(f.css(a,d,"padding")):null},f.fn["outer"+c]=function(a){var b=this[0];return b&&b.style?parseFloat(f.css(b,d,a?"margin":"border")):null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c];return e.document.compatMode==="CSS1Compat"&&g||e.document.body["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var h=f.css(e,d),i=parseFloat(h);return f.isNaN(i)?h:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window); \ No newline at end of file diff --git a/core/vendor/behat/mink/driver-testsuite/web-fixtures/js/jquery-ui-1.8.14.custom.min.js b/core/vendor/behat/mink/driver-testsuite/web-fixtures/js/jquery-ui-1.8.14.custom.min.js deleted file mode 100644 index 1764e11..0000000 --- a/core/vendor/behat/mink/driver-testsuite/web-fixtures/js/jquery-ui-1.8.14.custom.min.js +++ /dev/null @@ -1,127 +0,0 @@ -/*! - * jQuery UI 1.8.14 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI - */ -(function(c,j){function k(a,b){var d=a.nodeName.toLowerCase();if("area"===d){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&l(a)}return(/input|select|textarea|button|object/.test(d)?!a.disabled:"a"==d?a.href||b:b)&&l(a)}function l(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.14", -keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus(); -b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this, -"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"),10);if(!isNaN(b)&&b!==0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection", -function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,m,n){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(m)g-=parseFloat(c.curCSS(f,"border"+this+"Width",true))||0;if(n)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,outerWidth:c.fn.outerWidth, -outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c(this).css(h,d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){return k(a,!isNaN(c.attr(a,"tabindex")))},tabbable:function(a){var b=c.attr(a,"tabindex"),d=isNaN(b); -return(d||b>=0)&&k(a,!d)}});c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e= -0;e0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a=9)&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a);return a.preventDefault()}if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted= -false;a.target==this._mouseDownEvent.target&&b.data(a.target,this.widgetName+".preventClickEvent",true);this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery); -;/* - * jQuery UI Draggable 1.8.14 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Draggables - * - * Depends: - * jquery.ui.core.js - * jquery.ui.mouse.js - * jquery.ui.widget.js - */ -(function(d){d.widget("ui.draggable",d.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper== -"original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(a){var b= -this.options;if(this.helper||b.disabled||d(a.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(a);if(!this.handle)return false;d(b.iframeFix===true?"iframe":b.iframeFix).each(function(){d('
').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(d(this).offset()).appendTo("body")});return true},_mouseStart:function(a){var b=this.options;this.helper= -this._createHelper(a);this._cacheHelperProportions();if(d.ui.ddmanager)d.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}); -this.originalPosition=this.position=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);b.containment&&this._setContainment();if(this._trigger("start",a)===false){this._clear();return false}this._cacheHelperProportions();d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(a,true);d.ui.ddmanager&&d.ui.ddmanager.dragStart(this,a);return true}, -_mouseDrag:function(a,b){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!b){b=this._uiHash();if(this._trigger("drag",a,b)===false){this._mouseUp({});return false}this.position=b.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);return false},_mouseStop:function(a){var b= -false;if(d.ui.ddmanager&&!this.options.dropBehaviour)b=d.ui.ddmanager.drop(this,a);if(this.dropped){b=this.dropped;this.dropped=false}if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return false;if(this.options.revert=="invalid"&&!b||this.options.revert=="valid"&&b||this.options.revert===true||d.isFunction(this.options.revert)&&this.options.revert.call(this.element,b)){var c=this;d(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration, -10),function(){c._trigger("stop",a)!==false&&c._clear()})}else this._trigger("stop",a)!==false&&this._clear();return false},_mouseUp:function(a){this.options.iframeFix===true&&d("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)});d.ui.ddmanager&&d.ui.ddmanager.dragStop(this,a);return d.ui.mouse.prototype._mouseUp.call(this,a)},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(a){var b=!this.options.handle|| -!d(this.options.handle,this.element).length?true:false;d(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==a.target)b=true});return b},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a])):b.helper=="clone"?this.element.clone().removeAttr("id"):this.element;a.parents("body").length||a.appendTo(b.appendTo=="parent"?this.element[0].parentNode:b.appendTo);a[0]!=this.element[0]&&!/(fixed|absolute)/.test(a.css("position"))&& -a.css("position","absolute");return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]||0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent= -this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"), -10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"), -10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment=="parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[a.containment=="document"?0:d(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,a.containment=="document"?0:d(window).scrollTop()-this.offset.relative.top-this.offset.parent.top, -(a.containment=="document"?0:d(window).scrollLeft())+d(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a.containment=="document"?0:d(window).scrollTop())+(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)&&a.containment.constructor!=Array){a=d(a.containment);var b=a[0];if(b){a.offset();var c=d(b).css("overflow")!= -"hidden";this.containment=[(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0),(parseInt(d(b).css("borderTopWidth"),10)||0)+(parseInt(d(b).css("paddingTop"),10)||0),(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"), -10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom];this.relative_container=a}}else if(a.containment.constructor==Array)this.containment=a.containment},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName);return{top:b.top+ -this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&& -!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName),e=a.pageX,h=a.pageY;if(this.originalPosition){var g;if(this.containment){if(this.relative_container){g=this.relative_container.offset();g=[this.containment[0]+g.left,this.containment[1]+g.top,this.containment[2]+g.left,this.containment[3]+g.top]}else g=this.containment;if(a.pageX-this.offset.click.leftg[2])e=g[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>g[3])h=g[3]+this.offset.click.top}if(b.grid){h=b.grid[1]?this.originalPageY+Math.round((h-this.originalPageY)/b.grid[1])*b.grid[1]:this.originalPageY;h=g?!(h-this.offset.click.topg[3])?h:!(h-this.offset.click.topg[2])?e:!(e-this.offset.click.left=0;i--){var j=c.snapElements[i].left,l=j+c.snapElements[i].width,k=c.snapElements[i].top,m=k+c.snapElements[i].height;if(j-e=j&&f<=l||h>=j&&h<=l||fl)&&(e>= -i&&e<=k||g>=i&&g<=k||ek);default:return false}};d.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(a,b){var c=d.ui.ddmanager.droppables[a.options.scope]||[],e=b?b.type:null,g=(a.currentItem||a.element).find(":data(droppable)").andSelf(),f=0;a:for(;f - - - JS elements test - - - - - -
-
not clicked
-
no mouse action detected
- - - - - -
-
- -
- -
-

Drop here

-
- -
- - - - - - diff --git a/core/vendor/behat/mink/driver-testsuite/web-fixtures/json.php b/core/vendor/behat/mink/driver-testsuite/web-fixtures/json.php deleted file mode 100644 index 173d358..0000000 --- a/core/vendor/behat/mink/driver-testsuite/web-fixtures/json.php +++ /dev/null @@ -1,7 +0,0 @@ - 'val1', - 'key2' => 234, - 'key3' => array(1, 2, 3) -)); diff --git a/core/vendor/behat/mink/driver-testsuite/web-fixtures/links.html b/core/vendor/behat/mink/driver-testsuite/web-fixtures/links.html deleted file mode 100644 index ec626bf..0000000 --- a/core/vendor/behat/mink/driver-testsuite/web-fixtures/links.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - Links page - - - - Redirect me to - Random number page - Link with a ' - - basic form image - - - diff --git a/core/vendor/behat/mink/driver-testsuite/web-fixtures/multi_input_form.html b/core/vendor/behat/mink/driver-testsuite/web-fixtures/multi_input_form.html deleted file mode 100644 index 600a500..0000000 --- a/core/vendor/behat/mink/driver-testsuite/web-fixtures/multi_input_form.html +++ /dev/null @@ -1,27 +0,0 @@ - - - - Multi input Test - - - -

Multi input Test

- -
- - - - - -
- - diff --git a/core/vendor/behat/mink/driver-testsuite/web-fixtures/multicheckbox_form.html b/core/vendor/behat/mink/driver-testsuite/web-fixtures/multicheckbox_form.html deleted file mode 100644 index a2ae375..0000000 --- a/core/vendor/behat/mink/driver-testsuite/web-fixtures/multicheckbox_form.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - Multicheckbox Test - - - -

Multicheckbox Test

- -
- - - - -
- - diff --git a/core/vendor/behat/mink/driver-testsuite/web-fixtures/multiselect_form.html b/core/vendor/behat/mink/driver-testsuite/web-fixtures/multiselect_form.html deleted file mode 100644 index 0d28986..0000000 --- a/core/vendor/behat/mink/driver-testsuite/web-fixtures/multiselect_form.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - Multiselect Test - - - -

Multiselect Test

- -
- - - - - - - -
- - diff --git a/core/vendor/behat/mink/driver-testsuite/web-fixtures/popup1.html b/core/vendor/behat/mink/driver-testsuite/web-fixtures/popup1.html deleted file mode 100644 index b8e3fe2..0000000 --- a/core/vendor/behat/mink/driver-testsuite/web-fixtures/popup1.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - popup_1 - - - -
- Popup#1 div text -
- - - diff --git a/core/vendor/behat/mink/driver-testsuite/web-fixtures/popup2.html b/core/vendor/behat/mink/driver-testsuite/web-fixtures/popup2.html deleted file mode 100644 index dae1932..0000000 --- a/core/vendor/behat/mink/driver-testsuite/web-fixtures/popup2.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - popup_2 - - - -
- Popup#2 div text -
- - - diff --git a/core/vendor/behat/mink/driver-testsuite/web-fixtures/print_cookies.php b/core/vendor/behat/mink/driver-testsuite/web-fixtures/print_cookies.php deleted file mode 100644 index eef496e..0000000 --- a/core/vendor/behat/mink/driver-testsuite/web-fixtures/print_cookies.php +++ /dev/null @@ -1,10 +0,0 @@ - - - - Cookies page - - - - ', '', var_export($_COOKIE, true)); ?> - - diff --git a/core/vendor/behat/mink/driver-testsuite/web-fixtures/radio.html b/core/vendor/behat/mink/driver-testsuite/web-fixtures/radio.html deleted file mode 100644 index 69a916a..0000000 --- a/core/vendor/behat/mink/driver-testsuite/web-fixtures/radio.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - - Radio group - - -
- - - - - -
- -
- - -
- - diff --git a/core/vendor/behat/mink/driver-testsuite/web-fixtures/randomizer.php b/core/vendor/behat/mink/driver-testsuite/web-fixtures/randomizer.php deleted file mode 100644 index 07a73ec..0000000 --- a/core/vendor/behat/mink/driver-testsuite/web-fixtures/randomizer.php +++ /dev/null @@ -1,12 +0,0 @@ - - - - Index page - - - - -

- - - diff --git a/core/vendor/behat/mink/driver-testsuite/web-fixtures/redirect_destination.html b/core/vendor/behat/mink/driver-testsuite/web-fixtures/redirect_destination.html deleted file mode 100644 index 3de7481..0000000 --- a/core/vendor/behat/mink/driver-testsuite/web-fixtures/redirect_destination.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - Redirect destination - - - - You were redirected! - - diff --git a/core/vendor/behat/mink/driver-testsuite/web-fixtures/redirector.php b/core/vendor/behat/mink/driver-testsuite/web-fixtures/redirector.php deleted file mode 100644 index 44ac8f3..0000000 --- a/core/vendor/behat/mink/driver-testsuite/web-fixtures/redirector.php +++ /dev/null @@ -1,3 +0,0 @@ - - - - - Response headers - - - -

Response headers

- - diff --git a/core/vendor/behat/mink/driver-testsuite/web-fixtures/session_test.php b/core/vendor/behat/mink/driver-testsuite/web-fixtures/session_test.php deleted file mode 100644 index df1af6f..0000000 --- a/core/vendor/behat/mink/driver-testsuite/web-fixtures/session_test.php +++ /dev/null @@ -1,18 +0,0 @@ - - - - - Session Test - - - -
- - diff --git a/core/vendor/behat/mink/driver-testsuite/web-fixtures/some_file.txt b/core/vendor/behat/mink/driver-testsuite/web-fixtures/some_file.txt deleted file mode 100644 index d515a02..0000000 --- a/core/vendor/behat/mink/driver-testsuite/web-fixtures/some_file.txt +++ /dev/null @@ -1 +0,0 @@ -1 uploaded file diff --git a/core/vendor/behat/mink/driver-testsuite/web-fixtures/sub-folder/cookie_page1.php b/core/vendor/behat/mink/driver-testsuite/web-fixtures/sub-folder/cookie_page1.php deleted file mode 100644 index 750249b..0000000 --- a/core/vendor/behat/mink/driver-testsuite/web-fixtures/sub-folder/cookie_page1.php +++ /dev/null @@ -1,4 +0,0 @@ - - - - - - - - Popup #1 - - - - Popup #2 - - -
- Main window div text -
- - - diff --git a/core/vendor/behat/mink/phpdoc.ini.dist b/core/vendor/behat/mink/phpdoc.ini.dist deleted file mode 100644 index 3fef75d..0000000 --- a/core/vendor/behat/mink/phpdoc.ini.dist +++ /dev/null @@ -1,125 +0,0 @@ -; Default configuration file for PHPDoctor - -; This config file will cause PHPDoctor to generate API documentation of -; itself. - - -; PHPDoctor settings -; ----------------------------------------------------------------------------- - -; Names of files to parse. This can be a single filename, or a comma separated -; list of filenames. Wildcards are allowed. - -files = "*.php" - -; Names of files or directories to ignore. This can be a single filename, or a -; comma separated list of filenames. Wildcards are NOT allowed. - -ignore = "CVS, .svn, .git, _compiled" - -; The directory to look for files in, if not used the PHPDoctor will look in -; the current directory (the directory it is run from). - -source_path = "./src" - -; If you do not want PHPDoctor to look in each sub directory for files -; uncomment this line. - -;subdirs = off - -; Set how loud PHPDoctor is as it runs. Quiet mode suppresses all output other -; than warnings and errors. Verbose mode outputs additional messages during -; execution. - -;quiet = on -;verbose = on - -; Select the doclet to use for generating output. - -doclet = standard -;doclet = debug - -; The directory to find the doclet in. Doclets are expected to be in a -; directory named after themselves at the location given. - -;doclet_path = ./doclets - -; The directory to find taglets in. Taglets allow you to make PHPDoctor handle -; new tags and to alter the behavour of existing tags and their output. - -;taglet_path = ./taglets - -; If the code you are parsing does not use package tags or not all elements -; have package tags, use this setting to place unbound elements into a -; particular package. - -default_package = "Behat\Mink" - -; Specifies the name of a HTML file containing text for the overview -; documentation to be placed on the overview page. The path is relative to -; "source_path" unless an absolute path is given. - -overview = readme.html - -; Package comments will be looked for in a file named package.html in the same -; directory as the first source file parsed in that package or in the directory -; given below. If package comments are placed in the directory given below then -; they should be named ".html". - -package_comment_dir = ./ - -; Parse out global variables and/or global constants? - -;globals = off -;constants = off - -; Generate documentation for all class members - -;private = on - -; Generate documentation for public and protected class members - -;protected = on - -; Generate documentation for only public class members - -public = on - -; Use the PEAR compatible handling of the docblock first sentence - -;pear_compat = on - -; Standard doclet settings -; ----------------------------------------------------------------------------- - -; The directory to place generated documentation in. If the given path is -; relative to it will be relative to "source_path". - -d = "api" - -; Specifies the title to be placed in the HTML tag. - -windowtitle = "Behat\Mink" - -; Specifies the title to be placed near the top of the overview summary file. - -doctitle = "Behat\Mink: browser emulators abstraction library for PHP" - -; Specifies the header text to be placed at the top of each output file. The -; header will be placed to the right of the upper navigation bar. - -header = "Behat\Mink" - -; Specifies the footer text to be placed at the bottom of each output file. The -; footer will be placed to the right of the lower navigation bar. - -footer = "Behat\Mink" - -; Specifies the text to be placed at the bottom of each output file. The text -; will be placed at the bottom of the page, below the lower navigation bar. - -;bottom = "This document was generated by <a href="http://phpdoctor.sourceforge.net/">PHPDoctor: The PHP Documentation Creator</a>" - -; Create a class tree? - -tree = on diff --git a/core/vendor/behat/mink/phpunit.xml.dist b/core/vendor/behat/mink/phpunit.xml.dist deleted file mode 100644 index 6695433..0000000 --- a/core/vendor/behat/mink/phpunit.xml.dist +++ /dev/null @@ -1,15 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<phpunit colors="true" bootstrap="vendor/autoload.php"> - <testsuites> - <testsuite name="Behat Mink test suite"> - <directory>tests</directory> - </testsuite> - </testsuites> - - <filter> - <whitelist> - <directory>./src</directory> - </whitelist> - </filter> -</phpunit> diff --git a/core/vendor/behat/mink/src/Driver/CoreDriver.php b/core/vendor/behat/mink/src/Driver/CoreDriver.php deleted file mode 100644 index 248f291..0000000 --- a/core/vendor/behat/mink/src/Driver/CoreDriver.php +++ /dev/null @@ -1,447 +0,0 @@ -<?php - -/* - * This file is part of the Mink package. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Behat\Mink\Driver; - -use Behat\Mink\Exception\UnsupportedDriverActionException; -use Behat\Mink\Session; - -/** - * Core driver. - * All other drivers should extend this class for future compatibility. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -abstract class CoreDriver implements DriverInterface -{ - /** - * {@inheritdoc} - */ - public function setSession(Session $session) - { - throw new UnsupportedDriverActionException('Setting the session is not supported by %s', $this); - } - - /** - * {@inheritdoc} - */ - public function start() - { - throw new UnsupportedDriverActionException('Starting the driver is not supported by %s', $this); - } - - /** - * {@inheritdoc} - */ - public function isStarted() - { - throw new UnsupportedDriverActionException('Checking the driver state is not supported by %s', $this); - } - - /** - * {@inheritdoc} - */ - public function stop() - { - throw new UnsupportedDriverActionException('Stopping the driver is not supported by %s', $this); - } - - /** - * {@inheritdoc} - */ - public function reset() - { - throw new UnsupportedDriverActionException('Resetting the driver is not supported by %s', $this); - } - - /** - * {@inheritdoc} - */ - public function visit($url) - { - throw new UnsupportedDriverActionException('Visiting an url is not supported by %s', $this); - } - - /** - * {@inheritdoc} - */ - public function getCurrentUrl() - { - throw new UnsupportedDriverActionException('Getting the current url is not supported by %s', $this); - } - - /** - * {@inheritdoc} - */ - public function getContent() - { - throw new UnsupportedDriverActionException('Getting the page content is not supported by %s', $this); - } - - /** - * {@inheritdoc} - */ - public function find($xpath) - { - throw new UnsupportedDriverActionException('Finding elements is not supported by %s', $this); - } - - /** - * {@inheritdoc} - */ - public function getTagName($xpath) - { - throw new UnsupportedDriverActionException('Getting the tag name is not supported by %s', $this); - } - - /** - * {@inheritdoc} - */ - public function getText($xpath) - { - throw new UnsupportedDriverActionException('Getting the element text is not supported by %s', $this); - } - - /** - * {@inheritdoc} - */ - public function getHtml($xpath) - { - throw new UnsupportedDriverActionException('Getting the element inner HTML is not supported by %s', $this); - } - - /** - * {@inheritdoc} - */ - public function getOuterHtml($xpath) - { - throw new UnsupportedDriverActionException('Getting the element outer HTML is not supported by %s', $this); - } - - /** - * {@inheritdoc} - */ - public function getAttribute($xpath, $name) - { - throw new UnsupportedDriverActionException('Getting the element attribute is not supported by %s', $this); - } - - /** - * {@inheritdoc} - */ - public function getValue($xpath) - { - throw new UnsupportedDriverActionException('Getting the field value is not supported by %s', $this); - } - - /** - * {@inheritdoc} - */ - public function setValue($xpath, $value) - { - throw new UnsupportedDriverActionException('Setting the field value is not supported by %s', $this); - } - - /** - * {@inheritdoc} - */ - public function check($xpath) - { - throw new UnsupportedDriverActionException('Checking a checkbox is not supported by %s', $this); - } - - /** - * {@inheritdoc} - */ - public function uncheck($xpath) - { - throw new UnsupportedDriverActionException('Unchecking a checkbox is not supported by %s', $this); - } - - /** - * {@inheritdoc} - */ - public function isChecked($xpath) - { - throw new UnsupportedDriverActionException('Getting the state of a checkbox is not supported by %s', $this); - } - - /** - * {@inheritdoc} - */ - public function selectOption($xpath, $value, $multiple = false) - { - throw new UnsupportedDriverActionException('Selecting an option is not supported by %s', $this); - } - - /** - * {@inheritdoc} - */ - public function click($xpath) - { - throw new UnsupportedDriverActionException('Clicking on an element is not supported by %s', $this); - } - - /** - * {@inheritdoc} - */ - public function attachFile($xpath, $path) - { - throw new UnsupportedDriverActionException('Attaching a file in an input is not supported by %s', $this); - } - - /** - * {@inheritdoc} - */ - public function reload() - { - throw new UnsupportedDriverActionException('Page reloading is not supported by %s', $this); - } - - /** - * {@inheritdoc} - */ - public function forward() - { - throw new UnsupportedDriverActionException('Forward action is not supported by %s', $this); - } - - /** - * {@inheritdoc} - */ - public function back() - { - throw new UnsupportedDriverActionException('Backward action is not supported by %s', $this); - } - - /** - * {@inheritdoc} - */ - public function setBasicAuth($user, $password) - { - throw new UnsupportedDriverActionException('Basic auth setup is not supported by %s', $this); - } - - /** - * {@inheritdoc} - */ - public function switchToWindow($name = null) - { - throw new UnsupportedDriverActionException('Windows management is not supported by %s', $this); - } - - /** - * {@inheritdoc} - */ - public function switchToIFrame($name = null) - { - throw new UnsupportedDriverActionException('iFrames management is not supported by %s', $this); - } - - /** - * {@inheritdoc} - */ - public function setRequestHeader($name, $value) - { - throw new UnsupportedDriverActionException('Request headers manipulation is not supported by %s', $this); - } - - /** - * {@inheritdoc} - */ - public function getResponseHeaders() - { - throw new UnsupportedDriverActionException('Response headers are not available from %s', $this); - } - - /** - * {@inheritdoc} - */ - public function setCookie($name, $value = null) - { - throw new UnsupportedDriverActionException('Cookies manipulation is not supported by %s', $this); - } - - /** - * {@inheritdoc} - */ - public function getCookie($name) - { - throw new UnsupportedDriverActionException('Cookies are not available from %s', $this); - } - - /** - * {@inheritdoc} - */ - public function getStatusCode() - { - throw new UnsupportedDriverActionException('Status code is not available from %s', $this); - } - - /** - * {@inheritdoc} - */ - public function getScreenshot() - { - throw new UnsupportedDriverActionException('Screenshots are not supported by %s', $this); - } - - /** - * {@inheritdoc} - */ - public function getWindowNames() - { - throw new UnsupportedDriverActionException('Listing all window names is not supported by %s', $this); - } - - /** - * {@inheritdoc} - */ - public function getWindowName() - { - throw new UnsupportedDriverActionException('Listing this window name is not supported by %s', $this); - } - - /** - * {@inheritdoc} - */ - public function doubleClick($xpath) - { - throw new UnsupportedDriverActionException('Double-clicking is not supported by %s', $this); - } - - /** - * {@inheritdoc} - */ - public function rightClick($xpath) - { - throw new UnsupportedDriverActionException('Right-clicking is not supported by %s', $this); - } - - /** - * {@inheritdoc} - */ - public function isVisible($xpath) - { - throw new UnsupportedDriverActionException('Element visibility check is not supported by %s', $this); - } - - /** - * {@inheritdoc} - */ - public function isSelected($xpath) - { - throw new UnsupportedDriverActionException('Element selection check is not supported by %s', $this); - } - - /** - * {@inheritdoc} - */ - public function mouseOver($xpath) - { - throw new UnsupportedDriverActionException('Mouse manipulations are not supported by %s', $this); - } - - /** - * {@inheritdoc} - */ - public function focus($xpath) - { - throw new UnsupportedDriverActionException('Mouse manipulations are not supported by %s', $this); - } - - /** - * {@inheritdoc} - */ - public function blur($xpath) - { - throw new UnsupportedDriverActionException('Mouse manipulations are not supported by %s', $this); - } - - /** - * {@inheritdoc} - */ - public function keyPress($xpath, $char, $modifier = null) - { - throw new UnsupportedDriverActionException('Keyboard manipulations are not supported by %s', $this); - } - - /** - * {@inheritdoc} - */ - public function keyDown($xpath, $char, $modifier = null) - { - throw new UnsupportedDriverActionException('Keyboard manipulations are not supported by %s', $this); - } - - /** - * {@inheritdoc} - */ - public function keyUp($xpath, $char, $modifier = null) - { - throw new UnsupportedDriverActionException('Keyboard manipulations are not supported by %s', $this); - } - - /** - * {@inheritdoc} - */ - public function dragTo($sourceXpath, $destinationXpath) - { - throw new UnsupportedDriverActionException('Mouse manipulations are not supported by %s', $this); - } - - /** - * {@inheritdoc} - */ - public function executeScript($script) - { - throw new UnsupportedDriverActionException('JS is not supported by %s', $this); - } - - /** - * {@inheritdoc} - */ - public function evaluateScript($script) - { - throw new UnsupportedDriverActionException('JS is not supported by %s', $this); - } - - /** - * {@inheritdoc} - */ - public function wait($timeout, $condition) - { - throw new UnsupportedDriverActionException('JS is not supported by %s', $this); - } - - /** - * {@inheritdoc} - */ - public function resizeWindow($width, $height, $name = null) - { - throw new UnsupportedDriverActionException('Window resizing is not supported by %s', $this); - } - - /** - * {@inheritdoc} - */ - public function maximizeWindow($name = null) - { - throw new UnsupportedDriverActionException('Window maximize is not supported by %s', $this); - } - - /** - * {@inheritdoc} - */ - public function submitForm($xpath) - { - throw new UnsupportedDriverActionException('Form submission is not supported by %s', $this); - } -} diff --git a/core/vendor/behat/mink/src/Driver/DriverInterface.php b/core/vendor/behat/mink/src/Driver/DriverInterface.php deleted file mode 100644 index 8357caa..0000000 --- a/core/vendor/behat/mink/src/Driver/DriverInterface.php +++ /dev/null @@ -1,637 +0,0 @@ -<?php - -/* - * This file is part of the Mink package. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Behat\Mink\Driver; - -use Behat\Mink\Element\NodeElement; -use Behat\Mink\Exception\DriverException; -use Behat\Mink\Exception\UnsupportedDriverActionException; -use Behat\Mink\Session; - -/** - * Driver interface. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -interface DriverInterface -{ - /** - * Sets driver's current session. - * - * @param Session $session - */ - public function setSession(Session $session); - - /** - * Starts driver. - * - * Once started, the driver should be ready to visit a page. - * - * Calling any action before visiting a page is an undefined behavior. - * The only supported method calls on a fresh driver are - * - visit() - * - setRequestHeader() - * - setBasicAuth() - * - reset() - * - stop() - * - * Calling start on a started driver is an undefined behavior. Driver - * implementations are free to handle it silently or to fail with an - * exception. - * - * @throws DriverException When the driver cannot be started - */ - public function start(); - - /** - * Checks whether driver is started. - * - * @return Boolean - */ - public function isStarted(); - - /** - * Stops driver. - * - * Once stopped, the driver should be started again before using it again. - * - * Calling any action on a stopped driver is an undefined behavior. - * The only supported method call after stopping a driver is starting it again. - * - * Calling stop on a stopped driver is an undefined behavior. Driver - * implementations are free to handle it silently or to fail with an - * exception. - * - * @throws DriverException When the driver cannot be closed - */ - public function stop(); - - /** - * Resets driver state. - * - * This should reset cookies, request headers and basic authentication. - * When possible, the history should be reset as well, but this is not enforced - * as some implementations may not be able to reset it without restarting the - * driver entirely. Consumers requiring a clean history should restart the driver - * to enforce it. - * - * Once reset, the driver should be ready to visit a page. - * Calling any action before visiting a page is an undefined behavior. - * The only supported method calls on a fresh driver are - * - visit() - * - setRequestHeader() - * - setBasicAuth() - * - reset() - * - stop() - * - * Calling reset on a stopped driver is an undefined behavior. - */ - public function reset(); - - /** - * Visit specified URL. - * - * @param string $url url of the page - * - * @throws UnsupportedDriverActionException When operation not supported by the driver - * @throws DriverException When the operation cannot be done - */ - public function visit($url); - - /** - * Returns current URL address. - * - * @return string - * - * @throws UnsupportedDriverActionException When operation not supported by the driver - * @throws DriverException When the operation cannot be done - */ - public function getCurrentUrl(); - - /** - * Reloads current page. - * - * @throws UnsupportedDriverActionException When operation not supported by the driver - * @throws DriverException When the operation cannot be done - */ - public function reload(); - - /** - * Moves browser forward 1 page. - * - * @throws UnsupportedDriverActionException When operation not supported by the driver - * @throws DriverException When the operation cannot be done - */ - public function forward(); - - /** - * Moves browser backward 1 page. - * - * @throws UnsupportedDriverActionException When operation not supported by the driver - * @throws DriverException When the operation cannot be done - */ - public function back(); - - /** - * Sets HTTP Basic authentication parameters - * - * @param string|Boolean $user user name or false to disable authentication - * @param string $password password - * - * @throws UnsupportedDriverActionException When operation not supported by the driver - * @throws DriverException When the operation cannot be done - */ - public function setBasicAuth($user, $password); - - /** - * Switches to specific browser window. - * - * @param string $name window name (null for switching back to main window) - * - * @throws UnsupportedDriverActionException When operation not supported by the driver - * @throws DriverException When the operation cannot be done - */ - public function switchToWindow($name = null); - - /** - * Switches to specific iFrame. - * - * @param string $name iframe name (null for switching back) - * - * @throws UnsupportedDriverActionException When operation not supported by the driver - * @throws DriverException When the operation cannot be done - */ - public function switchToIFrame($name = null); - - /** - * Sets specific request header on client. - * - * @param string $name - * @param string $value - * - * @throws UnsupportedDriverActionException When operation not supported by the driver - * @throws DriverException When the operation cannot be done - */ - public function setRequestHeader($name, $value); - - /** - * Returns last response headers. - * - * @return array - * - * @throws UnsupportedDriverActionException When operation not supported by the driver - * @throws DriverException When the operation cannot be done - */ - public function getResponseHeaders(); - - /** - * Sets cookie. - * - * @param string $name - * @param string $value - * - * @throws UnsupportedDriverActionException When operation not supported by the driver - * @throws DriverException When the operation cannot be done - */ - public function setCookie($name, $value = null); - - /** - * Returns cookie by name. - * - * @param string $name - * - * @return string|null - * - * @throws UnsupportedDriverActionException When operation not supported by the driver - * @throws DriverException When the operation cannot be done - */ - public function getCookie($name); - - /** - * Returns last response status code. - * - * @return integer - * - * @throws UnsupportedDriverActionException When operation not supported by the driver - * @throws DriverException When the operation cannot be done - */ - public function getStatusCode(); - - /** - * Returns last response content. - * - * @return string - * - * @throws UnsupportedDriverActionException When operation not supported by the driver - * @throws DriverException When the operation cannot be done - */ - public function getContent(); - - /** - * Capture a screenshot of the current window. - * - * @return string screenshot of MIME type image/* depending - * on driver (e.g., image/png, image/jpeg) - * - * @throws UnsupportedDriverActionException When operation not supported by the driver - * @throws DriverException When the operation cannot be done - */ - public function getScreenshot(); - - /** - * Return the names of all open windows. - * - * @return array array of all open windows - * - * @throws UnsupportedDriverActionException When operation not supported by the driver - * @throws DriverException When the operation cannot be done - */ - public function getWindowNames(); - - /** - * Return the name of the currently active window. - * - * @return string the name of the current window - * - * @throws UnsupportedDriverActionException When operation not supported by the driver - * @throws DriverException When the operation cannot be done - */ - public function getWindowName(); - - /** - * Finds elements with specified XPath query. - * - * @param string $xpath - * - * @return NodeElement[] - * - * @throws UnsupportedDriverActionException When operation not supported by the driver - * @throws DriverException When the operation cannot be done - */ - public function find($xpath); - - /** - * Returns element's tag name by it's XPath query. - * - * @param string $xpath - * - * @return string - * - * @throws UnsupportedDriverActionException When operation not supported by the driver - * @throws DriverException When the operation cannot be done - */ - public function getTagName($xpath); - - /** - * Returns element's text by it's XPath query. - * - * @param string $xpath - * - * @return string - * - * @throws UnsupportedDriverActionException When operation not supported by the driver - * @throws DriverException When the operation cannot be done - */ - public function getText($xpath); - - /** - * Returns element's inner html by it's XPath query. - * - * @param string $xpath - * - * @return string - * - * @throws UnsupportedDriverActionException When operation not supported by the driver - * @throws DriverException When the operation cannot be done - */ - public function getHtml($xpath); - - /** - * Returns element's outer html by it's XPath query. - * - * @param string $xpath - * - * @return string - * - * @throws UnsupportedDriverActionException When operation not supported by the driver - * @throws DriverException When the operation cannot be done - */ - public function getOuterHtml($xpath); - - /** - * Returns element's attribute by it's XPath query. - * - * @param string $xpath - * @param string $name - * - * @return string|null - * - * @throws UnsupportedDriverActionException When operation not supported by the driver - * @throws DriverException When the operation cannot be done - */ - public function getAttribute($xpath, $name); - - /** - * Returns element's value by it's XPath query. - * - * @param string $xpath - * - * @return string|bool|array - * - * @throws UnsupportedDriverActionException When operation not supported by the driver - * @throws DriverException When the operation cannot be done - * - * @see \Behat\Mink\Element\NodeElement::getValue - */ - public function getValue($xpath); - - /** - * Sets element's value by it's XPath query. - * - * @param string $xpath - * @param string|bool|array $value - * - * @throws UnsupportedDriverActionException When operation not supported by the driver - * @throws DriverException When the operation cannot be done - * - * @see \Behat\Mink\Element\NodeElement::setValue - */ - public function setValue($xpath, $value); - - /** - * Checks checkbox by it's XPath query. - * - * @param string $xpath - * - * @throws UnsupportedDriverActionException When operation not supported by the driver - * @throws DriverException When the operation cannot be done - * - * @see \Behat\Mink\Element\NodeElement::check - */ - public function check($xpath); - - /** - * Unchecks checkbox by it's XPath query. - * - * @param string $xpath - * - * @throws UnsupportedDriverActionException When operation not supported by the driver - * @throws DriverException When the operation cannot be done - * - * @see \Behat\Mink\Element\NodeElement::uncheck - */ - public function uncheck($xpath); - - /** - * Checks whether checkbox or radio button located by it's XPath query is checked. - * - * @param string $xpath - * - * @return Boolean - * - * @throws UnsupportedDriverActionException When operation not supported by the driver - * @throws DriverException When the operation cannot be done - * - * @see \Behat\Mink\Element\NodeElement::isChecked - */ - public function isChecked($xpath); - - /** - * Selects option from select field or value in radio group located by it's XPath query. - * - * @param string $xpath - * @param string $value - * @param Boolean $multiple - * - * @throws UnsupportedDriverActionException When operation not supported by the driver - * @throws DriverException When the operation cannot be done - * - * @see \Behat\Mink\Element\NodeElement::selectOption - */ - public function selectOption($xpath, $value, $multiple = false); - - /** - * Checks whether select option, located by it's XPath query, is selected. - * - * @param string $xpath - * - * @return Boolean - * - * @throws UnsupportedDriverActionException When operation not supported by the driver - * @throws DriverException When the operation cannot be done - * - * @see \Behat\Mink\Element\NodeElement::isSelected - */ - public function isSelected($xpath); - - /** - * Clicks button or link located by it's XPath query. - * - * @param string $xpath - * - * @throws UnsupportedDriverActionException When operation not supported by the driver - * @throws DriverException When the operation cannot be done - */ - public function click($xpath); - - /** - * Double-clicks button or link located by it's XPath query. - * - * @param string $xpath - * - * @throws UnsupportedDriverActionException When operation not supported by the driver - * @throws DriverException When the operation cannot be done - */ - public function doubleClick($xpath); - - /** - * Right-clicks button or link located by it's XPath query. - * - * @param string $xpath - * - * @throws UnsupportedDriverActionException When operation not supported by the driver - * @throws DriverException When the operation cannot be done - */ - public function rightClick($xpath); - - /** - * Attaches file path to file field located by it's XPath query. - * - * @param string $xpath - * @param string $path - * - * @throws UnsupportedDriverActionException When operation not supported by the driver - * @throws DriverException When the operation cannot be done - * - * @see \Behat\Mink\Element\NodeElement::attachFile - */ - public function attachFile($xpath, $path); - - /** - * Checks whether element visible located by it's XPath query. - * - * @param string $xpath - * - * @return Boolean - * - * @throws UnsupportedDriverActionException When operation not supported by the driver - * @throws DriverException When the operation cannot be done - */ - public function isVisible($xpath); - - /** - * Simulates a mouse over on the element. - * - * @param string $xpath - * - * @throws UnsupportedDriverActionException When operation not supported by the driver - * @throws DriverException When the operation cannot be done - */ - public function mouseOver($xpath); - - /** - * Brings focus to element. - * - * @param string $xpath - * - * @throws UnsupportedDriverActionException When operation not supported by the driver - * @throws DriverException When the operation cannot be done - */ - public function focus($xpath); - - /** - * Removes focus from element. - * - * @param string $xpath - * - * @throws UnsupportedDriverActionException When operation not supported by the driver - * @throws DriverException When the operation cannot be done - */ - public function blur($xpath); - - /** - * Presses specific keyboard key. - * - * @param string $xpath - * @param string|integer $char could be either char ('b') or char-code (98) - * @param string $modifier keyboard modifier (could be 'ctrl', 'alt', 'shift' or 'meta') - * - * @throws UnsupportedDriverActionException When operation not supported by the driver - * @throws DriverException When the operation cannot be done - */ - public function keyPress($xpath, $char, $modifier = null); - - /** - * Pressed down specific keyboard key. - * - * @param string $xpath - * @param string|integer $char could be either char ('b') or char-code (98) - * @param string $modifier keyboard modifier (could be 'ctrl', 'alt', 'shift' or 'meta') - * - * @throws UnsupportedDriverActionException When operation not supported by the driver - * @throws DriverException When the operation cannot be done - */ - public function keyDown($xpath, $char, $modifier = null); - - /** - * Pressed up specific keyboard key. - * - * @param string $xpath - * @param string|integer $char could be either char ('b') or char-code (98) - * @param string $modifier keyboard modifier (could be 'ctrl', 'alt', 'shift' or 'meta') - * - * @throws UnsupportedDriverActionException When operation not supported by the driver - * @throws DriverException When the operation cannot be done - */ - public function keyUp($xpath, $char, $modifier = null); - - /** - * Drag one element onto another. - * - * @param string $sourceXpath - * @param string $destinationXpath - * - * @throws UnsupportedDriverActionException When operation not supported by the driver - * @throws DriverException When the operation cannot be done - */ - public function dragTo($sourceXpath, $destinationXpath); - - /** - * Executes JS script. - * - * @param string $script - * - * @throws UnsupportedDriverActionException When operation not supported by the driver - * @throws DriverException When the operation cannot be done - */ - public function executeScript($script); - - /** - * Evaluates JS script. - * - * The "return" keyword is optional in the script passed as argument. Driver implementations - * must accept the expression both with and without the keyword. - * - * @param string $script - * - * @return mixed - * - * @throws UnsupportedDriverActionException When operation not supported by the driver - * @throws DriverException When the operation cannot be done - */ - public function evaluateScript($script); - - /** - * Waits some time or until JS condition turns true. - * - * @param integer $timeout timeout in milliseconds - * @param string $condition JS condition - * - * @return boolean - * - * @throws UnsupportedDriverActionException When operation not supported by the driver - * @throws DriverException When the operation cannot be done - */ - public function wait($timeout, $condition); - - /** - * Set the dimensions of the window. - * - * @param integer $width set the window width, measured in pixels - * @param integer $height set the window height, measured in pixels - * @param string $name window name (null for the main window) - * - * @throws UnsupportedDriverActionException When operation not supported by the driver - * @throws DriverException When the operation cannot be done - */ - public function resizeWindow($width, $height, $name = null); - - /** - * Maximize the window if it is not maximized already - * - * @param string $name window name (null for the main window) - * - * @throws UnsupportedDriverActionException When operation not supported by the driver - * @throws DriverException When the operation cannot be done - */ - public function maximizeWindow($name = null); - - /** - * Submits the form. - * - * @param string $xpath Xpath. - * - * @throws UnsupportedDriverActionException When operation not supported by the driver - * @throws DriverException When the operation cannot be done - * - * @see \Behat\Mink\Element\NodeElement::submitForm - */ - public function submitForm($xpath); -} diff --git a/core/vendor/behat/mink/src/Element/DocumentElement.php b/core/vendor/behat/mink/src/Element/DocumentElement.php deleted file mode 100644 index edde3c3..0000000 --- a/core/vendor/behat/mink/src/Element/DocumentElement.php +++ /dev/null @@ -1,53 +0,0 @@ -<?php - -/* - * This file is part of the Mink package. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Behat\Mink\Element; - -/** - * Document element. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class DocumentElement extends TraversableElement -{ - /** - * Returns XPath for handled element. - * - * @return string - */ - public function getXpath() - { - return '//html'; - } - - /** - * Returns document content. - * - * @return string - */ - public function getContent() - { - return trim($this->getDriver()->getContent()); - } - - /** - * Check whether document has specified content. - * - * @param string $content - * - * @return Boolean - */ - public function hasContent($content) - { - return $this->has('named', array( - 'content', $this->getSelectorsHandler()->xpathLiteral($content), - )); - } -} diff --git a/core/vendor/behat/mink/src/Element/Element.php b/core/vendor/behat/mink/src/Element/Element.php deleted file mode 100644 index 07e1e11..0000000 --- a/core/vendor/behat/mink/src/Element/Element.php +++ /dev/null @@ -1,207 +0,0 @@ -<?php - -/* - * This file is part of the Mink package. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Behat\Mink\Element; - -use Behat\Mink\Driver\DriverInterface; -use Behat\Mink\Exception\ElementNotFoundException; -use Behat\Mink\Selector\SelectorsHandler; -use Behat\Mink\Selector\Xpath\Manipulator; -use Behat\Mink\Session; - -/** - * Base element. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -abstract class Element implements ElementInterface -{ - /** - * @var Session - */ - private $session; - - /** - * Driver. - * - * @var DriverInterface - */ - private $driver; - - /** - * @var SelectorsHandler - */ - private $selectorsHandler; - - /** - * @var Manipulator - */ - private $xpathManipulator; - - /** - * Initialize element. - * - * @param Session $session - */ - public function __construct(Session $session) - { - $this->xpathManipulator = new Manipulator(); - $this->session = $session; - - $this->driver = $session->getDriver(); - $this->selectorsHandler = $session->getSelectorsHandler(); - } - - /** - * Returns element session. - * - * @return Session - * - * @deprecated Accessing the session from the element is deprecated as of 1.6 and will be impossible in 2.0. - */ - public function getSession() - { - return $this->session; - } - - /** - * Returns element's driver. - * - * @return DriverInterface - */ - protected function getDriver() - { - return $this->driver; - } - - /** - * Returns selectors handler. - * - * @return SelectorsHandler - */ - protected function getSelectorsHandler() - { - return $this->selectorsHandler; - } - - /** - * {@inheritdoc} - */ - public function has($selector, $locator) - { - return null !== $this->find($selector, $locator); - } - - /** - * {@inheritdoc} - */ - public function isValid() - { - return 1 === count($this->getDriver()->find($this->getXpath())); - } - - /** - * {@inheritdoc} - */ - public function waitFor($timeout, $callback) - { - if (!is_callable($callback)) { - throw new \InvalidArgumentException('Given callback is not a valid callable'); - } - - $start = microtime(true); - $end = $start + $timeout; - - do { - $result = call_user_func($callback, $this); - - if ($result) { - break; - } - - usleep(100000); - } while (microtime(true) < $end); - - return $result; - } - - /** - * {@inheritdoc} - */ - public function find($selector, $locator) - { - $items = $this->findAll($selector, $locator); - - return count($items) ? current($items) : null; - } - - /** - * {@inheritdoc} - */ - public function findAll($selector, $locator) - { - if ('named' === $selector) { - $items = $this->findAll('named_exact', $locator); - if (empty($items)) { - $items = $this->findAll('named_partial', $locator); - } - - return $items; - } - - $xpath = $this->getSelectorsHandler()->selectorToXpath($selector, $locator); - $xpath = $this->xpathManipulator->prepend($xpath, $this->getXpath()); - - return $this->getDriver()->find($xpath); - } - - /** - * {@inheritdoc} - */ - public function getText() - { - return $this->getDriver()->getText($this->getXpath()); - } - - /** - * {@inheritdoc} - */ - public function getHtml() - { - return $this->getDriver()->getHtml($this->getXpath()); - } - - /** - * Returns element outer html. - * - * @return string - */ - public function getOuterHtml() - { - return $this->getDriver()->getOuterHtml($this->getXpath()); - } - - /** - * Builds an ElementNotFoundException - * - * This is an helper to build the ElementNotFoundException without - * needing to use the deprecated getSession accessor in child classes. - * - * @param string $type - * @param string|null $selector - * @param string|null $locator - * - * @return ElementNotFoundException - */ - protected function elementNotFound($type, $selector = null, $locator = null) - { - return new ElementNotFoundException($this->session, $type, $selector, $locator); - } -} diff --git a/core/vendor/behat/mink/src/Element/ElementInterface.php b/core/vendor/behat/mink/src/Element/ElementInterface.php deleted file mode 100644 index 8c134b9..0000000 --- a/core/vendor/behat/mink/src/Element/ElementInterface.php +++ /dev/null @@ -1,114 +0,0 @@ -<?php - -/* - * This file is part of the Mink package. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Behat\Mink\Element; - -use Behat\Mink\Session; - -/** - * Element interface. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -interface ElementInterface -{ - /** - * Returns XPath for handled element. - * - * @return string - */ - public function getXpath(); - - /** - * Returns element's session. - * - * @return Session - * - * @deprecated Accessing the session from the element is deprecated as of 1.6 and will be impossible in 2.0. - */ - public function getSession(); - - /** - * Checks whether element with specified selector exists inside the current element. - * - * @param string $selector selector engine name - * @param string|array $locator selector locator - * - * @return Boolean - * - * @see ElementInterface::findAll for the supported selectors - */ - public function has($selector, $locator); - - /** - * Checks if an element still exists in the DOM. - * - * @return boolean - */ - public function isValid(); - - /** - * Waits for an element(-s) to appear and returns it. - * - * @param int|float $timeout Maximal allowed waiting time in seconds. - * @param callable $callback Callback, which result is both used as waiting condition and returned. - * Will receive reference to `this element` as first argument. - * - * @return mixed - * @throws \InvalidArgumentException When invalid callback given. - */ - public function waitFor($timeout, $callback); - - /** - * Finds first element with specified selector inside the current element. - * - * @param string $selector selector engine name - * @param string|array $locator selector locator - * - * @return NodeElement|null - * - * @see ElementInterface::findAll for the supported selectors - */ - public function find($selector, $locator); - - /** - * Finds all elements with specified selector inside the current element. - * - * Valid selector engines are named, xpath, css, named_partial and named_exact. - * - * 'named' is a pseudo selector engine which prefers an exact match but - * will return a partial match if no exact match is found. - * 'xpath' is a pseudo selector engine supported by SelectorsHandler. - * - * More selector engines can be registered in the SelectorsHandler. - * - * @param string $selector selector engine name - * @param string|array $locator selector locator - * - * @return NodeElement[] - * - * @see NamedSelector for the locators supported by the named selectors - */ - public function findAll($selector, $locator); - - /** - * Returns element text (inside tag). - * - * @return string - */ - public function getText(); - - /** - * Returns element inner html. - * - * @return string - */ - public function getHtml(); -} diff --git a/core/vendor/behat/mink/src/Element/NodeElement.php b/core/vendor/behat/mink/src/Element/NodeElement.php deleted file mode 100644 index 8e43546..0000000 --- a/core/vendor/behat/mink/src/Element/NodeElement.php +++ /dev/null @@ -1,352 +0,0 @@ -<?php - -/* - * This file is part of the Mink package. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Behat\Mink\Element; - -use Behat\Mink\Session; -use Behat\Mink\Exception\ElementNotFoundException; - -/** - * Page element node. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class NodeElement extends TraversableElement -{ - private $xpath; - - /** - * Initializes node element. - * - * @param string $xpath element xpath - * @param Session $session session instance - */ - public function __construct($xpath, Session $session) - { - $this->xpath = $xpath; - - parent::__construct($session); - } - - /** - * Returns XPath for handled element. - * - * @return string - */ - public function getXpath() - { - return $this->xpath; - } - - /** - * Returns parent element to the current one. - * - * @return NodeElement - */ - public function getParent() - { - return $this->find('xpath', '..'); - } - - /** - * Returns current node tag name. - * - * The value is always returned in lowercase to allow an easy comparison. - * - * @return string - */ - public function getTagName() - { - return strtolower($this->getDriver()->getTagName($this->getXpath())); - } - - /** - * Returns the value of the form field or option element. - * - * For checkbox fields, the value is a boolean indicating whether the checkbox is checked. - * For radio buttons, the value is the value of the selected button in the radio group - * or null if no button is selected. - * For single select boxes, the value is the value of the selected option. - * For multiple select boxes, the value is an array of selected option values. - * for file inputs, the return value is undefined given that browsers don't allow accessing - * the value of file inputs for security reasons. Some drivers may allow accessing the - * path of the file set in the field, but this is not required if it cannot be implemented. - * For textarea elements and all textual fields, the value is the content of the field. - * Form option elements, the value is the value of the option (the value attribute or the text - * content if the attribute is not set). - * - * Calling this method on other elements than form fields or option elements is not allowed. - * - * @return string|bool|array - */ - public function getValue() - { - return $this->getDriver()->getValue($this->getXpath()); - } - - /** - * Sets the value of the form field. - * - * Calling this method on other elements than form fields is not allowed. - * - * @param string|bool|array $value - * - * @see NodeElement::getValue for the format of the value for each type of field - */ - public function setValue($value) - { - $this->getDriver()->setValue($this->getXpath(), $value); - } - - /** - * Checks whether element has attribute with specified name. - * - * @param string $name - * - * @return Boolean - */ - public function hasAttribute($name) - { - return null !== $this->getDriver()->getAttribute($this->getXpath(), $name); - } - - /** - * Returns specified attribute value. - * - * @param string $name - * - * @return string|null - */ - public function getAttribute($name) - { - return $this->getDriver()->getAttribute($this->getXpath(), $name); - } - - /** - * Checks whether an element has a named CSS class - * - * @param string $className Name of the class - * - * @return boolean - */ - public function hasClass($className) - { - if ($this->hasAttribute('class')) { - return in_array($className, explode(' ', $this->getAttribute('class'))); - } - - return false; - } - - /** - * Clicks current node. - */ - public function click() - { - $this->getDriver()->click($this->getXpath()); - } - - /** - * Presses current button. - */ - public function press() - { - $this->click(); - } - - /** - * Double-clicks current node. - */ - public function doubleClick() - { - $this->getDriver()->doubleClick($this->getXpath()); - } - - /** - * Right-clicks current node. - */ - public function rightClick() - { - $this->getDriver()->rightClick($this->getXpath()); - } - - /** - * Checks current node if it's a checkbox field. - */ - public function check() - { - $this->getDriver()->check($this->getXpath()); - } - - /** - * Unchecks current node if it's a checkbox field. - */ - public function uncheck() - { - $this->getDriver()->uncheck($this->getXpath()); - } - - /** - * Checks whether current node is checked if it's a checkbox or radio field. - * - * Calling this method on any other elements is not allowed. - * - * @return Boolean - */ - public function isChecked() - { - return (Boolean) $this->getDriver()->isChecked($this->getXpath()); - } - - /** - * Selects specified option for select field or specified radio button in the group - * - * If the current node is a select box, this selects the option found by its value or - * its text. - * If the current node is a radio button, this selects the radio button with the given - * value in the radio button group of the current node. - * - * Calling this method on any other elements is not allowed. - * - * @param string $option - * @param Boolean $multiple whether the option should be added to the selection for multiple selects - * - * @throws ElementNotFoundException when the option is not found in the select box - */ - public function selectOption($option, $multiple = false) - { - if ('select' !== $this->getTagName()) { - $this->getDriver()->selectOption($this->getXpath(), $option, $multiple); - - return; - } - - $opt = $this->find('named', array( - 'option', $this->getSelectorsHandler()->xpathLiteral($option), - )); - - if (null === $opt) { - throw $this->elementNotFound('select option', 'value|text', $option); - } - - $this->getDriver()->selectOption($this->getXpath(), $opt->getValue(), $multiple); - } - - /** - * Checks whether current node is selected if it's a option field. - * - * Calling this method on any other elements is not allowed. - * - * @return Boolean - */ - public function isSelected() - { - return (Boolean) $this->getDriver()->isSelected($this->getXpath()); - } - - /** - * Attach file to current node if it's a file input. - * - * Calling this method on any other elements than file input is not allowed. - * - * @param string $path path to file (local) - */ - public function attachFile($path) - { - $this->getDriver()->attachFile($this->getXpath(), $path); - } - - /** - * Checks whether current node is visible on page. - * - * @return Boolean - */ - public function isVisible() - { - return (Boolean) $this->getDriver()->isVisible($this->getXpath()); - } - - /** - * Simulates a mouse over on the element. - */ - public function mouseOver() - { - $this->getDriver()->mouseOver($this->getXpath()); - } - - /** - * Drags current node onto other node. - * - * @param ElementInterface $destination other node - */ - public function dragTo(ElementInterface $destination) - { - $this->getDriver()->dragTo($this->getXpath(), $destination->getXpath()); - } - - /** - * Brings focus to element. - */ - public function focus() - { - $this->getDriver()->focus($this->getXpath()); - } - - /** - * Removes focus from element. - */ - public function blur() - { - $this->getDriver()->blur($this->getXpath()); - } - - /** - * Presses specific keyboard key. - * - * @param string|integer $char could be either char ('b') or char-code (98) - * @param string $modifier keyboard modifier (could be 'ctrl', 'alt', 'shift' or 'meta') - */ - public function keyPress($char, $modifier = null) - { - $this->getDriver()->keyPress($this->getXpath(), $char, $modifier); - } - - /** - * Pressed down specific keyboard key. - * - * @param string|integer $char could be either char ('b') or char-code (98) - * @param string $modifier keyboard modifier (could be 'ctrl', 'alt', 'shift' or 'meta') - */ - public function keyDown($char, $modifier = null) - { - $this->getDriver()->keyDown($this->getXpath(), $char, $modifier); - } - - /** - * Pressed up specific keyboard key. - * - * @param string|integer $char could be either char ('b') or char-code (98) - * @param string $modifier keyboard modifier (could be 'ctrl', 'alt', 'shift' or 'meta') - */ - public function keyUp($char, $modifier = null) - { - $this->getDriver()->keyUp($this->getXpath(), $char, $modifier); - } - - /** - * Submits the form. - * - * Calling this method on anything else than form elements is not allowed. - */ - public function submit() - { - $this->getDriver()->submitForm($this->getXpath()); - } -} diff --git a/core/vendor/behat/mink/src/Element/TraversableElement.php b/core/vendor/behat/mink/src/Element/TraversableElement.php deleted file mode 100644 index 0621af3..0000000 --- a/core/vendor/behat/mink/src/Element/TraversableElement.php +++ /dev/null @@ -1,309 +0,0 @@ -<?php - -/* - * This file is part of the Mink package. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Behat\Mink\Element; - -use Behat\Mink\Exception\ElementNotFoundException; - -/** - * Traversable element. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -abstract class TraversableElement extends Element -{ - /** - * Finds element by its id. - * - * @param string $id element id - * - * @return NodeElement|null - */ - public function findById($id) - { - $id = $this->getSelectorsHandler()->xpathLiteral($id); - - return $this->find('named', array('id', $id)); - } - - /** - * Checks whether element has a link with specified locator. - * - * @param string $locator link id, title, text or image alt - * - * @return Boolean - */ - public function hasLink($locator) - { - return null !== $this->findLink($locator); - } - - /** - * Finds link with specified locator. - * - * @param string $locator link id, title, text or image alt - * - * @return NodeElement|null - */ - public function findLink($locator) - { - return $this->find('named', array( - 'link', $this->getSelectorsHandler()->xpathLiteral($locator), - )); - } - - /** - * Clicks link with specified locator. - * - * @param string $locator link id, title, text or image alt - * - * @throws ElementNotFoundException - */ - public function clickLink($locator) - { - $link = $this->findLink($locator); - - if (null === $link) { - throw $this->elementNotFound('link', 'id|title|alt|text', $locator); - } - - $link->click(); - } - - /** - * Checks whether element has a button (input[type=submit|image|button|reset], button) with specified locator. - * - * @param string $locator button id, value or alt - * - * @return Boolean - */ - public function hasButton($locator) - { - return null !== $this->findButton($locator); - } - - /** - * Finds button (input[type=submit|image|button|reset], button) with specified locator. - * - * @param string $locator button id, value or alt - * - * @return NodeElement|null - */ - public function findButton($locator) - { - return $this->find('named', array( - 'button', $this->getSelectorsHandler()->xpathLiteral($locator), - )); - } - - /** - * Presses button (input[type=submit|image|button|reset], button) with specified locator. - * - * @param string $locator button id, value or alt - * - * @throws ElementNotFoundException - */ - public function pressButton($locator) - { - $button = $this->findButton($locator); - - if (null === $button) { - throw $this->elementNotFound('button', 'id|name|title|alt|value', $locator); - } - - $button->press(); - } - - /** - * Checks whether element has a field (input, textarea, select) with specified locator. - * - * @param string $locator input id, name or label - * - * @return Boolean - */ - public function hasField($locator) - { - return null !== $this->findField($locator); - } - - /** - * Finds field (input, textarea, select) with specified locator. - * - * @param string $locator input id, name or label - * - * @return NodeElement|null - */ - public function findField($locator) - { - return $this->find('named', array( - 'field', $this->getSelectorsHandler()->xpathLiteral($locator), - )); - } - - /** - * Fills in field (input, textarea, select) with specified locator. - * - * @param string $locator input id, name or label - * @param string $value value - * - * @throws ElementNotFoundException - * - * @see NodeElement::setValue - */ - public function fillField($locator, $value) - { - $field = $this->findField($locator); - - if (null === $field) { - throw $this->elementNotFound('form field', 'id|name|label|value', $locator); - } - - $field->setValue($value); - } - - /** - * Checks whether element has a checkbox with specified locator, which is checked. - * - * @param string $locator input id, name or label - * - * @return Boolean - * - * @see NodeElement::isChecked - */ - public function hasCheckedField($locator) - { - $field = $this->findField($locator); - - return null !== $field && $field->isChecked(); - } - - /** - * Checks whether element has a checkbox with specified locator, which is unchecked. - * - * @param string $locator input id, name or label - * - * @return Boolean - * - * @see NodeElement::isChecked - */ - public function hasUncheckedField($locator) - { - $field = $this->findField($locator); - - return null !== $field && !$field->isChecked(); - } - - /** - * Checks checkbox with specified locator. - * - * @param string $locator input id, name or label - * - * @throws ElementNotFoundException - */ - public function checkField($locator) - { - $field = $this->findField($locator); - - if (null === $field) { - throw $this->elementNotFound('form field', 'id|name|label|value', $locator); - } - - $field->check(); - } - - /** - * Unchecks checkbox with specified locator. - * - * @param string $locator input id, name or label - * - * @throws ElementNotFoundException - */ - public function uncheckField($locator) - { - $field = $this->findField($locator); - - if (null === $field) { - throw $this->elementNotFound('form field', 'id|name|label|value', $locator); - } - - $field->uncheck(); - } - - /** - * Checks whether element has a select field with specified locator. - * - * @param string $locator select id, name or label - * - * @return Boolean - */ - public function hasSelect($locator) - { - return $this->has('named', array( - 'select', $this->getSelectorsHandler()->xpathLiteral($locator), - )); - } - - /** - * Selects option from select field with specified locator. - * - * @param string $locator input id, name or label - * @param string $value option value - * @param Boolean $multiple select multiple options - * - * @throws ElementNotFoundException - * - * @see NodeElement::selectOption - */ - public function selectFieldOption($locator, $value, $multiple = false) - { - $field = $this->findField($locator); - - if (null === $field) { - throw $this->elementNotFound('form field', 'id|name|label|value', $locator); - } - - $field->selectOption($value, $multiple); - } - - /** - * Checks whether element has a table with specified locator. - * - * @param string $locator table id or caption - * - * @return Boolean - */ - public function hasTable($locator) - { - return $this->has('named', array( - 'table', $this->getSelectorsHandler()->xpathLiteral($locator), - )); - } - - /** - * Attach file to file field with specified locator. - * - * @param string $locator input id, name or label - * @param string $path path to file - * - * @throws ElementNotFoundException - * - * @see NodeElement::attachFile - */ - public function attachFileToField($locator, $path) - { - $field = $this->findField($locator); - - if (null === $field) { - throw $this->elementNotFound('form field', 'id|name|label|value', $locator); - } - - $field->attachFile($path); - } -} diff --git a/core/vendor/behat/mink/src/Exception/DriverException.php b/core/vendor/behat/mink/src/Exception/DriverException.php deleted file mode 100644 index 840f8bd..0000000 --- a/core/vendor/behat/mink/src/Exception/DriverException.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/* - * This file is part of the Mink package. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Behat\Mink\Exception; - -/** - * Exception thrown by drivers when they fail to perform an action. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class DriverException extends Exception -{ - /** - * Initializes exception. - * - * @param string $message - * @param int $code - * @param \Exception|null $previous - */ - public function __construct($message, $code = 0, \Exception $previous = null) - { - parent::__construct($message, $code, $previous); - } -} diff --git a/core/vendor/behat/mink/src/Exception/ElementException.php b/core/vendor/behat/mink/src/Exception/ElementException.php deleted file mode 100644 index 49d5c6c..0000000 --- a/core/vendor/behat/mink/src/Exception/ElementException.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php - -/* - * This file is part of the Mink package. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Behat\Mink\Exception; - -use Behat\Mink\Element\Element; - -/** - * A standard way for elements to re-throw exceptions - * - * @deprecated This exception class is not used anymore in Mink 1.6 and will be removed in 2.0 - * - * @author Chris Worfolk <xmeltrut@gmail.com> - */ -class ElementException extends Exception -{ - private $element; - - /** - * Initialises exception. - * - * @param Element $element optional message - * @param \Exception $exception exception - */ - public function __construct(Element $element, \Exception $exception) - { - $this->element = $element; - - parent::__construct(sprintf("Exception thrown by %s\n%s", $element->getXpath(), $exception->getMessage())); - } - - /** - * Override default toString so we don't send a full backtrace in verbose mode. - * - * @return string - */ - public function __toString() - { - return $this->getMessage(); - } - - /** - * Get the element that caused the exception - * - * @return Element - */ - public function getElement() - { - return $this->element; - } -} diff --git a/core/vendor/behat/mink/src/Exception/ElementHtmlException.php b/core/vendor/behat/mink/src/Exception/ElementHtmlException.php deleted file mode 100644 index 99e2ea6..0000000 --- a/core/vendor/behat/mink/src/Exception/ElementHtmlException.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php - -/* - * This file is part of the Mink package. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Behat\Mink\Exception; - -use Behat\Mink\Session; -use Behat\Mink\Element\Element; - -/** - * Exception thrown when an expectation on the HTML of an element fails. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class ElementHtmlException extends ExpectationException -{ - /** - * Element instance. - * - * @var Element - */ - protected $element; - - /** - * Initializes exception. - * - * @param string $message optional message - * @param Session $session session instance - * @param Element $element element - * @param \Exception $exception expectation exception - */ - public function __construct($message, Session $session, Element $element, \Exception $exception = null) - { - $this->element = $element; - - parent::__construct($message, $session, $exception); - } - - protected function getContext() - { - return $this->element->getOuterHtml(); - } -} diff --git a/core/vendor/behat/mink/src/Exception/ElementNotFoundException.php b/core/vendor/behat/mink/src/Exception/ElementNotFoundException.php deleted file mode 100644 index 95fd5f0..0000000 --- a/core/vendor/behat/mink/src/Exception/ElementNotFoundException.php +++ /dev/null @@ -1,53 +0,0 @@ -<?php - -/* - * This file is part of the Mink package. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Behat\Mink\Exception; - -use Behat\Mink\Session; - -/** - * Exception thrown when an expected element is not found. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class ElementNotFoundException extends ExpectationException -{ - /** - * Initializes exception. - * - * @param Session $session session instance - * @param string $type element type - * @param string $selector element selector type - * @param string $locator element locator - */ - public function __construct(Session $session, $type = null, $selector = null, $locator = null) - { - $message = ''; - - if (null !== $type) { - $message .= ucfirst($type); - } else { - $message .= 'Tag'; - } - - if (null !== $locator) { - if (null === $selector || in_array($selector, array('css', 'xpath'))) { - $selector = 'matching '.($selector ?: 'locator'); - } else { - $selector = 'with '.$selector; - } - $message .= ' '.$selector.' "'.$locator.'"'; - } - - $message .= ' not found.'; - - parent::__construct($message, $session); - } -} diff --git a/core/vendor/behat/mink/src/Exception/ElementTextException.php b/core/vendor/behat/mink/src/Exception/ElementTextException.php deleted file mode 100644 index 5efff0f..0000000 --- a/core/vendor/behat/mink/src/Exception/ElementTextException.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -/* - * This file is part of the Mink package. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Behat\Mink\Exception; - -/** - * Exception thrown when an expectation on the text of an element fails. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class ElementTextException extends ElementHtmlException -{ - protected function getContext() - { - return $this->element->getText(); - } -} diff --git a/core/vendor/behat/mink/src/Exception/Exception.php b/core/vendor/behat/mink/src/Exception/Exception.php deleted file mode 100644 index 4662a5b..0000000 --- a/core/vendor/behat/mink/src/Exception/Exception.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -/* - * This file is part of the Mink package. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Behat\Mink\Exception; - -/** - * Mink base exception class. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -abstract class Exception extends \Exception -{ -} diff --git a/core/vendor/behat/mink/src/Exception/ExpectationException.php b/core/vendor/behat/mink/src/Exception/ExpectationException.php deleted file mode 100644 index 25034d1..0000000 --- a/core/vendor/behat/mink/src/Exception/ExpectationException.php +++ /dev/null @@ -1,145 +0,0 @@ -<?php - -/* - * This file is part of the Mink package. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Behat\Mink\Exception; - -use Behat\Mink\Session; - -/** - * Exception thrown for failed expectations. - * - * Some specialized child classes are available to customize the error rendering. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class ExpectationException extends Exception -{ - private $session; - - /** - * Initializes exception. - * - * @param string $message optional message - * @param Session $session session instance - * @param \Exception $exception expectation exception - */ - public function __construct($message, Session $session, \Exception $exception = null) - { - $this->session = $session; - - if (!$message && null !== $exception) { - $message = $exception->getMessage(); - } - - parent::__construct($message, 0, $exception); - } - - /** - * Returns exception message with additional context info. - * - * @return string - */ - public function __toString() - { - try { - $pageText = $this->pipeString($this->trimString($this->getContext())."\n"); - $string = sprintf("%s\n\n%s%s", $this->getMessage(), $this->getResponseInfo(), $pageText); - } catch (\Exception $e) { - return $this->getMessage(); - } - - return $string; - } - - /** - * Gets the context rendered for this exception - * - * @return string - */ - protected function getContext() - { - return $this->trimBody($this->getSession()->getPage()->getContent()); - } - - /** - * Returns exception session. - * - * @return Session - */ - protected function getSession() - { - return $this->session; - } - - /** - * Prepends every line in a string with pipe (|). - * - * @param string $string - * - * @return string - */ - protected function pipeString($string) - { - return '| '.strtr($string, array("\n" => "\n| ")); - } - - /** - * Removes response header/footer, letting only <body /> content. - * - * @param string $string response content - * - * @return string - */ - protected function trimBody($string) - { - $string = preg_replace(array('/^.*<body>/s', '/<\/body>.*$/s'), array('<body>', '</body>'), $string); - - return $string; - } - - /** - * Trims string to specified number of chars. - * - * @param string $string response content - * @param integer $count trim count - * - * @return string - */ - protected function trimString($string, $count = 1000) - { - $string = trim($string); - - if ($count < mb_strlen($string)) { - return mb_substr($string, 0, $count - 3).'...'; - } - - return $string; - } - - /** - * Returns response information string. - * - * @return string - */ - protected function getResponseInfo() - { - $driver = basename(str_replace('\\', '/', get_class($this->session->getDriver()))); - - $info = '+--[ '; - try { - $info .= 'HTTP/1.1 '.$this->session->getStatusCode().' | '; - } catch (UnsupportedDriverActionException $e) { - // Ignore the status code when not supported - } - $info .= $this->session->getCurrentUrl().' | '.$driver." ]\n|\n"; - - return $info; - } -} diff --git a/core/vendor/behat/mink/src/Exception/ResponseTextException.php b/core/vendor/behat/mink/src/Exception/ResponseTextException.php deleted file mode 100644 index 145ed6d..0000000 --- a/core/vendor/behat/mink/src/Exception/ResponseTextException.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -/* - * This file is part of the Mink package. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Behat\Mink\Exception; - -/** - * Exception thrown when an expectation on the response text fails. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class ResponseTextException extends ExpectationException -{ - protected function getContext() - { - return $this->getSession()->getPage()->getText(); - } -} diff --git a/core/vendor/behat/mink/src/Exception/UnsupportedDriverActionException.php b/core/vendor/behat/mink/src/Exception/UnsupportedDriverActionException.php deleted file mode 100644 index d02969b..0000000 --- a/core/vendor/behat/mink/src/Exception/UnsupportedDriverActionException.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php - -/* - * This file is part of the Mink package. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Behat\Mink\Exception; - -use Behat\Mink\Driver\DriverInterface; - -/** - * Exception thrown by drivers when they don't support the requested action. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class UnsupportedDriverActionException extends DriverException -{ - /** - * Initializes exception. - * - * @param string $template what is unsupported? - * @param DriverInterface $driver driver instance - * @param \Exception $previous previous exception - */ - public function __construct($template, DriverInterface $driver, \Exception $previous = null) - { - $message = sprintf($template, get_class($driver)); - - parent::__construct($message, 0, $previous); - } -} diff --git a/core/vendor/behat/mink/src/Mink.php b/core/vendor/behat/mink/src/Mink.php deleted file mode 100644 index d1621b1..0000000 --- a/core/vendor/behat/mink/src/Mink.php +++ /dev/null @@ -1,216 +0,0 @@ -<?php - -/* - * This file is part of the Mink package. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Behat\Mink; - -/** - * Mink sessions manager. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class Mink -{ - private $defaultSessionName; - - /** - * Sessions. - * - * @var Session[] - */ - private $sessions = array(); - - /** - * Initializes manager. - * - * @param Session[] $sessions - */ - public function __construct(array $sessions = array()) - { - foreach ($sessions as $name => $session) { - $this->registerSession($name, $session); - } - } - - /** - * Stops all started sessions. - */ - public function __destruct() - { - $this->stopSessions(); - } - - /** - * Registers new session. - * - * @param string $name - * @param Session $session - */ - public function registerSession($name, Session $session) - { - $name = strtolower($name); - - $this->sessions[$name] = $session; - } - - /** - * Checks whether session with specified name is registered. - * - * @param string $name - * - * @return Boolean - */ - public function hasSession($name) - { - return isset($this->sessions[strtolower($name)]); - } - - /** - * Sets default session name to use. - * - * @param string $name name of the registered session - * - * @throws \InvalidArgumentException - */ - public function setDefaultSessionName($name) - { - $name = strtolower($name); - - if (!isset($this->sessions[$name])) { - throw new \InvalidArgumentException(sprintf('Session "%s" is not registered.', $name)); - } - - $this->defaultSessionName = $name; - } - - /** - * Returns default session name or null if none. - * - * @return null|string - */ - public function getDefaultSessionName() - { - return $this->defaultSessionName; - } - - /** - * Returns registered session by it's name or active one and automatically starts it if required. - * - * @param string $name session name - * - * @return Session - * - * @throws \InvalidArgumentException If the named session is not registered - */ - public function getSession($name = null) - { - $session = $this->locateSession($name); - - // start session if needed - if (!$session->isStarted()) { - $session->start(); - } - - return $session; - } - - /** - * Checks whether a named session (or the default session) has already been started - * - * @param string $name session name - if null then the default session will be checked - * - * @return bool whether the session has been started - * - * @throws \InvalidArgumentException If the named session is not registered - */ - public function isSessionStarted($name = null) - { - $session = $this->locateSession($name); - - return $session->isStarted(); - } - - /** - * Returns session asserter. - * - * @param Session|string $session session object or name - * - * @return WebAssert - */ - public function assertSession($session = null) - { - if (!($session instanceof Session)) { - $session = $this->getSession($session); - } - - return new WebAssert($session); - } - - /** - * Resets all started sessions. - */ - public function resetSessions() - { - foreach ($this->sessions as $session) { - if ($session->isStarted()) { - $session->reset(); - } - } - } - - /** - * Restarts all started sessions. - */ - public function restartSessions() - { - foreach ($this->sessions as $session) { - if ($session->isStarted()) { - $session->restart(); - } - } - } - - /** - * Stops all started sessions. - */ - public function stopSessions() - { - foreach ($this->sessions as $session) { - if ($session->isStarted()) { - $session->stop(); - } - } - } - - /** - * Returns the named or default session without starting it. - * - * @param string $name session name - * - * @return Session - * - * @throws \InvalidArgumentException If the named session is not registered - */ - protected function locateSession($name = null) - { - $name = strtolower($name) ?: $this->defaultSessionName; - - if (null === $name) { - throw new \InvalidArgumentException('Specify session name to get'); - } - - if (!isset($this->sessions[$name])) { - throw new \InvalidArgumentException(sprintf('Session "%s" is not registered.', $name)); - } - - $session = $this->sessions[$name]; - - return $session; - } -} diff --git a/core/vendor/behat/mink/src/Selector/CssSelector.php b/core/vendor/behat/mink/src/Selector/CssSelector.php deleted file mode 100644 index 3636586..0000000 --- a/core/vendor/behat/mink/src/Selector/CssSelector.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -/* - * This file is part of the Mink package. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Behat\Mink\Selector; - -use Symfony\Component\CssSelector\CssSelector as CSS; - -/** - * CSS selector engine. Transforms CSS to XPath. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class CssSelector implements SelectorInterface -{ - /** - * Translates CSS into XPath. - * - * @param string|array $locator current selector locator - * - * @return string - */ - public function translateToXPath($locator) - { - if (!is_string($locator)) { - throw new \InvalidArgumentException('The CssSelector expects to get a string as locator'); - } - - return CSS::toXPath($locator); - } -} diff --git a/core/vendor/behat/mink/src/Selector/ExactNamedSelector.php b/core/vendor/behat/mink/src/Selector/ExactNamedSelector.php deleted file mode 100644 index 03315a9..0000000 --- a/core/vendor/behat/mink/src/Selector/ExactNamedSelector.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -/* - * This file is part of the Mink package. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Behat\Mink\Selector; - -/** - * Exact match selector engine. Like the Named selector engine but ignores partial matches. - */ -class ExactNamedSelector extends NamedSelector -{ - public function __construct() - { - $this->registerReplacement('%tagTextMatch%', 'normalize-space(string(.)) = %locator%'); - $this->registerReplacement('%valueMatch%', './@value = %locator%'); - $this->registerReplacement('%titleMatch%', './@title = %locator%'); - $this->registerReplacement('%altMatch%', './@alt = %locator%'); - $this->registerReplacement('%relMatch%', './@rel = %locator%'); - $this->registerReplacement('%labelAttributeMatch%', './@label = %locator%'); - - parent::__construct(); - } -} diff --git a/core/vendor/behat/mink/src/Selector/NamedSelector.php b/core/vendor/behat/mink/src/Selector/NamedSelector.php deleted file mode 100644 index 4845f99..0000000 --- a/core/vendor/behat/mink/src/Selector/NamedSelector.php +++ /dev/null @@ -1,238 +0,0 @@ -<?php - -/* - * This file is part of the Mink package. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Behat\Mink\Selector; - -/** - * Named selectors engine. Uses registered XPath selectors to create new expressions. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class NamedSelector implements SelectorInterface -{ - private $replacements = array( - // simple replacements - '%lowercaseType%' => "translate(./@type, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')", - '%lowercaseRole%' => "translate(./@role, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')", - '%tagTextMatch%' => 'contains(normalize-space(string(.)), %locator%)', - '%labelTextMatch%' => './@id = //label[%tagTextMatch%]/@for', - '%idMatch%' => './@id = %locator%', - '%valueMatch%' => 'contains(./@value, %locator%)', - '%idOrValueMatch%' => '(%idMatch% or %valueMatch%)', - '%idOrNameMatch%' => '(%idMatch% or ./@name = %locator%)', - '%placeholderMatch%' => './@placeholder = %locator%', - '%titleMatch%' => 'contains(./@title, %locator%)', - '%altMatch%' => 'contains(./@alt, %locator%)', - '%relMatch%' => 'contains(./@rel, %locator%)', - '%labelAttributeMatch%' => 'contains(./@label, %locator%)', - - // complex replacements - '%inputTypeWithoutPlaceholderFilter%' => "%lowercaseType% = 'radio' or %lowercaseType% = 'checkbox' or %lowercaseType% = 'file'", - '%fieldFilterWithPlaceholder%' => 'self::input[not(%inputTypeWithoutPlaceholderFilter%)] | self::textarea', - '%fieldMatchWithPlaceholder%' => '(%idOrNameMatch% or %labelTextMatch% or %placeholderMatch%)', - '%fieldMatchWithoutPlaceholder%' => '(%idOrNameMatch% or %labelTextMatch%)', - '%fieldFilterWithoutPlaceholder%' => 'self::input[%inputTypeWithoutPlaceholderFilter%] | self::select', - '%buttonTypeFilter%' => "%lowercaseType% = 'submit' or %lowercaseType% = 'image' or %lowercaseType% = 'button' or %lowercaseType% = 'reset'", - '%notFieldTypeFilter%' => "not(%buttonTypeFilter% or %lowercaseType% = 'hidden')", - '%buttonMatch%' => '%idOrNameMatch% or %valueMatch% or %titleMatch%', - '%linkMatch%' => '(%idMatch% or %tagTextMatch% or %titleMatch% or %relMatch%)', - '%imgAltMatch%' => './/img[%altMatch%]', - ); - - private $selectors = array( - 'fieldset' => <<<XPATH -.//fieldset -[(%idMatch% or .//legend[%tagTextMatch%])] -XPATH - - ,'field' => <<<XPATH -.//* -[%fieldFilterWithPlaceholder%][%notFieldTypeFilter%][%fieldMatchWithPlaceholder%] -| -.//label[%tagTextMatch%]//.//*[%fieldFilterWithPlaceholder%][%notFieldTypeFilter%] -| -.//* -[%fieldFilterWithoutPlaceholder%][%notFieldTypeFilter%][%fieldMatchWithoutPlaceholder%] -| -.//label[%tagTextMatch%]//.//*[%fieldFilterWithoutPlaceholder%][%notFieldTypeFilter%] -XPATH - - ,'link' => <<<XPATH -.//a -[./@href][(%linkMatch% or %imgAltMatch%)] -| -.//* -[%lowercaseRole% = 'link'][(%idOrValueMatch% or %titleMatch% or %tagTextMatch%)] -XPATH - - ,'button' => <<<XPATH -.//input -[%buttonTypeFilter%][(%buttonMatch%)] -| -.//input -[%lowercaseType% = 'image'][%altMatch%] -| -.//button -[(%buttonMatch% or %tagTextMatch%)] -| -.//* -[%lowercaseRole% = 'button'][(%buttonMatch% or %tagTextMatch%)] -XPATH - - ,'link_or_button' => <<<XPATH -.//a -[./@href][(%linkMatch% or %imgAltMatch%)] -| -.//input -[%buttonTypeFilter%][(%idOrValueMatch% or %titleMatch%)] -| -.//input -[%lowercaseType% = 'image'][%altMatch%] -| -.//button -[(%idOrValueMatch% or %titleMatch% or %tagTextMatch%)] -| -.//* -[(%lowercaseRole% = 'button' or %lowercaseRole% = 'link')][(%idOrValueMatch% or %titleMatch% or %tagTextMatch%)] -XPATH - - ,'content' => <<<XPATH -./descendant-or-self::* -[%tagTextMatch%] -XPATH - - ,'select' => <<<XPATH -.//select -[%fieldMatchWithoutPlaceholder%] -| -.//label[%tagTextMatch%]//.//select -XPATH - - ,'checkbox' => <<<XPATH -.//input -[%lowercaseType% = 'checkbox'][%fieldMatchWithoutPlaceholder%] -| -.//label[%tagTextMatch%]//.//input[%lowercaseType% = 'checkbox'] -XPATH - - ,'radio' => <<<XPATH -.//input -[%lowercaseType% = 'radio'][%fieldMatchWithoutPlaceholder%] -| -.//label[%tagTextMatch%]//.//input[%lowercaseType% = 'radio'] -XPATH - - ,'file' => <<<XPATH -.//input -[%lowercaseType% = 'file'][%fieldMatchWithoutPlaceholder%] -| -.//label[%tagTextMatch%]//.//input[%lowercaseType% = 'file'] -XPATH - - ,'optgroup' => <<<XPATH -.//optgroup -[%labelAttributeMatch%] -XPATH - - ,'option' => <<<XPATH -.//option -[(./@value = %locator% or %tagTextMatch%)] -XPATH - - ,'table' => <<<XPATH -.//table -[(%idMatch% or .//caption[%tagTextMatch%])] -XPATH - ,'id' => <<<XPATH -.//*[%idMatch%] -XPATH - ,'id_or_name' => <<<XPATH -.//*[%idOrNameMatch%] -XPATH - ); - - /** - * Creates selector instance. - */ - public function __construct() - { - foreach ($this->replacements as $from => $to) { - $this->replacements[$from] = strtr($to, $this->replacements); - } - - foreach ($this->selectors as $alias => $selector) { - $this->selectors[$alias] = strtr($selector, $this->replacements); - } - } - - /** - * Registers new XPath selector with specified name. - * - * @param string $name name for selector - * @param string $xpath xpath expression - */ - public function registerNamedXpath($name, $xpath) - { - $this->selectors[$name] = $xpath; - } - - /** - * Translates provided locator into XPath. - * - * @param string|array $locator selector name or array of (selector_name, locator) - * - * @return string - * - * @throws \InvalidArgumentException - */ - public function translateToXPath($locator) - { - if (2 < count($locator)) { - throw new \InvalidArgumentException('NamedSelector expects array(name, locator) as argument'); - } - - if (2 == count($locator)) { - $selector = $locator[0]; - $locator = $locator[1]; - } else { - $selector = (string) $locator; - $locator = null; - } - - if (!isset($this->selectors[$selector])) { - throw new \InvalidArgumentException(sprintf( - 'Unknown named selector provided: "%s". Expected one of (%s)', - $selector, - implode(', ', array_keys($this->selectors)) - )); - } - - $xpath = $this->selectors[$selector]; - - if (null !== $locator) { - $xpath = strtr($xpath, array('%locator%' => $locator)); - } - - return $xpath; - } - - /** - * Registers a replacement in the list of replacements - * - * This method must be called in the constructor before calling the parent constructor. - * - * @param string $from - * @param string $to - */ - protected function registerReplacement($from, $to) - { - $this->replacements[$from] = $to; - } -} diff --git a/core/vendor/behat/mink/src/Selector/PartialNamedSelector.php b/core/vendor/behat/mink/src/Selector/PartialNamedSelector.php deleted file mode 100644 index b864a22..0000000 --- a/core/vendor/behat/mink/src/Selector/PartialNamedSelector.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/* - * This file is part of the Mink package. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Behat\Mink\Selector; - -/** - * Named selectors engine. Uses registered XPath selectors to create new expressions. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class PartialNamedSelector extends NamedSelector -{ - public function __construct() - { - $this->registerReplacement('%tagTextMatch%', 'contains(normalize-space(string(.)), %locator%)'); - $this->registerReplacement('%valueMatch%', 'contains(./@value, %locator%)'); - $this->registerReplacement('%titleMatch%', 'contains(./@title, %locator%)'); - $this->registerReplacement('%altMatch%', 'contains(./@alt, %locator%)'); - $this->registerReplacement('%relMatch%', 'contains(./@rel, %locator%)'); - $this->registerReplacement('%labelAttributeMatch%', 'contains(./@label, %locator%)'); - - parent::__construct(); - } -} diff --git a/core/vendor/behat/mink/src/Selector/SelectorInterface.php b/core/vendor/behat/mink/src/Selector/SelectorInterface.php deleted file mode 100644 index e4f5f17..0000000 --- a/core/vendor/behat/mink/src/Selector/SelectorInterface.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -/* - * This file is part of the Mink package. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Behat\Mink\Selector; - -/** - * Mink selector engine interface. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -interface SelectorInterface -{ - /** - * Translates provided locator into XPath. - * - * @param string|array $locator current selector locator - * - * @return string - */ - public function translateToXPath($locator); -} diff --git a/core/vendor/behat/mink/src/Selector/SelectorsHandler.php b/core/vendor/behat/mink/src/Selector/SelectorsHandler.php deleted file mode 100644 index a19de67..0000000 --- a/core/vendor/behat/mink/src/Selector/SelectorsHandler.php +++ /dev/null @@ -1,125 +0,0 @@ -<?php - -/* - * This file is part of the Mink package. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Behat\Mink\Selector; - -use Behat\Mink\Selector\Xpath\Escaper; - -/** - * Selectors handler. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class SelectorsHandler -{ - private $selectors; - private $escaper; - - /** - * Initializes selectors handler. - * - * @param SelectorInterface[] $selectors default selectors to register - */ - public function __construct(array $selectors = array()) - { - $this->escaper = new Escaper(); - - $this->registerSelector('named_partial', new PartialNamedSelector()); - $this->registerSelector('named_exact', new ExactNamedSelector()); - $this->registerSelector('css', new CssSelector()); - - foreach ($selectors as $name => $selector) { - $this->registerSelector($name, $selector); - } - } - - /** - * Registers new selector engine with specified name. - * - * @param string $name selector engine name - * @param SelectorInterface $selector selector engine instance - */ - public function registerSelector($name, SelectorInterface $selector) - { - $this->selectors[$name] = $selector; - } - - /** - * Checks whether selector with specified name is registered on handler. - * - * @param string $name selector engine name - * - * @return Boolean - */ - public function isSelectorRegistered($name) - { - return isset($this->selectors[$name]); - } - - /** - * Returns selector engine with specified name. - * - * @param string $name selector engine name - * - * @return SelectorInterface - * - * @throws \InvalidArgumentException - */ - public function getSelector($name) - { - if ('named' === $name) { - trigger_error( - 'Using the "named" selector directly from the handler is deprecated as of 1.6 and will be removed in 2.0.' - .' Use the "named_partial" or use the "named" selector through the Element API instead.', - E_USER_DEPRECATED - ); - $name = 'named_partial'; - } - - if (!$this->isSelectorRegistered($name)) { - throw new \InvalidArgumentException("Selector \"$name\" is not registered."); - } - - return $this->selectors[$name]; - } - - /** - * Translates selector with specified name to XPath. - * - * @param string $selector selector engine name (registered) - * @param string|array $locator selector locator (an array or a string depending of the selector being used) - * - * @return string - */ - public function selectorToXpath($selector, $locator) - { - if ('xpath' === $selector) { - if (!is_string($locator)) { - throw new \InvalidArgumentException('The xpath selector expects to get a string as locator'); - } - - return $locator; - } - - return $this->getSelector($selector)->translateToXPath($locator); - } - - /** - * Translates string to XPath literal. - * - * @param string $s - * - * @return string - */ - public function xpathLiteral($s) - { - return $this->escaper->escapeLiteral($s); - } -} diff --git a/core/vendor/behat/mink/src/Selector/Xpath/Escaper.php b/core/vendor/behat/mink/src/Selector/Xpath/Escaper.php deleted file mode 100644 index be35000..0000000 --- a/core/vendor/behat/mink/src/Selector/Xpath/Escaper.php +++ /dev/null @@ -1,52 +0,0 @@ -<?php - -/* - * This file is part of the Mink package. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Behat\Mink\Selector\Xpath; - -/** - * XPath escaper. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class Escaper -{ - /** - * Escapes the string as a XPath literal. - * - * @param string $s - * - * @return string - */ - public function escapeLiteral($s) - { - if (false === strpos($s, "'")) { - return sprintf("'%s'", $s); - } - - if (false === strpos($s, '"')) { - return sprintf('"%s"', $s); - } - - $string = $s; - $parts = array(); - while (true) { - if (false !== $pos = strpos($string, "'")) { - $parts[] = sprintf("'%s'", substr($string, 0, $pos)); - $parts[] = "\"'\""; - $string = substr($string, $pos + 1); - } else { - $parts[] = "'$string'"; - break; - } - } - - return sprintf("concat(%s)", implode($parts, ',')); - } -} diff --git a/core/vendor/behat/mink/src/Selector/Xpath/Manipulator.php b/core/vendor/behat/mink/src/Selector/Xpath/Manipulator.php deleted file mode 100644 index 116650a..0000000 --- a/core/vendor/behat/mink/src/Selector/Xpath/Manipulator.php +++ /dev/null @@ -1,69 +0,0 @@ -<?php - -/* - * This file is part of the Mink package. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Behat\Mink\Selector\Xpath; - -/** - * XPath manipulation utility. - * - * @author Graham Bates - * @author Christophe Coevoet <stof@notk.org> - */ -class Manipulator -{ - /** - * Regex to find union operators not inside brackets. - */ - const UNION_PATTERN = '/\|(?![^\[]*\])/'; - - /** - * Prepends the XPath prefix to the given XPath. - * - * The returned XPath will match elements matching the XPath inside an element - * matching the prefix. - * - * @param string $xpath - * @param string $prefix - * - * @return string - */ - public function prepend($xpath, $prefix) - { - $expressions = array(); - - // If the xpath prefix contains a union we need to wrap it in parentheses. - if (preg_match(self::UNION_PATTERN, $prefix)) { - $prefix = '('.$prefix.')'; - } - - // Split any unions into individual expressions. - foreach (preg_split(self::UNION_PATTERN, $xpath) as $expression) { - $expression = trim($expression); - $parenthesis = ''; - - // If the union is inside some braces, we need to preserve the opening braces and apply - // the prefix only inside it. - if (preg_match('/^[\(\s*]+/', $expression, $matches)) { - $parenthesis = $matches[0]; - $expression = substr($expression, strlen($parenthesis)); - } - - // add prefix before element selector - if (0 === strpos($expression, '/')) { - $expression = $prefix.$expression; - } else { - $expression = $prefix.'/'.$expression; - } - $expressions[] = $parenthesis.$expression; - } - - return implode(' | ', $expressions); - } -} diff --git a/core/vendor/behat/mink/src/Session.php b/core/vendor/behat/mink/src/Session.php deleted file mode 100644 index c67f7f9..0000000 --- a/core/vendor/behat/mink/src/Session.php +++ /dev/null @@ -1,352 +0,0 @@ -<?php - -/* - * This file is part of the Mink package. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Behat\Mink; - -use Behat\Mink\Driver\DriverInterface; -use Behat\Mink\Selector\SelectorsHandler; -use Behat\Mink\Element\DocumentElement; - -/** - * Mink session. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class Session -{ - private $driver; - private $page; - private $selectorsHandler; - - /** - * Initializes session. - * - * @param DriverInterface $driver - * @param SelectorsHandler $selectorsHandler - */ - public function __construct(DriverInterface $driver, SelectorsHandler $selectorsHandler = null) - { - $driver->setSession($this); - - if (null === $selectorsHandler) { - $selectorsHandler = new SelectorsHandler(); - } - - $this->driver = $driver; - $this->selectorsHandler = $selectorsHandler; - $this->page = new DocumentElement($this); - } - - /** - * Checks whether session (driver) was started. - * - * @return Boolean - */ - public function isStarted() - { - return $this->driver->isStarted(); - } - - /** - * Starts session driver. - * - * Calling any action before visiting a page is an undefined behavior. - * The only supported method calls on a fresh driver are - * - visit() - * - setRequestHeader() - * - setBasicAuth() - * - reset() - * - stop() - */ - public function start() - { - $this->driver->start(); - } - - /** - * Stops session driver. - */ - public function stop() - { - $this->driver->stop(); - } - - /** - * Restart session driver. - */ - public function restart() - { - $this->driver->stop(); - $this->driver->start(); - } - - /** - * Reset session driver state. - * - * Calling any action before visiting a page is an undefined behavior. - * The only supported method calls on a fresh driver are - * - visit() - * - setRequestHeader() - * - setBasicAuth() - * - reset() - * - stop() - */ - public function reset() - { - $this->driver->reset(); - } - - /** - * Returns session driver. - * - * @return DriverInterface - */ - public function getDriver() - { - return $this->driver; - } - - /** - * Returns page element. - * - * @return DocumentElement - */ - public function getPage() - { - return $this->page; - } - - /** - * Returns selectors handler. - * - * @return SelectorsHandler - */ - public function getSelectorsHandler() - { - return $this->selectorsHandler; - } - - /** - * Visit specified URL. - * - * @param string $url url of the page - */ - public function visit($url) - { - $this->driver->visit($url); - } - - /** - * Sets HTTP Basic authentication parameters - * - * @param string|Boolean $user user name or false to disable authentication - * @param string $password password - */ - public function setBasicAuth($user, $password = '') - { - $this->driver->setBasicAuth($user, $password); - } - - /** - * Sets specific request header. - * - * @param string $name - * @param string $value - */ - public function setRequestHeader($name, $value) - { - $this->driver->setRequestHeader($name, $value); - } - - /** - * Returns all response headers. - * - * @return array - */ - public function getResponseHeaders() - { - return $this->driver->getResponseHeaders(); - } - - /** - * Sets cookie. - * - * @param string $name - * @param string $value - */ - public function setCookie($name, $value = null) - { - $this->driver->setCookie($name, $value); - } - - /** - * Returns cookie by name. - * - * @param string $name - * - * @return string|null - */ - public function getCookie($name) - { - return $this->driver->getCookie($name); - } - - /** - * Returns response status code. - * - * @return integer - */ - public function getStatusCode() - { - return $this->driver->getStatusCode(); - } - - /** - * Returns current URL address. - * - * @return string - */ - public function getCurrentUrl() - { - return $this->driver->getCurrentUrl(); - } - - /** - * Capture a screenshot of the current window. - * - * @return string screenshot of MIME type image/* depending - * on driver (e.g., image/png, image/jpeg) - */ - public function getScreenshot() - { - return $this->driver->getScreenshot(); - } - - /** - * Return the names of all open windows - * - * @return array Array of all open window's names. - */ - public function getWindowNames() - { - return $this->driver->getWindowNames(); - } - - /** - * Return the name of the currently active window - * - * @return string The name of the current window. - */ - public function getWindowName() - { - return $this->driver->getWindowName(); - } - - /** - * Reloads current session page. - */ - public function reload() - { - $this->driver->reload(); - } - - /** - * Moves backward 1 page in history. - */ - public function back() - { - $this->driver->back(); - } - - /** - * Moves forward 1 page in history. - */ - public function forward() - { - $this->driver->forward(); - } - - /** - * Switches to specific browser window. - * - * @param string $name window name (null for switching back to main window) - */ - public function switchToWindow($name = null) - { - $this->driver->switchToWindow($name); - } - - /** - * Switches to specific iFrame. - * - * @param string $name iframe name (null for switching back) - */ - public function switchToIFrame($name = null) - { - $this->driver->switchToIFrame($name); - } - - /** - * Execute JS in browser. - * - * @param string $script javascript - */ - public function executeScript($script) - { - $this->driver->executeScript($script); - } - - /** - * Execute JS in browser and return it's response. - * - * @param string $script javascript - * - * @return string - */ - public function evaluateScript($script) - { - return $this->driver->evaluateScript($script); - } - - /** - * Waits some time or until JS condition turns true. - * - * @param integer $time time in milliseconds - * @param string $condition JS condition - * - * @return boolean - */ - public function wait($time, $condition = 'false') - { - return $this->driver->wait($time, $condition); - } - - /** - * Set the dimensions of the window. - * - * @param integer $width set the window width, measured in pixels - * @param integer $height set the window height, measured in pixels - * @param string $name window name (null for the main window) - */ - public function resizeWindow($width, $height, $name = null) - { - $this->driver->resizeWindow($width, $height, $name); - } - - /** - * Maximize the window if it is not maximized already - * - * @param string $name window name (null for the main window) - */ - public function maximizeWindow($name = null) - { - $this->driver->maximizeWindow($name); - } -} diff --git a/core/vendor/behat/mink/src/WebAssert.php b/core/vendor/behat/mink/src/WebAssert.php deleted file mode 100644 index 127c3c1..0000000 --- a/core/vendor/behat/mink/src/WebAssert.php +++ /dev/null @@ -1,749 +0,0 @@ -<?php - -/* - * This file is part of the Mink package. - * (c) Konstantin Kudryashov <ever.zet@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Behat\Mink; - -use Behat\Mink\Element\Element; -use Behat\Mink\Element\ElementInterface; -use Behat\Mink\Element\NodeElement; -use Behat\Mink\Element\TraversableElement; -use Behat\Mink\Exception\ElementNotFoundException; -use Behat\Mink\Exception\ExpectationException; -use Behat\Mink\Exception\ResponseTextException; -use Behat\Mink\Exception\ElementHtmlException; -use Behat\Mink\Exception\ElementTextException; - -/** - * Mink web assertions tool. - * - * @author Konstantin Kudryashov <ever.zet@gmail.com> - */ -class WebAssert -{ - protected $session; - - /** - * Initializes assertion engine. - * - * @param Session $session - */ - public function __construct(Session $session) - { - $this->session = $session; - } - - /** - * Checks that current session address is equals to provided one. - * - * @param string $page - * - * @throws ExpectationException - */ - public function addressEquals($page) - { - $expected = $this->cleanUrl($page); - $actual = $this->getCurrentUrlPath(); - - $this->assert($actual === $expected, sprintf('Current page is "%s", but "%s" expected.', $actual, $expected)); - } - - /** - * Checks that current session address is not equals to provided one. - * - * @param string $page - * - * @throws ExpectationException - */ - public function addressNotEquals($page) - { - $expected = $this->cleanUrl($page); - $actual = $this->getCurrentUrlPath(); - - $this->assert($actual !== $expected, sprintf('Current page is "%s", but should not be.', $actual)); - } - - /** - * Checks that current session address matches regex. - * - * @param string $regex - * - * @throws ExpectationException - */ - public function addressMatches($regex) - { - $actual = $this->getCurrentUrlPath(); - $message = sprintf('Current page "%s" does not match the regex "%s".', $actual, $regex); - - $this->assert((bool) preg_match($regex, $actual), $message); - } - - /** - * Checks that specified cookie exists and its value equals to a given one - * - * @param string $name cookie name - * @param string $value cookie value - * - * @throws ExpectationException - */ - public function cookieEquals($name, $value) - { - $this->cookieExists($name); - - $actualValue = $this->session->getCookie($name); - $message = sprintf('Cookie "%s" value is "%s", but should be "%s".', $name, $actualValue, $value); - - $this->assert($actualValue == $value, $message); - } - - /** - * Checks that specified cookie exists - * - * @param string $name cookie name - * - * @throws ExpectationException - */ - public function cookieExists($name) - { - $message = sprintf('Cookie "%s" is not set, but should be.', $name); - $this->assert($this->session->getCookie($name) !== null, $message); - } - - /** - * Checks that current response code equals to provided one. - * - * @param integer $code - * - * @throws ExpectationException - */ - public function statusCodeEquals($code) - { - $actual = $this->session->getStatusCode(); - $message = sprintf('Current response status code is %d, but %d expected.', $actual, $code); - - $this->assert(intval($code) === intval($actual), $message); - } - - /** - * Checks that current response code not equals to provided one. - * - * @param integer $code - * - * @throws ExpectationException - */ - public function statusCodeNotEquals($code) - { - $actual = $this->session->getStatusCode(); - $message = sprintf('Current response status code is %d, but should not be.', $actual); - - $this->assert(intval($code) !== intval($actual), $message); - } - - /** - * Checks that current page contains text. - * - * @param string $text - * - * @throws ResponseTextException - */ - public function pageTextContains($text) - { - $actual = $this->session->getPage()->getText(); - $actual = preg_replace('/\s+/u', ' ', $actual); - $regex = '/'.preg_quote($text, '/').'/ui'; - $message = sprintf('The text "%s" was not found anywhere in the text of the current page.', $text); - - $this->assertResponseText((bool) preg_match($regex, $actual), $message); - } - - /** - * Checks that current page does not contains text. - * - * @param string $text - * - * @throws ResponseTextException - */ - public function pageTextNotContains($text) - { - $actual = $this->session->getPage()->getText(); - $actual = preg_replace('/\s+/u', ' ', $actual); - $regex = '/'.preg_quote($text, '/').'/ui'; - $message = sprintf('The text "%s" appears in the text of this page, but it should not.', $text); - - $this->assertResponseText(!preg_match($regex, $actual), $message); - } - - /** - * Checks that current page text matches regex. - * - * @param string $regex - * - * @throws ResponseTextException - */ - public function pageTextMatches($regex) - { - $actual = $this->session->getPage()->getText(); - $message = sprintf('The pattern %s was not found anywhere in the text of the current page.', $regex); - - $this->assertResponseText((bool) preg_match($regex, $actual), $message); - } - - /** - * Checks that current page text does not matches regex. - * - * @param string $regex - * - * @throws ResponseTextException - */ - public function pageTextNotMatches($regex) - { - $actual = $this->session->getPage()->getText(); - $message = sprintf('The pattern %s was found in the text of the current page, but it should not.', $regex); - - $this->assertResponseText(!preg_match($regex, $actual), $message); - } - - /** - * Checks that page HTML (response content) contains text. - * - * @param string $text - * - * @throws ExpectationException - */ - public function responseContains($text) - { - $actual = $this->session->getPage()->getContent(); - $regex = '/'.preg_quote($text, '/').'/ui'; - $message = sprintf('The string "%s" was not found anywhere in the HTML response of the current page.', $text); - - $this->assert((bool) preg_match($regex, $actual), $message); - } - - /** - * Checks that page HTML (response content) does not contains text. - * - * @param string $text - * - * @throws ExpectationException - */ - public function responseNotContains($text) - { - $actual = $this->session->getPage()->getContent(); - $regex = '/'.preg_quote($text, '/').'/ui'; - $message = sprintf('The string "%s" appears in the HTML response of this page, but it should not.', $text); - - $this->assert(!preg_match($regex, $actual), $message); - } - - /** - * Checks that page HTML (response content) matches regex. - * - * @param string $regex - * - * @throws ExpectationException - */ - public function responseMatches($regex) - { - $actual = $this->session->getPage()->getContent(); - $message = sprintf('The pattern %s was not found anywhere in the HTML response of the page.', $regex); - - $this->assert((bool) preg_match($regex, $actual), $message); - } - - /** - * Checks that page HTML (response content) does not matches regex. - * - * @param $regex - * - * @throws ExpectationException - */ - public function responseNotMatches($regex) - { - $actual = $this->session->getPage()->getContent(); - $message = sprintf('The pattern %s was found in the HTML response of the page, but it should not.', $regex); - - $this->assert(!preg_match($regex, $actual), $message); - } - - /** - * Checks that there is specified number of specific elements on the page. - * - * @param string $selectorType element selector type (css, xpath) - * @param string|array $selector element selector - * @param integer $count expected count - * @param ElementInterface $container document to check against - * - * @throws ExpectationException - */ - public function elementsCount($selectorType, $selector, $count, ElementInterface $container = null) - { - $container = $container ?: $this->session->getPage(); - $nodes = $container->findAll($selectorType, $selector); - - $message = sprintf( - '%d %s found on the page, but should be %d.', - count($nodes), - $this->getMatchingElementRepresentation($selectorType, $selector, count($nodes) !== 1), - $count - ); - - $this->assert(intval($count) === count($nodes), $message); - } - - /** - * Checks that specific element exists on the current page. - * - * @param string $selectorType element selector type (css, xpath) - * @param string|array $selector element selector - * @param ElementInterface $container document to check against - * - * @return NodeElement - * - * @throws ElementNotFoundException - */ - public function elementExists($selectorType, $selector, ElementInterface $container = null) - { - $container = $container ?: $this->session->getPage(); - $node = $container->find($selectorType, $selector); - - if (null === $node) { - if (is_array($selector)) { - $selector = implode(' ', $selector); - } - - throw new ElementNotFoundException($this->session, 'element', $selectorType, $selector); - } - - return $node; - } - - /** - * Checks that specific element does not exists on the current page. - * - * @param string $selectorType element selector type (css, xpath) - * @param string|array $selector element selector - * @param ElementInterface $container document to check against - * - * @throws ExpectationException - */ - public function elementNotExists($selectorType, $selector, ElementInterface $container = null) - { - $container = $container ?: $this->session->getPage(); - $node = $container->find($selectorType, $selector); - - $message = sprintf( - 'An %s appears on this page, but it should not.', - $this->getMatchingElementRepresentation($selectorType, $selector) - ); - - $this->assert(null === $node, $message); - } - - /** - * Checks that specific element contains text. - * - * @param string $selectorType element selector type (css, xpath) - * @param string|array $selector element selector - * @param string $text expected text - * - * @throws ElementTextException - */ - public function elementTextContains($selectorType, $selector, $text) - { - $element = $this->elementExists($selectorType, $selector); - $actual = $element->getText(); - $regex = '/'.preg_quote($text, '/').'/ui'; - - $message = sprintf( - 'The text "%s" was not found in the text of the %s.', - $text, - $this->getMatchingElementRepresentation($selectorType, $selector) - ); - - $this->assertElementText((bool) preg_match($regex, $actual), $message, $element); - } - - /** - * Checks that specific element does not contains text. - * - * @param string $selectorType element selector type (css, xpath) - * @param string|array $selector element selector - * @param string $text expected text - * - * @throws ElementTextException - */ - public function elementTextNotContains($selectorType, $selector, $text) - { - $element = $this->elementExists($selectorType, $selector); - $actual = $element->getText(); - $regex = '/'.preg_quote($text, '/').'/ui'; - - $message = sprintf( - 'The text "%s" appears in the text of the %s, but it should not.', - $text, - $this->getMatchingElementRepresentation($selectorType, $selector) - ); - - $this->assertElementText(!preg_match($regex, $actual), $message, $element); - } - - /** - * Checks that specific element contains HTML. - * - * @param string $selectorType element selector type (css, xpath) - * @param string|array $selector element selector - * @param string $html expected text - * - * @throws ElementHtmlException - */ - public function elementContains($selectorType, $selector, $html) - { - $element = $this->elementExists($selectorType, $selector); - $actual = $element->getHtml(); - $regex = '/'.preg_quote($html, '/').'/ui'; - - $message = sprintf( - 'The string "%s" was not found in the HTML of the %s.', - $html, - $this->getMatchingElementRepresentation($selectorType, $selector) - ); - - $this->assertElement((bool) preg_match($regex, $actual), $message, $element); - } - - /** - * Checks that specific element does not contains HTML. - * - * @param string $selectorType element selector type (css, xpath) - * @param string|array $selector element selector - * @param string $html expected text - * - * @throws ElementHtmlException - */ - public function elementNotContains($selectorType, $selector, $html) - { - $element = $this->elementExists($selectorType, $selector); - $actual = $element->getHtml(); - $regex = '/'.preg_quote($html, '/').'/ui'; - - $message = sprintf( - 'The string "%s" appears in the HTML of the %s, but it should not.', - $html, - $this->getMatchingElementRepresentation($selectorType, $selector) - ); - - $this->assertElement(!preg_match($regex, $actual), $message, $element); - } - - /** - * Checks that an attribute exists in an element. - * - * @param string $selectorType - * @param string|array $selector - * @param string $attribute - * - * @return NodeElement - * - * @throws ElementHtmlException - */ - public function elementAttributeExists($selectorType, $selector, $attribute) - { - $element = $this->elementExists($selectorType, $selector); - - $message = sprintf( - 'The attribute "%s" was not found in the %s.', - $attribute, - $this->getMatchingElementRepresentation($selectorType, $selector) - ); - - $this->assertElement($element->hasAttribute($attribute), $message, $element); - - return $element; - } - - /** - * Checks that an attribute of a specific elements contains text. - * - * @param string $selectorType - * @param string|array $selector - * @param string $attribute - * @param string $text - * - * @throws ElementHtmlException - */ - public function elementAttributeContains($selectorType, $selector, $attribute, $text) - { - $element = $this->elementAttributeExists($selectorType, $selector, $attribute); - $actual = $element->getAttribute($attribute); - $regex = '/'.preg_quote($text, '/').'/ui'; - - $message = sprintf( - 'The text "%s" was not found in the attribute "%s" of the %s.', - $text, - $attribute, - $this->getMatchingElementRepresentation($selectorType, $selector) - ); - - $this->assertElement((bool) preg_match($regex, $actual), $message, $element); - } - - /** - * Checks that an attribute of a specific elements does not contain text. - * - * @param string $selectorType - * @param string|array $selector - * @param string $attribute - * @param string $text - * - * @throws ElementHtmlException - */ - public function elementAttributeNotContains($selectorType, $selector, $attribute, $text) - { - $element = $this->elementAttributeExists($selectorType, $selector, $attribute); - $actual = $element->getAttribute($attribute); - $regex = '/'.preg_quote($text, '/').'/ui'; - - $message = sprintf( - 'The text "%s" was found in the attribute "%s" of the %s.', - $text, - $attribute, - $this->getMatchingElementRepresentation($selectorType, $selector) - ); - - $this->assertElement(!preg_match($regex, $actual), $message, $element); - } - - /** - * Checks that specific field exists on the current page. - * - * @param string $field field id|name|label|value - * @param TraversableElement $container document to check against - * - * @return NodeElement - * - * @throws ElementNotFoundException - */ - public function fieldExists($field, TraversableElement $container = null) - { - $container = $container ?: $this->session->getPage(); - $node = $container->findField($field); - - if (null === $node) { - throw new ElementNotFoundException($this->session, 'form field', 'id|name|label|value', $field); - } - - return $node; - } - - /** - * Checks that specific field does not exists on the current page. - * - * @param string $field field id|name|label|value - * @param TraversableElement $container document to check against - * - * @throws ExpectationException - */ - public function fieldNotExists($field, TraversableElement $container = null) - { - $container = $container ?: $this->session->getPage(); - $node = $container->findField($field); - - $this->assert(null === $node, sprintf('A field "%s" appears on this page, but it should not.', $field)); - } - - /** - * Checks that specific field have provided value. - * - * @param string $field field id|name|label|value - * @param string $value field value - * @param TraversableElement $container document to check against - * - * @throws ExpectationException - */ - public function fieldValueEquals($field, $value, TraversableElement $container = null) - { - $node = $this->fieldExists($field, $container); - $actual = $node->getValue(); - $regex = '/^'.preg_quote($value, '/').'$/ui'; - - $message = sprintf('The field "%s" value is "%s", but "%s" expected.', $field, $actual, $value); - - $this->assert((bool) preg_match($regex, $actual), $message); - } - - /** - * Checks that specific field have provided value. - * - * @param string $field field id|name|label|value - * @param string $value field value - * @param TraversableElement $container document to check against - * - * @throws ExpectationException - */ - public function fieldValueNotEquals($field, $value, TraversableElement $container = null) - { - $node = $this->fieldExists($field, $container); - $actual = $node->getValue(); - $regex = '/^'.preg_quote($value, '/').'$/ui'; - - $message = sprintf('The field "%s" value is "%s", but it should not be.', $field, $actual); - - $this->assert(!preg_match($regex, $actual), $message); - } - - /** - * Checks that specific checkbox is checked. - * - * @param string $field field id|name|label|value - * @param TraversableElement $container document to check against - * - * @throws ExpectationException - */ - public function checkboxChecked($field, TraversableElement $container = null) - { - $node = $this->fieldExists($field, $container); - - $this->assert($node->isChecked(), sprintf('Checkbox "%s" is not checked, but it should be.', $field)); - } - - /** - * Checks that specific checkbox is unchecked. - * - * @param string $field field id|name|label|value - * @param TraversableElement $container document to check against - * - * @throws ExpectationException - */ - public function checkboxNotChecked($field, TraversableElement $container = null) - { - $node = $this->fieldExists($field, $container); - - $this->assert(!$node->isChecked(), sprintf('Checkbox "%s" is checked, but it should not be.', $field)); - } - - /** - * Gets current url of the page. - * - * @return string - */ - protected function getCurrentUrlPath() - { - return $this->cleanUrl($this->session->getCurrentUrl()); - } - - /** - * Trims scriptname from the URL. - * - * @param string $url - * - * @return string - */ - protected function cleanUrl($url) - { - $parts = parse_url($url); - $fragment = empty($parts['fragment']) ? '' : '#'.$parts['fragment']; - $path = empty($parts['path']) ? '/' : $parts['path']; - - return preg_replace('/^\/[^\.\/]+\.php/', '', $path).$fragment; - } - - /** - * Asserts a condition. - * - * @param bool $condition - * @param string $message Failure message - * - * @throws ExpectationException when the condition is not fulfilled - */ - private function assert($condition, $message) - { - if ($condition) { - return; - } - - throw new ExpectationException($message, $this->session); - } - - /** - * Asserts a condition involving the response text. - * - * @param bool $condition - * @param string $message Failure message - * - * @throws ResponseTextException when the condition is not fulfilled - */ - private function assertResponseText($condition, $message) - { - if ($condition) { - return; - } - - throw new ResponseTextException($message, $this->session); - } - - /** - * Asserts a condition on an element. - * - * @param bool $condition - * @param string $message Failure message - * @param Element $element - * - * @throws ElementHtmlException when the condition is not fulfilled - */ - private function assertElement($condition, $message, Element $element) - { - if ($condition) { - return; - } - - throw new ElementHtmlException($message, $this->session, $element); - } - - /** - * Asserts a condition involving the text of an element. - * - * @param bool $condition - * @param string $message Failure message - * @param Element $element - * - * @throws ElementTextException when the condition is not fulfilled - */ - private function assertElementText($condition, $message, Element $element) - { - if ($condition) { - return; - } - - throw new ElementTextException($message, $this->session, $element); - } - - /** - * @param string $selectorType - * @param string|array $selector - * @param boolean $plural - * - * @return string - */ - private function getMatchingElementRepresentation($selectorType, $selector, $plural = false) - { - $pluralization = $plural ? 's' : ''; - - if (in_array($selectorType, array('named', 'named_exact', 'named_partial')) - && is_array($selector) && 2 === count($selector) - ) { - return sprintf('%s%s matching locator "%s"', $selector[0], $pluralization, $selector[1]); - } - - if (is_array($selector)) { - $selector = implode(' ', $selector); - } - - return sprintf('element%s matching %s "%s"', $pluralization, $selectorType, $selector); - } -} diff --git a/core/vendor/behat/mink/tests/Driver/CoreDriverTest.php b/core/vendor/behat/mink/tests/Driver/CoreDriverTest.php deleted file mode 100644 index d99b17f..0000000 --- a/core/vendor/behat/mink/tests/Driver/CoreDriverTest.php +++ /dev/null @@ -1,76 +0,0 @@ -<?php - -namespace Behat\Mink\Tests\Driver; - -class CoreDriverTest extends \PHPUnit_Framework_TestCase -{ - public function testNoExtraMethods() - { - $interfaceRef = new \ReflectionClass('Behat\Mink\Driver\DriverInterface'); - $coreDriverRef = new \ReflectionClass('Behat\Mink\Driver\CoreDriver'); - - foreach ($coreDriverRef->getMethods(\ReflectionMethod::IS_PUBLIC) as $method) { - $this->assertTrue( - $interfaceRef->hasMethod($method->getName()), - sprintf('CoreDriver should not implement methods which are not part of the DriverInterface but %s found', $method->getName()) - ); - } - } - - /** - * @dataProvider getDriverInterfaceMethods - */ - public function testInterfaceMethods(\ReflectionMethod $method) - { - $refl = new \ReflectionClass('Behat\Mink\Driver\CoreDriver'); - - $this->assertFalse( - $refl->getMethod($method->getName())->isAbstract(), - sprintf('CoreDriver should implement a dummy %s method', $method->getName()) - ); - - $driver = $this->getMockForAbstractClass('Behat\Mink\Driver\CoreDriver'); - - $this->setExpectedException('Behat\Mink\Exception\UnsupportedDriverActionException'); - call_user_func_array(array($driver, $method->getName()), $this->getArguments($method)); - } - - public function getDriverInterfaceMethods() - { - $ref = new \ReflectionClass('Behat\Mink\Driver\DriverInterface'); - - return array_map(function ($method) { - return array($method); - }, $ref->getMethods()); - } - - private function getArguments(\ReflectionMethod $method) - { - $arguments = array(); - - foreach ($method->getParameters() as $parameter) { - $arguments[] = $this->getArgument($parameter); - } - - return $arguments; - } - - private function getArgument(\ReflectionParameter $argument) - { - if ($argument->isOptional()) { - return $argument->getDefaultValue(); - } - - if ($argument->allowsNull()) { - return null; - } - - if ($argument->getClass()) { - return $this->getMockBuilder($argument->getClass()->getName()) - ->disableOriginalConstructor() - ->getMock(); - } - - return null; - } -} diff --git a/core/vendor/behat/mink/tests/Element/DocumentElementTest.php b/core/vendor/behat/mink/tests/Element/DocumentElementTest.php deleted file mode 100644 index bacd06d..0000000 --- a/core/vendor/behat/mink/tests/Element/DocumentElementTest.php +++ /dev/null @@ -1,446 +0,0 @@ -<?php - -namespace Behat\Mink\Tests\Element; - -use Behat\Mink\Element\DocumentElement; - -class DocumentElementTest extends ElementTest -{ - /** - * Page. - * - * @var DocumentElement - */ - private $document; - - protected function setUp() - { - parent::setUp(); - $this->document = new DocumentElement($this->session); - } - - public function testGetSession() - { - $this->assertEquals($this->session, $this->document->getSession()); - } - - public function testFindAll() - { - $xpath = 'h3[a]'; - $css = 'h3 > a'; - - $this->driver - ->expects($this->exactly(2)) - ->method('find') - ->will($this->returnValueMap(array( - array('//html/'.$xpath, array(2, 3, 4)), - array('//html/'.$css, array(1, 2)), - ))); - - $this->selectors - ->expects($this->exactly(2)) - ->method('selectorToXpath') - ->will($this->returnValueMap(array( - array('xpath', $xpath, $xpath), - array('css', $css, $css), - ))); - - $this->assertEquals(3, count($this->document->findAll('xpath', $xpath))); - $this->assertEquals(2, count($this->document->findAll('css', $css))); - } - - public function testFind() - { - $this->driver - ->expects($this->exactly(3)) - ->method('find') - ->with('//html/h3[a]') - ->will($this->onConsecutiveCalls(array(2, 3, 4), array(1, 2), array())); - - $xpath = 'h3[a]'; - $css = 'h3 > a'; - - $this->selectors - ->expects($this->exactly(3)) - ->method('selectorToXpath') - ->will($this->returnValueMap(array( - array('xpath', $xpath, $xpath), - array('xpath', $xpath, $xpath), - array('css', $css, $xpath), - ))); - - $this->assertEquals(2, $this->document->find('xpath', $xpath)); - $this->assertEquals(1, $this->document->find('css', $css)); - $this->assertNull($this->document->find('xpath', $xpath)); - } - - public function testFindField() - { - $this->mockNamedFinder( - '//field', - array('field1', 'field2', 'field3'), - array('field', 'some field') - ); - - $this->assertEquals('field1', $this->document->findField('some field')); - $this->assertEquals(null, $this->document->findField('some field')); - } - - public function testFindLink() - { - $this->mockNamedFinder( - '//link', - array('link1', 'link2', 'link3'), - array('link', 'some link') - ); - - $this->assertEquals('link1', $this->document->findLink('some link')); - $this->assertEquals(null, $this->document->findLink('some link')); - } - - public function testFindButton() - { - $this->mockNamedFinder( - '//button', - array('button1', 'button2', 'button3'), - array('button', 'some button') - ); - - $this->assertEquals('button1', $this->document->findButton('some button')); - $this->assertEquals(null, $this->document->findButton('some button')); - } - - public function testFindById() - { - $xpath = '//*[@id=some-item-2]'; - - $this->mockNamedFinder($xpath, array(array('id2', 'id3'), array()), array('id', 'some-item-2')); - - $this->assertEquals('id2', $this->document->findById('some-item-2')); - $this->assertEquals(null, $this->document->findById('some-item-2')); - } - - public function testHasSelector() - { - $this->driver - ->expects($this->exactly(2)) - ->method('find') - ->with('//html/some xpath') - ->will($this->onConsecutiveCalls(array('id2', 'id3'), array())); - - $this->selectors - ->expects($this->exactly(2)) - ->method('selectorToXpath') - ->with('xpath', 'some xpath') - ->will($this->returnValue('some xpath')); - - $this->assertTrue($this->document->has('xpath', 'some xpath')); - $this->assertFalse($this->document->has('xpath', 'some xpath')); - } - - public function testHasContent() - { - $this->mockNamedFinder( - '//some content', - array('item1', 'item2'), - array('content', 'some content') - ); - - $this->assertTrue($this->document->hasContent('some content')); - $this->assertFalse($this->document->hasContent('some content')); - } - - public function testHasLink() - { - $this->mockNamedFinder( - '//link', - array('link1', 'link2', 'link3'), - array('link', 'some link') - ); - - $this->assertTrue($this->document->hasLink('some link')); - $this->assertFalse($this->document->hasLink('some link')); - } - - public function testHasButton() - { - $this->mockNamedFinder( - '//button', - array('button1', 'button2', 'button3'), - array('button', 'some button') - ); - - $this->assertTrue($this->document->hasButton('some button')); - $this->assertFalse($this->document->hasButton('some button')); - } - - public function testHasField() - { - $this->mockNamedFinder( - '//field', - array('field1', 'field2', 'field3'), - array('field', 'some field') - ); - - $this->assertTrue($this->document->hasField('some field')); - $this->assertFalse($this->document->hasField('some field')); - } - - public function testHasCheckedField() - { - $checkbox = $this->getMockBuilder('Behat\Mink\Element\NodeElement') - ->disableOriginalConstructor() - ->getMock(); - $checkbox - ->expects($this->exactly(2)) - ->method('isChecked') - ->will($this->onConsecutiveCalls(true, false)); - - $this->mockNamedFinder( - '//field', - array(array($checkbox), array(), array($checkbox)), - array('field', 'some checkbox'), - 3 - ); - - $this->assertTrue($this->document->hasCheckedField('some checkbox')); - $this->assertFalse($this->document->hasCheckedField('some checkbox')); - $this->assertFalse($this->document->hasCheckedField('some checkbox')); - } - - public function testHasUncheckedField() - { - $checkbox = $this->getMockBuilder('Behat\Mink\Element\NodeElement') - ->disableOriginalConstructor() - ->getMock(); - $checkbox - ->expects($this->exactly(2)) - ->method('isChecked') - ->will($this->onConsecutiveCalls(true, false)); - - $this->mockNamedFinder( - '//field', - array(array($checkbox), array(), array($checkbox)), - array('field', 'some checkbox'), - 3 - ); - - $this->assertFalse($this->document->hasUncheckedField('some checkbox')); - $this->assertFalse($this->document->hasUncheckedField('some checkbox')); - $this->assertTrue($this->document->hasUncheckedField('some checkbox')); - } - - public function testHasSelect() - { - $this->mockNamedFinder( - '//select', - array('select'), - array('select', 'some select field') - ); - - $this->assertTrue($this->document->hasSelect('some select field')); - $this->assertFalse($this->document->hasSelect('some select field')); - } - - public function testHasTable() - { - $this->mockNamedFinder( - '//table', - array('table'), - array('table', 'some table') - ); - - $this->assertTrue($this->document->hasTable('some table')); - $this->assertFalse($this->document->hasTable('some table')); - } - - public function testClickLink() - { - $node = $this->getMockBuilder('Behat\Mink\Element\NodeElement') - ->disableOriginalConstructor() - ->getMock(); - $node - ->expects($this->once()) - ->method('click'); - - $this->mockNamedFinder( - '//link', - array($node), - array('link', 'some link') - ); - - $this->document->clickLink('some link'); - $this->setExpectedException('Behat\Mink\Exception\ElementNotFoundException'); - $this->document->clickLink('some link'); - } - - public function testClickButton() - { - $node = $this->getMockBuilder('Behat\Mink\Element\NodeElement') - ->disableOriginalConstructor() - ->getMock(); - $node - ->expects($this->once()) - ->method('press'); - - $this->mockNamedFinder( - '//button', - array($node), - array('button', 'some button') - ); - - $this->document->pressButton('some button'); - $this->setExpectedException('Behat\Mink\Exception\ElementNotFoundException'); - $this->document->pressButton('some button'); - } - - public function testFillField() - { - $node = $this->getMockBuilder('Behat\Mink\Element\NodeElement') - ->disableOriginalConstructor() - ->getMock(); - $node - ->expects($this->once()) - ->method('setValue') - ->with('some val'); - - $this->mockNamedFinder( - '//field', - array($node), - array('field', 'some field') - ); - - $this->document->fillField('some field', 'some val'); - $this->setExpectedException('Behat\Mink\Exception\ElementNotFoundException'); - $this->document->fillField('some field', 'some val'); - } - - public function testCheckField() - { - $node = $this->getMockBuilder('Behat\Mink\Element\NodeElement') - ->disableOriginalConstructor() - ->getMock(); - $node - ->expects($this->once()) - ->method('check'); - - $this->mockNamedFinder( - '//field', - array($node), - array('field', 'some field') - ); - - $this->document->checkField('some field'); - $this->setExpectedException('Behat\Mink\Exception\ElementNotFoundException'); - $this->document->checkField('some field'); - } - - public function testUncheckField() - { - $node = $this->getMockBuilder('Behat\Mink\Element\NodeElement') - ->disableOriginalConstructor() - ->getMock(); - $node - ->expects($this->once()) - ->method('uncheck'); - - $this->mockNamedFinder( - '//field', - array($node), - array('field', 'some field') - ); - - $this->document->uncheckField('some field'); - $this->setExpectedException('Behat\Mink\Exception\ElementNotFoundException'); - $this->document->uncheckField('some field'); - } - - public function testSelectField() - { - $node = $this->getMockBuilder('Behat\Mink\Element\NodeElement') - ->disableOriginalConstructor() - ->getMock(); - $node - ->expects($this->once()) - ->method('selectOption') - ->with('option2'); - - $this->mockNamedFinder( - '//field', - array($node), - array('field', 'some field') - ); - - $this->document->selectFieldOption('some field', 'option2'); - $this->setExpectedException('Behat\Mink\Exception\ElementNotFoundException'); - $this->document->selectFieldOption('some field', 'option2'); - } - - public function testAttachFileToField() - { - $node = $this->getMockBuilder('Behat\Mink\Element\NodeElement') - ->disableOriginalConstructor() - ->getMock(); - $node - ->expects($this->once()) - ->method('attachFile') - ->with('/path/to/file'); - - $this->mockNamedFinder( - '//field', - array($node), - array('field', 'some field') - ); - - $this->document->attachFileToField('some field', '/path/to/file'); - $this->setExpectedException('Behat\Mink\Exception\ElementNotFoundException'); - $this->document->attachFileToField('some field', '/path/to/file'); - } - - public function testGetContent() - { - $expects = 'page content'; - $this->driver - ->expects($this->once()) - ->method('getContent') - ->will($this->returnValue($expects)); - - $this->assertEquals($expects, $this->document->getContent()); - } - - public function testGetText() - { - $expects = 'val1'; - $this->driver - ->expects($this->once()) - ->method('getText') - ->with('//html') - ->will($this->returnValue($expects)); - - $this->assertEquals($expects, $this->document->getText()); - } - - public function testGetHtml() - { - $expects = 'val1'; - $this->driver - ->expects($this->once()) - ->method('getHtml') - ->with('//html') - ->will($this->returnValue($expects)); - - $this->assertEquals($expects, $this->document->getHtml()); - } - - public function testGetOuterHtml() - { - $expects = 'val1'; - $this->driver - ->expects($this->once()) - ->method('getOuterHtml') - ->with('//html') - ->will($this->returnValue($expects)); - - $this->assertEquals($expects, $this->document->getOuterHtml()); - } -} diff --git a/core/vendor/behat/mink/tests/Element/ElementTest.php b/core/vendor/behat/mink/tests/Element/ElementTest.php deleted file mode 100644 index a8c8a8c..0000000 --- a/core/vendor/behat/mink/tests/Element/ElementTest.php +++ /dev/null @@ -1,76 +0,0 @@ -<?php - -namespace Behat\Mink\Tests\Element; - -use Behat\Mink\Driver\DriverInterface; -use Behat\Mink\Session; -use Behat\Mink\Selector\SelectorsHandler; - -abstract class ElementTest extends \PHPUnit_Framework_TestCase -{ - /** - * Session. - * - * @var Session - */ - protected $session; - - /** - * @var DriverInterface|\PHPUnit_Framework_MockObject_MockObject - */ - protected $driver; - - /** - * Selectors. - * - * @var SelectorsHandler|\PHPUnit_Framework_MockObject_MockObject - */ - protected $selectors; - - protected function setUp() - { - $this->driver = $this->getMockBuilder('Behat\Mink\Driver\DriverInterface')->getMock(); - $this->driver - ->expects($this->once()) - ->method('setSession'); - - $this->selectors = $this->getMockBuilder('Behat\Mink\Selector\SelectorsHandler')->getMock(); - $this->session = new Session($this->driver, $this->selectors); - - $this->selectors - ->expects($this->any()) - ->method('xpathLiteral') - ->will($this->returnArgument(0)); - } - - protected function mockNamedFinder($xpath, array $results, $locator, $times = 2) - { - if (!is_array($results[0])) { - $results = array($results, array()); - } - - // In case of empty results, a second call will be done using the partial selector - $processedResults = array(); - foreach ($results as $result) { - $processedResults[] = $result; - if (empty($result)) { - $processedResults[] = $result; - $times++; - } - } - - $returnValue = call_user_func_array(array($this, 'onConsecutiveCalls'), $processedResults); - - $this->driver - ->expects($this->exactly($times)) - ->method('find') - ->with('//html'.$xpath) - ->will($returnValue); - - $this->selectors - ->expects($this->exactly($times)) - ->method('selectorToXpath') - ->with($this->logicalOr('named_exact', 'named_partial'), $locator) - ->will($this->returnValue($xpath)); - } -} diff --git a/core/vendor/behat/mink/tests/Element/NodeElementTest.php b/core/vendor/behat/mink/tests/Element/NodeElementTest.php deleted file mode 100644 index b6a8bde..0000000 --- a/core/vendor/behat/mink/tests/Element/NodeElementTest.php +++ /dev/null @@ -1,593 +0,0 @@ -<?php - -namespace Behat\Mink\Tests\Element; - -use Behat\Mink\Element\NodeElement; - -class NodeElementTest extends ElementTest -{ - public function testGetXpath() - { - $node = new NodeElement('some custom xpath', $this->session); - - $this->assertEquals('some custom xpath', $node->getXpath()); - $this->assertNotEquals('not some custom xpath', $node->getXpath()); - } - - public function testGetText() - { - $expected = 'val1'; - $node = new NodeElement('text_tag', $this->session); - - $this->driver - ->expects($this->once()) - ->method('getText') - ->with('text_tag') - ->will($this->returnValue($expected)); - - $this->assertEquals($expected, $node->getText()); - } - - public function testGetOuterHtml() - { - $expected = 'val1'; - $node = new NodeElement('text_tag', $this->session); - - $this->driver - ->expects($this->once()) - ->method('getOuterHtml') - ->with('text_tag') - ->will($this->returnValue($expected)); - - $this->assertEquals($expected, $node->getOuterHtml()); - } - - public function testElementIsValid() - { - $elementXpath = 'some xpath'; - $node = new NodeElement($elementXpath, $this->session); - - $this->driver - ->expects($this->once()) - ->method('find') - ->with($elementXpath) - ->will($this->returnValue(array($elementXpath))); - - $this->assertTrue($node->isValid()); - } - - public function testElementIsNotValid() - { - $node = new NodeElement('some xpath', $this->session); - - $this->driver - ->expects($this->exactly(2)) - ->method('find') - ->with('some xpath') - ->will($this->onConsecutiveCalls(array(), array('xpath1', 'xpath2'))); - - $this->assertFalse($node->isValid(), 'no elements found is invalid element'); - $this->assertFalse($node->isValid(), 'more then 1 element found is invalid element'); - } - - public function testWaitForSuccess() - { - $callCounter = 0; - $node = new NodeElement('some xpath', $this->session); - - $result = $node->waitFor(5, function ($givenNode) use (&$callCounter) { - $callCounter++; - - if (1 === $callCounter) { - return null; - } elseif (2 === $callCounter) { - return false; - } elseif (3 === $callCounter) { - return array(); - } - - return $givenNode; - }); - - $this->assertEquals(4, $callCounter, '->waitFor() tries to locate element several times before failing'); - $this->assertSame($node, $result, '->waitFor() returns node found in callback'); - } - - public function testWaitForTimeout() - { - $node = new NodeElement('some xpath', $this->session); - - $expectedTimeout = 2; - $startTime = microtime(true); - $result = $node->waitFor($expectedTimeout, function () { - return null; - }); - $endTime = microtime(true); - - $this->assertNull($result, '->waitFor() returns whatever callback gives'); - $this->assertEquals($expectedTimeout, round($endTime - $startTime)); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testWaitForFailure() - { - $node = new NodeElement('some xpath', $this->session); - $node->waitFor(5, 'not a callable'); - } - - public function testHasAttribute() - { - $node = new NodeElement('input_tag', $this->session); - - $this->driver - ->expects($this->exactly(2)) - ->method('getAttribute') - ->with('input_tag', 'href') - ->will($this->onConsecutiveCalls(null, 'http://...')); - - $this->assertFalse($node->hasAttribute('href')); - $this->assertTrue($node->hasAttribute('href')); - } - - public function testGetAttribute() - { - $expected = 'http://...'; - $node = new NodeElement('input_tag', $this->session); - - $this->driver - ->expects($this->once()) - ->method('getAttribute') - ->with('input_tag', 'href') - ->will($this->returnValue($expected)); - - $this->assertEquals($expected, $node->getAttribute('href')); - } - - public function testHasClass() - { - $node = new NodeElement('input_tag', $this->session); - - $this->driver - ->expects($this->exactly(6)) - ->method('getAttribute') - ->with('input_tag', 'class') - ->will($this->returnValue('class1 class2')); - - $this->assertTrue($node->hasClass('class1')); - $this->assertTrue($node->hasClass('class2')); - $this->assertFalse($node->hasClass('class3')); - } - - public function testHasClassWithoutArgument() - { - $node = new NodeElement('input_tag', $this->session); - - $this->driver - ->expects($this->once()) - ->method('getAttribute') - ->with('input_tag', 'class') - ->will($this->returnValue(null)); - - $this->assertFalse($node->hasClass('class3')); - } - - public function testGetValue() - { - $expected = 'val1'; - $node = new NodeElement('input_tag', $this->session); - - $this->driver - ->expects($this->once()) - ->method('getValue') - ->with('input_tag') - ->will($this->returnValue($expected)); - - $this->assertEquals($expected, $node->getValue()); - } - - public function testSetValue() - { - $expected = 'new_val'; - $node = new NodeElement('input_tag', $this->session); - - $this->driver - ->expects($this->once()) - ->method('setValue') - ->with('input_tag', $expected); - - $node->setValue($expected); - } - - public function testClick() - { - $node = new NodeElement('link_or_button', $this->session); - - $this->driver - ->expects($this->once()) - ->method('click') - ->with('link_or_button'); - - $node->click(); - } - - public function testPress() - { - $node = new NodeElement('link_or_button', $this->session); - - $this->driver - ->expects($this->once()) - ->method('click') - ->with('link_or_button'); - - $node->press(); - } - - public function testRightClick() - { - $node = new NodeElement('elem', $this->session); - - $this->driver - ->expects($this->once()) - ->method('rightClick') - ->with('elem'); - - $node->rightClick(); - } - - public function testDoubleClick() - { - $node = new NodeElement('elem', $this->session); - - $this->driver - ->expects($this->once()) - ->method('doubleClick') - ->with('elem'); - - $node->doubleClick(); - } - - public function testCheck() - { - $node = new NodeElement('checkbox_or_radio', $this->session); - - $this->driver - ->expects($this->once()) - ->method('check') - ->with('checkbox_or_radio'); - - $node->check(); - } - - public function testUncheck() - { - $node = new NodeElement('checkbox_or_radio', $this->session); - - $this->driver - ->expects($this->once()) - ->method('uncheck') - ->with('checkbox_or_radio'); - - $node->uncheck(); - } - - public function testSelectOption() - { - $node = new NodeElement('select', $this->session); - $option = $this->getMockBuilder('Behat\Mink\Element\NodeElement') - ->disableOriginalConstructor() - ->getMock(); - $option - ->expects($this->once()) - ->method('getValue') - ->will($this->returnValue('item1')); - - $this->driver - ->expects($this->once()) - ->method('getTagName') - ->with('select') - ->will($this->returnValue('select')); - - $this->driver - ->expects($this->once()) - ->method('find') - ->with('select/option') - ->will($this->returnValue(array($option))); - - $this->selectors - ->expects($this->once()) - ->method('selectorToXpath') - ->with('named_exact', array('option', 'item1')) - ->will($this->returnValue('option')); - - $this->driver - ->expects($this->once()) - ->method('selectOption') - ->with('select', 'item1', false); - - $node->selectOption('item1'); - } - - /** - * @expectedException \Behat\Mink\Exception\ElementNotFoundException - */ - public function testSelectOptionNotFound() - { - $node = new NodeElement('select', $this->session); - - $this->driver - ->expects($this->once()) - ->method('getTagName') - ->with('select') - ->will($this->returnValue('select')); - - $this->driver - ->expects($this->exactly(2)) - ->method('find') - ->with('select/option') - ->will($this->returnValue(array())); - - $this->selectors - ->expects($this->exactly(2)) - ->method('selectorToXpath') - ->with($this->logicalOr('named_exact', 'named_partial'), array('option', 'item1')) - ->will($this->returnValue('option')); - - $node->selectOption('item1'); - } - - public function testSelectOptionOtherTag() - { - $node = new NodeElement('div', $this->session); - - $this->driver - ->expects($this->once()) - ->method('getTagName') - ->with('div') - ->will($this->returnValue('div')); - - $this->driver - ->expects($this->once()) - ->method('selectOption') - ->with('div', 'item1', false); - - $node->selectOption('item1'); - } - - public function testGetTagName() - { - $node = new NodeElement('html//h3', $this->session); - - $this->driver - ->expects($this->once()) - ->method('getTagName') - ->with('html//h3') - ->will($this->returnValue('h3')); - - $this->assertEquals('h3', $node->getTagName()); - } - - public function testGetParent() - { - $node = new NodeElement('elem', $this->session); - $parent = $this->getMockBuilder('Behat\Mink\Element\NodeElement') - ->disableOriginalConstructor() - ->getMock(); - - $this->driver - ->expects($this->once()) - ->method('find') - ->with('elem/..') - ->will($this->returnValue(array($parent))); - - $this->selectors - ->expects($this->once()) - ->method('selectorToXpath') - ->with('xpath', '..') - ->will($this->returnValue('..')); - - $this->assertSame($parent, $node->getParent()); - } - - public function testAttachFile() - { - $node = new NodeElement('elem', $this->session); - - $this->driver - ->expects($this->once()) - ->method('attachFile') - ->with('elem', 'path'); - - $node->attachFile('path'); - } - - public function testIsVisible() - { - $node = new NodeElement('some_xpath', $this->session); - - $this->driver - ->expects($this->exactly(2)) - ->method('isVisible') - ->with('some_xpath') - ->will($this->onConsecutiveCalls(true, false)); - - $this->assertTrue($node->isVisible()); - $this->assertFalse($node->isVisible()); - } - - public function testIsChecked() - { - $node = new NodeElement('some_xpath', $this->session); - - $this->driver - ->expects($this->exactly(2)) - ->method('isChecked') - ->with('some_xpath') - ->will($this->onConsecutiveCalls(true, false)); - - $this->assertTrue($node->isChecked()); - $this->assertFalse($node->isChecked()); - } - - public function testIsSelected() - { - $node = new NodeElement('some_xpath', $this->session); - - $this->driver - ->expects($this->exactly(2)) - ->method('isSelected') - ->with('some_xpath') - ->will($this->onConsecutiveCalls(true, false)); - - $this->assertTrue($node->isSelected()); - $this->assertFalse($node->isSelected()); - } - - public function testFocus() - { - $node = new NodeElement('some-element', $this->session); - - $this->driver - ->expects($this->once()) - ->method('focus') - ->with('some-element'); - - $node->focus(); - } - - public function testBlur() - { - $node = new NodeElement('some-element', $this->session); - - $this->driver - ->expects($this->once()) - ->method('blur') - ->with('some-element'); - - $node->blur(); - } - - public function testMouseOver() - { - $node = new NodeElement('some-element', $this->session); - - $this->driver - ->expects($this->once()) - ->method('mouseOver') - ->with('some-element'); - - $node->mouseOver(); - } - - public function testDragTo() - { - $node = new NodeElement('some_tag1', $this->session); - - $target = $this->getMock('Behat\Mink\Element\ElementInterface'); - $target->expects($this->any()) - ->method('getXPath') - ->will($this->returnValue('some_tag2')); - - $this->driver - ->expects($this->once()) - ->method('dragTo') - ->with('some_tag1', 'some_tag2'); - - $node->dragTo($target); - } - - public function testKeyPress() - { - $node = new NodeElement('elem', $this->session); - - $this->driver - ->expects($this->once()) - ->method('keyPress') - ->with('elem', 'key'); - - $node->keyPress('key'); - } - - public function testKeyDown() - { - $node = new NodeElement('elem', $this->session); - - $this->driver - ->expects($this->once()) - ->method('keyDown') - ->with('elem', 'key'); - - $node->keyDown('key'); - } - - public function testKeyUp() - { - $node = new NodeElement('elem', $this->session); - - $this->driver - ->expects($this->once()) - ->method('keyUp') - ->with('elem', 'key'); - - $node->keyUp('key'); - } - - public function testSubmitForm() - { - $node = new NodeElement('some_xpath', $this->session); - - $this->driver - ->expects($this->once()) - ->method('submitForm') - ->with('some_xpath'); - - $node->submit(); - } - - public function testFindAllUnion() - { - $node = new NodeElement('some_xpath', $this->session); - $xpath = "some_tag1 | some_tag2[@foo =\n 'bar|'']\n | some_tag3[foo | bar]"; - $expected = "some_xpath/some_tag1 | some_xpath/some_tag2[@foo =\n 'bar|''] | some_xpath/some_tag3[foo | bar]"; - - $this->driver - ->expects($this->exactly(1)) - ->method('find') - ->will($this->returnValueMap(array( - array($expected, array(2, 3, 4)), - ))); - - $this->selectors - ->expects($this->exactly(1)) - ->method('selectorToXpath') - ->will($this->returnValueMap(array( - array('xpath', $xpath, $xpath), - ))); - - $this->assertEquals(3, count($node->findAll('xpath', $xpath))); - } - - public function testFindAllParentUnion() - { - $node = new NodeElement('some_xpath | another_xpath', $this->session); - $xpath = "some_tag1 | some_tag2"; - $expectedPrefixed = "(some_xpath | another_xpath)/some_tag1 | (some_xpath | another_xpath)/some_tag2"; - - $this->driver - ->expects($this->exactly(1)) - ->method('find') - ->will($this->returnValueMap(array( - array($expectedPrefixed, array(2, 3, 4)), - ))); - - $this->selectors - ->expects($this->exactly(1)) - ->method('selectorToXpath') - ->will($this->returnValueMap(array( - array('xpath', $xpath, $xpath), - ))); - - $this->assertEquals(3, count($node->findAll('xpath', $xpath))); - } -} diff --git a/core/vendor/behat/mink/tests/Exception/ElementExceptionTest.php b/core/vendor/behat/mink/tests/Exception/ElementExceptionTest.php deleted file mode 100644 index 021e8d5..0000000 --- a/core/vendor/behat/mink/tests/Exception/ElementExceptionTest.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php - -namespace Behat\Mink\Tests\Exception; - -use Behat\Mink\Exception\ElementException; - -class ElementExceptionTest extends \PHPUnit_Framework_TestCase -{ - public function testMessage() - { - $exception = new ElementException($this->getElementMock(), new \Exception('Something went wrong')); - - $expectedMessage = "Exception thrown by element XPath\nSomething went wrong"; - $this->assertEquals($expectedMessage, $exception->getMessage()); - $this->assertEquals($expectedMessage, (string) $exception); - } - - public function testElement() - { - $element = $this->getElementMock(); - - $exception = new ElementException($element, new \Exception('Something went wrong')); - - $this->assertSame($element, $exception->getElement()); - } - - private function getElementMock() - { - $mock = $this->getMockBuilder('Behat\Mink\Element\Element') - ->disableOriginalConstructor() - ->getMock(); - - $mock->expects($this->any()) - ->method('getXPath') - ->will($this->returnValue('element XPath')); - - return $mock; - } -} diff --git a/core/vendor/behat/mink/tests/Exception/ElementHtmlExceptionTest.php b/core/vendor/behat/mink/tests/Exception/ElementHtmlExceptionTest.php deleted file mode 100644 index 63d39dd..0000000 --- a/core/vendor/behat/mink/tests/Exception/ElementHtmlExceptionTest.php +++ /dev/null @@ -1,61 +0,0 @@ -<?php - -namespace Behat\Mink\Tests\Exception; - -use Behat\Mink\Exception\ElementHtmlException; - -class ElementHtmlExceptionTest extends \PHPUnit_Framework_TestCase -{ - public function testExceptionToString() - { - $driver = $this->getMock('Behat\Mink\Driver\DriverInterface'); - $element = $this->getElementMock(); - - $session = $this->getSessionMock(); - $session->expects($this->any()) - ->method('getDriver') - ->will($this->returnValue($driver)); - $session->expects($this->any()) - ->method('getStatusCode') - ->will($this->returnValue(200)); - $session->expects($this->any()) - ->method('getCurrentUrl') - ->will($this->returnValue('http://localhost/test')); - - $element->expects($this->any()) - ->method('getOuterHtml') - ->will($this->returnValue("<div>\n <h1>Hello world</h1>\n <p>Test</p>\n</div>")); - - $expected = <<<'TXT' -Html error - -+--[ HTTP/1.1 200 | http://localhost/test | %s ] -| -| <div> -| <h1>Hello world</h1> -| <p>Test</p> -| </div> -| -TXT; - - $expected = sprintf($expected.' ', get_class($driver)); - - $exception = new ElementHtmlException('Html error', $session, $element); - - $this->assertEquals($expected, $exception->__toString()); - } - - private function getSessionMock() - { - return $this->getMockBuilder('Behat\Mink\Session') - ->disableOriginalConstructor() - ->getMock(); - } - - private function getElementMock() - { - return $this->getMockBuilder('Behat\Mink\Element\NodeElement') - ->disableOriginalConstructor() - ->getMock(); - } -} diff --git a/core/vendor/behat/mink/tests/Exception/ElementNotFoundExceptionTest.php b/core/vendor/behat/mink/tests/Exception/ElementNotFoundExceptionTest.php deleted file mode 100644 index 8cb4e5d..0000000 --- a/core/vendor/behat/mink/tests/Exception/ElementNotFoundExceptionTest.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php - -namespace Behat\Mink\Tests\Exception; - -use Behat\Mink\Exception\ElementNotFoundException; - -class ElementNotFoundExceptionTest extends \PHPUnit_Framework_TestCase -{ - /** - * @dataProvider provideExceptionMessage - */ - public function testBuildMessage($message, $type, $selector = null, $locator = null) - { - $session = $this->getMockBuilder('Behat\Mink\Session') - ->disableOriginalConstructor() - ->getMock(); - - $exception = new ElementNotFoundException($session, $type, $selector, $locator); - - $this->assertEquals($message, $exception->getMessage()); - } - - public function provideExceptionMessage() - { - return array( - array('Tag not found.', null), - array('Field not found.', 'field'), - array('Tag matching locator "foobar" not found.', null, null, 'foobar'), - array('Tag matching css "foobar" not found.', null, 'css', 'foobar'), - array('Field matching xpath "foobar" not found.', 'Field', 'xpath', 'foobar'), - array('Tag with name "foobar" not found.', null, 'name', 'foobar'), - ); - } -} diff --git a/core/vendor/behat/mink/tests/Exception/ElementTextExceptionTest.php b/core/vendor/behat/mink/tests/Exception/ElementTextExceptionTest.php deleted file mode 100644 index 73cef5b..0000000 --- a/core/vendor/behat/mink/tests/Exception/ElementTextExceptionTest.php +++ /dev/null @@ -1,59 +0,0 @@ -<?php - -namespace Behat\Mink\Tests\Exception; - -use Behat\Mink\Exception\ElementTextException; - -class ElementTextExceptionTest extends \PHPUnit_Framework_TestCase -{ - public function testExceptionToString() - { - $driver = $this->getMock('Behat\Mink\Driver\DriverInterface'); - $element = $this->getElementMock(); - - $session = $this->getSessionMock(); - $session->expects($this->any()) - ->method('getDriver') - ->will($this->returnValue($driver)); - $session->expects($this->any()) - ->method('getStatusCode') - ->will($this->returnValue(200)); - $session->expects($this->any()) - ->method('getCurrentUrl') - ->will($this->returnValue('http://localhost/test')); - - $element->expects($this->any()) - ->method('getText') - ->will($this->returnValue("Hello world\nTest\n")); - - $expected = <<<'TXT' -Text error - -+--[ HTTP/1.1 200 | http://localhost/test | %s ] -| -| Hello world -| Test -| -TXT; - - $expected = sprintf($expected.' ', get_class($driver)); - - $exception = new ElementTextException('Text error', $session, $element); - - $this->assertEquals($expected, $exception->__toString()); - } - - private function getSessionMock() - { - return $this->getMockBuilder('Behat\Mink\Session') - ->disableOriginalConstructor() - ->getMock(); - } - - private function getElementMock() - { - return $this->getMockBuilder('Behat\Mink\Element\NodeElement') - ->disableOriginalConstructor() - ->getMock(); - } -} diff --git a/core/vendor/behat/mink/tests/Exception/ExpectationExceptionTest.php b/core/vendor/behat/mink/tests/Exception/ExpectationExceptionTest.php deleted file mode 100644 index 466bcca..0000000 --- a/core/vendor/behat/mink/tests/Exception/ExpectationExceptionTest.php +++ /dev/null @@ -1,126 +0,0 @@ -<?php - -namespace Behat\Mink\Tests\Exception; - -use Behat\Mink\Exception\ExpectationException; - -class ExpectationExceptionTest extends \PHPUnit_Framework_TestCase -{ - public function testEmptyMessageAndPreviousException() - { - $exception = new ExpectationException('', $this->getSessionMock(), new \Exception('Something failed')); - - $this->assertEquals('Something failed', $exception->getMessage()); - } - - public function testExceptionToString() - { - $driver = $this->getMock('Behat\Mink\Driver\DriverInterface'); - $page = $this->getPageMock(); - - $session = $this->getSessionMock(); - $session->expects($this->any()) - ->method('getDriver') - ->will($this->returnValue($driver)); - $session->expects($this->any()) - ->method('getPage') - ->will($this->returnValue($page)); - $session->expects($this->any()) - ->method('getStatusCode') - ->will($this->returnValue(200)); - $session->expects($this->any()) - ->method('getCurrentUrl') - ->will($this->returnValue('http://localhost/test')); - - $html = "<html><head><title>Hello\n\n

Hello world

\n

Test

\n"; - $page->expects($this->any()) - ->method('getContent') - ->will($this->returnValue($html)); - - $expected = <<<'TXT' -Expectation failure - -+--[ HTTP/1.1 200 | http://localhost/test | %s ] -| -| -|

Hello world

-|

Test

-| -| -TXT; - - $expected = sprintf($expected.' ', get_class($driver)); - - $exception = new ExpectationException('Expectation failure', $session); - - $this->assertEquals($expected, $exception->__toString()); - } - - public function testBigContent() - { - $driver = $this->getMock('Behat\Mink\Driver\DriverInterface'); - $page = $this->getPageMock(); - - $session = $this->getSessionMock(); - $session->expects($this->any()) - ->method('getDriver') - ->will($this->returnValue($driver)); - $session->expects($this->any()) - ->method('getPage') - ->will($this->returnValue($page)); - $session->expects($this->any()) - ->method('getStatusCode') - ->will($this->returnValue(200)); - $session->expects($this->any()) - ->method('getCurrentUrl') - ->will($this->returnValue('http://localhost/test')); - - $body = str_repeat('a', 1001 - strlen('')); - - $html = sprintf("Hello\n%s", $body); - $page->expects($this->any()) - ->method('getContent') - ->will($this->returnValue($html)); - - $expected = <<<'TXT' -Expectation failure - -+--[ HTTP/1.1 200 | http://localhost/test | %s ] -| -| %sassertEquals($expected, $exception->__toString()); - } - - public function testExceptionWhileRenderingString() - { - $session = $this->getSessionMock(); - $session->expects($this->any()) - ->method('getPage') - ->will($this->throwException(new \Exception('Broken page'))); - - $exception = new ExpectationException('Expectation failure', $session); - - $this->assertEquals('Expectation failure', $exception->__toString()); - } - - private function getSessionMock() - { - return $this->getMockBuilder('Behat\Mink\Session') - ->disableOriginalConstructor() - ->getMock(); - } - - private function getPageMock() - { - return $this->getMockBuilder('Behat\Mink\Element\DocumentElement') - ->disableOriginalConstructor() - ->getMock(); - } -} diff --git a/core/vendor/behat/mink/tests/Exception/ResponseTextExceptionTest.php b/core/vendor/behat/mink/tests/Exception/ResponseTextExceptionTest.php deleted file mode 100644 index 4651b7c..0000000 --- a/core/vendor/behat/mink/tests/Exception/ResponseTextExceptionTest.php +++ /dev/null @@ -1,62 +0,0 @@ -getMock('Behat\Mink\Driver\DriverInterface'); - $page = $this->getPageMock(); - - $session = $this->getSessionMock(); - $session->expects($this->any()) - ->method('getDriver') - ->will($this->returnValue($driver)); - $session->expects($this->any()) - ->method('getPage') - ->will($this->returnValue($page)); - $session->expects($this->any()) - ->method('getStatusCode') - ->will($this->returnValue(200)); - $session->expects($this->any()) - ->method('getCurrentUrl') - ->will($this->returnValue('http://localhost/test')); - - $page->expects($this->any()) - ->method('getText') - ->will($this->returnValue("Hello world\nTest\n")); - - $expected = <<<'TXT' -Text error - -+--[ HTTP/1.1 200 | http://localhost/test | %s ] -| -| Hello world -| Test -| -TXT; - - $expected = sprintf($expected.' ', get_class($driver)); - - $exception = new ResponseTextException('Text error', $session); - - $this->assertEquals($expected, $exception->__toString()); - } - - private function getSessionMock() - { - return $this->getMockBuilder('Behat\Mink\Session') - ->disableOriginalConstructor() - ->getMock(); - } - - private function getPageMock() - { - return $this->getMockBuilder('Behat\Mink\Element\DocumentElement') - ->disableOriginalConstructor() - ->getMock(); - } -} diff --git a/core/vendor/behat/mink/tests/MinkTest.php b/core/vendor/behat/mink/tests/MinkTest.php deleted file mode 100644 index 11d6466..0000000 --- a/core/vendor/behat/mink/tests/MinkTest.php +++ /dev/null @@ -1,246 +0,0 @@ -mink = new Mink(); - } - - public function testRegisterSession() - { - $session = $this->getSessionMock(); - - $this->assertFalse($this->mink->hasSession('not_registered')); - $this->assertFalse($this->mink->hasSession('js')); - $this->assertFalse($this->mink->hasSession('my')); - - $this->mink->registerSession('my', $session); - - $this->assertTrue($this->mink->hasSession('my')); - $this->assertFalse($this->mink->hasSession('not_registered')); - $this->assertFalse($this->mink->hasSession('js')); - } - - public function testRegisterSessionThroughConstructor() - { - $mink = new Mink(array('my' => $this->getSessionMock())); - - $this->assertTrue($mink->hasSession('my')); - } - - public function testSessionAutostop() - { - $session1 = $this->getSessionMock(); - $session2 = $this->getSessionMock(); - $this->mink->registerSession('my1', $session1); - $this->mink->registerSession('my2', $session2); - - $session1 - ->expects($this->once()) - ->method('isStarted') - ->will($this->returnValue(true)); - $session1 - ->expects($this->once()) - ->method('stop'); - $session2 - ->expects($this->once()) - ->method('isStarted') - ->will($this->returnValue(false)); - $session2 - ->expects($this->never()) - ->method('stop'); - - unset($this->mink); - } - - public function testNotStartedSession() - { - $session = $this->getSessionMock(); - - $session - ->expects($this->once()) - ->method('isStarted') - ->will($this->returnValue(false)); - $session - ->expects($this->once()) - ->method('start'); - - $this->mink->registerSession('mock_session', $session); - $this->assertSame($session, $this->mink->getSession('mock_session')); - - $this->setExpectedException('InvalidArgumentException'); - - $this->mink->getSession('not_registered'); - } - - public function testGetAlreadyStartedSession() - { - $session = $this->getSessionMock(); - - $session - ->expects($this->once()) - ->method('isStarted') - ->will($this->returnValue(true)); - $session - ->expects($this->never()) - ->method('start'); - - $this->mink->registerSession('mock_session', $session); - $this->assertSame($session, $this->mink->getSession('mock_session')); - } - - public function testSetDefaultSessionName() - { - $this->assertNull($this->mink->getDefaultSessionName()); - - $session = $this->getSessionMock(); - $this->mink->registerSession('session_name', $session); - $this->mink->setDefaultSessionName('session_name'); - - $this->assertEquals('session_name', $this->mink->getDefaultSessionName()); - - $this->setExpectedException('InvalidArgumentException'); - - $this->mink->setDefaultSessionName('not_registered'); - } - - public function testGetDefaultSession() - { - $session1 = $this->getSessionMock(); - $session2 = $this->getSessionMock(); - - $this->assertNotSame($session1, $session2); - - $this->mink->registerSession('session_1', $session1); - $this->mink->registerSession('session_2', $session2); - $this->mink->setDefaultSessionName('session_2'); - - $this->assertSame($session1, $this->mink->getSession('session_1')); - $this->assertSame($session2, $this->mink->getSession('session_2')); - $this->assertSame($session2, $this->mink->getSession()); - - $this->mink->setDefaultSessionName('session_1'); - - $this->assertSame($session1, $this->mink->getSession()); - } - - public function testGetNoDefaultSession() - { - $session1 = $this->getSessionMock(); - - $this->mink->registerSession('session_1', $session1); - - $this->setExpectedException('InvalidArgumentException'); - - $this->mink->getSession(); - } - - public function testIsSessionStarted() - { - $session_1 = $this->getSessionMock(); - $session_2 = $this->getSessionMock(); - - $session_1 - ->expects($this->any()) - ->method('isStarted') - ->will($this->returnValue(false)); - $session_1 - ->expects($this->never()) - ->method('start'); - - $session_2 - ->expects($this->any()) - ->method('isStarted') - ->will($this->returnValue(true)); - $session_2 - ->expects($this->never()) - ->method('start'); - - $this->mink->registerSession('not_started', $session_1); - $this->assertFalse($this->mink->isSessionStarted('not_started')); - - $this->mink->registerSession('started', $session_2); - $this->assertTrue($this->mink->isSessionStarted('started')); - - $this->setExpectedException('InvalidArgumentException'); - - $this->mink->getSession('not_registered'); - } - - public function testAssertSession() - { - $session = $this->getSessionMock(); - - $this->mink->registerSession('my', $session); - - $this->assertInstanceOf('Behat\Mink\WebAssert', $this->mink->assertSession('my')); - } - - public function testAssertSessionNotRegistered() - { - $session = $this->getSessionMock(); - - $this->assertInstanceOf('Behat\Mink\WebAssert', $this->mink->assertSession($session)); - } - - public function testResetSessions() - { - $session1 = $this->getSessionMock(); - $session1->expects($this->once()) - ->method('isStarted') - ->will($this->returnValue(false)); - $session1->expects($this->never()) - ->method('reset'); - - $session2 = $this->getSessionMock(); - $session2->expects($this->once()) - ->method('isStarted') - ->will($this->returnValue(true)); - $session2->expects($this->once()) - ->method('reset'); - - $this->mink->registerSession('not started', $session1); - $this->mink->registerSession('started', $session2); - - $this->mink->resetSessions(); - } - - public function testRestartSessions() - { - $session1 = $this->getSessionMock(); - $session1->expects($this->once()) - ->method('isStarted') - ->will($this->returnValue(false)); - $session1->expects($this->never()) - ->method('restart'); - - $session2 = $this->getSessionMock(); - $session2->expects($this->once()) - ->method('isStarted') - ->will($this->returnValue(true)); - $session2->expects($this->once()) - ->method('restart'); - - $this->mink->registerSession('not started', $session1); - $this->mink->registerSession('started', $session2); - - $this->mink->restartSessions(); - } - - private function getSessionMock() - { - return $this->getMockBuilder('Behat\Mink\Session') - ->disableOriginalConstructor() - ->getMock(); - } -} diff --git a/core/vendor/behat/mink/tests/Selector/CssSelectorTest.php b/core/vendor/behat/mink/tests/Selector/CssSelectorTest.php deleted file mode 100644 index ea80d93..0000000 --- a/core/vendor/behat/mink/tests/Selector/CssSelectorTest.php +++ /dev/null @@ -1,41 +0,0 @@ -markTestSkipped('Symfony2 CssSelector component not installed'); - } - } - - public function testSelector() - { - $selector = new CssSelector(); - - $this->assertEquals('descendant-or-self::h3', $selector->translateToXPath('h3')); - $this->assertEquals('descendant-or-self::h3/span', $selector->translateToXPath('h3 > span')); - - if (interface_exists('Symfony\Component\CssSelector\XPath\TranslatorInterface')) { - // The rewritten component of Symfony 2.3 checks for attribute existence first for the class. - $expectation = "descendant-or-self::h3/*[@class and contains(concat(' ', normalize-space(@class), ' '), ' my_div ')]"; - } else { - $expectation = "descendant-or-self::h3/*[contains(concat(' ', normalize-space(@class), ' '), ' my_div ')]"; - } - $this->assertEquals($expectation, $selector->translateToXPath('h3 > .my_div')); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testThrowsForArrayLocator() - { - $selector = new CssSelector(); - - $selector->translateToXPath(array('h3')); - } -} diff --git a/core/vendor/behat/mink/tests/Selector/ExactNamedSelectorTest.php b/core/vendor/behat/mink/tests/Selector/ExactNamedSelectorTest.php deleted file mode 100644 index df51f0f..0000000 --- a/core/vendor/behat/mink/tests/Selector/ExactNamedSelectorTest.php +++ /dev/null @@ -1,18 +0,0 @@ -getSelector(); - - $selector->registerNamedXpath('some', 'my_xpath'); - $this->assertEquals('my_xpath', $selector->translateToXPath('some')); - - $this->setExpectedException('InvalidArgumentException'); - - $selector->translateToXPath('custom'); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testInvalidLocator() - { - $namedSelector = $this->getSelector(); - - $namedSelector->translateToXPath(array('foo', 'bar', 'baz')); - } - - /** - * @dataProvider getSelectorTests - */ - public function testSelectors($fixtureFile, $selector, $locator, $expectedExactCount, $expectedPartialCount = null) - { - $expectedCount = $this->allowPartialMatch() && null !== $expectedPartialCount - ? $expectedPartialCount - : $expectedExactCount; - - // Don't use "loadHTMLFile" due HHVM 3.3.0 issue. - $dom = new \DOMDocument('1.0', 'UTF-8'); - $dom->loadHTML(file_get_contents(__DIR__.'/fixtures/'.$fixtureFile)); - - // Escape the locator as Mink 1.x expects the caller of the NamedSelector to handle it - $selectorsHandler = new SelectorsHandler(); - $locator = $selectorsHandler->xpathLiteral($locator); - - $namedSelector = $this->getSelector(); - - $xpath = $namedSelector->translateToXPath(array($selector, $locator)); - - $domXpath = new \DOMXPath($dom); - $nodeList = $domXpath->query($xpath); - - $this->assertEquals($expectedCount, $nodeList->length); - } - - public function getSelectorTests() - { - $fieldCount = 8; // fields without `type` attribute - $fieldCount += 4; // fields with `type=checkbox` attribute - $fieldCount += 4; // fields with `type=radio` attribute - $fieldCount += 4; // fields with `type=file` attribute - - // Fixture file, selector name, locator, expected number of exact matched elements, expected number of partial matched elements if different - return array( - 'fieldset' => array('test.html', 'fieldset', 'fieldset-text', 2, 3), - - 'field (name/placeholder/label)' => array('test.html', 'field', 'the-field', $fieldCount), - 'field (input, with-id)' => array('test.html', 'field', 'the-field-input', 1), - 'field (textarea, with-id)' => array('test.html', 'field', 'the-field-textarea', 1), - 'field (select, with-id)' => array('test.html', 'field', 'the-field-select', 1), - 'field (input type=submit, with-id) ignored' => array('test.html', 'field', 'the-field-submit-button', 0), - 'field (input type=image, with-id) ignored' => array('test.html', 'field', 'the-field-image-button', 0), - 'field (input type=button, with-id) ignored' => array('test.html', 'field', 'the-field-button-button', 0), - 'field (input type=reset, with-id) ignored' => array('test.html', 'field', 'the-field-reset-button', 0), - 'field (input type=hidden, with-id) ignored' => array('test.html', 'field', 'the-field-hidden', 0), - - 'link (with-href)' => array('test.html', 'link', 'link-text', 5, 9), - 'link (without-href) ignored' => array('test.html', 'link', 'bad-link-text', 0), - 'link* (role=link)' => array('test.html', 'link', 'link-role-text', 4, 7), - - 'button (input, name/value/title)' => array('test.html', 'button', 'button-text', 25, 42), - 'button (type=image, with-alt)' => array('test.html', 'button', 'button-alt-text', 1, 2), - 'button (input type=submit, with-id)' => array('test.html', 'button', 'input-submit-button', 1), - 'button (input type=image, with-id)' => array('test.html', 'button', 'input-image-button', 1), - 'button (input type=button, with-id)' => array('test.html', 'button', 'input-button-button', 1), - 'button (input type=reset, with-id)' => array('test.html', 'button', 'input-reset-button', 1), - 'button (button type=submit, with-id)' => array('test.html', 'button', 'button-submit-button', 1), - 'button (button type=image, with-id)' => array('test.html', 'button', 'button-image-button', 1), - 'button (button type=button, with-id)' => array('test.html', 'button', 'button-button-button', 1), - 'button (button type=reset, with-id)' => array('test.html', 'button', 'button-reset-button', 1), - 'button* (role=button, name/value/title)' => array('test.html', 'button', 'button-role-text', 12, 20), - 'button* (role=button type=submit, with-id)' => array('test.html', 'button', 'role-button-submit-button', 1), - 'button* (role=button type=image, with-id)' => array('test.html', 'button', 'role-button-image-button', 1), - 'button* (role=button type=button, with-id)' => array('test.html', 'button', 'role-button-button-button', 1), - 'button* (role=button type=reset, with-id)' => array('test.html', 'button', 'role-button-reset-button', 1), - - 'link_or_button (with-href)' => array('test.html', 'link_or_button', 'link-text', 5, 9), - 'link_or_button (without-href) ignored' => array('test.html', 'link_or_button', 'bad-link-text', 0), - 'link_or_button* (role=link)' => array('test.html', 'link_or_button', 'link-role-text', 4, 7), - - // bug in selector: 17 instead of 25 and 34 instead of 42, because 8 buttons with `name` attribute were not matched - 'link_or_button (input, name/value/title)' => array('test.html', 'link_or_button', 'button-text', 17, 34), - 'link_or_button (type=image, with-alt)' => array('test.html', 'link_or_button', 'button-alt-text', 1, 2), - 'link_or_button (input type=submit, with-id)' => array('test.html', 'link_or_button', 'input-submit-button', 1), - 'link_or_button (input type=image, with-id)' => array('test.html', 'link_or_button', 'input-image-button', 1), - 'link_or_button (input type=button, with-id)' => array('test.html', 'link_or_button', 'input-button-button', 1), - 'link_or_button (input type=reset, with-id)' => array('test.html', 'link_or_button', 'input-reset-button', 1), - 'link_or_button (button type=submit, with-id)' => array('test.html', 'link_or_button', 'button-submit-button', 1), - 'link_or_button (button type=image, with-id)' => array('test.html', 'link_or_button', 'button-image-button', 1), - 'link_or_button (button type=button, with-id)' => array('test.html', 'link_or_button', 'button-button-button', 1), - 'link_or_button (button type=reset, with-id)' => array('test.html', 'link_or_button', 'button-reset-button', 1), - - // bug in selector: 8 instead of 12 and 16 instead of 20, because 4 buttons with `name` attribute were not matched - 'link_or_button* (role=button, name/value/title)' => array('test.html', 'link_or_button', 'button-role-text', 8, 16), - 'link_or_button* (role=button type=submit, with-id)' => array('test.html', 'link_or_button', 'role-button-submit-button', 1), - 'link_or_button* (role=button type=image, with-id)' => array('test.html', 'link_or_button', 'role-button-image-button', 1), - 'link_or_button* (role=button type=button, with-id)' => array('test.html', 'link_or_button', 'role-button-button-button', 1), - 'link_or_button* (role=button type=reset, with-id)' => array('test.html', 'link_or_button', 'role-button-reset-button', 1), - - // 3 matches, because matches every HTML node in path: html > body > div - 'content' => array('test.html', 'content', 'content-text', 1, 4), - - 'select (name/label)' => array('test.html', 'select', 'the-field', 3), - 'select (with-id)' => array('test.html', 'select', 'the-field-select', 1), - - 'checkbox (name/label)' => array('test.html', 'checkbox', 'the-field', 3), - 'checkbox (with-id)' => array('test.html', 'checkbox', 'the-field-checkbox', 1), - - 'radio (name/label)' => array('test.html', 'radio', 'the-field', 3), - 'radio (with-id)' => array('test.html', 'radio', 'the-field-radio', 1), - - 'file (name/label)' => array('test.html', 'file', 'the-field', 3), - 'file (with-id)' => array('test.html', 'file', 'the-field-file', 1), - - 'optgroup' => array('test.html', 'optgroup', 'group-label', 1, 2), - - 'option' => array('test.html', 'option', 'option-value', 2, 3), - - 'table' => array('test.html', 'table', 'the-table', 2, 3), - - 'id' => array('test.html', 'id', 'bad-link-text', 1), - 'id or name' => array('test.html', 'id_or_name', 'the-table', 2), - ); - } - - /** - * @return NamedSelector - */ - abstract protected function getSelector(); - - /** - * @return boolean - */ - abstract protected function allowPartialMatch(); -} diff --git a/core/vendor/behat/mink/tests/Selector/PartialNamedSelectorTest.php b/core/vendor/behat/mink/tests/Selector/PartialNamedSelectorTest.php deleted file mode 100644 index c3e631a..0000000 --- a/core/vendor/behat/mink/tests/Selector/PartialNamedSelectorTest.php +++ /dev/null @@ -1,18 +0,0 @@ -getMockBuilder('Behat\Mink\Selector\SelectorInterface')->getMock(); - $handler = new SelectorsHandler(); - - $this->assertFalse($handler->isSelectorRegistered('custom')); - - $handler->registerSelector('custom', $selector); - - $this->assertTrue($handler->isSelectorRegistered('custom')); - $this->assertSame($selector, $handler->getSelector('custom')); - } - - public function testRegisterSelectorThroughConstructor() - { - $selector = $this->getMockBuilder('Behat\Mink\Selector\SelectorInterface')->getMock(); - $handler = new SelectorsHandler(array('custom' => $selector)); - - $this->assertTrue($handler->isSelectorRegistered('custom')); - $this->assertSame($selector, $handler->getSelector('custom')); - } - - public function testRegisterDefaultSelectors() - { - $handler = new SelectorsHandler(); - - $this->assertTrue($handler->isSelectorRegistered('css')); - $this->assertTrue($handler->isSelectorRegistered('named_exact')); - $this->assertTrue($handler->isSelectorRegistered('named_partial')); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testXpathSelectorThrowsExceptionForArrayLocator() - { - $handler = new SelectorsHandler(); - $handler->selectorToXpath('xpath', array('some_xpath')); - } - - public function testXpathSelectorIsReturnedAsIs() - { - $handler = new SelectorsHandler(); - $this->assertEquals('some_xpath', $handler->selectorToXpath('xpath', 'some_xpath')); - } - - public function testSelectorToXpath() - { - $selector = $this->getMockBuilder('Behat\Mink\Selector\SelectorInterface')->getMock(); - $handler = new SelectorsHandler(); - - $handler->registerSelector('custom_selector', $selector); - - $selector - ->expects($this->once()) - ->method('translateToXPath') - ->with($locator = 'some[locator]') - ->will($this->returnValue($ret = '[]some[]locator')); - - $this->assertEquals($ret, $handler->selectorToXpath('custom_selector', $locator)); - - $this->setExpectedException('InvalidArgumentException'); - $handler->selectorToXpath('undefined', 'asd'); - } - - public function testXpathLiteral() - { - $handler = new SelectorsHandler(); - - $this->assertEquals("'some simple string'", $handler->xpathLiteral('some simple string')); - } - - public function testBcLayer() - { - $selector = $this->getMockBuilder('Behat\Mink\Selector\SelectorInterface')->getMock(); - $handler = new SelectorsHandler(); - - $handler->registerSelector('named_partial', $selector); - - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - - $this->assertSame($selector, $handler->getSelector('named')); - } -} diff --git a/core/vendor/behat/mink/tests/Selector/Xpath/EscaperTest.php b/core/vendor/behat/mink/tests/Selector/Xpath/EscaperTest.php deleted file mode 100644 index 535dac6..0000000 --- a/core/vendor/behat/mink/tests/Selector/Xpath/EscaperTest.php +++ /dev/null @@ -1,31 +0,0 @@ -assertEquals($expected, $escaper->escapeLiteral($string)); - } - - public function getXpathLiterals() - { - return array( - array('some simple string', "'some simple string'"), - array('some "d-brackets" string', "'some \"d-brackets\" string'"), - array('some \'s-brackets\' string', "\"some 's-brackets' string\""), - array( - 'some \'s-brackets\' and "d-brackets" string', - 'concat(\'some \',"\'",\'s-brackets\',"\'",\' and "d-brackets" string\')', - ), - ); - } -} diff --git a/core/vendor/behat/mink/tests/Selector/Xpath/ManipulatorTest.php b/core/vendor/behat/mink/tests/Selector/Xpath/ManipulatorTest.php deleted file mode 100644 index 7c20561..0000000 --- a/core/vendor/behat/mink/tests/Selector/Xpath/ManipulatorTest.php +++ /dev/null @@ -1,64 +0,0 @@ -assertEquals($expectedXpath, $manipulator->prepend($xpath, $prefix)); - } - - public function getPrependedXpath() - { - return array( - 'simple' => array( - 'some_xpath', - 'some_tag1', - 'some_xpath/some_tag1', - ), - 'with slash' => array( - 'some_xpath', - '/some_tag1', - 'some_xpath/some_tag1', - ), - 'union' => array( - 'some_xpath', - 'some_tag1 | some_tag2', - 'some_xpath/some_tag1 | some_xpath/some_tag2', - ), - 'wrapped union' => array( - 'some_xpath', - '(some_tag1 | some_tag2)/some_child', - '(some_xpath/some_tag1 | some_xpath/some_tag2)/some_child', - ), - 'multiple wrapped union' => array( - 'some_xpath', - '( ( some_tag1 | some_tag2)/some_child | some_tag3)/leaf', - '( ( some_xpath/some_tag1 | some_xpath/some_tag2)/some_child | some_xpath/some_tag3)/leaf', - ), - 'parent union' => array( - 'some_xpath | another_xpath', - 'some_tag1 | some_tag2', - '(some_xpath | another_xpath)/some_tag1 | (some_xpath | another_xpath)/some_tag2', - ), - 'complex condition' => array( - 'some_xpath', - 'some_tag1 | some_tag2[@foo = "bar|"] | some_tag3[foo | bar]', - 'some_xpath/some_tag1 | some_xpath/some_tag2[@foo = "bar|"] | some_xpath/some_tag3[foo | bar]', - ), - 'multiline' => array( - 'some_xpath', - "some_tag1 | some_tag2[@foo =\n 'bar|'']\n | some_tag3[foo | bar]", - "some_xpath/some_tag1 | some_xpath/some_tag2[@foo =\n 'bar|''] | some_xpath/some_tag3[foo | bar]", - ), - ); - } -} diff --git a/core/vendor/behat/mink/tests/Selector/fixtures/test.html b/core/vendor/behat/mink/tests/Selector/fixtures/test.html deleted file mode 100644 index c64ae10..0000000 --- a/core/vendor/behat/mink/tests/Selector/fixtures/test.html +++ /dev/null @@ -1,310 +0,0 @@ - - - - - - - - -
- -
- -
- fieldset-text -
- -
- fieldset-text sample -
- - -
fieldset-text
-
-
- -
- content-text -
- -
- some content-text -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - -
- -
- - - - - -
- -
- - - - - -
- - -
- -
- -
- - -
the-table
- - - -
some the-table
- - - - - - - -
the-tablethe-table
-
- - - - diff --git a/core/vendor/behat/mink/tests/SessionTest.php b/core/vendor/behat/mink/tests/SessionTest.php deleted file mode 100644 index 9e6796d..0000000 --- a/core/vendor/behat/mink/tests/SessionTest.php +++ /dev/null @@ -1,289 +0,0 @@ -driver = $this->getMockBuilder('Behat\Mink\Driver\DriverInterface')->getMock(); - $this->selectorsHandler = $this->getMockBuilder('Behat\Mink\Selector\SelectorsHandler')->getMock(); - $this->session = new Session($this->driver, $this->selectorsHandler); - } - - public function testGetDriver() - { - $this->assertSame($this->driver, $this->session->getDriver()); - } - - public function testGetPage() - { - $this->assertInstanceOf('Behat\Mink\Element\DocumentElement', $this->session->getPage()); - } - - public function testGetSelectorsHandler() - { - $this->assertSame($this->selectorsHandler, $this->session->getSelectorsHandler()); - } - - public function testInstantiateWithoutOptionalDeps() - { - $session = new Session($this->driver); - - $this->assertInstanceOf('Behat\Mink\Selector\SelectorsHandler', $session->getSelectorsHandler()); - } - - public function testIsStarted() - { - $this->driver->expects($this->once()) - ->method('isStarted') - ->will($this->returnValue(true)); - - $this->assertTrue($this->session->isStarted()); - } - - public function testStart() - { - $this->driver->expects($this->once()) - ->method('start'); - - $this->session->start(); - } - - public function testStop() - { - $this->driver->expects($this->once()) - ->method('stop'); - - $this->session->stop(); - } - - public function testRestart() - { - $this->driver->expects($this->at(0)) - ->method('stop'); - $this->driver->expects($this->at(1)) - ->method('start'); - - $this->session->restart(); - } - - public function testVisit() - { - $this->driver - ->expects($this->once()) - ->method('visit') - ->with($url = 'some_url'); - - $this->session->visit($url); - } - - public function testReset() - { - $this->driver - ->expects($this->once()) - ->method('reset'); - - $this->session->reset(); - } - - public function testSetBasicAuth() - { - $this->driver->expects($this->once()) - ->method('setBasicAuth') - ->with('user', 'pass'); - - $this->session->setBasicAuth('user', 'pass'); - } - - public function testSetRequestHeader() - { - $this->driver->expects($this->once()) - ->method('setRequestHeader') - ->with('name', 'value'); - - $this->session->setRequestHeader('name', 'value'); - } - - public function testGetResponseHeaders() - { - $this->driver - ->expects($this->once()) - ->method('getResponseHeaders') - ->will($this->returnValue($ret = array(2, 3, 4))); - - $this->assertEquals($ret, $this->session->getResponseHeaders()); - } - - public function testSetCookie() - { - $this->driver->expects($this->once()) - ->method('setCookie') - ->with('name', 'value'); - - $this->session->setCookie('name', 'value'); - } - - public function testGetCookie() - { - $this->driver->expects($this->once()) - ->method('getCookie') - ->with('name') - ->will($this->returnValue('value')); - - $this->assertEquals('value', $this->session->getCookie('name')); - } - - public function testGetStatusCode() - { - $this->driver - ->expects($this->once()) - ->method('getStatusCode') - ->will($this->returnValue($ret = 404)); - - $this->assertEquals($ret, $this->session->getStatusCode()); - } - - public function testGetCurrentUrl() - { - $this->driver - ->expects($this->once()) - ->method('getCurrentUrl') - ->will($this->returnValue($ret = 'http://some.url')); - - $this->assertEquals($ret, $this->session->getCurrentUrl()); - } - - public function testGetScreenshot() - { - $this->driver->expects($this->once()) - ->method('getScreenshot') - ->will($this->returnValue('screenshot')); - - $this->assertEquals('screenshot', $this->session->getScreenshot()); - } - - public function testGetWindowNames() - { - $this->driver->expects($this->once()) - ->method('getWindowNames') - ->will($this->returnValue($names = array('window 1', 'window 2'))); - - $this->assertEquals($names, $this->session->getWindowNames()); - } - - public function testGetWindowName() - { - $this->driver->expects($this->once()) - ->method('getWindowName') - ->will($this->returnValue('name')); - - $this->assertEquals('name', $this->session->getWindowName()); - } - - public function testReload() - { - $this->driver->expects($this->once()) - ->method('reload'); - - $this->session->reload(); - } - - public function testBack() - { - $this->driver->expects($this->once()) - ->method('back'); - - $this->session->back(); - } - - public function testForward() - { - $this->driver->expects($this->once()) - ->method('forward'); - - $this->session->forward(); - } - - public function testSwitchToWindow() - { - $this->driver->expects($this->once()) - ->method('switchToWindow') - ->with('test'); - - $this->session->switchToWindow('test'); - } - - public function testSwitchToIFrame() - { - $this->driver->expects($this->once()) - ->method('switchToIFrame') - ->with('test'); - - $this->session->switchToIFrame('test'); - } - - public function testExecuteScript() - { - $this->driver - ->expects($this->once()) - ->method('executeScript') - ->with($arg = 'JS'); - - $this->session->executeScript($arg); - } - - public function testEvaluateScript() - { - $this->driver - ->expects($this->once()) - ->method('evaluateScript') - ->with($arg = 'JS func') - ->will($this->returnValue($ret = '23')); - - $this->assertEquals($ret, $this->session->evaluateScript($arg)); - } - - public function testWait() - { - $this->driver - ->expects($this->once()) - ->method('wait') - ->with(1000, 'function () {}'); - - $this->session->wait(1000, 'function () {}'); - } - - public function testResizeWindow() - { - $this->driver->expects($this->once()) - ->method('resizeWindow') - ->with(800, 600, 'test'); - - $this->session->resizeWindow(800, 600, 'test'); - } - - public function testMaximizeWindow() - { - $this->driver->expects($this->once()) - ->method('maximizeWindow') - ->with('test'); - - $this->session->maximizeWindow('test'); - } -} diff --git a/core/vendor/behat/mink/tests/WebAssertTest.php b/core/vendor/behat/mink/tests/WebAssertTest.php deleted file mode 100644 index c3bd3cf..0000000 --- a/core/vendor/behat/mink/tests/WebAssertTest.php +++ /dev/null @@ -1,1133 +0,0 @@ -session = $this->getMockBuilder('Behat\\Mink\\Session') - ->disableOriginalConstructor() - ->getMock(); - $this->assert = new WebAssert($this->session); - } - - public function testAddressEquals() - { - $this->session - ->expects($this->exactly(2)) - ->method('getCurrentUrl') - ->will($this->returnValue('http://example.com/script.php/sub/url?param=true#webapp/nav')) - ; - - $this->assertCorrectAssertion('addressEquals', array('/sub/url#webapp/nav')); - $this->assertWrongAssertion( - 'addressEquals', - array('sub_url'), - 'Behat\\Mink\\Exception\\ExpectationException', - 'Current page is "/sub/url#webapp/nav", but "sub_url" expected.' - ); - } - - public function testAddressEqualsEmptyPath() - { - $this->session - ->expects($this->once()) - ->method('getCurrentUrl') - ->willReturn('http://example.com') - ; - - $this->assertCorrectAssertion('addressEquals', array('/')); - } - - public function testAddressNotEquals() - { - $this->session - ->expects($this->exactly(2)) - ->method('getCurrentUrl') - ->will($this->returnValue('http://example.com/script.php/sub/url')) - ; - - $this->assertCorrectAssertion('addressNotEquals', array('sub_url')); - $this->assertWrongAssertion( - 'addressNotEquals', - array('/sub/url'), - 'Behat\\Mink\\Exception\\ExpectationException', - 'Current page is "/sub/url", but should not be.' - ); - } - - public function testAddressMatches() - { - $this->session - ->expects($this->exactly(2)) - ->method('getCurrentUrl') - ->will($this->returnValue('http://example.com/script.php/sub/url')) - ; - - $this->assertCorrectAssertion('addressMatches', array('/su.*rl/')); - $this->assertWrongAssertion( - 'addressMatches', - array('/suburl/'), - 'Behat\\Mink\\Exception\\ExpectationException', - 'Current page "/sub/url" does not match the regex "/suburl/".' - ); - } - - public function testCookieEquals() - { - $this->session-> - expects($this->any())-> - method('getCookie')-> - will($this->returnValueMap( - array( - array('foo', 'bar'), - array('bar', 'baz'), - ) - )); - - $this->assertCorrectAssertion('cookieEquals', array('foo', 'bar')); - $this->assertWrongAssertion( - 'cookieEquals', - array('bar', 'foo'), - 'Behat\Mink\Exception\ExpectationException', - 'Cookie "bar" value is "baz", but should be "foo".' - ); - } - - public function testCookieExists() - { - $this->session-> - expects($this->any())-> - method('getCookie')-> - will($this->returnValueMap( - array( - array('foo', '1'), - array('bar', null), - ) - )); - - $this->assertCorrectAssertion('cookieExists', array('foo')); - $this->assertWrongAssertion( - 'cookieExists', - array('bar'), - 'Behat\Mink\Exception\ExpectationException', - 'Cookie "bar" is not set, but should be.' - ); - } - - public function testStatusCodeEquals() - { - $this->session - ->expects($this->exactly(2)) - ->method('getStatusCode') - ->will($this->returnValue(200)) - ; - - $this->assertCorrectAssertion('statusCodeEquals', array(200)); - $this->assertWrongAssertion( - 'statusCodeEquals', - array(404), - 'Behat\\Mink\\Exception\\ExpectationException', - 'Current response status code is 200, but 404 expected.' - ); - } - - public function testStatusCodeNotEquals() - { - $this->session - ->expects($this->exactly(2)) - ->method('getStatusCode') - ->will($this->returnValue(404)) - ; - - $this->assertCorrectAssertion('statusCodeNotEquals', array(200)); - $this->assertWrongAssertion( - 'statusCodeNotEquals', - array(404), - 'Behat\\Mink\\Exception\\ExpectationException', - 'Current response status code is 404, but should not be.' - ); - } - - public function testPageTextContains() - { - $page = $this->getMockBuilder('Behat\\Mink\\Element\\DocumentElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session - ->expects($this->exactly(2)) - ->method('getPage') - ->will($this->returnValue($page)) - ; - - $page - ->expects($this->exactly(2)) - ->method('getText') - ->will($this->returnValue("Some page\n\ttext")) - ; - - $this->assertCorrectAssertion('pageTextContains', array('PAGE text')); - $this->assertWrongAssertion( - 'pageTextContains', - array('html text'), - 'Behat\\Mink\\Exception\\ResponseTextException', - 'The text "html text" was not found anywhere in the text of the current page.' - ); - } - - public function testPageTextNotContains() - { - $page = $this->getMockBuilder('Behat\\Mink\\Element\\DocumentElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session - ->expects($this->exactly(2)) - ->method('getPage') - ->will($this->returnValue($page)) - ; - - $page - ->expects($this->exactly(2)) - ->method('getText') - ->will($this->returnValue("Some html\n\ttext")) - ; - - $this->assertCorrectAssertion('pageTextNotContains', array('PAGE text')); - $this->assertWrongAssertion( - 'pageTextNotContains', - array('HTML text'), - 'Behat\\Mink\\Exception\\ResponseTextException', - 'The text "HTML text" appears in the text of this page, but it should not.' - ); - } - - public function testPageTextMatches() - { - $page = $this->getMockBuilder('Behat\\Mink\\Element\\DocumentElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session - ->expects($this->exactly(2)) - ->method('getPage') - ->will($this->returnValue($page)) - ; - - $page - ->expects($this->exactly(2)) - ->method('getText') - ->will($this->returnValue('Some page text')) - ; - - $this->assertCorrectAssertion('pageTextMatches', array('/PA.E/i')); - $this->assertWrongAssertion( - 'pageTextMatches', - array('/html/'), - 'Behat\\Mink\\Exception\\ResponseTextException', - 'The pattern /html/ was not found anywhere in the text of the current page.' - ); - } - - public function testPageTextNotMatches() - { - $page = $this->getMockBuilder('Behat\\Mink\\Element\\DocumentElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session - ->expects($this->exactly(2)) - ->method('getPage') - ->will($this->returnValue($page)) - ; - - $page - ->expects($this->exactly(2)) - ->method('getText') - ->will($this->returnValue('Some html text')) - ; - - $this->assertCorrectAssertion('pageTextNotMatches', array('/PA.E/i')); - $this->assertWrongAssertion( - 'pageTextNotMatches', - array('/HTML/i'), - 'Behat\\Mink\\Exception\\ResponseTextException', - 'The pattern /HTML/i was found in the text of the current page, but it should not.' - ); - } - - public function testResponseContains() - { - $page = $this->getMockBuilder('Behat\\Mink\\Element\\DocumentElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session - ->expects($this->exactly(2)) - ->method('getPage') - ->will($this->returnValue($page)) - ; - - $page - ->expects($this->exactly(2)) - ->method('getContent') - ->will($this->returnValue('Some page text')) - ; - - $this->assertCorrectAssertion('responseContains', array('PAGE text')); - $this->assertWrongAssertion( - 'responseContains', - array('html text'), - 'Behat\\Mink\\Exception\\ExpectationException', - 'The string "html text" was not found anywhere in the HTML response of the current page.' - ); - } - - public function testResponseNotContains() - { - $page = $this->getMockBuilder('Behat\\Mink\\Element\\DocumentElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session - ->expects($this->exactly(2)) - ->method('getPage') - ->will($this->returnValue($page)) - ; - - $page - ->expects($this->exactly(2)) - ->method('getContent') - ->will($this->returnValue('Some html text')) - ; - - $this->assertCorrectAssertion('responseNotContains', array('PAGE text')); - $this->assertWrongAssertion( - 'responseNotContains', - array('HTML text'), - 'Behat\\Mink\\Exception\\ExpectationException', - 'The string "HTML text" appears in the HTML response of this page, but it should not.' - ); - } - - public function testResponseMatches() - { - $page = $this->getMockBuilder('Behat\\Mink\\Element\\DocumentElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session - ->expects($this->exactly(2)) - ->method('getPage') - ->will($this->returnValue($page)) - ; - - $page - ->expects($this->exactly(2)) - ->method('getContent') - ->will($this->returnValue('Some page text')) - ; - - $this->assertCorrectAssertion('responseMatches', array('/PA.E/i')); - $this->assertWrongAssertion( - 'responseMatches', - array('/html/'), - 'Behat\\Mink\\Exception\\ExpectationException', - 'The pattern /html/ was not found anywhere in the HTML response of the page.' - ); - } - - public function testResponseNotMatches() - { - $page = $this->getMockBuilder('Behat\\Mink\\Element\\DocumentElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session - ->expects($this->exactly(2)) - ->method('getPage') - ->will($this->returnValue($page)) - ; - - $page - ->expects($this->exactly(2)) - ->method('getContent') - ->will($this->returnValue('Some html text')) - ; - - $this->assertCorrectAssertion('responseNotMatches', array('/PA.E/i')); - $this->assertWrongAssertion( - 'responseNotMatches', - array('/HTML/i'), - 'Behat\\Mink\\Exception\\ExpectationException', - 'The pattern /HTML/i was found in the HTML response of the page, but it should not.' - ); - } - - public function testElementsCount() - { - $page = $this->getMockBuilder('Behat\\Mink\\Element\\DocumentElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session - ->expects($this->exactly(2)) - ->method('getPage') - ->will($this->returnValue($page)) - ; - - $page - ->expects($this->exactly(2)) - ->method('findAll') - ->with('css', 'h2 > span') - ->will($this->returnValue(array(1, 2))) - ; - - $this->assertCorrectAssertion('elementsCount', array('css', 'h2 > span', 2)); - $this->assertWrongAssertion( - 'elementsCount', - array('css', 'h2 > span', 3), - 'Behat\\Mink\\Exception\\ExpectationException', - '2 elements matching css "h2 > span" found on the page, but should be 3.' - ); - } - - public function testElementExists() - { - $page = $this->getMockBuilder('Behat\\Mink\\Element\\DocumentElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session - ->expects($this->exactly(2)) - ->method('getPage') - ->will($this->returnValue($page)) - ; - - $page - ->expects($this->exactly(4)) - ->method('find') - ->with('css', 'h2 > span') - ->will($this->onConsecutiveCalls(1, null, 1, null)) - ; - - $this->assertCorrectAssertion('elementExists', array('css', 'h2 > span')); - $this->assertWrongAssertion( - 'elementExists', - array('css', 'h2 > span'), - 'Behat\\Mink\\Exception\\ElementNotFoundException', - 'Element matching css "h2 > span" not found.' - ); - - $this->assertCorrectAssertion('elementExists', array('css', 'h2 > span', $page)); - $this->assertWrongAssertion( - 'elementExists', - array('css', 'h2 > span', $page), - 'Behat\\Mink\\Exception\\ElementNotFoundException', - 'Element matching css "h2 > span" not found.' - ); - } - - public function testElementExistsWithArrayLocator() - { - $container = $this->getMockBuilder('Behat\\Mink\\Element\\NodeElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session->expects($this->never()) - ->method('getPage') - ; - - $container - ->expects($this->exactly(2)) - ->method('find') - ->with('named', array('element', 'Test')) - ->will($this->onConsecutiveCalls(1, null)) - ; - - $this->assertCorrectAssertion('elementExists', array('named', array('element', 'Test'), $container)); - $this->assertWrongAssertion( - 'elementExists', - array('named', array('element', 'Test'), $container), - 'Behat\\Mink\\Exception\\ElementNotFoundException', - 'Element with named "element Test" not found.' - ); - } - - public function testElementNotExists() - { - $page = $this->getMockBuilder('Behat\\Mink\\Element\\DocumentElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session - ->expects($this->exactly(2)) - ->method('getPage') - ->will($this->returnValue($page)) - ; - - $page - ->expects($this->exactly(4)) - ->method('find') - ->with('css', 'h2 > span') - ->will($this->onConsecutiveCalls(null, 1, null, 1)) - ; - - $this->assertCorrectAssertion('elementNotExists', array('css', 'h2 > span')); - $this->assertWrongAssertion( - 'elementNotExists', - array('css', 'h2 > span'), - 'Behat\\Mink\\Exception\\ExpectationException', - 'An element matching css "h2 > span" appears on this page, but it should not.' - ); - - $this->assertCorrectAssertion('elementNotExists', array('css', 'h2 > span', $page)); - $this->assertWrongAssertion( - 'elementNotExists', - array('css', 'h2 > span', $page), - 'Behat\\Mink\\Exception\\ExpectationException', - 'An element matching css "h2 > span" appears on this page, but it should not.' - ); - } - - /** - * @dataProvider getArrayLocatorFormats - */ - public function testElementNotExistsArrayLocator($selector, $locator, $expectedMessage) - { - $page = $this->getMockBuilder('Behat\\Mink\\Element\\DocumentElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session - ->expects($this->once()) - ->method('getPage') - ->will($this->returnValue($page)) - ; - - $page - ->expects($this->once()) - ->method('find') - ->with($selector, $locator) - ->will($this->returnValue(1)) - ; - - $this->assertWrongAssertion( - 'elementNotExists', - array($selector, $locator), - 'Behat\\Mink\\Exception\\ExpectationException', - $expectedMessage - ); - } - - public function getArrayLocatorFormats() - { - return array( - 'named' => array( - 'named', - array('button', 'Test'), - 'An button matching locator "Test" appears on this page, but it should not.', - ), - 'custom' => array( - 'custom', - array('test', 'foo'), - 'An element matching custom "test foo" appears on this page, but it should not.', - ), - ); - } - - public function testElementTextContains() - { - $page = $this->getMockBuilder('Behat\\Mink\\Element\\DocumentElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $element = $this->getMockBuilder('Behat\\Mink\\Element\\NodeElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session - ->expects($this->exactly(2)) - ->method('getPage') - ->will($this->returnValue($page)) - ; - - $page - ->expects($this->exactly(2)) - ->method('find') - ->with('css', 'h2 > span') - ->will($this->returnValue($element)) - ; - - $element - ->expects($this->exactly(2)) - ->method('getText') - ->will($this->returnValue('element text')) - ; - - $this->assertCorrectAssertion('elementTextContains', array('css', 'h2 > span', 'text')); - $this->assertWrongAssertion( - 'elementTextContains', - array('css', 'h2 > span', 'html'), - 'Behat\\Mink\\Exception\\ExpectationException', - 'The text "html" was not found in the text of the element matching css "h2 > span".' - ); - } - - public function testElementTextNotContains() - { - $page = $this->getMockBuilder('Behat\\Mink\\Element\\DocumentElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $element = $this->getMockBuilder('Behat\\Mink\\Element\\NodeElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session - ->expects($this->exactly(2)) - ->method('getPage') - ->will($this->returnValue($page)) - ; - - $page - ->expects($this->exactly(2)) - ->method('find') - ->with('css', 'h2 > span') - ->will($this->returnValue($element)) - ; - - $element - ->expects($this->exactly(2)) - ->method('getText') - ->will($this->returnValue('element text')) - ; - - $this->assertCorrectAssertion('elementTextNotContains', array('css', 'h2 > span', 'html')); - $this->assertWrongAssertion( - 'elementTextNotContains', - array('css', 'h2 > span', 'text'), - 'Behat\\Mink\\Exception\\ExpectationException', - 'The text "text" appears in the text of the element matching css "h2 > span", but it should not.' - ); - } - - public function testElementContains() - { - $page = $this->getMockBuilder('Behat\\Mink\\Element\\DocumentElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $element = $this->getMockBuilder('Behat\\Mink\\Element\\NodeElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session - ->expects($this->exactly(2)) - ->method('getPage') - ->will($this->returnValue($page)) - ; - - $page - ->expects($this->exactly(2)) - ->method('find') - ->with('css', 'h2 > span') - ->will($this->returnValue($element)) - ; - - $element - ->expects($this->exactly(2)) - ->method('getHtml') - ->will($this->returnValue('element html')) - ; - - $this->assertCorrectAssertion('elementContains', array('css', 'h2 > span', 'html')); - $this->assertWrongAssertion( - 'elementContains', - array('css', 'h2 > span', 'text'), - 'Behat\\Mink\\Exception\\ExpectationException', - 'The string "text" was not found in the HTML of the element matching css "h2 > span".' - ); - } - - public function testElementNotContains() - { - $page = $this->getMockBuilder('Behat\\Mink\\Element\\DocumentElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $element = $this->getMockBuilder('Behat\\Mink\\Element\\NodeElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session - ->expects($this->exactly(2)) - ->method('getPage') - ->will($this->returnValue($page)) - ; - - $page - ->expects($this->exactly(2)) - ->method('find') - ->with('css', 'h2 > span') - ->will($this->returnValue($element)) - ; - - $element - ->expects($this->exactly(2)) - ->method('getHtml') - ->will($this->returnValue('element html')) - ; - - $this->assertCorrectAssertion('elementNotContains', array('css', 'h2 > span', 'text')); - $this->assertWrongAssertion( - 'elementNotContains', - array('css', 'h2 > span', 'html'), - 'Behat\\Mink\\Exception\\ExpectationException', - 'The string "html" appears in the HTML of the element matching css "h2 > span", but it should not.' - ); - } - - public function testElementAttributeContains() - { - $page = $this->getMockBuilder('Behat\\Mink\\Element\\DocumentElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $element = $this->getMockBuilder('Behat\\Mink\\Element\\NodeElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session - ->expects($this->exactly(2)) - ->method('getPage') - ->will($this->returnValue($page)) - ; - - $page - ->expects($this->exactly(2)) - ->method('find') - ->with('css', 'h2 > span') - ->will($this->returnValue($element)) - ; - - $element - ->expects($this->exactly(2)) - ->method('hasAttribute') - ->will($this->returnValue(true)) - ; - - $element - ->expects($this->exactly(2)) - ->method('getAttribute') - ->with('name') - ->will($this->returnValue('foo')) - ; - - $this->assertCorrectAssertion('elementAttributeContains', array('css', 'h2 > span', 'name', 'foo')); - $this->assertWrongAssertion( - 'elementAttributeContains', - array('css', 'h2 > span', 'name', 'bar'), - 'Behat\\Mink\\Exception\\ElementHtmlException', - 'The text "bar" was not found in the attribute "name" of the element matching css "h2 > span".' - ); - } - - public function testElementAttributeExists() - { - $page = $this->getMockBuilder('Behat\\Mink\\Element\\DocumentElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $element = $this->getMockBuilder('Behat\\Mink\\Element\\NodeElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session - ->expects($this->exactly(2)) - ->method('getPage') - ->will($this->returnValue($page)) - ; - - $page - ->expects($this->exactly(2)) - ->method('find') - ->with('css', 'h2 > span') - ->will($this->returnValue($element)) - ; - - $element - ->expects($this->at(0)) - ->method('hasAttribute') - ->with('name') - ->will($this->returnValue(true)) - ; - - $element - ->expects($this->at(1)) - ->method('hasAttribute') - ->with('name') - ->will($this->returnValue(false)) - ; - - $this->assertCorrectAssertion('elementAttributeExists', array('css', 'h2 > span', 'name')); - $this->assertWrongAssertion( - 'elementAttributeExists', - array('css', 'h2 > span', 'name'), - 'Behat\\Mink\\Exception\\ElementHtmlException', - 'The attribute "name" was not found in the element matching css "h2 > span".' - ); - } - - public function testElementAttributeNotContains() - { - $page = $this->getMockBuilder('Behat\\Mink\\Element\\DocumentElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $element = $this->getMockBuilder('Behat\\Mink\\Element\\NodeElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session - ->expects($this->exactly(2)) - ->method('getPage') - ->will($this->returnValue($page)) - ; - - $page - ->expects($this->exactly(2)) - ->method('find') - ->with('css', 'h2 > span') - ->will($this->returnValue($element)) - ; - - $element - ->expects($this->exactly(2)) - ->method('hasAttribute') - ->will($this->returnValue(true)) - ; - - $element - ->expects($this->exactly(2)) - ->method('getAttribute') - ->with('name') - ->will($this->returnValue('foo')) - ; - - $this->assertCorrectAssertion('elementAttributeNotContains', array('css', 'h2 > span', 'name', 'bar')); - $this->assertWrongAssertion( - 'elementAttributeNotContains', - array('css', 'h2 > span', 'name', 'foo'), - 'Behat\\Mink\\Exception\\ElementHtmlException', - 'The text "foo" was found in the attribute "name" of the element matching css "h2 > span".' - ); - } - - public function testFieldExists() - { - $page = $this->getMockBuilder('Behat\\Mink\\Element\\DocumentElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $element = $this->getMockBuilder('Behat\\Mink\\Element\\NodeElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session - ->expects($this->exactly(2)) - ->method('getPage') - ->will($this->returnValue($page)) - ; - - $page - ->expects($this->exactly(2)) - ->method('findField') - ->with('username') - ->will($this->onConsecutiveCalls($element, null)) - ; - - $this->assertCorrectAssertion('fieldExists', array('username')); - $this->assertWrongAssertion( - 'fieldExists', - array('username'), - 'Behat\\Mink\\Exception\\ElementNotFoundException', - 'Form field with id|name|label|value "username" not found.' - ); - } - - public function testFieldNotExists() - { - $page = $this->getMockBuilder('Behat\\Mink\\Element\\DocumentElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $element = $this->getMockBuilder('Behat\\Mink\\Element\\NodeElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session - ->expects($this->exactly(2)) - ->method('getPage') - ->will($this->returnValue($page)) - ; - - $page - ->expects($this->exactly(2)) - ->method('findField') - ->with('username') - ->will($this->onConsecutiveCalls(null, $element)) - ; - - $this->assertCorrectAssertion('fieldNotExists', array('username')); - $this->assertWrongAssertion( - 'fieldNotExists', - array('username'), - 'Behat\\Mink\\Exception\\ExpectationException', - 'A field "username" appears on this page, but it should not.' - ); - } - - public function testFieldValueEquals() - { - $page = $this->getMockBuilder('Behat\\Mink\\Element\\DocumentElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $element = $this->getMockBuilder('Behat\\Mink\\Element\\NodeElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session - ->expects($this->exactly(4)) - ->method('getPage') - ->will($this->returnValue($page)) - ; - - $page - ->expects($this->exactly(4)) - ->method('findField') - ->with('username') - ->will($this->returnValue($element)) - ; - - $element - ->expects($this->exactly(4)) - ->method('getValue') - ->will($this->returnValue(234)) - ; - - $this->assertCorrectAssertion('fieldValueEquals', array('username', 234)); - $this->assertWrongAssertion( - 'fieldValueEquals', - array('username', 235), - 'Behat\\Mink\\Exception\\ExpectationException', - 'The field "username" value is "234", but "235" expected.' - ); - $this->assertWrongAssertion( - 'fieldValueEquals', - array('username', 23), - 'Behat\\Mink\\Exception\\ExpectationException', - 'The field "username" value is "234", but "23" expected.' - ); - $this->assertWrongAssertion( - 'fieldValueEquals', - array('username', ''), - 'Behat\\Mink\\Exception\\ExpectationException', - 'The field "username" value is "234", but "" expected.' - ); - } - - public function testFieldValueNotEquals() - { - $page = $this->getMockBuilder('Behat\\Mink\\Element\\DocumentElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $element = $this->getMockBuilder('Behat\\Mink\\Element\\NodeElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session - ->expects($this->exactly(4)) - ->method('getPage') - ->will($this->returnValue($page)) - ; - - $page - ->expects($this->exactly(4)) - ->method('findField') - ->with('username') - ->will($this->returnValue($element)) - ; - - $element - ->expects($this->exactly(4)) - ->method('getValue') - ->will($this->returnValue(235)) - ; - - $this->assertCorrectAssertion('fieldValueNotEquals', array('username', 234)); - $this->assertWrongAssertion( - 'fieldValueNotEquals', - array('username', 235), - 'Behat\\Mink\\Exception\\ExpectationException', - 'The field "username" value is "235", but it should not be.' - ); - $this->assertCorrectAssertion('fieldValueNotEquals', array('username', 23)); - $this->assertCorrectAssertion('fieldValueNotEquals', array('username', '')); - } - - public function testCheckboxChecked() - { - $page = $this->getMockBuilder('Behat\\Mink\\Element\\DocumentElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $element = $this->getMockBuilder('Behat\\Mink\\Element\\NodeElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session - ->expects($this->exactly(2)) - ->method('getPage') - ->will($this->returnValue($page)) - ; - - $page - ->expects($this->exactly(2)) - ->method('findField') - ->with('remember_me') - ->will($this->returnValue($element)) - ; - - $element - ->expects($this->exactly(2)) - ->method('isChecked') - ->will($this->onConsecutiveCalls(true, false)) - ; - - $this->assertCorrectAssertion('checkboxChecked', array('remember_me')); - $this->assertWrongAssertion( - 'checkboxChecked', - array('remember_me'), - 'Behat\\Mink\\Exception\\ExpectationException', - 'Checkbox "remember_me" is not checked, but it should be.' - ); - } - - public function testCheckboxNotChecked() - { - $page = $this->getMockBuilder('Behat\\Mink\\Element\\DocumentElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $element = $this->getMockBuilder('Behat\\Mink\\Element\\NodeElement') - ->disableOriginalConstructor() - ->getMock() - ; - - $this->session - ->expects($this->exactly(2)) - ->method('getPage') - ->will($this->returnValue($page)) - ; - - $page - ->expects($this->exactly(2)) - ->method('findField') - ->with('remember_me') - ->will($this->returnValue($element)) - ; - - $element - ->expects($this->exactly(2)) - ->method('isChecked') - ->will($this->onConsecutiveCalls(false, true)) - ; - - $this->assertCorrectAssertion('checkboxNotChecked', array('remember_me')); - $this->assertWrongAssertion( - 'checkboxNotChecked', - array('remember_me'), - 'Behat\\Mink\\Exception\\ExpectationException', - 'Checkbox "remember_me" is checked, but it should not be.' - ); - } - - private function assertCorrectAssertion($assertion, $arguments) - { - try { - call_user_func_array(array($this->assert, $assertion), $arguments); - } catch (ExpectationException $e) { - $this->fail('Correct assertion should not throw an exception: '.$e->getMessage()); - } - } - - private function assertWrongAssertion($assertion, $arguments, $exceptionClass, $exceptionMessage) - { - if ('Behat\Mink\Exception\ExpectationException' !== $exceptionClass && !is_subclass_of($exceptionClass, 'Behat\Mink\Exception\ExpectationException')) { - throw new \LogicException('Wrong expected exception for the failed assertion. It should be a Behat\Mink\Exception\ExpectationException.'); - } - - try { - call_user_func_array(array($this->assert, $assertion), $arguments); - $this->fail('Wrong assertion should throw an exception'); - } catch (ExpectationException $e) { - $this->assertInstanceOf($exceptionClass, $e); - $this->assertSame($exceptionMessage, $e->getMessage()); - } - } -} diff --git a/core/vendor/bin/phpunit b/core/vendor/bin/phpunit deleted file mode 120000 index 2c48930..0000000 --- a/core/vendor/bin/phpunit +++ /dev/null @@ -1 +0,0 @@ -../phpunit/phpunit/phpunit \ No newline at end of file diff --git a/core/vendor/composer/ClassLoader.php b/core/vendor/composer/ClassLoader.php deleted file mode 100644 index 4e05d3b..0000000 --- a/core/vendor/composer/ClassLoader.php +++ /dev/null @@ -1,413 +0,0 @@ - - * Jordi Boggiano - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Composer\Autoload; - -/** - * ClassLoader implements a PSR-0 class loader - * - * See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md - * - * $loader = new \Composer\Autoload\ClassLoader(); - * - * // register classes with namespaces - * $loader->add('Symfony\Component', __DIR__.'/component'); - * $loader->add('Symfony', __DIR__.'/framework'); - * - * // activate the autoloader - * $loader->register(); - * - * // to enable searching the include path (eg. for PEAR packages) - * $loader->setUseIncludePath(true); - * - * In this example, if you try to use a class in the Symfony\Component - * namespace or one of its children (Symfony\Component\Console for instance), - * the autoloader will first look for the class under the component/ - * directory, and it will then fallback to the framework/ directory if not - * found before giving up. - * - * This class is loosely based on the Symfony UniversalClassLoader. - * - * @author Fabien Potencier - * @author Jordi Boggiano - */ -class ClassLoader -{ - // PSR-4 - private $prefixLengthsPsr4 = array(); - private $prefixDirsPsr4 = array(); - private $fallbackDirsPsr4 = array(); - - // PSR-0 - private $prefixesPsr0 = array(); - private $fallbackDirsPsr0 = array(); - - private $useIncludePath = false; - private $classMap = array(); - - private $classMapAuthoritative = false; - - public function getPrefixes() - { - if (!empty($this->prefixesPsr0)) { - return call_user_func_array('array_merge', $this->prefixesPsr0); - } - - return array(); - } - - public function getPrefixesPsr4() - { - return $this->prefixDirsPsr4; - } - - public function getFallbackDirs() - { - return $this->fallbackDirsPsr0; - } - - public function getFallbackDirsPsr4() - { - return $this->fallbackDirsPsr4; - } - - public function getClassMap() - { - return $this->classMap; - } - - /** - * @param array $classMap Class to filename map - */ - public function addClassMap(array $classMap) - { - if ($this->classMap) { - $this->classMap = array_merge($this->classMap, $classMap); - } else { - $this->classMap = $classMap; - } - } - - /** - * Registers a set of PSR-0 directories for a given prefix, either - * appending or prepending to the ones previously set for this prefix. - * - * @param string $prefix The prefix - * @param array|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories - */ - public function add($prefix, $paths, $prepend = false) - { - if (!$prefix) { - if ($prepend) { - $this->fallbackDirsPsr0 = array_merge( - (array) $paths, - $this->fallbackDirsPsr0 - ); - } else { - $this->fallbackDirsPsr0 = array_merge( - $this->fallbackDirsPsr0, - (array) $paths - ); - } - - return; - } - - $first = $prefix[0]; - if (!isset($this->prefixesPsr0[$first][$prefix])) { - $this->prefixesPsr0[$first][$prefix] = (array) $paths; - - return; - } - if ($prepend) { - $this->prefixesPsr0[$first][$prefix] = array_merge( - (array) $paths, - $this->prefixesPsr0[$first][$prefix] - ); - } else { - $this->prefixesPsr0[$first][$prefix] = array_merge( - $this->prefixesPsr0[$first][$prefix], - (array) $paths - ); - } - } - - /** - * Registers a set of PSR-4 directories for a given namespace, either - * appending or prepending to the ones previously set for this namespace. - * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param array|string $paths The PSR-0 base directories - * @param bool $prepend Whether to prepend the directories - * - * @throws \InvalidArgumentException - */ - public function addPsr4($prefix, $paths, $prepend = false) - { - if (!$prefix) { - // Register directories for the root namespace. - if ($prepend) { - $this->fallbackDirsPsr4 = array_merge( - (array) $paths, - $this->fallbackDirsPsr4 - ); - } else { - $this->fallbackDirsPsr4 = array_merge( - $this->fallbackDirsPsr4, - (array) $paths - ); - } - } elseif (!isset($this->prefixDirsPsr4[$prefix])) { - // Register directories for a new namespace. - $length = strlen($prefix); - if ('\\' !== $prefix[$length - 1]) { - throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); - } - $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; - } elseif ($prepend) { - // Prepend directories for an already registered namespace. - $this->prefixDirsPsr4[$prefix] = array_merge( - (array) $paths, - $this->prefixDirsPsr4[$prefix] - ); - } else { - // Append directories for an already registered namespace. - $this->prefixDirsPsr4[$prefix] = array_merge( - $this->prefixDirsPsr4[$prefix], - (array) $paths - ); - } - } - - /** - * Registers a set of PSR-0 directories for a given prefix, - * replacing any others previously set for this prefix. - * - * @param string $prefix The prefix - * @param array|string $paths The PSR-0 base directories - */ - public function set($prefix, $paths) - { - if (!$prefix) { - $this->fallbackDirsPsr0 = (array) $paths; - } else { - $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; - } - } - - /** - * Registers a set of PSR-4 directories for a given namespace, - * replacing any others previously set for this namespace. - * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param array|string $paths The PSR-4 base directories - * - * @throws \InvalidArgumentException - */ - public function setPsr4($prefix, $paths) - { - if (!$prefix) { - $this->fallbackDirsPsr4 = (array) $paths; - } else { - $length = strlen($prefix); - if ('\\' !== $prefix[$length - 1]) { - throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); - } - $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; - } - } - - /** - * Turns on searching the include path for class files. - * - * @param bool $useIncludePath - */ - public function setUseIncludePath($useIncludePath) - { - $this->useIncludePath = $useIncludePath; - } - - /** - * Can be used to check if the autoloader uses the include path to check - * for classes. - * - * @return bool - */ - public function getUseIncludePath() - { - return $this->useIncludePath; - } - - /** - * Turns off searching the prefix and fallback directories for classes - * that have not been registered with the class map. - * - * @param bool $classMapAuthoritative - */ - public function setClassMapAuthoritative($classMapAuthoritative) - { - $this->classMapAuthoritative = $classMapAuthoritative; - } - - /** - * Should class lookup fail if not found in the current class map? - * - * @return bool - */ - public function isClassMapAuthoritative() - { - return $this->classMapAuthoritative; - } - - /** - * Registers this instance as an autoloader. - * - * @param bool $prepend Whether to prepend the autoloader or not - */ - public function register($prepend = false) - { - spl_autoload_register(array($this, 'loadClass'), true, $prepend); - } - - /** - * Unregisters this instance as an autoloader. - */ - public function unregister() - { - spl_autoload_unregister(array($this, 'loadClass')); - } - - /** - * Loads the given class or interface. - * - * @param string $class The name of the class - * @return bool|null True if loaded, null otherwise - */ - public function loadClass($class) - { - if ($file = $this->findFile($class)) { - includeFile($file); - - return true; - } - } - - /** - * Finds the path to the file where the class is defined. - * - * @param string $class The name of the class - * - * @return string|false The path if found, false otherwise - */ - public function findFile($class) - { - // work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731 - if ('\\' == $class[0]) { - $class = substr($class, 1); - } - - // class map lookup - if (isset($this->classMap[$class])) { - return $this->classMap[$class]; - } - if ($this->classMapAuthoritative) { - return false; - } - - $file = $this->findFileWithExtension($class, '.php'); - - // Search for Hack files if we are running on HHVM - if ($file === null && defined('HHVM_VERSION')) { - $file = $this->findFileWithExtension($class, '.hh'); - } - - if ($file === null) { - // Remember that this class does not exist. - return $this->classMap[$class] = false; - } - - return $file; - } - - private function findFileWithExtension($class, $ext) - { - // PSR-4 lookup - $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; - - $first = $class[0]; - if (isset($this->prefixLengthsPsr4[$first])) { - foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) { - if (0 === strpos($class, $prefix)) { - foreach ($this->prefixDirsPsr4[$prefix] as $dir) { - if (is_file($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) { - return $file; - } - } - } - } - } - - // PSR-4 fallback dirs - foreach ($this->fallbackDirsPsr4 as $dir) { - if (is_file($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { - return $file; - } - } - - // PSR-0 lookup - if (false !== $pos = strrpos($class, '\\')) { - // namespaced class name - $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) - . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); - } else { - // PEAR-like class name - $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; - } - - if (isset($this->prefixesPsr0[$first])) { - foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { - if (0 === strpos($class, $prefix)) { - foreach ($dirs as $dir) { - if (is_file($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { - return $file; - } - } - } - } - } - - // PSR-0 fallback dirs - foreach ($this->fallbackDirsPsr0 as $dir) { - if (is_file($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { - return $file; - } - } - - // PSR-0 include paths. - if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { - return $file; - } - } -} - -/** - * Scope isolated include. - * - * Prevents access to $this/self from included files. - */ -function includeFile($file) -{ - include $file; -} diff --git a/core/vendor/composer/autoload_classmap.php b/core/vendor/composer/autoload_classmap.php deleted file mode 100644 index e66d49b..0000000 --- a/core/vendor/composer/autoload_classmap.php +++ /dev/null @@ -1,438 +0,0 @@ - $baseDir . '/lib/Drupal/Component/Utility/Timer.php', - 'Drupal\\Component\\Utility\\Unicode' => $baseDir . '/lib/Drupal/Component/Utility/Unicode.php', - 'Drupal\\Core\\Database\\Database' => $baseDir . '/lib/Drupal/Core/Database/Database.php', - 'Drupal\\Core\\DrupalKernel' => $baseDir . '/lib/Drupal/Core/DrupalKernel.php', - 'Drupal\\Core\\DrupalKernelInterface' => $baseDir . '/lib/Drupal/Core/DrupalKernelInterface.php', - 'Drupal\\Core\\Site\\Settings' => $baseDir . '/lib/Drupal/Core/Site/Settings.php', - 'File_Iterator' => $vendorDir . '/phpunit/php-file-iterator/src/Iterator.php', - 'File_Iterator_Facade' => $vendorDir . '/phpunit/php-file-iterator/src/Facade.php', - 'File_Iterator_Factory' => $vendorDir . '/phpunit/php-file-iterator/src/Factory.php', - 'PHPUnit_Exception' => $vendorDir . '/phpunit/phpunit/src/Exception.php', - 'PHPUnit_Extensions_GroupTestSuite' => $vendorDir . '/phpunit/phpunit/src/Extensions/GroupTestSuite.php', - 'PHPUnit_Extensions_PhptTestCase' => $vendorDir . '/phpunit/phpunit/src/Extensions/PhptTestCase.php', - 'PHPUnit_Extensions_PhptTestSuite' => $vendorDir . '/phpunit/phpunit/src/Extensions/PhptTestSuite.php', - 'PHPUnit_Extensions_RepeatedTest' => $vendorDir . '/phpunit/phpunit/src/Extensions/RepeatedTest.php', - 'PHPUnit_Extensions_TestDecorator' => $vendorDir . '/phpunit/phpunit/src/Extensions/TestDecorator.php', - 'PHPUnit_Extensions_TicketListener' => $vendorDir . '/phpunit/phpunit/src/Extensions/TicketListener.php', - 'PHPUnit_Framework_Assert' => $vendorDir . '/phpunit/phpunit/src/Framework/Assert.php', - 'PHPUnit_Framework_AssertionFailedError' => $vendorDir . '/phpunit/phpunit/src/Framework/AssertionFailedError.php', - 'PHPUnit_Framework_BaseTestListener' => $vendorDir . '/phpunit/phpunit/src/Framework/BaseTestListener.php', - 'PHPUnit_Framework_CodeCoverageException' => $vendorDir . '/phpunit/phpunit/src/Framework/CodeCoverageException.php', - 'PHPUnit_Framework_Constraint' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint.php', - 'PHPUnit_Framework_Constraint_And' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/And.php', - 'PHPUnit_Framework_Constraint_ArrayHasKey' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/ArrayHasKey.php', - 'PHPUnit_Framework_Constraint_ArraySubset' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/ArraySubset.php', - 'PHPUnit_Framework_Constraint_Attribute' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Attribute.php', - 'PHPUnit_Framework_Constraint_Callback' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Callback.php', - 'PHPUnit_Framework_Constraint_ClassHasAttribute' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/ClassHasAttribute.php', - 'PHPUnit_Framework_Constraint_ClassHasStaticAttribute' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/ClassHasStaticAttribute.php', - 'PHPUnit_Framework_Constraint_Composite' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Composite.php', - 'PHPUnit_Framework_Constraint_Count' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Count.php', - 'PHPUnit_Framework_Constraint_Exception' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Exception.php', - 'PHPUnit_Framework_Constraint_ExceptionCode' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/ExceptionCode.php', - 'PHPUnit_Framework_Constraint_ExceptionMessage' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/ExceptionMessage.php', - 'PHPUnit_Framework_Constraint_ExceptionMessageRegExp' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/ExceptionMessageRegExp.php', - 'PHPUnit_Framework_Constraint_FileExists' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/FileExists.php', - 'PHPUnit_Framework_Constraint_GreaterThan' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/GreaterThan.php', - 'PHPUnit_Framework_Constraint_IsAnything' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/IsAnything.php', - 'PHPUnit_Framework_Constraint_IsEmpty' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/IsEmpty.php', - 'PHPUnit_Framework_Constraint_IsEqual' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/IsEqual.php', - 'PHPUnit_Framework_Constraint_IsFalse' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/IsFalse.php', - 'PHPUnit_Framework_Constraint_IsIdentical' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/IsIdentical.php', - 'PHPUnit_Framework_Constraint_IsInstanceOf' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/IsInstanceOf.php', - 'PHPUnit_Framework_Constraint_IsJson' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/IsJson.php', - 'PHPUnit_Framework_Constraint_IsNull' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/IsNull.php', - 'PHPUnit_Framework_Constraint_IsTrue' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/IsTrue.php', - 'PHPUnit_Framework_Constraint_IsType' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/IsType.php', - 'PHPUnit_Framework_Constraint_JsonMatches' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/JsonMatches.php', - 'PHPUnit_Framework_Constraint_JsonMatches_ErrorMessageProvider' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/JsonMatches/ErrorMessageProvider.php', - 'PHPUnit_Framework_Constraint_LessThan' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/LessThan.php', - 'PHPUnit_Framework_Constraint_Not' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Not.php', - 'PHPUnit_Framework_Constraint_ObjectHasAttribute' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/ObjectHasAttribute.php', - 'PHPUnit_Framework_Constraint_Or' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Or.php', - 'PHPUnit_Framework_Constraint_PCREMatch' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/PCREMatch.php', - 'PHPUnit_Framework_Constraint_SameSize' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/SameSize.php', - 'PHPUnit_Framework_Constraint_StringContains' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/StringContains.php', - 'PHPUnit_Framework_Constraint_StringEndsWith' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/StringEndsWith.php', - 'PHPUnit_Framework_Constraint_StringMatches' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/StringMatches.php', - 'PHPUnit_Framework_Constraint_StringStartsWith' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/StringStartsWith.php', - 'PHPUnit_Framework_Constraint_TraversableContains' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/TraversableContains.php', - 'PHPUnit_Framework_Constraint_TraversableContainsOnly' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/TraversableContainsOnly.php', - 'PHPUnit_Framework_Constraint_Xor' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Xor.php', - 'PHPUnit_Framework_Error' => $vendorDir . '/phpunit/phpunit/src/Framework/Error.php', - 'PHPUnit_Framework_Error_Deprecated' => $vendorDir . '/phpunit/phpunit/src/Framework/Error/Deprecated.php', - 'PHPUnit_Framework_Error_Notice' => $vendorDir . '/phpunit/phpunit/src/Framework/Error/Notice.php', - 'PHPUnit_Framework_Error_Warning' => $vendorDir . '/phpunit/phpunit/src/Framework/Error/Warning.php', - 'PHPUnit_Framework_Exception' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception.php', - 'PHPUnit_Framework_ExceptionWrapper' => $vendorDir . '/phpunit/phpunit/src/Framework/ExceptionWrapper.php', - 'PHPUnit_Framework_ExpectationFailedException' => $vendorDir . '/phpunit/phpunit/src/Framework/ExpectationFailedException.php', - 'PHPUnit_Framework_IncompleteTest' => $vendorDir . '/phpunit/phpunit/src/Framework/IncompleteTest.php', - 'PHPUnit_Framework_IncompleteTestCase' => $vendorDir . '/phpunit/phpunit/src/Framework/IncompleteTestCase.php', - 'PHPUnit_Framework_IncompleteTestError' => $vendorDir . '/phpunit/phpunit/src/Framework/IncompleteTestError.php', - 'PHPUnit_Framework_InvalidCoversTargetError' => $vendorDir . '/phpunit/phpunit/src/Framework/InvalidCoversTargetError.php', - 'PHPUnit_Framework_InvalidCoversTargetException' => $vendorDir . '/phpunit/phpunit/src/Framework/InvalidCoversTargetException.php', - 'PHPUnit_Framework_MockObject_BadMethodCallException' => $vendorDir . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Exception/BadMethodCallException.php', - 'PHPUnit_Framework_MockObject_Builder_Identity' => $vendorDir . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Builder/Identity.php', - 'PHPUnit_Framework_MockObject_Builder_InvocationMocker' => $vendorDir . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Builder/InvocationMocker.php', - 'PHPUnit_Framework_MockObject_Builder_Match' => $vendorDir . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Builder/Match.php', - 'PHPUnit_Framework_MockObject_Builder_MethodNameMatch' => $vendorDir . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Builder/MethodNameMatch.php', - 'PHPUnit_Framework_MockObject_Builder_Namespace' => $vendorDir . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Builder/Namespace.php', - 'PHPUnit_Framework_MockObject_Builder_ParametersMatch' => $vendorDir . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Builder/ParametersMatch.php', - 'PHPUnit_Framework_MockObject_Builder_Stub' => $vendorDir . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Builder/Stub.php', - 'PHPUnit_Framework_MockObject_Exception' => $vendorDir . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Exception/Exception.php', - 'PHPUnit_Framework_MockObject_Generator' => $vendorDir . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Generator.php', - 'PHPUnit_Framework_MockObject_Invocation' => $vendorDir . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Invocation.php', - 'PHPUnit_Framework_MockObject_InvocationMocker' => $vendorDir . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/InvocationMocker.php', - 'PHPUnit_Framework_MockObject_Invocation_Object' => $vendorDir . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Invocation/Object.php', - 'PHPUnit_Framework_MockObject_Invocation_Static' => $vendorDir . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Invocation/Static.php', - 'PHPUnit_Framework_MockObject_Invokable' => $vendorDir . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Invokable.php', - 'PHPUnit_Framework_MockObject_Matcher' => $vendorDir . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Matcher.php', - 'PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount' => $vendorDir . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Matcher/AnyInvokedCount.php', - 'PHPUnit_Framework_MockObject_Matcher_AnyParameters' => $vendorDir . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Matcher/AnyParameters.php', - 'PHPUnit_Framework_MockObject_Matcher_ConsecutiveParameters' => $vendorDir . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Matcher/ConsecutiveParameters.php', - 'PHPUnit_Framework_MockObject_Matcher_Invocation' => $vendorDir . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Matcher/Invocation.php', - 'PHPUnit_Framework_MockObject_Matcher_InvokedAtIndex' => $vendorDir . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Matcher/InvokedAtIndex.php', - 'PHPUnit_Framework_MockObject_Matcher_InvokedAtLeastCount' => $vendorDir . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Matcher/InvokedAtLeastCount.php', - 'PHPUnit_Framework_MockObject_Matcher_InvokedAtLeastOnce' => $vendorDir . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Matcher/InvokedAtLeastOnce.php', - 'PHPUnit_Framework_MockObject_Matcher_InvokedAtMostCount' => $vendorDir . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Matcher/InvokedAtMostCount.php', - 'PHPUnit_Framework_MockObject_Matcher_InvokedCount' => $vendorDir . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Matcher/InvokedCount.php', - 'PHPUnit_Framework_MockObject_Matcher_InvokedRecorder' => $vendorDir . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Matcher/InvokedRecorder.php', - 'PHPUnit_Framework_MockObject_Matcher_MethodName' => $vendorDir . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Matcher/MethodName.php', - 'PHPUnit_Framework_MockObject_Matcher_Parameters' => $vendorDir . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Matcher/Parameters.php', - 'PHPUnit_Framework_MockObject_Matcher_StatelessInvocation' => $vendorDir . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Matcher/StatelessInvocation.php', - 'PHPUnit_Framework_MockObject_MockBuilder' => $vendorDir . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/MockBuilder.php', - 'PHPUnit_Framework_MockObject_MockObject' => $vendorDir . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/MockObject.php', - 'PHPUnit_Framework_MockObject_RuntimeException' => $vendorDir . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Exception/RuntimeException.php', - 'PHPUnit_Framework_MockObject_Stub' => $vendorDir . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Stub.php', - 'PHPUnit_Framework_MockObject_Stub_ConsecutiveCalls' => $vendorDir . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Stub/ConsecutiveCalls.php', - 'PHPUnit_Framework_MockObject_Stub_Exception' => $vendorDir . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Stub/Exception.php', - 'PHPUnit_Framework_MockObject_Stub_MatcherCollection' => $vendorDir . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Stub/MatcherCollection.php', - 'PHPUnit_Framework_MockObject_Stub_Return' => $vendorDir . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Stub/Return.php', - 'PHPUnit_Framework_MockObject_Stub_ReturnArgument' => $vendorDir . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Stub/ReturnArgument.php', - 'PHPUnit_Framework_MockObject_Stub_ReturnCallback' => $vendorDir . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Stub/ReturnCallback.php', - 'PHPUnit_Framework_MockObject_Stub_ReturnSelf' => $vendorDir . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Stub/ReturnSelf.php', - 'PHPUnit_Framework_MockObject_Stub_ReturnValueMap' => $vendorDir . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Stub/ReturnValueMap.php', - 'PHPUnit_Framework_MockObject_Verifiable' => $vendorDir . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Verifiable.php', - 'PHPUnit_Framework_OutputError' => $vendorDir . '/phpunit/phpunit/src/Framework/OutputError.php', - 'PHPUnit_Framework_RiskyTest' => $vendorDir . '/phpunit/phpunit/src/Framework/RiskyTest.php', - 'PHPUnit_Framework_RiskyTestError' => $vendorDir . '/phpunit/phpunit/src/Framework/RiskyTestError.php', - 'PHPUnit_Framework_SelfDescribing' => $vendorDir . '/phpunit/phpunit/src/Framework/SelfDescribing.php', - 'PHPUnit_Framework_SkippedTest' => $vendorDir . '/phpunit/phpunit/src/Framework/SkippedTest.php', - 'PHPUnit_Framework_SkippedTestCase' => $vendorDir . '/phpunit/phpunit/src/Framework/SkippedTestCase.php', - 'PHPUnit_Framework_SkippedTestError' => $vendorDir . '/phpunit/phpunit/src/Framework/SkippedTestError.php', - 'PHPUnit_Framework_SkippedTestSuiteError' => $vendorDir . '/phpunit/phpunit/src/Framework/SkippedTestSuiteError.php', - 'PHPUnit_Framework_SyntheticError' => $vendorDir . '/phpunit/phpunit/src/Framework/SyntheticError.php', - 'PHPUnit_Framework_Test' => $vendorDir . '/phpunit/phpunit/src/Framework/Test.php', - 'PHPUnit_Framework_TestCase' => $vendorDir . '/phpunit/phpunit/src/Framework/TestCase.php', - 'PHPUnit_Framework_TestFailure' => $vendorDir . '/phpunit/phpunit/src/Framework/TestFailure.php', - 'PHPUnit_Framework_TestListener' => $vendorDir . '/phpunit/phpunit/src/Framework/TestListener.php', - 'PHPUnit_Framework_TestResult' => $vendorDir . '/phpunit/phpunit/src/Framework/TestResult.php', - 'PHPUnit_Framework_TestSuite' => $vendorDir . '/phpunit/phpunit/src/Framework/TestSuite.php', - 'PHPUnit_Framework_TestSuite_DataProvider' => $vendorDir . '/phpunit/phpunit/src/Framework/TestSuite/DataProvider.php', - 'PHPUnit_Framework_UnintentionallyCoveredCodeError' => $vendorDir . '/phpunit/phpunit/src/Framework/UnintentionallyCoveredCodeError.php', - 'PHPUnit_Framework_Warning' => $vendorDir . '/phpunit/phpunit/src/Framework/Warning.php', - 'PHPUnit_Runner_BaseTestRunner' => $vendorDir . '/phpunit/phpunit/src/Runner/BaseTestRunner.php', - 'PHPUnit_Runner_Exception' => $vendorDir . '/phpunit/phpunit/src/Runner/Exception.php', - 'PHPUnit_Runner_Filter_Factory' => $vendorDir . '/phpunit/phpunit/src/Runner/Filter/Factory.php', - 'PHPUnit_Runner_Filter_GroupFilterIterator' => $vendorDir . '/phpunit/phpunit/src/Runner/Filter/Group.php', - 'PHPUnit_Runner_Filter_Group_Exclude' => $vendorDir . '/phpunit/phpunit/src/Runner/Filter/Group/Exclude.php', - 'PHPUnit_Runner_Filter_Group_Include' => $vendorDir . '/phpunit/phpunit/src/Runner/Filter/Group/Include.php', - 'PHPUnit_Runner_Filter_Test' => $vendorDir . '/phpunit/phpunit/src/Runner/Filter/Test.php', - 'PHPUnit_Runner_StandardTestSuiteLoader' => $vendorDir . '/phpunit/phpunit/src/Runner/StandardTestSuiteLoader.php', - 'PHPUnit_Runner_TestSuiteLoader' => $vendorDir . '/phpunit/phpunit/src/Runner/TestSuiteLoader.php', - 'PHPUnit_Runner_Version' => $vendorDir . '/phpunit/phpunit/src/Runner/Version.php', - 'PHPUnit_TextUI_Command' => $vendorDir . '/phpunit/phpunit/src/TextUI/Command.php', - 'PHPUnit_TextUI_ResultPrinter' => $vendorDir . '/phpunit/phpunit/src/TextUI/ResultPrinter.php', - 'PHPUnit_TextUI_TestRunner' => $vendorDir . '/phpunit/phpunit/src/TextUI/TestRunner.php', - 'PHPUnit_Util_Blacklist' => $vendorDir . '/phpunit/phpunit/src/Util/Blacklist.php', - 'PHPUnit_Util_Configuration' => $vendorDir . '/phpunit/phpunit/src/Util/Configuration.php', - 'PHPUnit_Util_ErrorHandler' => $vendorDir . '/phpunit/phpunit/src/Util/ErrorHandler.php', - 'PHPUnit_Util_Fileloader' => $vendorDir . '/phpunit/phpunit/src/Util/Fileloader.php', - 'PHPUnit_Util_Filesystem' => $vendorDir . '/phpunit/phpunit/src/Util/Filesystem.php', - 'PHPUnit_Util_Filter' => $vendorDir . '/phpunit/phpunit/src/Util/Filter.php', - 'PHPUnit_Util_Getopt' => $vendorDir . '/phpunit/phpunit/src/Util/Getopt.php', - 'PHPUnit_Util_GlobalState' => $vendorDir . '/phpunit/phpunit/src/Util/GlobalState.php', - 'PHPUnit_Util_InvalidArgumentHelper' => $vendorDir . '/phpunit/phpunit/src/Util/InvalidArgumentHelper.php', - 'PHPUnit_Util_Log_JSON' => $vendorDir . '/phpunit/phpunit/src/Util/Log/JSON.php', - 'PHPUnit_Util_Log_JUnit' => $vendorDir . '/phpunit/phpunit/src/Util/Log/JUnit.php', - 'PHPUnit_Util_Log_TAP' => $vendorDir . '/phpunit/phpunit/src/Util/Log/TAP.php', - 'PHPUnit_Util_PHP' => $vendorDir . '/phpunit/phpunit/src/Util/PHP.php', - 'PHPUnit_Util_PHP_Default' => $vendorDir . '/phpunit/phpunit/src/Util/PHP/Default.php', - 'PHPUnit_Util_PHP_Windows' => $vendorDir . '/phpunit/phpunit/src/Util/PHP/Windows.php', - 'PHPUnit_Util_Printer' => $vendorDir . '/phpunit/phpunit/src/Util/Printer.php', - 'PHPUnit_Util_Regex' => $vendorDir . '/phpunit/phpunit/src/Util/Regex.php', - 'PHPUnit_Util_String' => $vendorDir . '/phpunit/phpunit/src/Util/String.php', - 'PHPUnit_Util_Test' => $vendorDir . '/phpunit/phpunit/src/Util/Test.php', - 'PHPUnit_Util_TestDox_NamePrettifier' => $vendorDir . '/phpunit/phpunit/src/Util/TestDox/NamePrettifier.php', - 'PHPUnit_Util_TestDox_ResultPrinter' => $vendorDir . '/phpunit/phpunit/src/Util/TestDox/ResultPrinter.php', - 'PHPUnit_Util_TestDox_ResultPrinter_HTML' => $vendorDir . '/phpunit/phpunit/src/Util/TestDox/ResultPrinter/HTML.php', - 'PHPUnit_Util_TestDox_ResultPrinter_Text' => $vendorDir . '/phpunit/phpunit/src/Util/TestDox/ResultPrinter/Text.php', - 'PHPUnit_Util_TestSuiteIterator' => $vendorDir . '/phpunit/phpunit/src/Util/TestSuiteIterator.php', - 'PHPUnit_Util_Type' => $vendorDir . '/phpunit/phpunit/src/Util/Type.php', - 'PHPUnit_Util_XML' => $vendorDir . '/phpunit/phpunit/src/Util/XML.php', - 'PHP_CodeCoverage' => $vendorDir . '/phpunit/php-code-coverage/src/CodeCoverage.php', - 'PHP_CodeCoverage_Driver' => $vendorDir . '/phpunit/php-code-coverage/src/CodeCoverage/Driver.php', - 'PHP_CodeCoverage_Driver_HHVM' => $vendorDir . '/phpunit/php-code-coverage/src/CodeCoverage/Driver/HHVM.php', - 'PHP_CodeCoverage_Driver_Xdebug' => $vendorDir . '/phpunit/php-code-coverage/src/CodeCoverage/Driver/Xdebug.php', - 'PHP_CodeCoverage_Exception' => $vendorDir . '/phpunit/php-code-coverage/src/CodeCoverage/Exception.php', - 'PHP_CodeCoverage_Exception_UnintentionallyCoveredCode' => $vendorDir . '/phpunit/php-code-coverage/src/CodeCoverage/Exception/UnintentionallyCoveredCode.php', - 'PHP_CodeCoverage_Filter' => $vendorDir . '/phpunit/php-code-coverage/src/CodeCoverage/Filter.php', - 'PHP_CodeCoverage_Report_Clover' => $vendorDir . '/phpunit/php-code-coverage/src/CodeCoverage/Report/Clover.php', - 'PHP_CodeCoverage_Report_Crap4j' => $vendorDir . '/phpunit/php-code-coverage/src/CodeCoverage/Report/Crap4j.php', - 'PHP_CodeCoverage_Report_Factory' => $vendorDir . '/phpunit/php-code-coverage/src/CodeCoverage/Report/Factory.php', - 'PHP_CodeCoverage_Report_HTML' => $vendorDir . '/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML.php', - 'PHP_CodeCoverage_Report_HTML_Renderer' => $vendorDir . '/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer.php', - 'PHP_CodeCoverage_Report_HTML_Renderer_Dashboard' => $vendorDir . '/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Dashboard.php', - 'PHP_CodeCoverage_Report_HTML_Renderer_Directory' => $vendorDir . '/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Directory.php', - 'PHP_CodeCoverage_Report_HTML_Renderer_File' => $vendorDir . '/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/File.php', - 'PHP_CodeCoverage_Report_Node' => $vendorDir . '/phpunit/php-code-coverage/src/CodeCoverage/Report/Node.php', - 'PHP_CodeCoverage_Report_Node_Directory' => $vendorDir . '/phpunit/php-code-coverage/src/CodeCoverage/Report/Node/Directory.php', - 'PHP_CodeCoverage_Report_Node_File' => $vendorDir . '/phpunit/php-code-coverage/src/CodeCoverage/Report/Node/File.php', - 'PHP_CodeCoverage_Report_Node_Iterator' => $vendorDir . '/phpunit/php-code-coverage/src/CodeCoverage/Report/Node/Iterator.php', - 'PHP_CodeCoverage_Report_PHP' => $vendorDir . '/phpunit/php-code-coverage/src/CodeCoverage/Report/PHP.php', - 'PHP_CodeCoverage_Report_Text' => $vendorDir . '/phpunit/php-code-coverage/src/CodeCoverage/Report/Text.php', - 'PHP_CodeCoverage_Report_XML' => $vendorDir . '/phpunit/php-code-coverage/src/CodeCoverage/Report/XML.php', - 'PHP_CodeCoverage_Report_XML_Directory' => $vendorDir . '/phpunit/php-code-coverage/src/CodeCoverage/Report/XML/Directory.php', - 'PHP_CodeCoverage_Report_XML_File' => $vendorDir . '/phpunit/php-code-coverage/src/CodeCoverage/Report/XML/File.php', - 'PHP_CodeCoverage_Report_XML_File_Coverage' => $vendorDir . '/phpunit/php-code-coverage/src/CodeCoverage/Report/XML/File/Coverage.php', - 'PHP_CodeCoverage_Report_XML_File_Method' => $vendorDir . '/phpunit/php-code-coverage/src/CodeCoverage/Report/XML/File/Method.php', - 'PHP_CodeCoverage_Report_XML_File_Report' => $vendorDir . '/phpunit/php-code-coverage/src/CodeCoverage/Report/XML/File/Report.php', - 'PHP_CodeCoverage_Report_XML_File_Unit' => $vendorDir . '/phpunit/php-code-coverage/src/CodeCoverage/Report/XML/File/Unit.php', - 'PHP_CodeCoverage_Report_XML_Node' => $vendorDir . '/phpunit/php-code-coverage/src/CodeCoverage/Report/XML/Node.php', - 'PHP_CodeCoverage_Report_XML_Project' => $vendorDir . '/phpunit/php-code-coverage/src/CodeCoverage/Report/XML/Project.php', - 'PHP_CodeCoverage_Report_XML_Tests' => $vendorDir . '/phpunit/php-code-coverage/src/CodeCoverage/Report/XML/Tests.php', - 'PHP_CodeCoverage_Report_XML_Totals' => $vendorDir . '/phpunit/php-code-coverage/src/CodeCoverage/Report/XML/Totals.php', - 'PHP_CodeCoverage_Util' => $vendorDir . '/phpunit/php-code-coverage/src/CodeCoverage/Util.php', - 'PHP_CodeCoverage_Util_InvalidArgumentHelper' => $vendorDir . '/phpunit/php-code-coverage/src/CodeCoverage/Util/InvalidArgumentHelper.php', - 'PHP_Timer' => $vendorDir . '/phpunit/php-timer/PHP/Timer.php', - 'PHP_Token' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_TokenWithScope' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_TokenWithScopeAndVisibility' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_ABSTRACT' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_AMPERSAND' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_AND_EQUAL' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_ARRAY' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_ARRAY_CAST' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_AS' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_AT' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_BACKTICK' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_BAD_CHARACTER' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_BOOLEAN_AND' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_BOOLEAN_OR' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_BOOL_CAST' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_BREAK' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_CALLABLE' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_CARET' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_CASE' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_CATCH' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_CHARACTER' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_CLASS' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_CLASS_C' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_CLASS_NAME_CONSTANT' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_CLONE' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_CLOSE_BRACKET' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_CLOSE_CURLY' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_CLOSE_SQUARE' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_CLOSE_TAG' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_COLON' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_COMMA' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_COMMENT' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_CONCAT_EQUAL' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_CONST' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_CONSTANT_ENCAPSED_STRING' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_CONTINUE' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_CURLY_OPEN' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_DEC' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_DECLARE' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_DEFAULT' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_DIR' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_DIV' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_DIV_EQUAL' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_DNUMBER' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_DO' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_DOC_COMMENT' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_DOLLAR' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_DOLLAR_OPEN_CURLY_BRACES' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_DOT' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_DOUBLE_ARROW' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_DOUBLE_CAST' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_DOUBLE_COLON' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_DOUBLE_QUOTES' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_ECHO' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_ELLIPSIS' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_ELSE' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_ELSEIF' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_EMPTY' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_ENCAPSED_AND_WHITESPACE' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_ENDDECLARE' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_ENDFOR' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_ENDFOREACH' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_ENDIF' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_ENDSWITCH' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_ENDWHILE' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_END_HEREDOC' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_EQUAL' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_EVAL' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_EXCLAMATION_MARK' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_EXIT' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_EXTENDS' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_FILE' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_FINAL' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_FINALLY' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_FOR' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_FOREACH' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_FUNCTION' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_FUNC_C' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_GLOBAL' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_GOTO' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_GT' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_HALT_COMPILER' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_IF' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_IMPLEMENTS' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_IN' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_INC' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_INCLUDE' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_INCLUDE_ONCE' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_INLINE_HTML' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_INSTANCEOF' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_INSTEADOF' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_INTERFACE' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_INT_CAST' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_ISSET' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_IS_EQUAL' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_IS_GREATER_OR_EQUAL' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_IS_IDENTICAL' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_IS_NOT_EQUAL' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_IS_NOT_IDENTICAL' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_IS_SMALLER_OR_EQUAL' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_Includes' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_JOIN' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_LAMBDA_ARROW' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_LAMBDA_CP' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_LAMBDA_OP' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_LINE' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_LIST' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_LNUMBER' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_LOGICAL_AND' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_LOGICAL_OR' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_LOGICAL_XOR' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_LT' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_METHOD_C' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_MINUS' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_MINUS_EQUAL' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_MOD_EQUAL' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_MULT' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_MUL_EQUAL' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_NAMESPACE' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_NEW' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_NS_C' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_NS_SEPARATOR' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_NUM_STRING' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_OBJECT_CAST' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_OBJECT_OPERATOR' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_OPEN_BRACKET' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_OPEN_CURLY' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_OPEN_SQUARE' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_OPEN_TAG' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_OPEN_TAG_WITH_ECHO' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_OR_EQUAL' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_PAAMAYIM_NEKUDOTAYIM' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_PERCENT' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_PIPE' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_PLUS' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_PLUS_EQUAL' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_POW' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_POW_EQUAL' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_PRINT' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_PRIVATE' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_PROTECTED' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_PUBLIC' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_QUESTION_MARK' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_REQUIRE' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_REQUIRE_ONCE' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_RETURN' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_SEMICOLON' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_SHAPE' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_SL' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_SL_EQUAL' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_SR' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_SR_EQUAL' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_START_HEREDOC' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_STATIC' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_STRING' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_STRING_CAST' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_STRING_VARNAME' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_SWITCH' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_Stream' => $vendorDir . '/phpunit/php-token-stream/src/Token/Stream.php', - 'PHP_Token_Stream_CachingFactory' => $vendorDir . '/phpunit/php-token-stream/src/Token/Stream/CachingFactory.php', - 'PHP_Token_THROW' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_TILDE' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_TRAIT' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_TRAIT_C' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_TRY' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_TYPE' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_TYPELIST_GT' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_TYPELIST_LT' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_UNSET' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_UNSET_CAST' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_USE' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_VAR' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_VARIABLE' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_WHILE' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_WHITESPACE' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_XOR_EQUAL' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'PHP_Token_YIELD' => $vendorDir . '/phpunit/php-token-stream/src/Token.php', - 'SebastianBergmann\\Comparator\\ArrayComparator' => $vendorDir . '/sebastian/comparator/src/ArrayComparator.php', - 'SebastianBergmann\\Comparator\\Comparator' => $vendorDir . '/sebastian/comparator/src/Comparator.php', - 'SebastianBergmann\\Comparator\\ComparisonFailure' => $vendorDir . '/sebastian/comparator/src/ComparisonFailure.php', - 'SebastianBergmann\\Comparator\\DOMNodeComparator' => $vendorDir . '/sebastian/comparator/src/DOMNodeComparator.php', - 'SebastianBergmann\\Comparator\\DateTimeComparator' => $vendorDir . '/sebastian/comparator/src/DateTimeComparator.php', - 'SebastianBergmann\\Comparator\\DoubleComparator' => $vendorDir . '/sebastian/comparator/src/DoubleComparator.php', - 'SebastianBergmann\\Comparator\\ExceptionComparator' => $vendorDir . '/sebastian/comparator/src/ExceptionComparator.php', - 'SebastianBergmann\\Comparator\\Factory' => $vendorDir . '/sebastian/comparator/src/Factory.php', - 'SebastianBergmann\\Comparator\\MockObjectComparator' => $vendorDir . '/sebastian/comparator/src/MockObjectComparator.php', - 'SebastianBergmann\\Comparator\\NumericComparator' => $vendorDir . '/sebastian/comparator/src/NumericComparator.php', - 'SebastianBergmann\\Comparator\\ObjectComparator' => $vendorDir . '/sebastian/comparator/src/ObjectComparator.php', - 'SebastianBergmann\\Comparator\\ResourceComparator' => $vendorDir . '/sebastian/comparator/src/ResourceComparator.php', - 'SebastianBergmann\\Comparator\\ScalarComparator' => $vendorDir . '/sebastian/comparator/src/ScalarComparator.php', - 'SebastianBergmann\\Comparator\\SplObjectStorageComparator' => $vendorDir . '/sebastian/comparator/src/SplObjectStorageComparator.php', - 'SebastianBergmann\\Comparator\\TypeComparator' => $vendorDir . '/sebastian/comparator/src/TypeComparator.php', - 'SebastianBergmann\\Diff\\Chunk' => $vendorDir . '/sebastian/diff/src/Chunk.php', - 'SebastianBergmann\\Diff\\Diff' => $vendorDir . '/sebastian/diff/src/Diff.php', - 'SebastianBergmann\\Diff\\Differ' => $vendorDir . '/sebastian/diff/src/Differ.php', - 'SebastianBergmann\\Diff\\LCS\\LongestCommonSubsequence' => $vendorDir . '/sebastian/diff/src/LCS/LongestCommonSubsequence.php', - 'SebastianBergmann\\Diff\\LCS\\MemoryEfficientImplementation' => $vendorDir . '/sebastian/diff/src/LCS/MemoryEfficientLongestCommonSubsequenceImplementation.php', - 'SebastianBergmann\\Diff\\LCS\\TimeEfficientImplementation' => $vendorDir . '/sebastian/diff/src/LCS/TimeEfficientLongestCommonSubsequenceImplementation.php', - 'SebastianBergmann\\Diff\\Line' => $vendorDir . '/sebastian/diff/src/Line.php', - 'SebastianBergmann\\Diff\\Parser' => $vendorDir . '/sebastian/diff/src/Parser.php', - 'SebastianBergmann\\Environment\\Console' => $vendorDir . '/sebastian/environment/src/Console.php', - 'SebastianBergmann\\Environment\\Runtime' => $vendorDir . '/sebastian/environment/src/Runtime.php', - 'SebastianBergmann\\Exporter\\Exporter' => $vendorDir . '/sebastian/exporter/src/Exporter.php', - 'SebastianBergmann\\GlobalState\\Blacklist' => $vendorDir . '/sebastian/global-state/src/Blacklist.php', - 'SebastianBergmann\\GlobalState\\Exception' => $vendorDir . '/sebastian/global-state/src/Exception.php', - 'SebastianBergmann\\GlobalState\\Restorer' => $vendorDir . '/sebastian/global-state/src/Restorer.php', - 'SebastianBergmann\\GlobalState\\RuntimeException' => $vendorDir . '/sebastian/global-state/src/RuntimeException.php', - 'SebastianBergmann\\GlobalState\\Snapshot' => $vendorDir . '/sebastian/global-state/src/Snapshot.php', - 'SebastianBergmann\\RecursionContext\\Context' => $vendorDir . '/sebastian/recursion-context/src/Context.php', - 'SebastianBergmann\\RecursionContext\\Exception' => $vendorDir . '/sebastian/recursion-context/src/Exception.php', - 'SebastianBergmann\\RecursionContext\\InvalidArgumentException' => $vendorDir . '/sebastian/recursion-context/src/InvalidArgumentException.php', - 'SebastianBergmann\\Version' => $vendorDir . '/sebastian/version/src/Version.php', - 'SessionHandlerInterface' => $vendorDir . '/symfony/http-foundation/Resources/stubs/SessionHandlerInterface.php', - 'Symfony\\Component\\HttpFoundation\\FileBag' => $vendorDir . '/symfony/http-foundation/FileBag.php', - 'Symfony\\Component\\HttpFoundation\\HeaderBag' => $vendorDir . '/symfony/http-foundation/HeaderBag.php', - 'Symfony\\Component\\HttpFoundation\\ParameterBag' => $vendorDir . '/symfony/http-foundation/ParameterBag.php', - 'Symfony\\Component\\HttpFoundation\\Request' => $vendorDir . '/symfony/http-foundation/Request.php', - 'Symfony\\Component\\HttpFoundation\\ServerBag' => $vendorDir . '/symfony/http-foundation/ServerBag.php', - 'Symfony\\Component\\HttpKernel\\HttpKernel' => $vendorDir . '/symfony/http-kernel/HttpKernel.php', - 'Symfony\\Component\\HttpKernel\\HttpKernelInterface' => $vendorDir . '/symfony/http-kernel/HttpKernelInterface.php', - 'Symfony\\Component\\HttpKernel\\TerminableInterface' => $vendorDir . '/symfony/http-kernel/TerminableInterface.php', - 'Text_Template' => $vendorDir . '/phpunit/php-text-template/Text/Template.php', -); diff --git a/core/vendor/composer/autoload_files.php b/core/vendor/composer/autoload_files.php deleted file mode 100644 index 853f9a0..0000000 --- a/core/vendor/composer/autoload_files.php +++ /dev/null @@ -1,11 +0,0 @@ - array($vendorDir . '/phpdocumentor/reflection-docblock/src'), - 'org\\bovigo\\vfs\\' => array($vendorDir . '/mikey179/vfsStream/src/main/php'), - 'Twig_' => array($vendorDir . '/twig/twig/lib'), - 'Stack' => array($vendorDir . '/stack/builder/src'), - 'Psr\\Log\\' => array($vendorDir . '/psr/log'), - 'Prophecy\\' => array($vendorDir . '/phpspec/prophecy/src'), - 'Gliph' => array($vendorDir . '/sdboyer/gliph/src'), - 'Egulias\\' => array($vendorDir . '/egulias/email-validator/src'), - 'EasyRdf_' => array($vendorDir . '/easyrdf/easyrdf/lib'), - 'Doctrine\\Instantiator\\' => array($vendorDir . '/doctrine/instantiator/src'), - 'Doctrine\\Common\\Lexer\\' => array($vendorDir . '/doctrine/lexer/lib'), - 'Doctrine\\Common\\Inflector\\' => array($vendorDir . '/doctrine/inflector/lib'), - 'Doctrine\\Common\\Collections\\' => array($vendorDir . '/doctrine/collections/lib'), - 'Doctrine\\Common\\Cache\\' => array($vendorDir . '/doctrine/cache/lib'), - 'Doctrine\\Common\\Annotations\\' => array($vendorDir . '/doctrine/annotations/lib'), - 'Doctrine\\Common\\' => array($vendorDir . '/doctrine/common/lib'), - 'Behat\\Mink\\Driver' => array($vendorDir . '/behat/mink-browserkit-driver/src', $vendorDir . '/behat/mink-goutte-driver/src'), -); diff --git a/core/vendor/composer/autoload_psr4.php b/core/vendor/composer/autoload_psr4.php deleted file mode 100644 index a026f26..0000000 --- a/core/vendor/composer/autoload_psr4.php +++ /dev/null @@ -1,39 +0,0 @@ - array($vendorDir . '/zendframework/zend-stdlib'), - 'Zend\\Feed\\' => array($vendorDir . '/zendframework/zend-feed'), - 'Zend\\Escaper\\' => array($vendorDir . '/zendframework/zend-escaper'), - 'Symfony\\Component\\Yaml\\' => array($vendorDir . '/symfony/yaml'), - 'Symfony\\Component\\Validator\\' => array($vendorDir . '/symfony/validator'), - 'Symfony\\Component\\Translation\\' => array($vendorDir . '/symfony/translation'), - 'Symfony\\Component\\Serializer\\' => array($vendorDir . '/symfony/serializer'), - 'Symfony\\Component\\Routing\\' => array($vendorDir . '/symfony/routing'), - 'Symfony\\Component\\Process\\' => array($vendorDir . '/symfony/process'), - 'Symfony\\Component\\HttpKernel\\' => array($vendorDir . '/symfony/http-kernel'), - 'Symfony\\Component\\HttpFoundation\\' => array($vendorDir . '/symfony/http-foundation'), - 'Symfony\\Component\\EventDispatcher\\' => array($vendorDir . '/symfony/event-dispatcher'), - 'Symfony\\Component\\DomCrawler\\' => array($vendorDir . '/symfony/dom-crawler'), - 'Symfony\\Component\\DependencyInjection\\' => array($vendorDir . '/symfony/dependency-injection'), - 'Symfony\\Component\\Debug\\' => array($vendorDir . '/symfony/debug'), - 'Symfony\\Component\\CssSelector\\' => array($vendorDir . '/symfony/css-selector'), - 'Symfony\\Component\\Console\\' => array($vendorDir . '/symfony/console'), - 'Symfony\\Component\\ClassLoader\\' => array($vendorDir . '/symfony/class-loader'), - 'Symfony\\Component\\BrowserKit\\' => array($vendorDir . '/symfony/browser-kit'), - 'Symfony\\Cmf\\Component\\Routing\\' => array($vendorDir . '/symfony-cmf/routing'), - 'React\\Promise\\' => array($vendorDir . '/react/promise/src'), - 'Masterminds\\' => array($vendorDir . '/masterminds/html5/src'), - 'GuzzleHttp\\Stream\\' => array($vendorDir . '/guzzlehttp/streams/src'), - 'GuzzleHttp\\Ring\\' => array($vendorDir . '/guzzlehttp/ringphp/src'), - 'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'), - 'Goutte\\' => array($vendorDir . '/fabpot/goutte/Goutte'), - 'Drupal\\Driver\\' => array($baseDir . '/../drivers/lib/Drupal/Driver'), - 'Drupal\\Core\\' => array($baseDir . '/lib/Drupal/Core'), - 'Drupal\\Component\\' => array($baseDir . '/lib/Drupal/Component'), - 'Behat\\Mink\\' => array($vendorDir . '/behat/mink/src'), -); diff --git a/core/vendor/composer/autoload_real.php b/core/vendor/composer/autoload_real.php deleted file mode 100644 index f41b172..0000000 --- a/core/vendor/composer/autoload_real.php +++ /dev/null @@ -1,59 +0,0 @@ - $path) { - $loader->set($namespace, $path); - } - - $map = require __DIR__ . '/autoload_psr4.php'; - foreach ($map as $namespace => $path) { - $loader->setPsr4($namespace, $path); - } - - $classMap = require __DIR__ . '/autoload_classmap.php'; - if ($classMap) { - $loader->addClassMap($classMap); - } - - $loader->register(true); - - $includeFiles = require __DIR__ . '/autoload_files.php'; - foreach ($includeFiles as $file) { - composerRequireDrupal8($file); - } - - return $loader; - } -} - -function composerRequireDrupal8($file) -{ - require $file; -} diff --git a/core/vendor/composer/include_paths.php b/core/vendor/composer/include_paths.php deleted file mode 100644 index 9490138..0000000 --- a/core/vendor/composer/include_paths.php +++ /dev/null @@ -1,11 +0,0 @@ -=5.3.2" - }, - "time": "2013-01-12 18:59:04", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-0": { - "Doctrine\\Common\\Lexer\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com", - "homepage": "http://www.instaclick.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Johannes M. Schmitt", - "email": "schmittjoh@gmail.com", - "homepage": "https://github.com/schmittjoh", - "role": "Developer of wrapped JMSSerializerBundle" - } - ], - "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "lexer", - "parser" - ] - }, - { - "name": "doctrine/inflector", - "version": "v1.0", - "version_normalized": "1.0.0.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/inflector.git", - "reference": "v1.0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/54b8333d2a5682afdc690060c1cf384ba9f47f08", - "reference": "v1.0", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "time": "2013-01-10 21:49:15", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-0": { - "Doctrine\\Common\\Inflector\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com", - "homepage": "http://www.jwage.com/" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com", - "homepage": "http://www.instaclick.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Johannes M. Schmitt", - "email": "schmittjoh@gmail.com", - "homepage": "https://github.com/schmittjoh", - "role": "Developer of wrapped JMSSerializerBundle" - } - ], - "description": "Common String Manipulations with regard to casing and singular/plural rules.", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "inflection", - "pluarlize", - "singuarlize", - "string" - ] - }, - { - "name": "doctrine/collections", - "version": "v1.2", - "version_normalized": "1.2.0.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/collections.git", - "reference": "b99c5c46c87126201899afe88ec490a25eedd6a2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/collections/zipball/b99c5c46c87126201899afe88ec490a25eedd6a2", - "reference": "b99c5c46c87126201899afe88ec490a25eedd6a2", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "time": "2014-02-03 23:07:43", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Doctrine\\Common\\Collections\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com", - "homepage": "http://www.jwage.com/", - "role": "Creator" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com", - "homepage": "http://www.instaclick.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com", - "homepage": "https://github.com/schmittjoh", - "role": "Developer of wrapped JMSSerializerBundle" - } - ], - "description": "Collections Abstraction library", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "array", - "collections", - "iterator" - ] - }, - { - "name": "doctrine/cache", - "version": "v1.3.1", - "version_normalized": "1.3.1.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/cache.git", - "reference": "cf483685798a72c93bf4206e3dd6358ea07d64e7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/cf483685798a72c93bf4206e3dd6358ea07d64e7", - "reference": "cf483685798a72c93bf4206e3dd6358ea07d64e7", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "conflict": { - "doctrine/common": ">2.2,<2.4" - }, - "require-dev": { - "phpunit/phpunit": ">=3.7", - "satooshi/php-coveralls": "~0.6" - }, - "time": "2014-09-17 14:24:04", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Doctrine\\Common\\Cache\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Caching library offering an object-oriented API for many cache backends", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "cache", - "caching" - ] - }, - { - "name": "doctrine/annotations", - "version": "v1.2.1", - "version_normalized": "1.2.1.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/annotations.git", - "reference": "6a6bec0670bb6e71a263b08bc1b98ea242928633" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/6a6bec0670bb6e71a263b08bc1b98ea242928633", - "reference": "6a6bec0670bb6e71a263b08bc1b98ea242928633", - "shasum": "" - }, - "require": { - "doctrine/lexer": "1.*", - "php": ">=5.3.2" - }, - "require-dev": { - "doctrine/cache": "1.*", - "phpunit/phpunit": "4.*" - }, - "time": "2014-09-25 16:45:30", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Doctrine\\Common\\Annotations\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Docblock Annotations Parser", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "annotations", - "docblock", - "parser" - ] - }, - { - "name": "guzzlehttp/streams", - "version": "3.0.0", - "version_normalized": "3.0.0.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/streams.git", - "reference": "47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/streams/zipball/47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5", - "reference": "47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5", - "shasum": "" - }, - "require": { - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "time": "2014-10-12 19:18:40", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "GuzzleHttp\\Stream\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Provides a simple abstraction over streams of data", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "Guzzle", - "stream" - ] - }, - { - "name": "phpunit/php-text-template", - "version": "1.2.0", - "version_normalized": "1.2.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", - "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "time": "2014-01-30 17:20:04", - "type": "library", - "installation-source": "dist", - "autoload": { - "classmap": [ - "Text/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ] - }, - { - "name": "doctrine/instantiator", - "version": "1.0.4", - "version_normalized": "1.0.4.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "f976e5de371104877ebc89bd8fecb0019ed9c119" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/f976e5de371104877ebc89bd8fecb0019ed9c119", - "reference": "f976e5de371104877ebc89bd8fecb0019ed9c119", - "shasum": "" - }, - "require": { - "php": ">=5.3,<8.0-DEV" - }, - "require-dev": { - "athletic/athletic": "~0.1.8", - "ext-pdo": "*", - "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "2.0.*@ALPHA" - }, - "time": "2014-10-13 12:58:55", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Doctrine\\Instantiator\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://github.com/doctrine/instantiator", - "keywords": [ - "constructor", - "instantiate" - ] - }, - { - "name": "phpunit/php-timer", - "version": "1.0.5", - "version_normalized": "1.0.5.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/19689d4354b295ee3d8c54b4f42c3efb69cbc17c", - "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "time": "2013-08-02 07:42:54", - "type": "library", - "installation-source": "dist", - "autoload": { - "classmap": [ - "PHP/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ] - }, - { - "name": "sdboyer/gliph", - "version": "0.1.8", - "version_normalized": "0.1.8.0", - "source": { - "type": "git", - "url": "https://github.com/sdboyer/gliph.git", - "reference": "db9e4b77622f91e2d338cc45f83c2cd0e3cf0e1e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sdboyer/gliph/zipball/db9e4b77622f91e2d338cc45f83c2cd0e3cf0e1e", - "reference": "db9e4b77622f91e2d338cc45f83c2cd0e3cf0e1e", - "shasum": "" - }, - "require": { - "php": ">=5.3" - }, - "require-dev": { - "phpunit/phpunit": "3.7.*", - "satooshi/php-coveralls": "0.6.*" - }, - "time": "2014-08-03 14:34:47", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-0": { - "Gliph": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Sam Boyer", - "email": "tech@samboyer.org" - } - ], - "description": "A graph library for PHP.", - "homepage": "http://github.com/sdboyer/gliph", - "keywords": [ - "gliph", - "graph", - "library", - "php", - "spl" - ] - }, - { - "name": "psr/log", - "version": "1.0.0", - "version_normalized": "1.0.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "1.0.0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b", - "reference": "1.0.0", - "shasum": "" - }, - "time": "2012-12-21 11:40:51", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-0": { - "Psr\\Log\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "keywords": [ - "log", - "psr", - "psr-3" - ] - }, - { - "name": "stack/builder", - "version": "v1.0.2", - "version_normalized": "1.0.2.0", - "source": { - "type": "git", - "url": "https://github.com/stackphp/builder.git", - "reference": "b4af43e7b7f3f7fac919ff475b29f7c5dc7b23b7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/stackphp/builder/zipball/b4af43e7b7f3f7fac919ff475b29f7c5dc7b23b7", - "reference": "b4af43e7b7f3f7fac919ff475b29f7c5dc7b23b7", - "shasum": "" - }, - "require": { - "php": ">=5.3.0", - "symfony/http-foundation": "~2.1", - "symfony/http-kernel": "~2.1" - }, - "require-dev": { - "silex/silex": "~1.0" - }, - "time": "2014-01-28 19:42:24", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Stack": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Igor Wiedler", - "email": "igor@wiedler.ch", - "homepage": "http://wiedler.ch/igor/" - } - ], - "description": "Builder for stack middlewares based on HttpKernelInterface.", - "keywords": [ - "stack" - ] - }, - { - "name": "symfony-cmf/routing", - "version": "1.3.0", - "version_normalized": "1.3.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony-cmf/Routing.git", - "reference": "8e87981d72c6930a27585dcd3119f3199f6cb2a6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony-cmf/Routing/zipball/8e87981d72c6930a27585dcd3119f3199f6cb2a6", - "reference": "8e87981d72c6930a27585dcd3119f3199f6cb2a6", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "psr/log": "~1.0", - "symfony/http-kernel": "~2.2", - "symfony/routing": "~2.2" - }, - "require-dev": { - "symfony/config": "~2.2", - "symfony/dependency-injection": "~2.0@stable", - "symfony/event-dispatcher": "~2.1" - }, - "suggest": { - "symfony/event-dispatcher": "DynamicRouter can optionally trigger an event at the start of matching. Minimal version ~2.1" - }, - "time": "2014-10-20 20:55:17", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Cmf\\Component\\Routing\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Symfony CMF Community", - "homepage": "https://github.com/symfony-cmf/Routing/contributors" - } - ], - "description": "Extends the Symfony2 routing component for dynamic routes and chaining several routers", - "homepage": "http://cmf.symfony.com", - "keywords": [ - "database", - "routing" - ] - }, - { - "name": "egulias/email-validator", - "version": "1.2.5", - "version_normalized": "1.2.5.0", - "source": { - "type": "git", - "url": "https://github.com/egulias/EmailValidator.git", - "reference": "518f80a0ff7c1a35780e7702f4262c8c6f2b807f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/518f80a0ff7c1a35780e7702f4262c8c6f2b807f", - "reference": "518f80a0ff7c1a35780e7702f4262c8c6f2b807f", - "shasum": "" - }, - "require": { - "doctrine/lexer": "~1.0", - "php": ">= 5.3.3" - }, - "require-dev": { - "satooshi/php-coveralls": "dev-master" - }, - "time": "2014-11-06 08:59:44", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Egulias\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Eduardo Gulias Davis" - } - ], - "description": "A library for validating emails", - "homepage": "https://github.com/egulias/EmailValidator", - "keywords": [ - "email", - "validation", - "validator" - ] - }, - { - "name": "easyrdf/easyrdf", - "version": "0.9.0", - "version_normalized": "0.9.0.0", - "source": { - "type": "git", - "url": "https://github.com/njh/easyrdf.git", - "reference": "bb9fd99768d23af0c5b7b55cec5baddc201272b8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/njh/easyrdf/zipball/bb9fd99768d23af0c5b7b55cec5baddc201272b8", - "reference": "bb9fd99768d23af0c5b7b55cec5baddc201272b8", - "shasum": "" - }, - "require": { - "ext-mbstring": "*", - "ext-pcre": "*", - "php": ">=5.2.8" - }, - "require-dev": { - "phpunit/phpunit": "~3.5", - "sami/sami": "~1.4", - "squizlabs/php_codesniffer": "~1.4.3" - }, - "suggest": { - "ml/json-ld": "~1.0" - }, - "time": "2014-11-07 18:02:16", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-0": { - "EasyRdf_": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Nicholas Humfrey", - "email": "njh@aelius.com", - "homepage": "http://www.aelius.com/njh/", - "role": "Developer" - }, - { - "name": "Alexey Zakhlestin", - "email": "indeyets@gmail.com", - "role": "Developer" - } - ], - "description": "EasyRdf is a PHP library designed to make it easy to consume and produce RDF.", - "homepage": "http://www.easyrdf.org/", - "keywords": [ - "Linked Data", - "RDF", - "Semantic Web", - "Turtle", - "rdfa", - "sparql" - ] - }, - { - "name": "sebastian/global-state", - "version": "1.0.0", - "version_normalized": "1.0.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/c7428acdb62ece0a45e6306f1ae85e1c05b09c01", - "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "suggest": { - "ext-uopz": "*" - }, - "time": "2014-10-06 09:23:50", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ] - }, - { - "name": "doctrine/common", - "version": "v2.4.2", - "version_normalized": "2.4.2.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/common.git", - "reference": "5db6ab40e4c531f14dad4ca96a394dfce5d4255b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/common/zipball/5db6ab40e4c531f14dad4ca96a394dfce5d4255b", - "reference": "5db6ab40e4c531f14dad4ca96a394dfce5d4255b", - "shasum": "" - }, - "require": { - "doctrine/annotations": "1.*", - "doctrine/cache": "1.*", - "doctrine/collections": "1.*", - "doctrine/inflector": "1.*", - "doctrine/lexer": "1.*", - "php": ">=5.3.2" - }, - "require-dev": { - "phpunit/phpunit": "~3.7" - }, - "time": "2014-05-21 19:28:51", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Doctrine\\Common\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com", - "homepage": "http://www.jwage.com/", - "role": "Creator" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com", - "homepage": "http://www.instaclick.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com", - "homepage": "https://github.com/schmittjoh", - "role": "Developer of wrapped JMSSerializerBundle" - } - ], - "description": "Common Library for Doctrine projects", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "annotations", - "collections", - "eventmanager", - "persistence", - "spl" - ] - }, - { - "name": "behat/mink", - "version": "v1.6.1", - "version_normalized": "1.6.1.0", - "source": { - "type": "git", - "url": "https://github.com/minkphp/Mink.git", - "reference": "8b68523a339ec991bcd638b39dc8f04f808da88a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/minkphp/Mink/zipball/8b68523a339ec991bcd638b39dc8f04f808da88a", - "reference": "8b68523a339ec991bcd638b39dc8f04f808da88a", - "shasum": "" - }, - "require": { - "php": ">=5.3.1", - "symfony/css-selector": "~2.0" - }, - "suggest": { - "behat/mink-browserkit-driver": "extremely fast headless driver for Symfony\\Kernel-based apps (Sf2, Silex)", - "behat/mink-goutte-driver": "fast headless driver for any app without JS emulation", - "behat/mink-selenium2-driver": "slow, but JS-enabled driver for any app (requires Selenium2)", - "behat/mink-zombie-driver": "fast and JS-enabled headless driver for any app (requires node.js)" - }, - "time": "2015-02-04 17:02:06", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.6.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Behat\\Mink\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - } - ], - "description": "Browser controller/emulator abstraction for PHP", - "homepage": "http://mink.behat.org/", - "keywords": [ - "browser", - "testing", - "web" - ] - }, - { - "name": "behat/mink-browserkit-driver", - "version": "v1.2.0", - "version_normalized": "1.2.0.0", - "source": { - "type": "git", - "url": "https://github.com/minkphp/MinkBrowserKitDriver.git", - "reference": "aed8f4a596b79014a75254c3e337511c33e38cbd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/minkphp/MinkBrowserKitDriver/zipball/aed8f4a596b79014a75254c3e337511c33e38cbd", - "reference": "aed8f4a596b79014a75254c3e337511c33e38cbd", - "shasum": "" - }, - "require": { - "behat/mink": "~1.6@dev", - "php": ">=5.3.1", - "symfony/browser-kit": "~2.0", - "symfony/dom-crawler": "~2.0" - }, - "require-dev": { - "silex/silex": "~1.2" - }, - "time": "2014-09-26 11:35:19", - "type": "mink-driver", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Behat\\Mink\\Driver": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - } - ], - "description": "Symfony2 BrowserKit driver for Mink framework", - "homepage": "http://mink.behat.org/", - "keywords": [ - "Mink", - "Symfony2", - "browser", - "testing" - ] - }, - { - "name": "behat/mink-goutte-driver", - "version": "v1.1.0", - "version_normalized": "1.1.0.0", - "source": { - "type": "git", - "url": "https://github.com/minkphp/MinkGoutteDriver.git", - "reference": "2bf327b4166694ecaa8ae7f956cb6ae252ecf03e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/minkphp/MinkGoutteDriver/zipball/2bf327b4166694ecaa8ae7f956cb6ae252ecf03e", - "reference": "2bf327b4166694ecaa8ae7f956cb6ae252ecf03e", - "shasum": "" - }, - "require": { - "behat/mink": "~1.6@dev", - "behat/mink-browserkit-driver": "~1.2@dev", - "fabpot/goutte": "~1.0.4|~2.0", - "php": ">=5.3.1" - }, - "time": "2014-10-09 09:21:12", - "type": "mink-driver", - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Behat\\Mink\\Driver": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - } - ], - "description": "Goutte driver for Mink framework", - "homepage": "http://mink.behat.org/", - "keywords": [ - "browser", - "goutte", - "headless", - "testing" - ] - }, - { - "name": "fabpot/goutte", - "version": "v2.0.3", - "version_normalized": "2.0.3.0", - "source": { - "type": "git", - "url": "https://github.com/FriendsOfPHP/Goutte.git", - "reference": "65ab61eae03d670b93a9044ad2328eb81aa1bde5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/Goutte/zipball/65ab61eae03d670b93a9044ad2328eb81aa1bde5", - "reference": "65ab61eae03d670b93a9044ad2328eb81aa1bde5", - "shasum": "" - }, - "require": { - "guzzlehttp/guzzle": ">=4,<6", - "php": ">=5.4.0", - "symfony/browser-kit": "~2.1", - "symfony/css-selector": "~2.1", - "symfony/dom-crawler": "~2.1" - }, - "time": "2014-11-28 09:48:17", - "type": "application", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Goutte\\": "Goutte" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "A simple PHP Web Scraper", - "homepage": "https://github.com/FriendsOfPHP/Goutte", - "keywords": [ - "scraper" - ] - }, - { - "name": "react/promise", - "version": "v2.2.0", - "version_normalized": "2.2.0.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/promise.git", - "reference": "365fcee430dfa4ace1fbc75737ca60ceea7eeeef" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise/zipball/365fcee430dfa4ace1fbc75737ca60ceea7eeeef", - "reference": "365fcee430dfa4ace1fbc75737ca60ceea7eeeef", - "shasum": "" - }, - "require": { - "php": ">=5.4.0" - }, - "time": "2014-12-30 13:32:42", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "React\\Promise\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jan Sorgalla", - "email": "jsorgalla@googlemail.com" - } - ], - "description": "A lightweight implementation of CommonJS Promises/A for PHP" - }, - { - "name": "masterminds/html5", - "version": "2.1.0", - "version_normalized": "2.1.0.0", - "source": { - "type": "git", - "url": "https://github.com/Masterminds/html5-php.git", - "reference": "a10f8d392e1aad0b500f7b440c8f0d3bc9189704" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Masterminds/html5-php/zipball/a10f8d392e1aad0b500f7b440c8f0d3bc9189704", - "reference": "a10f8d392e1aad0b500f7b440c8f0d3bc9189704", - "shasum": "" - }, - "require": { - "ext-libxml": "*", - "php": ">=5.3.0" - }, - "require-dev": { - "phpunit/phpunit": "4.*", - "sami/sami": "~2.0", - "satooshi/php-coveralls": "0.6.*" - }, - "time": "2015-02-09 16:26:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Masterminds\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Matt Butcher", - "email": "technosophos@gmail.com" - }, - { - "name": "Asmir Mustafic", - "email": "goetas@gmail.com" - }, - { - "name": "Matt Farina", - "email": "matt@mattfarina.com" - } - ], - "description": "An HTML5 parser and serializer.", - "homepage": "http://masterminds.github.io/html5-php", - "keywords": [ - "HTML5", - "dom", - "html", - "parser", - "querypath", - "serializer", - "xml" - ] - }, - { - "name": "guzzlehttp/guzzle", - "version": "5.2.0", - "version_normalized": "5.2.0.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "475b29ccd411f2fa8a408e64576418728c032cfa" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/475b29ccd411f2fa8a408e64576418728c032cfa", - "reference": "475b29ccd411f2fa8a408e64576418728c032cfa", - "shasum": "" - }, - "require": { - "guzzlehttp/ringphp": "~1.0", - "php": ">=5.4.0" - }, - "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "~4.0", - "psr/log": "~1.0" - }, - "time": "2015-01-28 01:03:29", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "GuzzleHttp\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle is a PHP HTTP client library and framework for building RESTful web service clients", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "rest", - "web service" - ] - }, - { - "name": "guzzlehttp/ringphp", - "version": "1.0.7", - "version_normalized": "1.0.7.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/RingPHP.git", - "reference": "52d868f13570a9a56e5fce6614e0ec75d0f13ac2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/RingPHP/zipball/52d868f13570a9a56e5fce6614e0ec75d0f13ac2", - "reference": "52d868f13570a9a56e5fce6614e0ec75d0f13ac2", - "shasum": "" - }, - "require": { - "guzzlehttp/streams": "~3.0", - "php": ">=5.4.0", - "react/promise": "~2.0" - }, - "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "~4.0" - }, - "suggest": { - "ext-curl": "Guzzle will use specific adapters if cURL is present" - }, - "time": "2015-03-30 01:43:20", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "GuzzleHttp\\Ring\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Provides a simple API and specification that abstracts away the details of HTTP into a single PHP function." - }, - { - "name": "zendframework/zend-stdlib", - "version": "2.4.0", - "version_normalized": "2.4.0.0", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-stdlib.git", - "reference": "eab586f4c18af3fa63c977611939f1f4a3cf1030" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-stdlib/zipball/cf05c5ba75606e47ffee91cedc72778da46f74c3", - "reference": "eab586f4c18af3fa63c977611939f1f4a3cf1030", - "shasum": "" - }, - "require": { - "php": ">=5.3.23" - }, - "require-dev": { - "zendframework/zend-eventmanager": "self.version", - "zendframework/zend-filter": "self.version", - "zendframework/zend-serializer": "self.version", - "zendframework/zend-servicemanager": "self.version" - }, - "suggest": { - "zendframework/zend-eventmanager": "To support aggregate hydrator usage", - "zendframework/zend-filter": "To support naming strategy hydrator usage", - "zendframework/zend-serializer": "Zend\\Serializer component", - "zendframework/zend-servicemanager": "To support hydrator plugin manager usage" - }, - "time": "2015-04-01 18:09:29", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3-dev", - "dev-develop": "2.4-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Zend\\Stdlib\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "homepage": "https://github.com/zendframework/zf2", - "keywords": [ - "stdlib", - "zf2" - ] - }, - { - "name": "zendframework/zend-escaper", - "version": "2.4.0", - "version_normalized": "2.4.0.0", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-escaper.git", - "reference": "65b3328627362b0be1d5e9067bc846511d1fbc96" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-escaper/zipball/15e5769e4fcdb4bf07ebd76500810e7070e23a97", - "reference": "65b3328627362b0be1d5e9067bc846511d1fbc96", - "shasum": "" - }, - "require": { - "php": ">=5.3.23" - }, - "time": "2015-04-01 18:02:07", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3-dev", - "dev-develop": "2.4-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Zend\\Escaper\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "homepage": "https://github.com/zendframework/zf2", - "keywords": [ - "escaper", - "zf2" - ] - }, - { - "name": "zendframework/zend-feed", - "version": "2.4.0", - "version_normalized": "2.4.0.0", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-feed.git", - "reference": "aca2b42ecf06d94c621e3c3be8e95d61d3a79bf5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-feed/zipball/0f59e560364f1f1fcb09a96874328ae3ff690db2", - "reference": "aca2b42ecf06d94c621e3c3be8e95d61d3a79bf5", - "shasum": "" - }, - "require": { - "php": ">=5.3.23", - "zendframework/zend-escaper": "self.version", - "zendframework/zend-stdlib": "self.version" - }, - "require-dev": { - "zendframework/zend-cache": "self.version", - "zendframework/zend-db": "self.version", - "zendframework/zend-http": "self.version", - "zendframework/zend-servicemanager": "self.version", - "zendframework/zend-validator": "self.version" - }, - "suggest": { - "zendframework/zend-cache": "Zend\\Cache component", - "zendframework/zend-db": "Zend\\Db component", - "zendframework/zend-http": "Zend\\Http for PubSubHubbub, and optionally for use with Zend\\Feed\\Reader", - "zendframework/zend-servicemanager": "Zend\\ServiceManager component, for default/recommended ExtensionManager implementations", - "zendframework/zend-validator": "Zend\\Validator component" - }, - "time": "2015-04-01 18:09:25", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3-dev", - "dev-develop": "2.4-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Zend\\Feed\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "provides functionality for consuming RSS and Atom feeds", - "homepage": "https://github.com/zendframework/zf2", - "keywords": [ - "feed", - "zf2" - ] - }, - { - "name": "twig/twig", - "version": "v1.18.1", - "version_normalized": "1.18.1.0", - "source": { - "type": "git", - "url": "https://github.com/twigphp/Twig.git", - "reference": "9f70492f44398e276d1b81c1b43adfe6751c7b7f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/9f70492f44398e276d1b81c1b43adfe6751c7b7f", - "reference": "9f70492f44398e276d1b81c1b43adfe6751c7b7f", - "shasum": "" - }, - "require": { - "php": ">=5.2.7" - }, - "time": "2015-04-19 08:30:27", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.18-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Twig_": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, - { - "name": "Armin Ronacher", - "email": "armin.ronacher@active-4.com", - "role": "Project Founder" - }, - { - "name": "Twig Team", - "homepage": "http://twig.sensiolabs.org/contributors", - "role": "Contributors" - } - ], - "description": "Twig, the flexible, fast, and secure template language for PHP", - "homepage": "http://twig.sensiolabs.org", - "keywords": [ - "templating" - ] - }, - { - "name": "sebastian/version", - "version": "1.0.5", - "version_normalized": "1.0.5.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "ab931d46cd0d3204a91e1b9a40c4bc13032b58e4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/ab931d46cd0d3204a91e1b9a40c4bc13032b58e4", - "reference": "ab931d46cd0d3204a91e1b9a40c4bc13032b58e4", - "shasum": "" - }, - "time": "2015-02-24 06:35:25", - "type": "library", - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version" - }, - { - "name": "sebastian/recursion-context", - "version": "1.0.0", - "version_normalized": "1.0.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "3989662bbb30a29d20d9faa04a846af79b276252" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/3989662bbb30a29d20d9faa04a846af79b276252", - "reference": "3989662bbb30a29d20d9faa04a846af79b276252", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "time": "2015-01-24 09:48:32", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context" - }, - { - "name": "sebastian/exporter", - "version": "1.2.0", - "version_normalized": "1.2.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "84839970d05254c73cde183a721c7af13aede943" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/84839970d05254c73cde183a721c7af13aede943", - "reference": "84839970d05254c73cde183a721c7af13aede943", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~1.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "time": "2015-01-27 07:23:06", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ] - }, - { - "name": "sebastian/environment", - "version": "1.2.2", - "version_normalized": "1.2.2.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "5a8c7d31914337b69923db26c4221b81ff5a196e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5a8c7d31914337b69923db26c4221b81ff5a196e", - "reference": "5a8c7d31914337b69923db26c4221b81ff5a196e", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "time": "2015-01-01 10:01:08", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ] - }, - { - "name": "sebastian/diff", - "version": "1.3.0", - "version_normalized": "1.3.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/863df9687835c62aa423a22412d26fa2ebde3fd3", - "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "time": "2015-02-22 15:13:53", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Diff implementation", - "homepage": "http://www.github.com/sebastianbergmann/diff", - "keywords": [ - "diff" - ] - }, - { - "name": "sebastian/comparator", - "version": "1.1.1", - "version_normalized": "1.1.1.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "1dd8869519a225f7f2b9eb663e225298fade819e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1dd8869519a225f7f2b9eb663e225298fade819e", - "reference": "1dd8869519a225f7f2b9eb663e225298fade819e", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "time": "2015-01-29 16:28:08", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ] - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "2.0.4", - "version_normalized": "2.0.4.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "suggest": { - "dflydev/markdown": "~1.0", - "erusev/parsedown": "~1.0" - }, - "time": "2015-02-03 12:10:50", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "phpDocumentor": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "mike.vanriel@naenius.com" - } - ] - }, - { - "name": "phpspec/prophecy", - "version": "1.4.0", - "version_normalized": "1.4.0.0", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "8724cd239f8ef4c046f55a3b18b4d91cc7f3e4c5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/8724cd239f8ef4c046f55a3b18b4d91cc7f3e4c5", - "reference": "8724cd239f8ef4c046f55a3b18b4d91cc7f3e4c5", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.2", - "phpdocumentor/reflection-docblock": "~2.0", - "sebastian/comparator": "~1.1" - }, - "require-dev": { - "phpspec/phpspec": "~2.0" - }, - "time": "2015-03-27 19:31:25", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Prophecy\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ] - }, - { - "name": "phpunit/phpunit-mock-objects", - "version": "2.3.1", - "version_normalized": "2.3.1.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "74ffb87f527f24616f72460e54b595f508dccb5c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/74ffb87f527f24616f72460e54b595f508dccb5c", - "reference": "74ffb87f527f24616f72460e54b595f508dccb5c", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "~1.0,>=1.0.2", - "php": ">=5.3.3", - "phpunit/php-text-template": "~1.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "suggest": { - "ext-soap": "*" - }, - "time": "2015-04-02 05:36:41", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", - "keywords": [ - "mock", - "xunit" - ] - }, - { - "name": "phpunit/php-token-stream", - "version": "1.4.1", - "version_normalized": "1.4.1.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "eab81d02569310739373308137284e0158424330" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/eab81d02569310739373308137284e0158424330", - "reference": "eab81d02569310739373308137284e0158424330", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "time": "2015-04-08 04:46:07", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ] - }, - { - "name": "phpunit/php-file-iterator", - "version": "1.4.0", - "version_normalized": "1.4.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "a923bb15680d0089e2316f7a4af8f437046e96bb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/a923bb15680d0089e2316f7a4af8f437046e96bb", - "reference": "a923bb15680d0089e2316f7a4af8f437046e96bb", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "time": "2015-04-02 05:19:05", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ] - }, - { - "name": "phpunit/php-code-coverage", - "version": "2.0.16", - "version_normalized": "2.0.16.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "934fd03eb6840508231a7f73eb8940cf32c3b66c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/934fd03eb6840508231a7f73eb8940cf32c3b66c", - "reference": "934fd03eb6840508231a7f73eb8940cf32c3b66c", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "phpunit/php-file-iterator": "~1.3", - "phpunit/php-text-template": "~1.2", - "phpunit/php-token-stream": "~1.3", - "sebastian/environment": "~1.0", - "sebastian/version": "~1.0" - }, - "require-dev": { - "ext-xdebug": ">=2.1.4", - "phpunit/phpunit": "~4" - }, - "suggest": { - "ext-dom": "*", - "ext-xdebug": ">=2.2.1", - "ext-xmlwriter": "*" - }, - "time": "2015-04-11 04:35:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ] - }, - { - "name": "phpunit/phpunit", - "version": "4.6.4", - "version_normalized": "4.6.4.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "163232991e652e6efed2f8470326fffa61e848e2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/163232991e652e6efed2f8470326fffa61e848e2", - "reference": "163232991e652e6efed2f8470326fffa61e848e2", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-json": "*", - "ext-pcre": "*", - "ext-reflection": "*", - "ext-spl": "*", - "php": ">=5.3.3", - "phpspec/prophecy": "~1.3,>=1.3.1", - "phpunit/php-code-coverage": "~2.0,>=2.0.11", - "phpunit/php-file-iterator": "~1.4", - "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": "~1.0", - "phpunit/phpunit-mock-objects": "~2.3", - "sebastian/comparator": "~1.1", - "sebastian/diff": "~1.2", - "sebastian/environment": "~1.2", - "sebastian/exporter": "~1.2", - "sebastian/global-state": "~1.0", - "sebastian/version": "~1.0", - "symfony/yaml": "~2.1|~3.0" - }, - "suggest": { - "phpunit/php-invoker": "~1.1" - }, - "time": "2015-04-11 05:23:21", - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.6.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ] - }, - { - "name": "mikey179/vfsStream", - "version": "v1.5.0", - "version_normalized": "1.5.0.0", - "source": { - "type": "git", - "url": "https://github.com/mikey179/vfsStream.git", - "reference": "4dc0d2f622412f561f5b242b19b98068bbbc883a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/mikey179/vfsStream/zipball/4dc0d2f622412f561f5b242b19b98068bbbc883a", - "reference": "4dc0d2f622412f561f5b242b19b98068bbbc883a", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.5" - }, - "time": "2015-03-29 11:19:49", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.5.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "org\\bovigo\\vfs\\": "src/main/php" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Frank Kleine", - "homepage": "http://frankkleine.de/", - "role": "Developer" - } - ], - "description": "Virtual file system to mock the real file system in unit tests.", - "homepage": "http://vfs.bovigo.org/" - }, - { - "name": "symfony/class-loader", - "version": "v2.7.0", - "version_normalized": "2.7.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/ClassLoader.git", - "reference": "fa19598cb708b92d983b34aae313f57c217f9386" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/ClassLoader/zipball/fa19598cb708b92d983b34aae313f57c217f9386", - "reference": "fa19598cb708b92d983b34aae313f57c217f9386", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "symfony/finder": "~2.0,>=2.0.5", - "symfony/phpunit-bridge": "~2.7" - }, - "time": "2015-05-15 13:33:16", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\ClassLoader\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony ClassLoader Component", - "homepage": "https://symfony.com" - }, - { - "name": "symfony/css-selector", - "version": "v2.7.0", - "version_normalized": "2.7.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/CssSelector.git", - "reference": "0b5c07b516226b7dd32afbbc82fe547a469c5092" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/CssSelector/zipball/0b5c07b516226b7dd32afbbc82fe547a469c5092", - "reference": "0b5c07b516226b7dd32afbbc82fe547a469c5092", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7" - }, - "time": "2015-05-15 13:33:16", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\CssSelector\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jean-François Simon", - "email": "jeanfrancois.simon@sensiolabs.com" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony CssSelector Component", - "homepage": "https://symfony.com" - }, - { - "name": "symfony/dependency-injection", - "version": "v2.7.0", - "version_normalized": "2.7.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/DependencyInjection.git", - "reference": "137bf489c5151c7eb1e4b7dd34a123f9a74b966d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/DependencyInjection/zipball/137bf489c5151c7eb1e4b7dd34a123f9a74b966d", - "reference": "137bf489c5151c7eb1e4b7dd34a123f9a74b966d", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "conflict": { - "symfony/expression-language": "<2.6" - }, - "require-dev": { - "symfony/config": "~2.2", - "symfony/expression-language": "~2.6", - "symfony/phpunit-bridge": "~2.7", - "symfony/yaml": "~2.1" - }, - "suggest": { - "symfony/config": "", - "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", - "symfony/yaml": "" - }, - "time": "2015-05-29 14:44:44", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\DependencyInjection\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony DependencyInjection Component", - "homepage": "https://symfony.com" - }, - { - "name": "symfony/http-foundation", - "version": "v2.7.0", - "version_normalized": "2.7.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/HttpFoundation.git", - "reference": "729de183da037c125c5f6366bd4f0631ba1a1abb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/729de183da037c125c5f6366bd4f0631ba1a1abb", - "reference": "729de183da037c125c5f6366bd4f0631ba1a1abb", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "symfony/expression-language": "~2.4", - "symfony/phpunit-bridge": "~2.7" - }, - "time": "2015-05-22 14:54:25", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\HttpFoundation\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony HttpFoundation Component", - "homepage": "https://symfony.com" - }, - { - "name": "symfony/event-dispatcher", - "version": "v2.7.0", - "version_normalized": "2.7.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/EventDispatcher.git", - "reference": "687039686d0e923429ba6e958d0baa920cd5d458" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/687039686d0e923429ba6e958d0baa920cd5d458", - "reference": "687039686d0e923429ba6e958d0baa920cd5d458", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~2.0,>=2.0.5", - "symfony/dependency-injection": "~2.6", - "symfony/expression-language": "~2.6", - "symfony/phpunit-bridge": "~2.7", - "symfony/stopwatch": "~2.3" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" - }, - "time": "2015-05-02 15:21:08", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony EventDispatcher Component", - "homepage": "https://symfony.com" - }, - { - "name": "symfony/http-kernel", - "version": "v2.7.0", - "version_normalized": "2.7.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/HttpKernel.git", - "reference": "74acbb7ef9c4aae0620d3250b9b990d2fff28d16" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/HttpKernel/zipball/74acbb7ef9c4aae0620d3250b9b990d2fff28d16", - "reference": "74acbb7ef9c4aae0620d3250b9b990d2fff28d16", - "shasum": "" - }, - "require": { - "php": ">=5.3.9", - "psr/log": "~1.0", - "symfony/debug": "~2.6,>=2.6.2", - "symfony/event-dispatcher": "~2.5.9|~2.6,>=2.6.2", - "symfony/http-foundation": "~2.5,>=2.5.4" - }, - "conflict": { - "symfony/config": "<2.7" - }, - "require-dev": { - "symfony/browser-kit": "~2.3", - "symfony/class-loader": "~2.1", - "symfony/config": "~2.7", - "symfony/console": "~2.3", - "symfony/css-selector": "~2.0,>=2.0.5", - "symfony/dependency-injection": "~2.2", - "symfony/dom-crawler": "~2.0,>=2.0.5", - "symfony/expression-language": "~2.4", - "symfony/finder": "~2.0,>=2.0.5", - "symfony/phpunit-bridge": "~2.7", - "symfony/process": "~2.0,>=2.0.5", - "symfony/routing": "~2.2", - "symfony/stopwatch": "~2.3", - "symfony/templating": "~2.2", - "symfony/translation": "~2.0,>=2.0.5", - "symfony/var-dumper": "~2.6" - }, - "suggest": { - "symfony/browser-kit": "", - "symfony/class-loader": "", - "symfony/config": "", - "symfony/console": "", - "symfony/dependency-injection": "", - "symfony/finder": "", - "symfony/var-dumper": "" - }, - "time": "2015-05-30 16:52:28", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\HttpKernel\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony HttpKernel Component", - "homepage": "https://symfony.com" - }, - { - "name": "symfony/routing", - "version": "v2.7.0", - "version_normalized": "2.7.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/Routing.git", - "reference": "6f0333fb8b89cf6f8fd9d6740c5e83b73d9c95b9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Routing/zipball/6f0333fb8b89cf6f8fd9d6740c5e83b73d9c95b9", - "reference": "6f0333fb8b89cf6f8fd9d6740c5e83b73d9c95b9", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "conflict": { - "symfony/config": "<2.7" - }, - "require-dev": { - "doctrine/annotations": "~1.0", - "doctrine/common": "~2.2", - "psr/log": "~1.0", - "symfony/config": "~2.7", - "symfony/expression-language": "~2.4", - "symfony/http-foundation": "~2.3", - "symfony/phpunit-bridge": "~2.7", - "symfony/yaml": "~2.0,>=2.0.5" - }, - "suggest": { - "doctrine/annotations": "For using the annotation loader", - "symfony/config": "For using the all-in-one router or any loader", - "symfony/expression-language": "For using expression matching", - "symfony/yaml": "For using the YAML loader" - }, - "time": "2015-05-19 06:58:17", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Routing\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Routing Component", - "homepage": "https://symfony.com", - "keywords": [ - "router", - "routing", - "uri", - "url" - ] - }, - { - "name": "symfony/serializer", - "version": "v2.7.0", - "version_normalized": "2.7.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/Serializer.git", - "reference": "634d3adf119396320fba4c14caa01390700e7f3b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Serializer/zipball/634d3adf119396320fba4c14caa01390700e7f3b", - "reference": "634d3adf119396320fba4c14caa01390700e7f3b", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "doctrine/annotations": "~1.0", - "doctrine/cache": "~1.0", - "symfony/config": "~2.2", - "symfony/phpunit-bridge": "~2.7", - "symfony/property-access": "~2.3", - "symfony/yaml": "~2.0" - }, - "suggest": { - "doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.", - "doctrine/cache": "For using the default cached annotation reader and metadata cache.", - "symfony/config": "For using the XML mapping loader.", - "symfony/property-access": "For using the ObjectNormalizer.", - "symfony/yaml": "For using the default YAML mapping loader." - }, - "time": "2015-05-29 14:44:44", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Serializer\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Serializer Component", - "homepage": "https://symfony.com" - }, - { - "name": "symfony/translation", - "version": "v2.7.0-BETA2", - "version_normalized": "2.7.0.0-beta2", - "source": { - "type": "git", - "url": "https://github.com/symfony/Translation.git", - "reference": "1be5bbed3938247acd7c5f4e4f29dd32db636b1f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Translation/zipball/1be5bbed3938247acd7c5f4e4f29dd32db636b1f", - "reference": "1be5bbed3938247acd7c5f4e4f29dd32db636b1f", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "conflict": { - "symfony/config": "<2.7" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~2.7", - "symfony/intl": "~2.3", - "symfony/phpunit-bridge": "~2.7", - "symfony/yaml": "~2.2" - }, - "suggest": { - "psr/log": "To use logging capability in translator", - "symfony/config": "", - "symfony/yaml": "" - }, - "time": "2015-05-11 02:35:29", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Translation\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Translation Component", - "homepage": "https://symfony.com" - }, - { - "name": "symfony/validator", - "version": "v2.7.0", - "version_normalized": "2.7.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/Validator.git", - "reference": "3a5461a388ff8962790fd5a39e6e2da84ba1e824" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Validator/zipball/3a5461a388ff8962790fd5a39e6e2da84ba1e824", - "reference": "3a5461a388ff8962790fd5a39e6e2da84ba1e824", - "shasum": "" - }, - "require": { - "php": ">=5.3.9", - "symfony/translation": "~2.4" - }, - "require-dev": { - "doctrine/annotations": "~1.0", - "doctrine/cache": "~1.0", - "egulias/email-validator": "~1.2,>=1.2.1", - "symfony/config": "~2.2", - "symfony/expression-language": "~2.4", - "symfony/http-foundation": "~2.1", - "symfony/intl": "~2.3", - "symfony/phpunit-bridge": "~2.7", - "symfony/property-access": "~2.3", - "symfony/yaml": "~2.0,>=2.0.5" - }, - "suggest": { - "doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.", - "doctrine/cache": "For using the default cached annotation reader and metadata cache.", - "egulias/email-validator": "Strict (RFC compliant) email validation", - "symfony/config": "", - "symfony/expression-language": "For using the 2.4 Expression validator", - "symfony/http-foundation": "", - "symfony/intl": "", - "symfony/property-access": "For using the 2.4 Validator API", - "symfony/yaml": "" - }, - "time": "2015-05-29 14:44:44", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Validator\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Validator Component", - "homepage": "https://symfony.com" - }, - { - "name": "symfony/process", - "version": "v2.7.0", - "version_normalized": "2.7.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/Process.git", - "reference": "e0a82b58e36afc60f8e79b8bc85a22bb064077c1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Process/zipball/e0a82b58e36afc60f8e79b8bc85a22bb064077c1", - "reference": "e0a82b58e36afc60f8e79b8bc85a22bb064077c1", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7" - }, - "time": "2015-05-15 13:33:16", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Process\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Process Component", - "homepage": "https://symfony.com" - }, - { - "name": "symfony/yaml", - "version": "v2.7.0", - "version_normalized": "2.7.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/Yaml.git", - "reference": "4a29a5248aed4fb45f626a7bbbd330291492f5c3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/4a29a5248aed4fb45f626a7bbbd330291492f5c3", - "reference": "4a29a5248aed4fb45f626a7bbbd330291492f5c3", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7" - }, - "time": "2015-05-02 15:21:08", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Yaml Component", - "homepage": "https://symfony.com" - }, - { - "name": "symfony/console", - "version": "v2.7.0", - "version_normalized": "2.7.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/Console.git", - "reference": "7f0bec04961c61c961df0cb8c2ae88dbfd83f399" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Console/zipball/7f0bec04961c61c961df0cb8c2ae88dbfd83f399", - "reference": "7f0bec04961c61c961df0cb8c2ae88dbfd83f399", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/event-dispatcher": "~2.1", - "symfony/phpunit-bridge": "~2.7", - "symfony/process": "~2.1" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/process": "" - }, - "time": "2015-05-29 16:22:24", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Console Component", - "homepage": "https://symfony.com" - }, - { - "name": "symfony/debug", - "version": "v2.7.0", - "version_normalized": "2.7.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/Debug.git", - "reference": "1df2971b27a6ff73dae4ea622f42802000ec332d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Debug/zipball/1df2971b27a6ff73dae4ea622f42802000ec332d", - "reference": "1df2971b27a6ff73dae4ea622f42802000ec332d", - "shasum": "" - }, - "require": { - "php": ">=5.3.9", - "psr/log": "~1.0" - }, - "conflict": { - "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" - }, - "require-dev": { - "symfony/class-loader": "~2.2", - "symfony/http-foundation": "~2.1", - "symfony/http-kernel": "~2.3.24|~2.5.9|~2.6,>=2.6.2", - "symfony/phpunit-bridge": "~2.7" - }, - "suggest": { - "symfony/http-foundation": "", - "symfony/http-kernel": "" - }, - "time": "2015-05-22 14:54:25", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Debug\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Debug Component", - "homepage": "https://symfony.com" - }, - { - "name": "symfony/dom-crawler", - "version": "v2.7.0", - "version_normalized": "2.7.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/DomCrawler.git", - "reference": "11d8eb8ccc1533f4c2d89a025f674894fda520b3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/DomCrawler/zipball/11d8eb8ccc1533f4c2d89a025f674894fda520b3", - "reference": "11d8eb8ccc1533f4c2d89a025f674894fda520b3", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "symfony/css-selector": "~2.3", - "symfony/phpunit-bridge": "~2.7" - }, - "suggest": { - "symfony/css-selector": "" - }, - "time": "2015-05-22 14:54:25", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\DomCrawler\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony DomCrawler Component", - "homepage": "https://symfony.com" - }, - { - "name": "symfony/browser-kit", - "version": "v2.7.0", - "version_normalized": "2.7.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/BrowserKit.git", - "reference": "70cdc18dd601a486a8cc69ee26367cbaedd60400" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/BrowserKit/zipball/70cdc18dd601a486a8cc69ee26367cbaedd60400", - "reference": "70cdc18dd601a486a8cc69ee26367cbaedd60400", - "shasum": "" - }, - "require": { - "php": ">=5.3.9", - "symfony/dom-crawler": "~2.0,>=2.0.5" - }, - "require-dev": { - "symfony/css-selector": "~2.0,>=2.0.5", - "symfony/phpunit-bridge": "~2.7", - "symfony/process": "~2.0,>=2.0.5" - }, - "suggest": { - "symfony/process": "" - }, - "time": "2015-05-02 15:21:08", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\BrowserKit\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony BrowserKit Component", - "homepage": "https://symfony.com" - } -] diff --git a/core/vendor/doctrine/annotations/.gitignore b/core/vendor/doctrine/annotations/.gitignore deleted file mode 100644 index 164c346..0000000 --- a/core/vendor/doctrine/annotations/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -vendor/ -composer.lock -composer.phar diff --git a/core/vendor/doctrine/annotations/.travis.yml b/core/vendor/doctrine/annotations/.travis.yml deleted file mode 100644 index 7f6c0ef..0000000 --- a/core/vendor/doctrine/annotations/.travis.yml +++ /dev/null @@ -1,11 +0,0 @@ -language: php - -php: - - 5.3 - - 5.4 - - 5.5 - - 5.6 - - hhvm - -before_script: - - composer --prefer-source --dev install diff --git a/core/vendor/doctrine/annotations/LICENSE b/core/vendor/doctrine/annotations/LICENSE deleted file mode 100644 index 5e781fc..0000000 --- a/core/vendor/doctrine/annotations/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2006-2013 Doctrine Project - -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/core/vendor/doctrine/annotations/README.md b/core/vendor/doctrine/annotations/README.md deleted file mode 100644 index ebb30e0..0000000 --- a/core/vendor/doctrine/annotations/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# Doctrine Annotations - -[![Build Status](https://travis-ci.org/doctrine/annotations.png?branch=master)](https://travis-ci.org/doctrine/annotations) - -Docblock Annotations Parser library (extracted from [Doctrine Common](https://github.com/doctrine/common)). - -## Changelog - -### v1.2.0 - - * HHVM support - * Allowing dangling comma in annotations - * Excluded annotations are no longer autoloaded - * Importing namespaces also in traits - * Added support for `::class` 5.5-style constant, works also in 5.3 and 5.4 - -### v1.1 - - * Add Exception when ZendOptimizer+ or Opcache is configured to drop comments diff --git a/core/vendor/doctrine/annotations/composer.json b/core/vendor/doctrine/annotations/composer.json deleted file mode 100644 index 1c65f6c..0000000 --- a/core/vendor/doctrine/annotations/composer.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "doctrine/annotations", - "type": "library", - "description": "Docblock Annotations Parser", - "keywords": ["annotations", "docblock", "parser"], - "homepage": "http://www.doctrine-project.org", - "license": "MIT", - "authors": [ - {"name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com"}, - {"name": "Roman Borschel", "email": "roman@code-factory.org"}, - {"name": "Benjamin Eberlei", "email": "kontakt@beberlei.de"}, - {"name": "Jonathan Wage", "email": "jonwage@gmail.com"}, - {"name": "Johannes Schmitt", "email": "schmittjoh@gmail.com"} - ], - "require": { - "php": ">=5.3.2", - "doctrine/lexer": "1.*" - }, - "require-dev": { - "doctrine/cache": "1.*", - "phpunit/phpunit": "4.*" - }, - "autoload": { - "psr-0": { "Doctrine\\Common\\Annotations\\": "lib/" } - }, - "extra": { - "branch-alias": { - "dev-master": "1.3.x-dev" - } - } -} diff --git a/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation.php b/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation.php deleted file mode 100644 index a79a0f8..0000000 --- a/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation.php +++ /dev/null @@ -1,79 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations; - -/** - * Annotations class. - * - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class Annotation -{ - /** - * Value property. Common among all derived classes. - * - * @var string - */ - public $value; - - /** - * Constructor. - * - * @param array $data Key-value for properties to be defined in this class. - */ - public final function __construct(array $data) - { - foreach ($data as $key => $value) { - $this->$key = $value; - } - } - - /** - * Error handler for unknown property accessor in Annotation class. - * - * @param string $name Unknown property name. - * - * @throws \BadMethodCallException - */ - public function __get($name) - { - throw new \BadMethodCallException( - sprintf("Unknown property '%s' on annotation '%s'.", $name, get_class($this)) - ); - } - - /** - * Error handler for unknown property mutator in Annotation class. - * - * @param string $name Unknown property name. - * @param mixed $value Property value. - * - * @throws \BadMethodCallException - */ - public function __set($name, $value) - { - throw new \BadMethodCallException( - sprintf("Unknown property '%s' on annotation '%s'.", $name, get_class($this)) - ); - } -} diff --git a/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Attribute.php b/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Attribute.php deleted file mode 100644 index dbef6df..0000000 --- a/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Attribute.php +++ /dev/null @@ -1,47 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations\Annotation; - -/** - * Annotation that can be used to signal to the parser - * to check the attribute type during the parsing process. - * - * @author Fabio B. Silva - * - * @Annotation - */ -final class Attribute -{ - /** - * @var string - */ - public $name; - - /** - * @var string - */ - public $type; - - /** - * @var boolean - */ - public $required = false; -} diff --git a/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Attributes.php b/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Attributes.php deleted file mode 100644 index 53134e3..0000000 --- a/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Attributes.php +++ /dev/null @@ -1,37 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations\Annotation; - -/** - * Annotation that can be used to signal to the parser - * to check the types of all declared attributes during the parsing process. - * - * @author Fabio B. Silva - * - * @Annotation - */ -final class Attributes -{ - /** - * @var array - */ - public $value; -} diff --git a/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Enum.php b/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Enum.php deleted file mode 100644 index e122a75..0000000 --- a/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Enum.php +++ /dev/null @@ -1,84 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations\Annotation; - -/** - * Annotation that can be used to signal to the parser - * to check the available values during the parsing process. - * - * @since 2.4 - * @author Fabio B. Silva - * - * @Annotation - * @Attributes({ - * @Attribute("value", required = true, type = "array"), - * @Attribute("literal", required = false, type = "array") - * }) - */ -final class Enum -{ - /** - * @var array - */ - public $value; - - /** - * Literal target declaration. - * - * @var array - */ - public $literal; - - /** - * Annotation constructor. - * - * @param array $values - * - * @throws \InvalidArgumentException - */ - public function __construct(array $values) - { - if ( ! isset($values['literal'])) { - $values['literal'] = array(); - } - - foreach ($values['value'] as $var) { - if( ! is_scalar($var)) { - throw new \InvalidArgumentException(sprintf( - '@Enum supports only scalar values "%s" given.', - is_object($var) ? get_class($var) : gettype($var) - )); - } - } - - foreach ($values['literal'] as $key => $var) { - if( ! in_array($key, $values['value'])) { - throw new \InvalidArgumentException(sprintf( - 'Undefined enumerator value "%s" for literal "%s".', - $key , $var - )); - } - } - - $this->value = $values['value']; - $this->literal = $values['literal']; - } -} diff --git a/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/IgnoreAnnotation.php b/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/IgnoreAnnotation.php deleted file mode 100644 index 175226a..0000000 --- a/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/IgnoreAnnotation.php +++ /dev/null @@ -1,54 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations\Annotation; - -/** - * Annotation that can be used to signal to the parser to ignore specific - * annotations during the parsing process. - * - * @Annotation - * @author Johannes M. Schmitt - */ -final class IgnoreAnnotation -{ - /** - * @var array - */ - public $names; - - /** - * Constructor. - * - * @param array $values - * - * @throws \RuntimeException - */ - public function __construct(array $values) - { - if (is_string($values['value'])) { - $values['value'] = array($values['value']); - } - if (!is_array($values['value'])) { - throw new \RuntimeException(sprintf('@IgnoreAnnotation expects either a string name, or an array of strings, but got %s.', json_encode($values['value']))); - } - - $this->names = $values['value']; - } -} diff --git a/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Required.php b/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Required.php deleted file mode 100644 index d67f960..0000000 --- a/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Required.php +++ /dev/null @@ -1,33 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations\Annotation; - -/** - * Annotation that can be used to signal to the parser - * to check if that attribute is required during the parsing process. - * - * @author Fabio B. Silva - * - * @Annotation - */ -final class Required -{ -} diff --git a/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Target.php b/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Target.php deleted file mode 100644 index f6c5445..0000000 --- a/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Target.php +++ /dev/null @@ -1,107 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations\Annotation; - -/** - * Annotation that can be used to signal to the parser - * to check the annotation target during the parsing process. - * - * @author Fabio B. Silva - * - * @Annotation - */ -final class Target -{ - const TARGET_CLASS = 1; - const TARGET_METHOD = 2; - const TARGET_PROPERTY = 4; - const TARGET_ANNOTATION = 8; - const TARGET_ALL = 15; - - /** - * @var array - */ - private static $map = array( - 'ALL' => self::TARGET_ALL, - 'CLASS' => self::TARGET_CLASS, - 'METHOD' => self::TARGET_METHOD, - 'PROPERTY' => self::TARGET_PROPERTY, - 'ANNOTATION' => self::TARGET_ANNOTATION, - ); - - /** - * @var array - */ - public $value; - - /** - * Targets as bitmask. - * - * @var integer - */ - public $targets; - - /** - * Literal target declaration. - * - * @var integer - */ - public $literal; - - /** - * Annotation constructor. - * - * @param array $values - * - * @throws \InvalidArgumentException - */ - public function __construct(array $values) - { - if (!isset($values['value'])){ - $values['value'] = null; - } - if (is_string($values['value'])){ - $values['value'] = array($values['value']); - } - if (!is_array($values['value'])){ - throw new \InvalidArgumentException( - sprintf('@Target expects either a string value, or an array of strings, "%s" given.', - is_object($values['value']) ? get_class($values['value']) : gettype($values['value']) - ) - ); - } - - $bitmask = 0; - foreach ($values['value'] as $literal) { - if(!isset(self::$map[$literal])){ - throw new \InvalidArgumentException( - sprintf('Invalid Target "%s". Available targets: [%s]', - $literal, implode(', ', array_keys(self::$map))) - ); - } - $bitmask |= self::$map[$literal]; - } - - $this->targets = $bitmask; - $this->value = $values['value']; - $this->literal = implode(', ', $this->value); - } -} diff --git a/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationException.php b/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationException.php deleted file mode 100644 index d06fe66..0000000 --- a/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationException.php +++ /dev/null @@ -1,197 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations; - -/** - * Description of AnnotationException - * - * @since 2.0 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class AnnotationException extends \Exception -{ - /** - * Creates a new AnnotationException describing a Syntax error. - * - * @param string $message Exception message - * - * @return AnnotationException - */ - public static function syntaxError($message) - { - return new self('[Syntax Error] ' . $message); - } - - /** - * Creates a new AnnotationException describing a Semantical error. - * - * @param string $message Exception message - * - * @return AnnotationException - */ - public static function semanticalError($message) - { - return new self('[Semantical Error] ' . $message); - } - - /** - * Creates a new AnnotationException describing an error which occurred during - * the creation of the annotation. - * - * @since 2.2 - * - * @param string $message - * - * @return AnnotationException - */ - public static function creationError($message) - { - return new self('[Creation Error] ' . $message); - } - - /** - * Creates a new AnnotationException describing a type error. - * - * @since 1.1 - * - * @param string $message - * - * @return AnnotationException - */ - public static function typeError($message) - { - return new self('[Type Error] ' . $message); - } - - /** - * Creates a new AnnotationException describing a constant semantical error. - * - * @since 2.3 - * - * @param string $identifier - * @param string $context - * - * @return AnnotationException - */ - public static function semanticalErrorConstants($identifier, $context = null) - { - return self::semanticalError(sprintf( - "Couldn't find constant %s%s.", - $identifier, - $context ? ', ' . $context : '' - )); - } - - /** - * Creates a new AnnotationException describing an type error of an attribute. - * - * @since 2.2 - * - * @param string $attributeName - * @param string $annotationName - * @param string $context - * @param string $expected - * @param mixed $actual - * - * @return AnnotationException - */ - public static function attributeTypeError($attributeName, $annotationName, $context, $expected, $actual) - { - return self::typeError(sprintf( - 'Attribute "%s" of @%s declared on %s expects %s, but got %s.', - $attributeName, - $annotationName, - $context, - $expected, - is_object($actual) ? 'an instance of ' . get_class($actual) : gettype($actual) - )); - } - - /** - * Creates a new AnnotationException describing an required error of an attribute. - * - * @since 2.2 - * - * @param string $attributeName - * @param string $annotationName - * @param string $context - * @param string $expected - * - * @return AnnotationException - */ - public static function requiredError($attributeName, $annotationName, $context, $expected) - { - return self::typeError(sprintf( - 'Attribute "%s" of @%s declared on %s expects %s. This value should not be null.', - $attributeName, - $annotationName, - $context, - $expected - )); - } - - /** - * Creates a new AnnotationException describing a invalid enummerator. - * - * @since 2.4 - * - * @param string $attributeName - * @param string $annotationName - * @param string $context - * @param array $available - * @param mixed $given - * - * @return AnnotationException - */ - public static function enumeratorError($attributeName, $annotationName, $context, $available, $given) - { - return new self(sprintf( - '[Enum Error] Attribute "%s" of @%s declared on %s accept only [%s], but got %s.', - $attributeName, - $annotationName, - $context, - implode(', ', $available), - is_object($given) ? get_class($given) : $given - )); - } - - /** - * @return AnnotationException - */ - public static function optimizerPlusSaveComments() - { - return new self( - "You have to enable opcache.save_comments=1 or zend_optimizerplus.save_comments=1." - ); - } - - /** - * @return AnnotationException - */ - public static function optimizerPlusLoadComments() - { - return new self( - "You have to enable opcache.load_comments=1 or zend_optimizerplus.load_comments=1." - ); - } -} diff --git a/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php b/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php deleted file mode 100644 index d559960..0000000 --- a/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php +++ /dev/null @@ -1,393 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations; - -use Doctrine\Common\Annotations\Annotation\IgnoreAnnotation; -use Doctrine\Common\Annotations\Annotation\Target; -use ReflectionClass; -use ReflectionMethod; -use ReflectionProperty; - -/** - * A reader for docblock annotations. - * - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Johannes M. Schmitt - */ -class AnnotationReader implements Reader -{ - /** - * Global map for imports. - * - * @var array - */ - private static $globalImports = array( - 'ignoreannotation' => 'Doctrine\Common\Annotations\Annotation\IgnoreAnnotation', - ); - - /** - * A list with annotations that are not causing exceptions when not resolved to an annotation class. - * - * The names are case sensitive. - * - * @var array - */ - private static $globalIgnoredNames = array( - // Annotation tags - 'Annotation' => true, 'Attribute' => true, 'Attributes' => true, - /* Can we enable this? 'Enum' => true, */ - 'Required' => true, - 'Target' => true, - // Widely used tags (but not existent in phpdoc) - 'fix' => true , 'fixme' => true, - 'override' => true, - // PHPDocumentor 1 tags - 'abstract'=> true, 'access'=> true, - 'code' => true, - 'deprec'=> true, - 'endcode' => true, 'exception'=> true, - 'final'=> true, - 'ingroup' => true, 'inheritdoc'=> true, 'inheritDoc'=> true, - 'magic' => true, - 'name'=> true, - 'toc' => true, 'tutorial'=> true, - 'private' => true, - 'static'=> true, 'staticvar'=> true, 'staticVar'=> true, - 'throw' => true, - // PHPDocumentor 2 tags. - 'api' => true, 'author'=> true, - 'category'=> true, 'copyright'=> true, - 'deprecated'=> true, - 'example'=> true, - 'filesource'=> true, - 'global'=> true, - 'ignore'=> true, /* Can we enable this? 'index' => true, */ 'internal'=> true, - 'license'=> true, 'link'=> true, - 'method' => true, - 'package'=> true, 'param'=> true, 'property' => true, 'property-read' => true, 'property-write' => true, - 'return'=> true, - 'see'=> true, 'since'=> true, 'source' => true, 'subpackage'=> true, - 'throws'=> true, 'todo'=> true, 'TODO'=> true, - 'usedby'=> true, 'uses' => true, - 'var'=> true, 'version'=> true, - // PHPUnit tags - 'codeCoverageIgnore' => true, 'codeCoverageIgnoreStart' => true, 'codeCoverageIgnoreEnd' => true, - // PHPCheckStyle - 'SuppressWarnings' => true, - // PHPStorm - 'noinspection' => true, - // PEAR - 'package_version' => true, - // PlantUML - 'startuml' => true, 'enduml' => true, - ); - - /** - * Add a new annotation to the globally ignored annotation names with regard to exception handling. - * - * @param string $name - */ - static public function addGlobalIgnoredName($name) - { - self::$globalIgnoredNames[$name] = true; - } - - /** - * Annotations parser. - * - * @var \Doctrine\Common\Annotations\DocParser - */ - private $parser; - - /** - * Annotations parser used to collect parsing metadata. - * - * @var \Doctrine\Common\Annotations\DocParser - */ - private $preParser; - - /** - * PHP parser used to collect imports. - * - * @var \Doctrine\Common\Annotations\PhpParser - */ - private $phpParser; - - /** - * In-memory cache mechanism to store imported annotations per class. - * - * @var array - */ - private $imports = array(); - - /** - * In-memory cache mechanism to store ignored annotations per class. - * - * @var array - */ - private $ignoredAnnotationNames = array(); - - /** - * Constructor. - * - * Initializes a new AnnotationReader. - */ - public function __construct() - { - if (extension_loaded('Zend Optimizer+') && (ini_get('zend_optimizerplus.save_comments') === "0" || ini_get('opcache.save_comments') === "0")) { - throw AnnotationException::optimizerPlusSaveComments(); - } - - if (extension_loaded('Zend OPcache') && ini_get('opcache.save_comments') == 0) { - throw AnnotationException::optimizerPlusSaveComments(); - } - - - if (extension_loaded('Zend Optimizer+') && (ini_get('zend_optimizerplus.load_comments') === "0" || ini_get('opcache.load_comments') === "0")) { - throw AnnotationException::optimizerPlusLoadComments(); - } - - if (extension_loaded('Zend OPcache') && ini_get('opcache.load_comments') == 0) { - throw AnnotationException::optimizerPlusLoadComments(); - } - - AnnotationRegistry::registerFile(__DIR__ . '/Annotation/IgnoreAnnotation.php'); - - $this->parser = new DocParser; - $this->preParser = new DocParser; - - $this->preParser->setImports(self::$globalImports); - $this->preParser->setIgnoreNotImportedAnnotations(true); - - $this->phpParser = new PhpParser; - } - - /** - * {@inheritDoc} - */ - public function getClassAnnotations(ReflectionClass $class) - { - $this->parser->setTarget(Target::TARGET_CLASS); - $this->parser->setImports($this->getClassImports($class)); - $this->parser->setIgnoredAnnotationNames($this->getIgnoredAnnotationNames($class)); - - return $this->parser->parse($class->getDocComment(), 'class ' . $class->getName()); - } - - /** - * {@inheritDoc} - */ - public function getClassAnnotation(ReflectionClass $class, $annotationName) - { - $annotations = $this->getClassAnnotations($class); - - foreach ($annotations as $annotation) { - if ($annotation instanceof $annotationName) { - return $annotation; - } - } - - return null; - } - - /** - * {@inheritDoc} - */ - public function getPropertyAnnotations(ReflectionProperty $property) - { - $class = $property->getDeclaringClass(); - $context = 'property ' . $class->getName() . "::\$" . $property->getName(); - - $this->parser->setTarget(Target::TARGET_PROPERTY); - $this->parser->setImports($this->getPropertyImports($property)); - $this->parser->setIgnoredAnnotationNames($this->getIgnoredAnnotationNames($class)); - - return $this->parser->parse($property->getDocComment(), $context); - } - - /** - * {@inheritDoc} - */ - public function getPropertyAnnotation(ReflectionProperty $property, $annotationName) - { - $annotations = $this->getPropertyAnnotations($property); - - foreach ($annotations as $annotation) { - if ($annotation instanceof $annotationName) { - return $annotation; - } - } - - return null; - } - - /** - * {@inheritDoc} - */ - public function getMethodAnnotations(ReflectionMethod $method) - { - $class = $method->getDeclaringClass(); - $context = 'method ' . $class->getName() . '::' . $method->getName() . '()'; - - $this->parser->setTarget(Target::TARGET_METHOD); - $this->parser->setImports($this->getMethodImports($method)); - $this->parser->setIgnoredAnnotationNames($this->getIgnoredAnnotationNames($class)); - - return $this->parser->parse($method->getDocComment(), $context); - } - - /** - * {@inheritDoc} - */ - public function getMethodAnnotation(ReflectionMethod $method, $annotationName) - { - $annotations = $this->getMethodAnnotations($method); - - foreach ($annotations as $annotation) { - if ($annotation instanceof $annotationName) { - return $annotation; - } - } - - return null; - } - - /** - * Returns the ignored annotations for the given class. - * - * @param \ReflectionClass $class - * - * @return array - */ - private function getIgnoredAnnotationNames(ReflectionClass $class) - { - if (isset($this->ignoredAnnotationNames[$name = $class->getName()])) { - return $this->ignoredAnnotationNames[$name]; - } - - $this->collectParsingMetadata($class); - - return $this->ignoredAnnotationNames[$name]; - } - - /** - * Retrieves imports. - * - * @param \ReflectionClass $class - * - * @return array - */ - private function getClassImports(ReflectionClass $class) - { - if (isset($this->imports[$name = $class->getName()])) { - return $this->imports[$name]; - } - - $this->collectParsingMetadata($class); - - return $this->imports[$name]; - } - - /** - * Retrieves imports for methods. - * - * @param \ReflectionMethod $method - * - * @return array - */ - private function getMethodImports(ReflectionMethod $method) - { - $class = $method->getDeclaringClass(); - $classImports = $this->getClassImports($class); - if (!method_exists($class, 'getTraits')) { - return $classImports; - } - - $traitImports = array(); - - foreach ($class->getTraits() as $trait) { - if ($trait->hasMethod($method->getName()) - && $trait->getFileName() === $method->getFileName() - ) { - $traitImports = array_merge($traitImports, $this->phpParser->parseClass($trait)); - } - } - - return array_merge($classImports, $traitImports); - } - - /** - * Retrieves imports for properties. - * - * @param \ReflectionProperty $property - * - * @return array - */ - private function getPropertyImports(ReflectionProperty $property) - { - $class = $property->getDeclaringClass(); - $classImports = $this->getClassImports($class); - if (!method_exists($class, 'getTraits')) { - return $classImports; - } - - $traitImports = array(); - - foreach ($class->getTraits() as $trait) { - if ($trait->hasProperty($property->getName())) { - $traitImports = array_merge($traitImports, $this->phpParser->parseClass($trait)); - } - } - - return array_merge($classImports, $traitImports); - } - - /** - * Collects parsing metadata for a given class. - * - * @param \ReflectionClass $class - */ - private function collectParsingMetadata(ReflectionClass $class) - { - $ignoredAnnotationNames = self::$globalIgnoredNames; - $annotations = $this->preParser->parse($class->getDocComment(), 'class ' . $class->name); - - foreach ($annotations as $annotation) { - if ($annotation instanceof IgnoreAnnotation) { - foreach ($annotation->names AS $annot) { - $ignoredAnnotationNames[$annot] = true; - } - } - } - - $name = $class->getName(); - - $this->imports[$name] = array_merge( - self::$globalImports, - $this->phpParser->parseClass($class), - array('__NAMESPACE__' => $class->getNamespaceName()) - ); - - $this->ignoredAnnotationNames[$name] = $ignoredAnnotationNames; - } -} diff --git a/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationRegistry.php b/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationRegistry.php deleted file mode 100644 index 13ceb63..0000000 --- a/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationRegistry.php +++ /dev/null @@ -1,151 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations; - -/** - * AnnotationRegistry. - */ -final class AnnotationRegistry -{ - /** - * A map of namespaces to use for autoloading purposes based on a PSR-0 convention. - * - * Contains the namespace as key and an array of directories as value. If the value is NULL - * the include path is used for checking for the corresponding file. - * - * This autoloading mechanism does not utilize the PHP autoloading but implements autoloading on its own. - * - * @var array - */ - static private $autoloadNamespaces = array(); - - /** - * A map of autoloader callables. - * - * @var array - */ - static private $loaders = array(); - - /** - * @return void - */ - static public function reset() - { - self::$autoloadNamespaces = array(); - self::$loaders = array(); - } - - /** - * Registers file. - * - * @param string $file - * - * @return void - */ - static public function registerFile($file) - { - require_once $file; - } - - /** - * Adds a namespace with one or many directories to look for files or null for the include path. - * - * Loading of this namespaces will be done with a PSR-0 namespace loading algorithm. - * - * @param string $namespace - * @param string|array|null $dirs - * - * @return void - */ - static public function registerAutoloadNamespace($namespace, $dirs = null) - { - self::$autoloadNamespaces[$namespace] = $dirs; - } - - /** - * Registers multiple namespaces. - * - * Loading of this namespaces will be done with a PSR-0 namespace loading algorithm. - * - * @param array $namespaces - * - * @return void - */ - static public function registerAutoloadNamespaces(array $namespaces) - { - self::$autoloadNamespaces = array_merge(self::$autoloadNamespaces, $namespaces); - } - - /** - * Registers an autoloading callable for annotations, much like spl_autoload_register(). - * - * NOTE: These class loaders HAVE to be silent when a class was not found! - * IMPORTANT: Loaders have to return true if they loaded a class that could contain the searched annotation class. - * - * @param callable $callable - * - * @return void - * - * @throws \InvalidArgumentException - */ - static public function registerLoader($callable) - { - if (!is_callable($callable)) { - throw new \InvalidArgumentException("A callable is expected in AnnotationRegistry::registerLoader()."); - } - self::$loaders[] = $callable; - } - - /** - * Autoloads an annotation class silently. - * - * @param string $class - * - * @return boolean - */ - static public function loadAnnotationClass($class) - { - foreach (self::$autoloadNamespaces AS $namespace => $dirs) { - if (strpos($class, $namespace) === 0) { - $file = str_replace("\\", DIRECTORY_SEPARATOR, $class) . ".php"; - if ($dirs === null) { - if ($path = stream_resolve_include_path($file)) { - require $path; - return true; - } - } else { - foreach((array)$dirs AS $dir) { - if (is_file($dir . DIRECTORY_SEPARATOR . $file)) { - require $dir . DIRECTORY_SEPARATOR . $file; - return true; - } - } - } - } - } - - foreach (self::$loaders AS $loader) { - if (call_user_func($loader, $class) === true) { - return true; - } - } - return false; - } -} diff --git a/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/CachedReader.php b/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/CachedReader.php deleted file mode 100644 index e6dc593..0000000 --- a/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/CachedReader.php +++ /dev/null @@ -1,235 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations; - -use Doctrine\Common\Cache\Cache; - -/** - * A cache aware annotation reader. - * - * @author Johannes M. Schmitt - * @author Benjamin Eberlei - */ -final class CachedReader implements Reader -{ - /** - * @var string - */ - private static $CACHE_SALT = '@[Annot]'; - - /** - * @var Reader - */ - private $delegate; - - /** - * @var Cache - */ - private $cache; - - /** - * @var boolean - */ - private $debug; - - /** - * @var array - */ - private $loadedAnnotations = array(); - - /** - * Constructor. - * - * @param Reader $reader - * @param Cache $cache - * @param bool $debug - */ - public function __construct(Reader $reader, Cache $cache, $debug = false) - { - $this->delegate = $reader; - $this->cache = $cache; - $this->debug = (boolean) $debug; - } - - /** - * {@inheritDoc} - */ - public function getClassAnnotations(\ReflectionClass $class) - { - $cacheKey = $class->getName(); - - if (isset($this->loadedAnnotations[$cacheKey])) { - return $this->loadedAnnotations[$cacheKey]; - } - - if (false === ($annots = $this->fetchFromCache($cacheKey, $class))) { - $annots = $this->delegate->getClassAnnotations($class); - $this->saveToCache($cacheKey, $annots); - } - - return $this->loadedAnnotations[$cacheKey] = $annots; - } - - /** - * {@inheritDoc} - */ - public function getClassAnnotation(\ReflectionClass $class, $annotationName) - { - foreach ($this->getClassAnnotations($class) as $annot) { - if ($annot instanceof $annotationName) { - return $annot; - } - } - - return null; - } - - /** - * {@inheritDoc} - */ - public function getPropertyAnnotations(\ReflectionProperty $property) - { - $class = $property->getDeclaringClass(); - $cacheKey = $class->getName().'$'.$property->getName(); - - if (isset($this->loadedAnnotations[$cacheKey])) { - return $this->loadedAnnotations[$cacheKey]; - } - - if (false === ($annots = $this->fetchFromCache($cacheKey, $class))) { - $annots = $this->delegate->getPropertyAnnotations($property); - $this->saveToCache($cacheKey, $annots); - } - - return $this->loadedAnnotations[$cacheKey] = $annots; - } - - /** - * {@inheritDoc} - */ - public function getPropertyAnnotation(\ReflectionProperty $property, $annotationName) - { - foreach ($this->getPropertyAnnotations($property) as $annot) { - if ($annot instanceof $annotationName) { - return $annot; - } - } - - return null; - } - - /** - * {@inheritDoc} - */ - public function getMethodAnnotations(\ReflectionMethod $method) - { - $class = $method->getDeclaringClass(); - $cacheKey = $class->getName().'#'.$method->getName(); - - if (isset($this->loadedAnnotations[$cacheKey])) { - return $this->loadedAnnotations[$cacheKey]; - } - - if (false === ($annots = $this->fetchFromCache($cacheKey, $class))) { - $annots = $this->delegate->getMethodAnnotations($method); - $this->saveToCache($cacheKey, $annots); - } - - return $this->loadedAnnotations[$cacheKey] = $annots; - } - - /** - * {@inheritDoc} - */ - public function getMethodAnnotation(\ReflectionMethod $method, $annotationName) - { - foreach ($this->getMethodAnnotations($method) as $annot) { - if ($annot instanceof $annotationName) { - return $annot; - } - } - - return null; - } - - /** - * Clears loaded annotations. - * - * @return void - */ - public function clearLoadedAnnotations() - { - $this->loadedAnnotations = array(); - } - - /** - * Fetches a value from the cache. - * - * @param string $rawCacheKey The cache key. - * @param \ReflectionClass $class The related class. - * - * @return mixed The cached value or false when the value is not in cache. - */ - private function fetchFromCache($rawCacheKey, \ReflectionClass $class) - { - $cacheKey = $rawCacheKey . self::$CACHE_SALT; - if (($data = $this->cache->fetch($cacheKey)) !== false) { - if (!$this->debug || $this->isCacheFresh($cacheKey, $class)) { - return $data; - } - } - - return false; - } - - /** - * Saves a value to the cache. - * - * @param string $rawCacheKey The cache key. - * @param mixed $value The value. - * - * @return void - */ - private function saveToCache($rawCacheKey, $value) - { - $cacheKey = $rawCacheKey . self::$CACHE_SALT; - $this->cache->save($cacheKey, $value); - if ($this->debug) { - $this->cache->save('[C]'.$cacheKey, time()); - } - } - - /** - * Checks if the cache is fresh. - * - * @param string $cacheKey - * @param \ReflectionClass $class - * - * @return boolean - */ - private function isCacheFresh($cacheKey, \ReflectionClass $class) - { - if (false === $filename = $class->getFilename()) { - return true; - } - - return $this->cache->fetch('[C]'.$cacheKey) >= filemtime($filename); - } -} diff --git a/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocLexer.php b/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocLexer.php deleted file mode 100644 index 330afd3..0000000 --- a/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocLexer.php +++ /dev/null @@ -1,134 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations; - -use Doctrine\Common\Lexer\AbstractLexer; - -/** - * Simple lexer for docblock annotations. - * - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Johannes M. Schmitt - */ -final class DocLexer extends AbstractLexer -{ - const T_NONE = 1; - const T_INTEGER = 2; - const T_STRING = 3; - const T_FLOAT = 4; - - // All tokens that are also identifiers should be >= 100 - const T_IDENTIFIER = 100; - const T_AT = 101; - const T_CLOSE_CURLY_BRACES = 102; - const T_CLOSE_PARENTHESIS = 103; - const T_COMMA = 104; - const T_EQUALS = 105; - const T_FALSE = 106; - const T_NAMESPACE_SEPARATOR = 107; - const T_OPEN_CURLY_BRACES = 108; - const T_OPEN_PARENTHESIS = 109; - const T_TRUE = 110; - const T_NULL = 111; - const T_COLON = 112; - - /** - * @var array - */ - protected $noCase = array( - '@' => self::T_AT, - ',' => self::T_COMMA, - '(' => self::T_OPEN_PARENTHESIS, - ')' => self::T_CLOSE_PARENTHESIS, - '{' => self::T_OPEN_CURLY_BRACES, - '}' => self::T_CLOSE_CURLY_BRACES, - '=' => self::T_EQUALS, - ':' => self::T_COLON, - '\\' => self::T_NAMESPACE_SEPARATOR - ); - - /** - * @var array - */ - protected $withCase = array( - 'true' => self::T_TRUE, - 'false' => self::T_FALSE, - 'null' => self::T_NULL - ); - - /** - * {@inheritdoc} - */ - protected function getCatchablePatterns() - { - return array( - '[a-z_\\\][a-z0-9_\:\\\]*[a-z_][a-z0-9_]*', - '(?:[+-]?[0-9]+(?:[\.][0-9]+)*)(?:[eE][+-]?[0-9]+)?', - '"(?:[^"]|"")*"', - ); - } - - /** - * {@inheritdoc} - */ - protected function getNonCatchablePatterns() - { - return array('\s+', '\*+', '(.)'); - } - - /** - * {@inheritdoc} - */ - protected function getType(&$value) - { - $type = self::T_NONE; - - if ($value[0] === '"') { - $value = str_replace('""', '"', substr($value, 1, strlen($value) - 2)); - - return self::T_STRING; - } - - if (isset($this->noCase[$value])) { - return $this->noCase[$value]; - } - - if ($value[0] === '_' || $value[0] === '\\' || ctype_alpha($value[0])) { - return self::T_IDENTIFIER; - } - - $lowerValue = strtolower($value); - - if (isset($this->withCase[$lowerValue])) { - return $this->withCase[$lowerValue]; - } - - // Checking numeric value - if (is_numeric($value)) { - return (strpos($value, '.') !== false || stripos($value, 'e') !== false) - ? self::T_FLOAT : self::T_INTEGER; - } - - return $type; - } -} diff --git a/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php b/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php deleted file mode 100644 index db66846..0000000 --- a/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php +++ /dev/null @@ -1,1138 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations; - -use Doctrine\Common\Annotations\Annotation\Attribute; -use ReflectionClass; -use Doctrine\Common\Annotations\Annotation\Enum; -use Doctrine\Common\Annotations\Annotation\Target; -use Doctrine\Common\Annotations\Annotation\Attributes; - -/** - * A parser for docblock annotations. - * - * It is strongly discouraged to change the default annotation parsing process. - * - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Johannes M. Schmitt - * @author Fabio B. Silva - */ -final class DocParser -{ - /** - * An array of all valid tokens for a class name. - * - * @var array - */ - private static $classIdentifiers = array( - DocLexer::T_IDENTIFIER, - DocLexer::T_TRUE, - DocLexer::T_FALSE, - DocLexer::T_NULL - ); - - /** - * The lexer. - * - * @var \Doctrine\Common\Annotations\DocLexer - */ - private $lexer; - - /** - * Current target context. - * - * @var string - */ - private $target; - - /** - * Doc parser used to collect annotation target. - * - * @var \Doctrine\Common\Annotations\DocParser - */ - private static $metadataParser; - - /** - * Flag to control if the current annotation is nested or not. - * - * @var boolean - */ - private $isNestedAnnotation = false; - - /** - * Hashmap containing all use-statements that are to be used when parsing - * the given doc block. - * - * @var array - */ - private $imports = array(); - - /** - * This hashmap is used internally to cache results of class_exists() - * look-ups. - * - * @var array - */ - private $classExists = array(); - - /** - * Whether annotations that have not been imported should be ignored. - * - * @var boolean - */ - private $ignoreNotImportedAnnotations = false; - - /** - * An array of default namespaces if operating in simple mode. - * - * @var array - */ - private $namespaces = array(); - - /** - * A list with annotations that are not causing exceptions when not resolved to an annotation class. - * - * The names must be the raw names as used in the class, not the fully qualified - * class names. - * - * @var array - */ - private $ignoredAnnotationNames = array(); - - /** - * @var string - */ - private $context = ''; - - /** - * Hash-map for caching annotation metadata. - * - * @var array - */ - private static $annotationMetadata = array( - 'Doctrine\Common\Annotations\Annotation\Target' => array( - 'is_annotation' => true, - 'has_constructor' => true, - 'properties' => array(), - 'targets_literal' => 'ANNOTATION_CLASS', - 'targets' => Target::TARGET_CLASS, - 'default_property' => 'value', - 'attribute_types' => array( - 'value' => array( - 'required' => false, - 'type' =>'array', - 'array_type'=>'string', - 'value' =>'array' - ) - ), - ), - 'Doctrine\Common\Annotations\Annotation\Attribute' => array( - 'is_annotation' => true, - 'has_constructor' => false, - 'targets_literal' => 'ANNOTATION_ANNOTATION', - 'targets' => Target::TARGET_ANNOTATION, - 'default_property' => 'name', - 'properties' => array( - 'name' => 'name', - 'type' => 'type', - 'required' => 'required' - ), - 'attribute_types' => array( - 'value' => array( - 'required' => true, - 'type' =>'string', - 'value' =>'string' - ), - 'type' => array( - 'required' =>true, - 'type' =>'string', - 'value' =>'string' - ), - 'required' => array( - 'required' =>false, - 'type' =>'boolean', - 'value' =>'boolean' - ) - ), - ), - 'Doctrine\Common\Annotations\Annotation\Attributes' => array( - 'is_annotation' => true, - 'has_constructor' => false, - 'targets_literal' => 'ANNOTATION_CLASS', - 'targets' => Target::TARGET_CLASS, - 'default_property' => 'value', - 'properties' => array( - 'value' => 'value' - ), - 'attribute_types' => array( - 'value' => array( - 'type' =>'array', - 'required' =>true, - 'array_type'=>'Doctrine\Common\Annotations\Annotation\Attribute', - 'value' =>'array' - ) - ), - ), - 'Doctrine\Common\Annotations\Annotation\Enum' => array( - 'is_annotation' => true, - 'has_constructor' => true, - 'targets_literal' => 'ANNOTATION_PROPERTY', - 'targets' => Target::TARGET_PROPERTY, - 'default_property' => 'value', - 'properties' => array( - 'value' => 'value' - ), - 'attribute_types' => array( - 'value' => array( - 'type' => 'array', - 'required' => true, - ), - 'literal' => array( - 'type' => 'array', - 'required' => false, - ), - ), - ), - ); - - /** - * Hash-map for handle types declaration. - * - * @var array - */ - private static $typeMap = array( - 'float' => 'double', - 'bool' => 'boolean', - // allow uppercase Boolean in honor of George Boole - 'Boolean' => 'boolean', - 'int' => 'integer', - ); - - /** - * Constructs a new DocParser. - */ - public function __construct() - { - $this->lexer = new DocLexer; - } - - /** - * Sets the annotation names that are ignored during the parsing process. - * - * The names are supposed to be the raw names as used in the class, not the - * fully qualified class names. - * - * @param array $names - * - * @return void - */ - public function setIgnoredAnnotationNames(array $names) - { - $this->ignoredAnnotationNames = $names; - } - - /** - * Sets ignore on not-imported annotations. - * - * @param boolean $bool - * - * @return void - */ - public function setIgnoreNotImportedAnnotations($bool) - { - $this->ignoreNotImportedAnnotations = (boolean) $bool; - } - - /** - * Sets the default namespaces. - * - * @param array $namespace - * - * @return void - * - * @throws \RuntimeException - */ - public function addNamespace($namespace) - { - if ($this->imports) { - throw new \RuntimeException('You must either use addNamespace(), or setImports(), but not both.'); - } - - $this->namespaces[] = $namespace; - } - - /** - * Sets the imports. - * - * @param array $imports - * - * @return void - * - * @throws \RuntimeException - */ - public function setImports(array $imports) - { - if ($this->namespaces) { - throw new \RuntimeException('You must either use addNamespace(), or setImports(), but not both.'); - } - - $this->imports = $imports; - } - - /** - * Sets current target context as bitmask. - * - * @param integer $target - * - * @return void - */ - public function setTarget($target) - { - $this->target = $target; - } - - /** - * Parses the given docblock string for annotations. - * - * @param string $input The docblock string to parse. - * @param string $context The parsing context. - * - * @return array Array of annotations. If no annotations are found, an empty array is returned. - */ - public function parse($input, $context = '') - { - $pos = $this->findInitialTokenPosition($input); - if ($pos === null) { - return array(); - } - - $this->context = $context; - - $this->lexer->setInput(trim(substr($input, $pos), '* /')); - $this->lexer->moveNext(); - - return $this->Annotations(); - } - - /** - * Finds the first valid annotation - * - * @param string $input The docblock string to parse - * - * @return int|null - */ - private function findInitialTokenPosition($input) - { - $pos = 0; - - // search for first valid annotation - while (($pos = strpos($input, '@', $pos)) !== false) { - // if the @ is preceded by a space or * it is valid - if ($pos === 0 || $input[$pos - 1] === ' ' || $input[$pos - 1] === '*') { - return $pos; - } - - $pos++; - } - - return null; - } - - /** - * Attempts to match the given token with the current lookahead token. - * If they match, updates the lookahead token; otherwise raises a syntax error. - * - * @param integer $token Type of token. - * - * @return boolean True if tokens match; false otherwise. - */ - private function match($token) - { - if ( ! $this->lexer->isNextToken($token) ) { - $this->syntaxError($this->lexer->getLiteral($token)); - } - - return $this->lexer->moveNext(); - } - - /** - * Attempts to match the current lookahead token with any of the given tokens. - * - * If any of them matches, this method updates the lookahead token; otherwise - * a syntax error is raised. - * - * @param array $tokens - * - * @return boolean - */ - private function matchAny(array $tokens) - { - if ( ! $this->lexer->isNextTokenAny($tokens)) { - $this->syntaxError(implode(' or ', array_map(array($this->lexer, 'getLiteral'), $tokens))); - } - - return $this->lexer->moveNext(); - } - - /** - * Generates a new syntax error. - * - * @param string $expected Expected string. - * @param array|null $token Optional token. - * - * @return void - * - * @throws AnnotationException - */ - private function syntaxError($expected, $token = null) - { - if ($token === null) { - $token = $this->lexer->lookahead; - } - - $message = sprintf('Expected %s, got ', $expected); - $message .= ($this->lexer->lookahead === null) - ? 'end of string' - : sprintf("'%s' at position %s", $token['value'], $token['position']); - - if (strlen($this->context)) { - $message .= ' in ' . $this->context; - } - - $message .= '.'; - - throw AnnotationException::syntaxError($message); - } - - /** - * Attempts to check if a class exists or not. This never goes through the PHP autoloading mechanism - * but uses the {@link AnnotationRegistry} to load classes. - * - * @param string $fqcn - * - * @return boolean - */ - private function classExists($fqcn) - { - if (isset($this->classExists[$fqcn])) { - return $this->classExists[$fqcn]; - } - - // first check if the class already exists, maybe loaded through another AnnotationReader - if (class_exists($fqcn, false)) { - return $this->classExists[$fqcn] = true; - } - - // final check, does this class exist? - return $this->classExists[$fqcn] = AnnotationRegistry::loadAnnotationClass($fqcn); - } - - /** - * Collects parsing metadata for a given annotation class - * - * @param string $name The annotation name - * - * @return void - */ - private function collectAnnotationMetadata($name) - { - if (self::$metadataParser === null) { - self::$metadataParser = new self(); - - self::$metadataParser->setIgnoreNotImportedAnnotations(true); - self::$metadataParser->setIgnoredAnnotationNames($this->ignoredAnnotationNames); - self::$metadataParser->setImports(array( - 'enum' => 'Doctrine\Common\Annotations\Annotation\Enum', - 'target' => 'Doctrine\Common\Annotations\Annotation\Target', - 'attribute' => 'Doctrine\Common\Annotations\Annotation\Attribute', - 'attributes' => 'Doctrine\Common\Annotations\Annotation\Attributes' - )); - - AnnotationRegistry::registerFile(__DIR__ . '/Annotation/Enum.php'); - AnnotationRegistry::registerFile(__DIR__ . '/Annotation/Target.php'); - AnnotationRegistry::registerFile(__DIR__ . '/Annotation/Attribute.php'); - AnnotationRegistry::registerFile(__DIR__ . '/Annotation/Attributes.php'); - } - - $class = new \ReflectionClass($name); - $docComment = $class->getDocComment(); - - // Sets default values for annotation metadata - $metadata = array( - 'default_property' => null, - 'has_constructor' => (null !== $constructor = $class->getConstructor()) && $constructor->getNumberOfParameters() > 0, - 'properties' => array(), - 'property_types' => array(), - 'attribute_types' => array(), - 'targets_literal' => null, - 'targets' => Target::TARGET_ALL, - 'is_annotation' => false !== strpos($docComment, '@Annotation'), - ); - - // verify that the class is really meant to be an annotation - if ($metadata['is_annotation']) { - self::$metadataParser->setTarget(Target::TARGET_CLASS); - - foreach (self::$metadataParser->parse($docComment, 'class @' . $name) as $annotation) { - if ($annotation instanceof Target) { - $metadata['targets'] = $annotation->targets; - $metadata['targets_literal'] = $annotation->literal; - - continue; - } - - if ($annotation instanceof Attributes) { - foreach ($annotation->value as $attribute) { - $this->collectAttributeTypeMetadata($metadata, $attribute); - } - } - } - - // if not has a constructor will inject values into public properties - if (false === $metadata['has_constructor']) { - // collect all public properties - foreach ($class->getProperties(\ReflectionProperty::IS_PUBLIC) as $property) { - $metadata['properties'][$property->name] = $property->name; - - if (false === ($propertyComment = $property->getDocComment())) { - continue; - } - - $attribute = new Attribute(); - - $attribute->required = (false !== strpos($propertyComment, '@Required')); - $attribute->name = $property->name; - $attribute->type = (false !== strpos($propertyComment, '@var') && preg_match('/@var\s+([^\s]+)/',$propertyComment, $matches)) - ? $matches[1] - : 'mixed'; - - $this->collectAttributeTypeMetadata($metadata, $attribute); - - // checks if the property has @Enum - if (false !== strpos($propertyComment, '@Enum')) { - $context = 'property ' . $class->name . "::\$" . $property->name; - - self::$metadataParser->setTarget(Target::TARGET_PROPERTY); - - foreach (self::$metadataParser->parse($propertyComment, $context) as $annotation) { - if ( ! $annotation instanceof Enum) { - continue; - } - - $metadata['enum'][$property->name]['value'] = $annotation->value; - $metadata['enum'][$property->name]['literal'] = ( ! empty($annotation->literal)) - ? $annotation->literal - : $annotation->value; - } - } - } - - // choose the first property as default property - $metadata['default_property'] = reset($metadata['properties']); - } - } - - self::$annotationMetadata[$name] = $metadata; - } - - /** - * Collects parsing metadata for a given attribute. - * - * @param array $metadata - * @param Attribute $attribute - * - * @return void - */ - private function collectAttributeTypeMetadata(&$metadata, Attribute $attribute) - { - // handle internal type declaration - $type = isset(self::$typeMap[$attribute->type]) - ? self::$typeMap[$attribute->type] - : $attribute->type; - - // handle the case if the property type is mixed - if ('mixed' === $type) { - return; - } - - // Evaluate type - switch (true) { - // Checks if the property has array - case (false !== $pos = strpos($type, '<')): - $arrayType = substr($type, $pos + 1, -1); - $type = 'array'; - - if (isset(self::$typeMap[$arrayType])) { - $arrayType = self::$typeMap[$arrayType]; - } - - $metadata['attribute_types'][$attribute->name]['array_type'] = $arrayType; - break; - - // Checks if the property has type[] - case (false !== $pos = strrpos($type, '[')): - $arrayType = substr($type, 0, $pos); - $type = 'array'; - - if (isset(self::$typeMap[$arrayType])) { - $arrayType = self::$typeMap[$arrayType]; - } - - $metadata['attribute_types'][$attribute->name]['array_type'] = $arrayType; - break; - } - - $metadata['attribute_types'][$attribute->name]['type'] = $type; - $metadata['attribute_types'][$attribute->name]['value'] = $attribute->type; - $metadata['attribute_types'][$attribute->name]['required'] = $attribute->required; - } - - /** - * Annotations ::= Annotation {[ "*" ]* [Annotation]}* - * - * @return array - */ - private function Annotations() - { - $annotations = array(); - - while (null !== $this->lexer->lookahead) { - if (DocLexer::T_AT !== $this->lexer->lookahead['type']) { - $this->lexer->moveNext(); - continue; - } - - // make sure the @ is preceded by non-catchable pattern - if (null !== $this->lexer->token && $this->lexer->lookahead['position'] === $this->lexer->token['position'] + strlen($this->lexer->token['value'])) { - $this->lexer->moveNext(); - continue; - } - - // make sure the @ is followed by either a namespace separator, or - // an identifier token - if ((null === $peek = $this->lexer->glimpse()) - || (DocLexer::T_NAMESPACE_SEPARATOR !== $peek['type'] && !in_array($peek['type'], self::$classIdentifiers, true)) - || $peek['position'] !== $this->lexer->lookahead['position'] + 1) { - $this->lexer->moveNext(); - continue; - } - - $this->isNestedAnnotation = false; - if (false !== $annot = $this->Annotation()) { - $annotations[] = $annot; - } - } - - return $annotations; - } - - /** - * Annotation ::= "@" AnnotationName MethodCall - * AnnotationName ::= QualifiedName | SimpleName - * QualifiedName ::= NameSpacePart "\" {NameSpacePart "\"}* SimpleName - * NameSpacePart ::= identifier | null | false | true - * SimpleName ::= identifier | null | false | true - * - * @return mixed False if it is not a valid annotation. - * - * @throws AnnotationException - */ - private function Annotation() - { - $this->match(DocLexer::T_AT); - - // check if we have an annotation - $name = $this->Identifier(); - - // only process names which are not fully qualified, yet - // fully qualified names must start with a \ - $originalName = $name; - - if ('\\' !== $name[0]) { - $alias = (false === $pos = strpos($name, '\\'))? $name : substr($name, 0, $pos); - $found = false; - - if ($this->namespaces) { - foreach ($this->namespaces as $namespace) { - if ($this->classExists($namespace.'\\'.$name)) { - $name = $namespace.'\\'.$name; - $found = true; - break; - } - } - } elseif (isset($this->imports[$loweredAlias = strtolower($alias)])) { - $found = true; - $name = (false !== $pos) - ? $this->imports[$loweredAlias] . substr($name, $pos) - : $this->imports[$loweredAlias]; - } elseif ( ! isset($this->ignoredAnnotationNames[$name]) - && isset($this->imports['__NAMESPACE__']) - && $this->classExists($this->imports['__NAMESPACE__'] . '\\' . $name) - ) { - $name = $this->imports['__NAMESPACE__'].'\\'.$name; - $found = true; - } elseif (! isset($this->ignoredAnnotationNames[$name]) && $this->classExists($name)) { - $found = true; - } - - if ( ! $found) { - if ($this->ignoreNotImportedAnnotations || isset($this->ignoredAnnotationNames[$name])) { - return false; - } - - throw AnnotationException::semanticalError(sprintf('The annotation "@%s" in %s was never imported. Did you maybe forget to add a "use" statement for this annotation?', $name, $this->context)); - } - } - - if ( ! $this->classExists($name)) { - throw AnnotationException::semanticalError(sprintf('The annotation "@%s" in %s does not exist, or could not be auto-loaded.', $name, $this->context)); - } - - // at this point, $name contains the fully qualified class name of the - // annotation, and it is also guaranteed that this class exists, and - // that it is loaded - - - // collects the metadata annotation only if there is not yet - if ( ! isset(self::$annotationMetadata[$name])) { - $this->collectAnnotationMetadata($name); - } - - // verify that the class is really meant to be an annotation and not just any ordinary class - if (self::$annotationMetadata[$name]['is_annotation'] === false) { - if (isset($this->ignoredAnnotationNames[$originalName])) { - return false; - } - - throw AnnotationException::semanticalError(sprintf('The class "%s" is not annotated with @Annotation. Are you sure this class can be used as annotation? If so, then you need to add @Annotation to the _class_ doc comment of "%s". If it is indeed no annotation, then you need to add @IgnoreAnnotation("%s") to the _class_ doc comment of %s.', $name, $name, $originalName, $this->context)); - } - - //if target is nested annotation - $target = $this->isNestedAnnotation ? Target::TARGET_ANNOTATION : $this->target; - - // Next will be nested - $this->isNestedAnnotation = true; - - //if annotation does not support current target - if (0 === (self::$annotationMetadata[$name]['targets'] & $target) && $target) { - throw AnnotationException::semanticalError( - sprintf('Annotation @%s is not allowed to be declared on %s. You may only use this annotation on these code elements: %s.', - $originalName, $this->context, self::$annotationMetadata[$name]['targets_literal']) - ); - } - - $values = $this->MethodCall(); - - if (isset(self::$annotationMetadata[$name]['enum'])) { - // checks all declared attributes - foreach (self::$annotationMetadata[$name]['enum'] as $property => $enum) { - // checks if the attribute is a valid enumerator - if (isset($values[$property]) && ! in_array($values[$property], $enum['value'])) { - throw AnnotationException::enumeratorError($property, $name, $this->context, $enum['literal'], $values[$property]); - } - } - } - - // checks all declared attributes - foreach (self::$annotationMetadata[$name]['attribute_types'] as $property => $type) { - if ($property === self::$annotationMetadata[$name]['default_property'] - && !isset($values[$property]) && isset($values['value'])) { - $property = 'value'; - } - - // handle a not given attribute or null value - if (!isset($values[$property])) { - if ($type['required']) { - throw AnnotationException::requiredError($property, $originalName, $this->context, 'a(n) '.$type['value']); - } - - continue; - } - - if ($type['type'] === 'array') { - // handle the case of a single value - if ( ! is_array($values[$property])) { - $values[$property] = array($values[$property]); - } - - // checks if the attribute has array type declaration, such as "array" - if (isset($type['array_type'])) { - foreach ($values[$property] as $item) { - if (gettype($item) !== $type['array_type'] && !$item instanceof $type['array_type']) { - throw AnnotationException::attributeTypeError($property, $originalName, $this->context, 'either a(n) '.$type['array_type'].', or an array of '.$type['array_type'].'s', $item); - } - } - } - } elseif (gettype($values[$property]) !== $type['type'] && !$values[$property] instanceof $type['type']) { - throw AnnotationException::attributeTypeError($property, $originalName, $this->context, 'a(n) '.$type['value'], $values[$property]); - } - } - - // check if the annotation expects values via the constructor, - // or directly injected into public properties - if (self::$annotationMetadata[$name]['has_constructor'] === true) { - return new $name($values); - } - - $instance = new $name(); - - foreach ($values as $property => $value) { - if (!isset(self::$annotationMetadata[$name]['properties'][$property])) { - if ('value' !== $property) { - throw AnnotationException::creationError(sprintf('The annotation @%s declared on %s does not have a property named "%s". Available properties: %s', $originalName, $this->context, $property, implode(', ', self::$annotationMetadata[$name]['properties']))); - } - - // handle the case if the property has no annotations - if ( ! $property = self::$annotationMetadata[$name]['default_property']) { - throw AnnotationException::creationError(sprintf('The annotation @%s declared on %s does not accept any values, but got %s.', $originalName, $this->context, json_encode($values))); - } - } - - $instance->{$property} = $value; - } - - return $instance; - } - - /** - * MethodCall ::= ["(" [Values] ")"] - * - * @return array - */ - private function MethodCall() - { - $values = array(); - - if ( ! $this->lexer->isNextToken(DocLexer::T_OPEN_PARENTHESIS)) { - return $values; - } - - $this->match(DocLexer::T_OPEN_PARENTHESIS); - - if ( ! $this->lexer->isNextToken(DocLexer::T_CLOSE_PARENTHESIS)) { - $values = $this->Values(); - } - - $this->match(DocLexer::T_CLOSE_PARENTHESIS); - - return $values; - } - - /** - * Values ::= Array | Value {"," Value}* [","] - * - * @return array - */ - private function Values() - { - $values = array($this->Value()); - - while ($this->lexer->isNextToken(DocLexer::T_COMMA)) { - $this->match(DocLexer::T_COMMA); - - if ($this->lexer->isNextToken(DocLexer::T_CLOSE_PARENTHESIS)) { - break; - } - - $token = $this->lexer->lookahead; - $value = $this->Value(); - - if ( ! is_object($value) && ! is_array($value)) { - $this->syntaxError('Value', $token); - } - - $values[] = $value; - } - - foreach ($values as $k => $value) { - if (is_object($value) && $value instanceof \stdClass) { - $values[$value->name] = $value->value; - } else if ( ! isset($values['value'])){ - $values['value'] = $value; - } else { - if ( ! is_array($values['value'])) { - $values['value'] = array($values['value']); - } - - $values['value'][] = $value; - } - - unset($values[$k]); - } - - return $values; - } - - /** - * Constant ::= integer | string | float | boolean - * - * @return mixed - * - * @throws AnnotationException - */ - private function Constant() - { - $identifier = $this->Identifier(); - - if ( ! defined($identifier) && false !== strpos($identifier, '::') && '\\' !== $identifier[0]) { - list($className, $const) = explode('::', $identifier); - - $alias = (false === $pos = strpos($className, '\\')) ? $className : substr($className, 0, $pos); - $found = false; - - switch (true) { - case !empty ($this->namespaces): - foreach ($this->namespaces as $ns) { - if (class_exists($ns.'\\'.$className) || interface_exists($ns.'\\'.$className)) { - $className = $ns.'\\'.$className; - $found = true; - break; - } - } - break; - - case isset($this->imports[$loweredAlias = strtolower($alias)]): - $found = true; - $className = (false !== $pos) - ? $this->imports[$loweredAlias] . substr($className, $pos) - : $this->imports[$loweredAlias]; - break; - - default: - if(isset($this->imports['__NAMESPACE__'])) { - $ns = $this->imports['__NAMESPACE__']; - - if (class_exists($ns.'\\'.$className) || interface_exists($ns.'\\'.$className)) { - $className = $ns.'\\'.$className; - $found = true; - } - } - break; - } - - if ($found) { - $identifier = $className . '::' . $const; - } - } - - // checks if identifier ends with ::class, \strlen('::class') === 7 - $classPos = stripos($identifier, '::class'); - if ($classPos === strlen($identifier) - 7) { - return substr($identifier, 0, $classPos); - } - - if (!defined($identifier)) { - throw AnnotationException::semanticalErrorConstants($identifier, $this->context); - } - - return constant($identifier); - } - - /** - * Identifier ::= string - * - * @return string - */ - private function Identifier() - { - // check if we have an annotation - if ( ! $this->lexer->isNextTokenAny(self::$classIdentifiers)) { - $this->syntaxError('namespace separator or identifier'); - } - - $this->lexer->moveNext(); - - $className = $this->lexer->token['value']; - - while ($this->lexer->lookahead['position'] === ($this->lexer->token['position'] + strlen($this->lexer->token['value'])) - && $this->lexer->isNextToken(DocLexer::T_NAMESPACE_SEPARATOR)) { - - $this->match(DocLexer::T_NAMESPACE_SEPARATOR); - $this->matchAny(self::$classIdentifiers); - - $className .= '\\' . $this->lexer->token['value']; - } - - return $className; - } - - /** - * Value ::= PlainValue | FieldAssignment - * - * @return mixed - */ - private function Value() - { - $peek = $this->lexer->glimpse(); - - if (DocLexer::T_EQUALS === $peek['type']) { - return $this->FieldAssignment(); - } - - return $this->PlainValue(); - } - - /** - * PlainValue ::= integer | string | float | boolean | Array | Annotation - * - * @return mixed - */ - private function PlainValue() - { - if ($this->lexer->isNextToken(DocLexer::T_OPEN_CURLY_BRACES)) { - return $this->Arrayx(); - } - - if ($this->lexer->isNextToken(DocLexer::T_AT)) { - return $this->Annotation(); - } - - if ($this->lexer->isNextToken(DocLexer::T_IDENTIFIER)) { - return $this->Constant(); - } - - switch ($this->lexer->lookahead['type']) { - case DocLexer::T_STRING: - $this->match(DocLexer::T_STRING); - return $this->lexer->token['value']; - - case DocLexer::T_INTEGER: - $this->match(DocLexer::T_INTEGER); - return (int)$this->lexer->token['value']; - - case DocLexer::T_FLOAT: - $this->match(DocLexer::T_FLOAT); - return (float)$this->lexer->token['value']; - - case DocLexer::T_TRUE: - $this->match(DocLexer::T_TRUE); - return true; - - case DocLexer::T_FALSE: - $this->match(DocLexer::T_FALSE); - return false; - - case DocLexer::T_NULL: - $this->match(DocLexer::T_NULL); - return null; - - default: - $this->syntaxError('PlainValue'); - } - } - - /** - * FieldAssignment ::= FieldName "=" PlainValue - * FieldName ::= identifier - * - * @return array - */ - private function FieldAssignment() - { - $this->match(DocLexer::T_IDENTIFIER); - $fieldName = $this->lexer->token['value']; - - $this->match(DocLexer::T_EQUALS); - - $item = new \stdClass(); - $item->name = $fieldName; - $item->value = $this->PlainValue(); - - return $item; - } - - /** - * Array ::= "{" ArrayEntry {"," ArrayEntry}* [","] "}" - * - * @return array - */ - private function Arrayx() - { - $array = $values = array(); - - $this->match(DocLexer::T_OPEN_CURLY_BRACES); - - // If the array is empty, stop parsing and return. - if ($this->lexer->isNextToken(DocLexer::T_CLOSE_CURLY_BRACES)) { - $this->match(DocLexer::T_CLOSE_CURLY_BRACES); - - return $array; - } - - $values[] = $this->ArrayEntry(); - - while ($this->lexer->isNextToken(DocLexer::T_COMMA)) { - $this->match(DocLexer::T_COMMA); - - // optional trailing comma - if ($this->lexer->isNextToken(DocLexer::T_CLOSE_CURLY_BRACES)) { - break; - } - - $values[] = $this->ArrayEntry(); - } - - $this->match(DocLexer::T_CLOSE_CURLY_BRACES); - - foreach ($values as $value) { - list ($key, $val) = $value; - - if ($key !== null) { - $array[$key] = $val; - } else { - $array[] = $val; - } - } - - return $array; - } - - /** - * ArrayEntry ::= Value | KeyValuePair - * KeyValuePair ::= Key ("=" | ":") PlainValue | Constant - * Key ::= string | integer | Constant - * - * @return array - */ - private function ArrayEntry() - { - $peek = $this->lexer->glimpse(); - - if (DocLexer::T_EQUALS === $peek['type'] - || DocLexer::T_COLON === $peek['type']) { - - if ($this->lexer->isNextToken(DocLexer::T_IDENTIFIER)) { - $key = $this->Constant(); - } else { - $this->matchAny(array(DocLexer::T_INTEGER, DocLexer::T_STRING)); - $key = $this->lexer->token['value']; - } - - $this->matchAny(array(DocLexer::T_EQUALS, DocLexer::T_COLON)); - - return array($key, $this->PlainValue()); - } - - return array(null, $this->Value()); - } -} diff --git a/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/FileCacheReader.php b/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/FileCacheReader.php deleted file mode 100644 index e9b29af..0000000 --- a/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/FileCacheReader.php +++ /dev/null @@ -1,252 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations; - -/** - * File cache reader for annotations. - * - * @author Johannes M. Schmitt - * @author Benjamin Eberlei - */ -class FileCacheReader implements Reader -{ - /** - * @var Reader - */ - private $reader; - - /** - * @var string - */ - private $dir; - - /** - * @var bool - */ - private $debug; - - /** - * @var array - */ - private $loadedAnnotations = array(); - - /** - * @var array - */ - private $classNameHashes = array(); - - /** - * Constructor. - * - * @param Reader $reader - * @param string $cacheDir - * @param boolean $debug - * - * @throws \InvalidArgumentException - */ - public function __construct(Reader $reader, $cacheDir, $debug = false) - { - $this->reader = $reader; - if (!is_dir($cacheDir) && !@mkdir($cacheDir, 0777, true)) { - throw new \InvalidArgumentException(sprintf('The directory "%s" does not exist and could not be created.', $cacheDir)); - } - - $this->dir = rtrim($cacheDir, '\\/'); - $this->debug = $debug; - } - - /** - * {@inheritDoc} - */ - public function getClassAnnotations(\ReflectionClass $class) - { - if ( ! isset($this->classNameHashes[$class->name])) { - $this->classNameHashes[$class->name] = sha1($class->name); - } - $key = $this->classNameHashes[$class->name]; - - if (isset($this->loadedAnnotations[$key])) { - return $this->loadedAnnotations[$key]; - } - - $path = $this->dir.'/'.strtr($key, '\\', '-').'.cache.php'; - if (!is_file($path)) { - $annot = $this->reader->getClassAnnotations($class); - $this->saveCacheFile($path, $annot); - return $this->loadedAnnotations[$key] = $annot; - } - - if ($this->debug - && (false !== $filename = $class->getFilename()) - && filemtime($path) < filemtime($filename)) { - @unlink($path); - - $annot = $this->reader->getClassAnnotations($class); - $this->saveCacheFile($path, $annot); - return $this->loadedAnnotations[$key] = $annot; - } - - return $this->loadedAnnotations[$key] = include $path; - } - - /** - * {@inheritDoc} - */ - public function getPropertyAnnotations(\ReflectionProperty $property) - { - $class = $property->getDeclaringClass(); - if ( ! isset($this->classNameHashes[$class->name])) { - $this->classNameHashes[$class->name] = sha1($class->name); - } - $key = $this->classNameHashes[$class->name].'$'.$property->getName(); - - if (isset($this->loadedAnnotations[$key])) { - return $this->loadedAnnotations[$key]; - } - - $path = $this->dir.'/'.strtr($key, '\\', '-').'.cache.php'; - if (!is_file($path)) { - $annot = $this->reader->getPropertyAnnotations($property); - $this->saveCacheFile($path, $annot); - return $this->loadedAnnotations[$key] = $annot; - } - - if ($this->debug - && (false !== $filename = $class->getFilename()) - && filemtime($path) < filemtime($filename)) { - @unlink($path); - - $annot = $this->reader->getPropertyAnnotations($property); - $this->saveCacheFile($path, $annot); - return $this->loadedAnnotations[$key] = $annot; - } - - return $this->loadedAnnotations[$key] = include $path; - } - - /** - * {@inheritDoc} - */ - public function getMethodAnnotations(\ReflectionMethod $method) - { - $class = $method->getDeclaringClass(); - if ( ! isset($this->classNameHashes[$class->name])) { - $this->classNameHashes[$class->name] = sha1($class->name); - } - $key = $this->classNameHashes[$class->name].'#'.$method->getName(); - - if (isset($this->loadedAnnotations[$key])) { - return $this->loadedAnnotations[$key]; - } - - $path = $this->dir.'/'.strtr($key, '\\', '-').'.cache.php'; - if (!is_file($path)) { - $annot = $this->reader->getMethodAnnotations($method); - $this->saveCacheFile($path, $annot); - return $this->loadedAnnotations[$key] = $annot; - } - - if ($this->debug - && (false !== $filename = $class->getFilename()) - && filemtime($path) < filemtime($filename)) { - @unlink($path); - - $annot = $this->reader->getMethodAnnotations($method); - $this->saveCacheFile($path, $annot); - return $this->loadedAnnotations[$key] = $annot; - } - - return $this->loadedAnnotations[$key] = include $path; - } - - /** - * Saves the cache file. - * - * @param string $path - * @param mixed $data - * - * @return void - */ - private function saveCacheFile($path, $data) - { - if (!is_writable($this->dir)) { - throw new \InvalidArgumentException(sprintf('The directory "%s" is not writable. Both, the webserver and the console user need access. You can manage access rights for multiple users with "chmod +a". If your system does not support this, check out the acl package.', $this->dir)); - } - file_put_contents($path, 'getClassAnnotations($class); - - foreach ($annotations as $annotation) { - if ($annotation instanceof $annotationName) { - return $annotation; - } - } - - return null; - } - - /** - * {@inheritDoc} - */ - public function getMethodAnnotation(\ReflectionMethod $method, $annotationName) - { - $annotations = $this->getMethodAnnotations($method); - - foreach ($annotations as $annotation) { - if ($annotation instanceof $annotationName) { - return $annotation; - } - } - - return null; - } - - /** - * {@inheritDoc} - */ - public function getPropertyAnnotation(\ReflectionProperty $property, $annotationName) - { - $annotations = $this->getPropertyAnnotations($property); - - foreach ($annotations as $annotation) { - if ($annotation instanceof $annotationName) { - return $annotation; - } - } - - return null; - } - - /** - * Clears loaded annotations. - * - * @return void - */ - public function clearLoadedAnnotations() - { - $this->loadedAnnotations = array(); - } -} diff --git a/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/IndexedReader.php b/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/IndexedReader.php deleted file mode 100644 index bf7fbdc..0000000 --- a/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/IndexedReader.php +++ /dev/null @@ -1,119 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations; - -/** - * Allows the reader to be used in-place of Doctrine's reader. - * - * @author Johannes M. Schmitt - */ -class IndexedReader implements Reader -{ - /** - * @var Reader - */ - private $delegate; - - /** - * Constructor. - * - * @param Reader $reader - */ - public function __construct(Reader $reader) - { - $this->delegate = $reader; - } - - /** - * {@inheritDoc} - */ - public function getClassAnnotations(\ReflectionClass $class) - { - $annotations = array(); - foreach ($this->delegate->getClassAnnotations($class) as $annot) { - $annotations[get_class($annot)] = $annot; - } - - return $annotations; - } - - /** - * {@inheritDoc} - */ - public function getClassAnnotation(\ReflectionClass $class, $annotation) - { - return $this->delegate->getClassAnnotation($class, $annotation); - } - - /** - * {@inheritDoc} - */ - public function getMethodAnnotations(\ReflectionMethod $method) - { - $annotations = array(); - foreach ($this->delegate->getMethodAnnotations($method) as $annot) { - $annotations[get_class($annot)] = $annot; - } - - return $annotations; - } - - /** - * {@inheritDoc} - */ - public function getMethodAnnotation(\ReflectionMethod $method, $annotation) - { - return $this->delegate->getMethodAnnotation($method, $annotation); - } - - /** - * {@inheritDoc} - */ - public function getPropertyAnnotations(\ReflectionProperty $property) - { - $annotations = array(); - foreach ($this->delegate->getPropertyAnnotations($property) as $annot) { - $annotations[get_class($annot)] = $annot; - } - - return $annotations; - } - - /** - * {@inheritDoc} - */ - public function getPropertyAnnotation(\ReflectionProperty $property, $annotation) - { - return $this->delegate->getPropertyAnnotation($property, $annotation); - } - - /** - * Proxies all methods to the delegate. - * - * @param string $method - * @param array $args - * - * @return mixed - */ - public function __call($method, $args) - { - return call_user_func_array(array($this->delegate, $method), $args); - } -} diff --git a/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/PhpParser.php b/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/PhpParser.php deleted file mode 100644 index 21ee7cc..0000000 --- a/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/PhpParser.php +++ /dev/null @@ -1,91 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations; - -use SplFileObject; - -/** - * Parses a file for namespaces/use/class declarations. - * - * @author Fabien Potencier - * @author Christian Kaps - */ -final class PhpParser -{ - /** - * Parses a class. - * - * @param \ReflectionClass $class A ReflectionClass object. - * - * @return array A list with use statements in the form (Alias => FQN). - */ - public function parseClass(\ReflectionClass $class) - { - if (method_exists($class, 'getUseStatements')) { - return $class->getUseStatements(); - } - - if (false === $filename = $class->getFilename()) { - return array(); - } - - $content = $this->getFileContent($filename, $class->getStartLine()); - - if (null === $content) { - return array(); - } - - $namespace = preg_quote($class->getNamespaceName()); - $content = preg_replace('/^.*?(\bnamespace\s+' . $namespace . '\s*[;{].*)$/s', '\\1', $content); - $tokenizer = new TokenParser('parseUseStatements($class->getNamespaceName()); - - return $statements; - } - - /** - * Gets the content of the file right up to the given line number. - * - * @param string $filename The name of the file to load. - * @param integer $lineNumber The number of lines to read from file. - * - * @return string The content of the file. - */ - private function getFileContent($filename, $lineNumber) - { - if ( ! is_file($filename)) { - return null; - } - - $content = ''; - $lineCnt = 0; - $file = new SplFileObject($filename); - while (!$file->eof()) { - if ($lineCnt++ == $lineNumber) { - break; - } - - $content .= $file->fgets(); - } - - return $content; - } -} diff --git a/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Reader.php b/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Reader.php deleted file mode 100644 index 4774f87..0000000 --- a/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Reader.php +++ /dev/null @@ -1,89 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations; - -/** - * Interface for annotation readers. - * - * @author Johannes M. Schmitt - */ -interface Reader -{ - /** - * Gets the annotations applied to a class. - * - * @param \ReflectionClass $class The ReflectionClass of the class from which - * the class annotations should be read. - * - * @return array An array of Annotations. - */ - function getClassAnnotations(\ReflectionClass $class); - - /** - * Gets a class annotation. - * - * @param \ReflectionClass $class The ReflectionClass of the class from which - * the class annotations should be read. - * @param string $annotationName The name of the annotation. - * - * @return object|null The Annotation or NULL, if the requested annotation does not exist. - */ - function getClassAnnotation(\ReflectionClass $class, $annotationName); - - /** - * Gets the annotations applied to a method. - * - * @param \ReflectionMethod $method The ReflectionMethod of the method from which - * the annotations should be read. - * - * @return array An array of Annotations. - */ - function getMethodAnnotations(\ReflectionMethod $method); - - /** - * Gets a method annotation. - * - * @param \ReflectionMethod $method The ReflectionMethod to read the annotations from. - * @param string $annotationName The name of the annotation. - * - * @return object|null The Annotation or NULL, if the requested annotation does not exist. - */ - function getMethodAnnotation(\ReflectionMethod $method, $annotationName); - - /** - * Gets the annotations applied to a property. - * - * @param \ReflectionProperty $property The ReflectionProperty of the property - * from which the annotations should be read. - * - * @return array An array of Annotations. - */ - function getPropertyAnnotations(\ReflectionProperty $property); - - /** - * Gets a property annotation. - * - * @param \ReflectionProperty $property The ReflectionProperty to read the annotations from. - * @param string $annotationName The name of the annotation. - * - * @return object|null The Annotation or NULL, if the requested annotation does not exist. - */ - function getPropertyAnnotation(\ReflectionProperty $property, $annotationName); -} diff --git a/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/SimpleAnnotationReader.php b/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/SimpleAnnotationReader.php deleted file mode 100644 index d4757ee..0000000 --- a/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/SimpleAnnotationReader.php +++ /dev/null @@ -1,127 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations; - -/** - * Simple Annotation Reader. - * - * This annotation reader is intended to be used in projects where you have - * full-control over all annotations that are available. - * - * @since 2.2 - * @author Johannes M. Schmitt - * @author Fabio B. Silva - */ -class SimpleAnnotationReader implements Reader -{ - /** - * @var DocParser - */ - private $parser; - - /** - * Constructor. - * - * Initializes a new SimpleAnnotationReader. - */ - public function __construct() - { - $this->parser = new DocParser(); - $this->parser->setIgnoreNotImportedAnnotations(true); - } - - /** - * Adds a namespace in which we will look for annotations. - * - * @param string $namespace - * - * @return void - */ - public function addNamespace($namespace) - { - $this->parser->addNamespace($namespace); - } - - /** - * {@inheritDoc} - */ - public function getClassAnnotations(\ReflectionClass $class) - { - return $this->parser->parse($class->getDocComment(), 'class '.$class->getName()); - } - - /** - * {@inheritDoc} - */ - public function getMethodAnnotations(\ReflectionMethod $method) - { - return $this->parser->parse($method->getDocComment(), 'method '.$method->getDeclaringClass()->name.'::'.$method->getName().'()'); - } - - /** - * {@inheritDoc} - */ - public function getPropertyAnnotations(\ReflectionProperty $property) - { - return $this->parser->parse($property->getDocComment(), 'property '.$property->getDeclaringClass()->name.'::$'.$property->getName()); - } - - /** - * {@inheritDoc} - */ - public function getClassAnnotation(\ReflectionClass $class, $annotationName) - { - foreach ($this->getClassAnnotations($class) as $annot) { - if ($annot instanceof $annotationName) { - return $annot; - } - } - - return null; - } - - /** - * {@inheritDoc} - */ - public function getMethodAnnotation(\ReflectionMethod $method, $annotationName) - { - foreach ($this->getMethodAnnotations($method) as $annot) { - if ($annot instanceof $annotationName) { - return $annot; - } - } - - return null; - } - - /** - * {@inheritDoc} - */ - public function getPropertyAnnotation(\ReflectionProperty $property, $annotationName) - { - foreach ($this->getPropertyAnnotations($property) as $annot) { - if ($annot instanceof $annotationName) { - return $annot; - } - } - - return null; - } -} diff --git a/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/TokenParser.php b/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/TokenParser.php deleted file mode 100644 index 9bdccce..0000000 --- a/core/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/TokenParser.php +++ /dev/null @@ -1,187 +0,0 @@ -. - */ - -namespace Doctrine\Common\Annotations; - -/** - * Parses a file for namespaces/use/class declarations. - * - * @author Fabien Potencier - * @author Christian Kaps - */ -class TokenParser -{ - /** - * The token list. - * - * @var array - */ - private $tokens; - - /** - * The number of tokens. - * - * @var int - */ - private $numTokens; - - /** - * The current array pointer. - * - * @var int - */ - private $pointer = 0; - - /** - * @param string $contents - */ - public function __construct($contents) - { - $this->tokens = token_get_all($contents); - - // The PHP parser sets internal compiler globals for certain things. Annoyingly, the last docblock comment it - // saw gets stored in doc_comment. When it comes to compile the next thing to be include()d this stored - // doc_comment becomes owned by the first thing the compiler sees in the file that it considers might have a - // docblock. If the first thing in the file is a class without a doc block this would cause calls to - // getDocBlock() on said class to return our long lost doc_comment. Argh. - // To workaround, cause the parser to parse an empty docblock. Sure getDocBlock() will return this, but at least - // it's harmless to us. - token_get_all("numTokens = count($this->tokens); - } - - /** - * Gets the next non whitespace and non comment token. - * - * @param boolean $docCommentIsComment If TRUE then a doc comment is considered a comment and skipped. - * If FALSE then only whitespace and normal comments are skipped. - * - * @return array|null The token if exists, null otherwise. - */ - public function next($docCommentIsComment = TRUE) - { - for ($i = $this->pointer; $i < $this->numTokens; $i++) { - $this->pointer++; - if ($this->tokens[$i][0] === T_WHITESPACE || - $this->tokens[$i][0] === T_COMMENT || - ($docCommentIsComment && $this->tokens[$i][0] === T_DOC_COMMENT)) { - - continue; - } - - return $this->tokens[$i]; - } - - return null; - } - - /** - * Parses a single use statement. - * - * @return array A list with all found class names for a use statement. - */ - public function parseUseStatement() - { - $class = ''; - $alias = ''; - $statements = array(); - $explicitAlias = false; - while (($token = $this->next())) { - $isNameToken = $token[0] === T_STRING || $token[0] === T_NS_SEPARATOR; - if (!$explicitAlias && $isNameToken) { - $class .= $token[1]; - $alias = $token[1]; - } else if ($explicitAlias && $isNameToken) { - $alias .= $token[1]; - } else if ($token[0] === T_AS) { - $explicitAlias = true; - $alias = ''; - } else if ($token === ',') { - $statements[strtolower($alias)] = $class; - $class = ''; - $alias = ''; - $explicitAlias = false; - } else if ($token === ';') { - $statements[strtolower($alias)] = $class; - break; - } else { - break; - } - } - - return $statements; - } - - /** - * Gets all use statements. - * - * @param string $namespaceName The namespace name of the reflected class. - * - * @return array A list with all found use statements. - */ - public function parseUseStatements($namespaceName) - { - $statements = array(); - while (($token = $this->next())) { - if ($token[0] === T_USE) { - $statements = array_merge($statements, $this->parseUseStatement()); - continue; - } - if ($token[0] !== T_NAMESPACE || $this->parseNamespace() != $namespaceName) { - continue; - } - - // Get fresh array for new namespace. This is to prevent the parser to collect the use statements - // for a previous namespace with the same name. This is the case if a namespace is defined twice - // or if a namespace with the same name is commented out. - $statements = array(); - } - - return $statements; - } - - /** - * Gets the namespace. - * - * @return string The found namespace. - */ - public function parseNamespace() - { - $name = ''; - while (($token = $this->next()) && ($token[0] === T_STRING || $token[0] === T_NS_SEPARATOR)) { - $name .= $token[1]; - } - - return $name; - } - - /** - * Gets the class name. - * - * @return string The found class name. - */ - public function parseClass() - { - // Namespaces and class names are tokenized the same: T_STRINGs - // separated by T_NS_SEPARATOR so we can use one function to provide - // both. - return $this->parseNamespace(); - } -} diff --git a/core/vendor/doctrine/annotations/phpunit.xml.dist b/core/vendor/doctrine/annotations/phpunit.xml.dist deleted file mode 100644 index 6ab0c8c..0000000 --- a/core/vendor/doctrine/annotations/phpunit.xml.dist +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - ./tests/Doctrine/ - - - - - - ./lib/Doctrine/ - - - - - - performance - - - diff --git a/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/AbstractReaderTest.php b/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/AbstractReaderTest.php deleted file mode 100644 index dd324bd..0000000 --- a/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/AbstractReaderTest.php +++ /dev/null @@ -1,645 +0,0 @@ -getReflectionClass(); - $reader = $this->getReader(); - - $this->assertEquals(1, count($reader->getClassAnnotations($class))); - $this->assertInstanceOf($annotName = 'Doctrine\Tests\Common\Annotations\DummyAnnotation', $annot = $reader->getClassAnnotation($class, $annotName)); - $this->assertEquals("hello", $annot->dummyValue); - - $field1Prop = $class->getProperty('field1'); - $propAnnots = $reader->getPropertyAnnotations($field1Prop); - $this->assertEquals(1, count($propAnnots)); - $this->assertInstanceOf($annotName, $annot = $reader->getPropertyAnnotation($field1Prop, $annotName)); - $this->assertEquals("fieldHello", $annot->dummyValue); - - $getField1Method = $class->getMethod('getField1'); - $methodAnnots = $reader->getMethodAnnotations($getField1Method); - $this->assertEquals(1, count($methodAnnots)); - $this->assertInstanceOf($annotName, $annot = $reader->getMethodAnnotation($getField1Method, $annotName)); - $this->assertEquals(array(1, 2, "three"), $annot->value); - - $field2Prop = $class->getProperty('field2'); - $propAnnots = $reader->getPropertyAnnotations($field2Prop); - $this->assertEquals(1, count($propAnnots)); - $this->assertInstanceOf($annotName = 'Doctrine\Tests\Common\Annotations\DummyJoinTable', $joinTableAnnot = $reader->getPropertyAnnotation($field2Prop, $annotName)); - $this->assertEquals(1, count($joinTableAnnot->joinColumns)); - $this->assertEquals(1, count($joinTableAnnot->inverseJoinColumns)); - $this->assertTrue($joinTableAnnot->joinColumns[0] instanceof DummyJoinColumn); - $this->assertTrue($joinTableAnnot->inverseJoinColumns[0] instanceof DummyJoinColumn); - $this->assertEquals('col1', $joinTableAnnot->joinColumns[0]->name); - $this->assertEquals('col2', $joinTableAnnot->joinColumns[0]->referencedColumnName); - $this->assertEquals('col3', $joinTableAnnot->inverseJoinColumns[0]->name); - $this->assertEquals('col4', $joinTableAnnot->inverseJoinColumns[0]->referencedColumnName); - - $dummyAnnot = $reader->getMethodAnnotation($class->getMethod('getField1'), 'Doctrine\Tests\Common\Annotations\DummyAnnotation'); - $this->assertEquals('', $dummyAnnot->dummyValue); - $this->assertEquals(array(1, 2, 'three'), $dummyAnnot->value); - - $dummyAnnot = $reader->getPropertyAnnotation($class->getProperty('field1'), 'Doctrine\Tests\Common\Annotations\DummyAnnotation'); - $this->assertEquals('fieldHello', $dummyAnnot->dummyValue); - - $classAnnot = $reader->getClassAnnotation($class, 'Doctrine\Tests\Common\Annotations\DummyAnnotation'); - $this->assertEquals('hello', $classAnnot->dummyValue); - } - - public function testAnnotationsWithValidTargets() - { - $reader = $this->getReader(); - $class = new ReflectionClass('Doctrine\Tests\Common\Annotations\Fixtures\ClassWithValidAnnotationTarget'); - - $this->assertEquals(1,count($reader->getClassAnnotations($class))); - $this->assertEquals(1,count($reader->getPropertyAnnotations($class->getProperty('foo')))); - $this->assertEquals(1,count($reader->getMethodAnnotations($class->getMethod('someFunction')))); - $this->assertEquals(1,count($reader->getPropertyAnnotations($class->getProperty('nested')))); - } - - public function testAnnotationsWithVarType() - { - $reader = $this->getReader(); - $class = new ReflectionClass('Doctrine\Tests\Common\Annotations\Fixtures\ClassWithAnnotationWithVarType'); - - $this->assertEquals(1,count($fooAnnot = $reader->getPropertyAnnotations($class->getProperty('foo')))); - $this->assertEquals(1,count($barAnnot = $reader->getMethodAnnotations($class->getMethod('bar')))); - - $this->assertInternalType('string', $fooAnnot[0]->string); - $this->assertInstanceOf('Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll', $barAnnot[0]->annotation); - } - - public function testAtInDescription() - { - $reader = $this->getReader(); - $class = new ReflectionClass('Doctrine\Tests\Common\Annotations\Fixtures\ClassWithAtInDescriptionAndAnnotation'); - - $this->assertEquals(1, count($fooAnnot = $reader->getPropertyAnnotations($class->getProperty('foo')))); - $this->assertEquals(1, count($barAnnot = $reader->getPropertyAnnotations($class->getProperty('bar')))); - - $this->assertInstanceOf('Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetPropertyMethod', $fooAnnot[0]); - $this->assertInstanceOf('Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetPropertyMethod', $barAnnot[0]); - } - - public function testClassWithWithDanglingComma() - { - $reader = $this->getReader(); - $annots = $reader->getClassAnnotations(new \ReflectionClass('Doctrine\Tests\Common\Annotations\DummyClassWithDanglingComma')); - - $this->assertCount(1, $annots); - } - - /** - * @expectedException \Doctrine\Common\Annotations\AnnotationException - * @expectedExceptionMessage [Semantical Error] Annotation @AnnotationTargetPropertyMethod is not allowed to be declared on class Doctrine\Tests\Common\Annotations\Fixtures\ClassWithInvalidAnnotationTargetAtClass. You may only use this annotation on these code elements: METHOD, PROPERTY - */ - public function testClassWithInvalidAnnotationTargetAtClassDocBlock() - { - $reader = $this->getReader(); - $reader->getClassAnnotations(new \ReflectionClass('Doctrine\Tests\Common\Annotations\Fixtures\ClassWithInvalidAnnotationTargetAtClass')); - } - - public function testClassWithWithInclude() - { - $reader = $this->getReader(); - $annots = $reader->getClassAnnotations(new \ReflectionClass('Doctrine\Tests\Common\Annotations\Fixtures\ClassWithRequire')); - $this->assertCount(1, $annots); - } - - /** - * @expectedException \Doctrine\Common\Annotations\AnnotationException - * @expectedExceptionMessage [Semantical Error] Annotation @AnnotationTargetClass is not allowed to be declared on property Doctrine\Tests\Common\Annotations\Fixtures\ClassWithInvalidAnnotationTargetAtProperty::$foo. You may only use this annotation on these code elements: CLASS - */ - public function testClassWithInvalidAnnotationTargetAtPropertyDocBlock() - { - $reader = $this->getReader(); - $reader->getPropertyAnnotations(new \ReflectionProperty('Doctrine\Tests\Common\Annotations\Fixtures\ClassWithInvalidAnnotationTargetAtProperty', 'foo')); - } - - /** - * @expectedException \Doctrine\Common\Annotations\AnnotationException - * @expectedExceptionMessage [Semantical Error] Annotation @AnnotationTargetAnnotation is not allowed to be declared on property Doctrine\Tests\Common\Annotations\Fixtures\ClassWithInvalidAnnotationTargetAtProperty::$bar. You may only use this annotation on these code elements: ANNOTATION - */ - public function testClassWithInvalidNestedAnnotationTargetAtPropertyDocBlock() - { - $reader = $this->getReader(); - $reader->getPropertyAnnotations(new \ReflectionProperty('Doctrine\Tests\Common\Annotations\Fixtures\ClassWithInvalidAnnotationTargetAtProperty', 'bar')); - } - - /** - * @expectedException \Doctrine\Common\Annotations\AnnotationException - * @expectedExceptionMessage [Semantical Error] Annotation @AnnotationTargetClass is not allowed to be declared on method Doctrine\Tests\Common\Annotations\Fixtures\ClassWithInvalidAnnotationTargetAtMethod::functionName(). You may only use this annotation on these code elements: CLASS - */ - public function testClassWithInvalidAnnotationTargetAtMethodDocBlock() - { - $reader = $this->getReader(); - $reader->getMethodAnnotations(new \ReflectionMethod('Doctrine\Tests\Common\Annotations\Fixtures\ClassWithInvalidAnnotationTargetAtMethod', 'functionName')); - } - - /** - * @expectedException \Doctrine\Common\Annotations\AnnotationException - * @expectedExceptionMessage Expected namespace separator or identifier, got ')' at position 24 in class @Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithTargetSyntaxError. - */ - public function testClassWithAnnotationWithTargetSyntaxErrorAtClassDocBlock() - { - $reader = $this->getReader(); - $reader->getClassAnnotations(new \ReflectionClass('Doctrine\Tests\Common\Annotations\Fixtures\ClassWithAnnotationWithTargetSyntaxError')); - } - - /** - * @expectedException \Doctrine\Common\Annotations\AnnotationException - * @expectedExceptionMessage Expected namespace separator or identifier, got ')' at position 24 in class @Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithTargetSyntaxError. - */ - public function testClassWithAnnotationWithTargetSyntaxErrorAtPropertyDocBlock() - { - $reader = $this->getReader(); - $reader->getPropertyAnnotations(new \ReflectionProperty('Doctrine\Tests\Common\Annotations\Fixtures\ClassWithAnnotationWithTargetSyntaxError','foo')); - } - - /** - * @expectedException \Doctrine\Common\Annotations\AnnotationException - * @expectedExceptionMessage Expected namespace separator or identifier, got ')' at position 24 in class @Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithTargetSyntaxError. - */ - public function testClassWithAnnotationWithTargetSyntaxErrorAtMethodDocBlock() - { - $reader = $this->getReader(); - $reader->getMethodAnnotations(new \ReflectionMethod('Doctrine\Tests\Common\Annotations\Fixtures\ClassWithAnnotationWithTargetSyntaxError','bar')); - } - - /** - * @expectedException \Doctrine\Common\Annotations\AnnotationException - * @expectedExceptionMessage [Type Error] Attribute "string" of @AnnotationWithVarType declared on property Doctrine\Tests\Common\Annotations\Fixtures\ClassWithAnnotationWithVarType::$invalidProperty expects a(n) string, but got integer. - */ - public function testClassWithPropertyInvalidVarTypeError() - { - $reader = $this->getReader(); - $class = new ReflectionClass('Doctrine\Tests\Common\Annotations\Fixtures\ClassWithAnnotationWithVarType'); - - $reader->getPropertyAnnotations($class->getProperty('invalidProperty')); - } - - /** - * @expectedException \Doctrine\Common\Annotations\AnnotationException - * @expectedExceptionMessage [Type Error] Attribute "annotation" of @AnnotationWithVarType declared on method Doctrine\Tests\Common\Annotations\Fixtures\ClassWithAnnotationWithVarType::invalidMethod() expects a(n) Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll, but got an instance of Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAnnotation. - */ - public function testClassWithMethodInvalidVarTypeError() - { - $reader = $this->getReader(); - $class = new ReflectionClass('Doctrine\Tests\Common\Annotations\Fixtures\ClassWithAnnotationWithVarType'); - - $reader->getMethodAnnotations($class->getMethod('invalidMethod')); - } - - /** - * @expectedException \Doctrine\Common\Annotations\AnnotationException - * @expectedExceptionMessage Expected namespace separator or identifier, got ')' at position 18 in class Doctrine\Tests\Common\Annotations\DummyClassSyntaxError. - */ - public function testClassSyntaxErrorContext() - { - $reader = $this->getReader(); - $reader->getClassAnnotations(new \ReflectionClass('Doctrine\Tests\Common\Annotations\DummyClassSyntaxError')); - } - - /** - * @expectedException \Doctrine\Common\Annotations\AnnotationException - * @expectedExceptionMessage Expected namespace separator or identifier, got ')' at position 18 in method Doctrine\Tests\Common\Annotations\DummyClassMethodSyntaxError::foo(). - */ - public function testMethodSyntaxErrorContext() - { - $reader = $this->getReader(); - $reader->getMethodAnnotations(new \ReflectionMethod('Doctrine\Tests\Common\Annotations\DummyClassMethodSyntaxError', 'foo')); - } - - /** - * @expectedException \Doctrine\Common\Annotations\AnnotationException - * @expectedExceptionMessage Expected namespace separator or identifier, got ')' at position 18 in property Doctrine\Tests\Common\Annotations\DummyClassPropertySyntaxError::$foo. - */ - public function testPropertySyntaxErrorContext() - { - $reader = $this->getReader(); - $reader->getPropertyAnnotations(new \ReflectionProperty('Doctrine\Tests\Common\Annotations\DummyClassPropertySyntaxError', 'foo')); - } - - /** - * @group regression - */ - public function testMultipleAnnotationsOnSameLine() - { - $reader = $this->getReader(); - $annots = $reader->getPropertyAnnotations(new \ReflectionProperty('Doctrine\Tests\Common\Annotations\DummyClass2', 'id')); - $this->assertEquals(3, count($annots)); - } - - public function testNonAnnotationProblem() - { - $reader = $this->getReader(); - - $this->assertNotNull($annot = $reader->getPropertyAnnotation(new \ReflectionProperty('Doctrine\Tests\Common\Annotations\DummyClassNonAnnotationProblem', 'foo'), $name = 'Doctrine\Tests\Common\Annotations\DummyAnnotation')); - $this->assertInstanceOf($name, $annot); - } - - public function testIncludeIgnoreAnnotation() - { - $reader = $this->getReader(); - - $reader->getPropertyAnnotations(new \ReflectionProperty('Doctrine\Tests\Common\Annotations\Fixtures\ClassWithIgnoreAnnotation', 'foo')); - $this->assertFalse(class_exists('Doctrine\Tests\Common\Annotations\Fixtures\IgnoreAnnotationClass', false)); - } - - public function testImportWithConcreteAnnotation() - { - $reader = $this->getReader(); - $property = new \ReflectionProperty('Doctrine\Tests\Common\Annotations\TestImportWithConcreteAnnotation', 'field'); - $annotations = $reader->getPropertyAnnotations($property); - $this->assertEquals(1, count($annotations)); - $this->assertNotNull($reader->getPropertyAnnotation($property, 'Doctrine\Tests\Common\Annotations\DummyAnnotation')); - } - - public function testImportWithInheritance() - { - $reader = $this->getReader(); - - $class = new TestParentClass(); - $ref = new \ReflectionClass($class); - - $childAnnotations = $reader->getPropertyAnnotations($ref->getProperty('child')); - $this->assertEquals(1, count($childAnnotations)); - $this->assertInstanceOf('Doctrine\Tests\Common\Annotations\Foo\Name', reset($childAnnotations)); - - $parentAnnotations = $reader->getPropertyAnnotations($ref->getProperty('parent')); - $this->assertEquals(1, count($parentAnnotations)); - $this->assertInstanceOf('Doctrine\Tests\Common\Annotations\Bar\Name', reset($parentAnnotations)); - } - - /** - * @expectedException \Doctrine\Common\Annotations\AnnotationException - * @expectedExceptionMessage The annotation "@NameFoo" in property Doctrine\Tests\Common\Annotations\TestAnnotationNotImportedClass::$field was never imported. - */ - public function testImportDetectsNotImportedAnnotation() - { - $reader = $this->getReader(); - $reader->getPropertyAnnotations(new \ReflectionProperty('Doctrine\Tests\Common\Annotations\TestAnnotationNotImportedClass', 'field')); - } - - /** - * @expectedException \Doctrine\Common\Annotations\AnnotationException - * @expectedExceptionMessage The annotation "@Foo\Bar\Name" in property Doctrine\Tests\Common\Annotations\TestNonExistentAnnotationClass::$field was never imported. - */ - public function testImportDetectsNonExistentAnnotation() - { - $reader = $this->getReader(); - $reader->getPropertyAnnotations(new \ReflectionProperty('Doctrine\Tests\Common\Annotations\TestNonExistentAnnotationClass', 'field')); - } - - public function testTopLevelAnnotation() - { - $reader = $this->getReader(); - $annotations = $reader->getPropertyAnnotations(new \ReflectionProperty('Doctrine\Tests\Common\Annotations\TestTopLevelAnnotationClass', 'field')); - - $this->assertEquals(1, count($annotations)); - $this->assertInstanceOf('\TopLevelAnnotation', reset($annotations)); - } - - public function testIgnoresAnnotationsNotPrefixedWithWhitespace() - { - $reader = $this->getReader(); - - $annotation = $reader->getClassAnnotation(new \ReflectionClass(new TestIgnoresNonAnnotationsClass()), 'Doctrine\Tests\Common\Annotations\Name'); - $this->assertInstanceOf('Doctrine\Tests\Common\Annotations\Name', $annotation); - } - - private static $testResetsPhpParserAfterUseRun = false; - - /** - * When getUseStatements isn't available on ReflectionClass the PhpParser has to use token_get_all(). If that - * happens various PHP compiler globals get set, and these can have seriously bad effects on the next file to be - * parsed. - * Notably the doc_comment compiler global can end up containing a docblock comment. The next file to be parsed - * on an include() will have this docblock comment attached to the first thing in the file that the compiler - * considers to own comments. If this is a class then any later calls to getDocComment() for that class will have - * undesirable effects. *sigh* - */ - public function testResetsPhpParserAfterUse() - { - // If someone has already included our main test fixture this test is invalid. It's important that our require - // causes this file to be parsed and compiled at a certain point. - $this->assertFalse(!self::$testResetsPhpParserAfterUseRun && class_exists('Doctrine_Tests_Common_Annotations_Fixtures_ClassNoNamespaceNoComment'), 'Test invalid if class has already been compiled'); - self::$testResetsPhpParserAfterUseRun = true; - - $reader = $this->getReader(); - - // First make sure the annotation cache knows about the annotations we want to use. - // If we don't do this then loading of annotations into the cache will cause the parser to get out of the bad - // state we want to test. - $class = new ReflectionClass('Doctrine\Tests\Common\Annotations\Fixtures\ClassWithValidAnnotationTarget'); - $reader->getClassAnnotations($class); - - // Now import an incredibly dull class which makes use of the same class level annotation that the previous class does. - $class = new ReflectionClass('Doctrine\Tests\Common\Annotations\Fixtures\ClassWithClassAnnotationOnly'); - $annotations = $reader->getClassAnnotations($class); - - // This include needs to be here since we need the PHP compiler to run over it as the next thing the PHP - // parser sees since PhpParser called token_get_all() on the intro to ClassWithClassAnnotationOnly. - // Our test class cannot be in a namespace (some versions of PHP reset the doc_comment compiler global when - // you hit a namespace declaration), so cannot be autoloaded. - require_once __DIR__ . '/Fixtures/ClassNoNamespaceNoComment.php'; - - // So, hopefully, if all has gone OK, our class with class annotations should actually have them. - // If this fails then something is quite badly wrong elsewhere. - // Note that if this happens before the require it can cause other PHP files to be included, resetting the - // compiler global state, and invalidating this test case. - $this->assertNotEmpty($annotations); - - $annotations = $reader->getClassAnnotations(new \ReflectionClass(new \Doctrine_Tests_Common_Annotations_Fixtures_ClassNoNamespaceNoComment())); - // And if our workaround for this bug is OK, our class with no doc comment should not have any class annotations. - $this->assertEmpty($annotations); - } - - /** - * @expectedException \Doctrine\Common\Annotations\AnnotationException - * @expectedExceptionMessage The class "Doctrine\Tests\Common\Annotations\Fixtures\NoAnnotation" is not annotated with @Annotation. Are you sure this class can be used as annotation? If so, then you need to add @Annotation to the _class_ doc comment of "Doctrine\Tests\Common\Annotations\Fixtures\NoAnnotation". If it is indeed no annotation, then you need to add @IgnoreAnnotation("NoAnnotation") to the _class_ doc comment of class Doctrine\Tests\Common\Annotations\Fixtures\InvalidAnnotationUsageClass. - */ - public function testErrorWhenInvalidAnnotationIsUsed() - { - $reader = $this->getReader(); - $ref = new \ReflectionClass('Doctrine\Tests\Common\Annotations\Fixtures\InvalidAnnotationUsageClass'); - $reader->getClassAnnotations($ref); - } - - public function testInvalidAnnotationUsageButIgnoredClass() - { - $reader = $this->getReader(); - $ref = new \ReflectionClass('Doctrine\Tests\Common\Annotations\Fixtures\InvalidAnnotationUsageButIgnoredClass'); - $annots = $reader->getClassAnnotations($ref); - - $this->assertEquals(2, count($annots)); - } - - /** - * @group DDC-1660 - * @group regression - */ - public function testInvalidAnnotationButIgnored() - { - $reader = $this->getReader(); - $class = new \ReflectionClass('Doctrine\Tests\Common\Annotations\Fixtures\ClassDDC1660'); - - $this->assertTrue(class_exists('Doctrine\Tests\Common\Annotations\Fixtures\Annotation\Version')); - $this->assertCount(0, $reader->getClassAnnotations($class)); - $this->assertCount(0, $reader->getMethodAnnotations($class->getMethod('bar'))); - $this->assertCount(0, $reader->getPropertyAnnotations($class->getProperty('foo'))); - } - - public function testAnnotationEnumeratorException() - { - $reader = $this->getReader(); - $class = new \ReflectionClass('Doctrine\Tests\Common\Annotations\Fixtures\ClassWithAnnotationEnum'); - - $this->assertCount(1, $bar = $reader->getMethodAnnotations($class->getMethod('bar'))); - $this->assertCount(1, $foo = $reader->getPropertyAnnotations($class->getProperty('foo'))); - - $this->assertInstanceOf('Doctrine\Tests\Common\Annotations\Fixtures\AnnotationEnum', $bar[0]); - $this->assertInstanceOf('Doctrine\Tests\Common\Annotations\Fixtures\AnnotationEnum', $foo[0]); - - try { - $reader->getPropertyAnnotations($class->getProperty('invalidProperty')); - $this->fail(); - } catch (\Doctrine\Common\Annotations\AnnotationException $exc) { - $this->assertEquals('[Enum Error] Attribute "value" of @Doctrine\Tests\Common\Annotations\Fixtures\AnnotationEnum declared on property Doctrine\Tests\Common\Annotations\Fixtures\ClassWithAnnotationEnum::$invalidProperty accept only [ONE, TWO, THREE], but got FOUR.', $exc->getMessage()); - } - - try { - $reader->getMethodAnnotations($class->getMethod('invalidMethod')); - $this->fail(); - } catch (\Doctrine\Common\Annotations\AnnotationException $exc) { - $this->assertEquals('[Enum Error] Attribute "value" of @Doctrine\Tests\Common\Annotations\Fixtures\AnnotationEnum declared on method Doctrine\Tests\Common\Annotations\Fixtures\ClassWithAnnotationEnum::invalidMethod() accept only [ONE, TWO, THREE], but got 5.', $exc->getMessage()); - } - } - - /** - * @group DCOM-106 - */ - public function testIgnoreFixMeAndUpperCaseToDo() - { - $reader = $this->getReader(); - $ref = new \ReflectionClass('Doctrine\Tests\Common\Annotations\DCOM106'); - $reader->getClassAnnotations($ref); - } - - /** - * @return AnnotationReader - */ - abstract protected function getReader(); -} - -/** - * @parseAnnotation("var") - * @author Johannes M. Schmitt - * - */ -class TestParseAnnotationClass -{ - /** - * @var - */ - private $field; -} - -/** - * @Name - * @author Johannes M. Schmitt - */ -class TestIgnoresNonAnnotationsClass -{ -} - -class TestTopLevelAnnotationClass -{ - /** - * @\TopLevelAnnotation - */ - private $field; -} - -class TestNonExistentAnnotationClass -{ - /** - * @Foo\Bar\Name - */ - private $field; -} - -class TestAnnotationNotImportedClass -{ - /** - * @NameFoo - */ - private $field; -} - -class TestChildClass -{ - /** - * @\Doctrine\Tests\Common\Annotations\Foo\Name(name = "foo") - */ - protected $child; -} - -class TestParentClass extends TestChildClass -{ - /** - * @\Doctrine\Tests\Common\Annotations\Bar\Name(name = "bar") - */ - private $parent; -} - -class TestImportWithConcreteAnnotation -{ - /** - * @DummyAnnotation(dummyValue = "bar") - */ - private $field; -} - -/** - * @ignoreAnnotation("var") - */ -class DummyClass2 { - /** - * @DummyId @DummyColumn(type="integer") @DummyGeneratedValue - * @var integer - */ - private $id; -} - -/** @Annotation */ -class DummyId extends Annotation {} -/** @Annotation */ -class DummyColumn extends Annotation { - public $type; -} -/** @Annotation */ -class DummyGeneratedValue extends Annotation {} -/** @Annotation */ -class DummyAnnotation extends Annotation { - public $dummyValue; -} - -/** - * @api - * @Annotation - */ -class DummyAnnotationWithIgnoredAnnotation extends Annotation { - public $dummyValue; -} - -/** @Annotation */ -class DummyJoinColumn extends Annotation { - public $name; - public $referencedColumnName; -} -/** @Annotation */ -class DummyJoinTable extends Annotation { - public $name; - public $joinColumns; - public $inverseJoinColumns; -} - -/** - * @DummyAnnotation(dummyValue = "bar",) - */ -class DummyClassWithDanglingComma -{ -} - -/** - * @DummyAnnotation(@) - */ -class DummyClassSyntaxError -{ - -} - -class DummyClassMethodSyntaxError -{ - /** - * @DummyAnnotation(@) - */ - public function foo() - { - - } -} - -class DummyClassPropertySyntaxError -{ - /** - * @DummyAnnotation(@) - */ - public $foo; -} - -/** - * @ignoreAnnotation({"since", "var"}) - */ -class DummyClassNonAnnotationProblem -{ - /** - * @DummyAnnotation - * - * @var \Test - * @since 0.1 - */ - public $foo; -} - - -/** -* @DummyAnnotation Foo bar -*/ -class DummyClassWithEmail -{ - -} - - -/** - * @fixme public - * @TODO - */ -class DCOM106 -{ - -} - -namespace Doctrine\Tests\Common\Annotations\Foo; - -/** @Annotation */ -class Name extends \Doctrine\Common\Annotations\Annotation -{ - public $name; -} - -namespace Doctrine\Tests\Common\Annotations\Bar; - -/** @Annotation */ -class Name extends \Doctrine\Common\Annotations\Annotation -{ - public $name; -} diff --git a/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/Annotation/TargetTest.php b/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/Annotation/TargetTest.php deleted file mode 100644 index 7627f76..0000000 --- a/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/Annotation/TargetTest.php +++ /dev/null @@ -1,47 +0,0 @@ -. - */ - -namespace Doctrine\Tests\Common\Annotations\Annotation; - -use Doctrine\Common\Annotations\Annotation\Target; - -/** - * Tests for {@see \Doctrine\Common\Annotations\Annotation\Target} - * - * @covers \Doctrine\Common\Annotations\Annotation\Target - */ -class TargetTest extends \PHPUnit_Framework_TestCase -{ - /** - * @group DDC-3006 - */ - public function testValidMixedTargets() - { - $target = new Target(array("value" => array("ALL"))); - $this->assertEquals(Target::TARGET_ALL, $target->targets); - - $target = new Target(array("value" => array("METHOD", "METHOD"))); - $this->assertEquals(Target::TARGET_METHOD, $target->targets); - $this->assertNotEquals(Target::TARGET_PROPERTY, $target->targets); - - $target = new Target(array("value" => array("PROPERTY", "METHOD"))); - $this->assertEquals(Target::TARGET_METHOD | Target::TARGET_PROPERTY, $target->targets); - } -} - diff --git a/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/AnnotationReaderTest.php b/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/AnnotationReaderTest.php deleted file mode 100644 index d6dd056..0000000 --- a/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/AnnotationReaderTest.php +++ /dev/null @@ -1,59 +0,0 @@ -markTestSkipped('This test requires PHP 5.4 or later.'); - } - - $reader = $this->getReader(); - $ref = new \ReflectionClass('Doctrine\Tests\Common\Annotations\Fixtures\ClassUsesTrait'); - - $annotations = $reader->getMethodAnnotations($ref->getMethod('someMethod')); - $this->assertInstanceOf('Doctrine\Tests\Common\Annotations\Bar\Autoload', $annotations[0]); - - $annotations = $reader->getMethodAnnotations($ref->getMethod('traitMethod')); - $this->assertInstanceOf('Doctrine\Tests\Common\Annotations\Fixtures\Annotation\Autoload', $annotations[0]); - } - - public function testMethodAnnotationFromOverwrittenTrait() - { - if (PHP_VERSION_ID < 50400) { - $this->markTestSkipped('This test requires PHP 5.4 or later.'); - } - - $reader = $this->getReader(); - $ref = new \ReflectionClass('Doctrine\Tests\Common\Annotations\Fixtures\ClassOverwritesTrait'); - - $annotations = $reader->getMethodAnnotations($ref->getMethod('traitMethod')); - $this->assertInstanceOf('Doctrine\Tests\Common\Annotations\Bar2\Autoload', $annotations[0]); - } - - public function testPropertyAnnotationFromTrait() - { - if (PHP_VERSION_ID < 50400) { - $this->markTestSkipped('This test requires PHP 5.4 or later.'); - } - - $reader = $this->getReader(); - $ref = new \ReflectionClass('Doctrine\Tests\Common\Annotations\Fixtures\ClassUsesTrait'); - - $annotations = $reader->getPropertyAnnotations($ref->getProperty('aProperty')); - $this->assertInstanceOf('Doctrine\Tests\Common\Annotations\Bar\Autoload', $annotations[0]); - - $annotations = $reader->getPropertyAnnotations($ref->getProperty('traitProperty')); - $this->assertInstanceOf('Doctrine\Tests\Common\Annotations\Fixtures\Annotation\Autoload', $annotations[0]); - } - -} \ No newline at end of file diff --git a/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/CachedReaderTest.php b/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/CachedReaderTest.php deleted file mode 100644 index 5dd89f7..0000000 --- a/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/CachedReaderTest.php +++ /dev/null @@ -1,56 +0,0 @@ -getMock('Doctrine\Common\Cache\Cache'); - $cache - ->expects($this->at(0)) - ->method('fetch') - ->with($this->equalTo($cacheKey)) - ->will($this->returnValue(array())) - ; - $cache - ->expects($this->at(1)) - ->method('fetch') - ->with($this->equalTo('[C]'.$cacheKey)) - ->will($this->returnValue(time() - 10)) - ; - $cache - ->expects($this->at(2)) - ->method('save') - ->with($this->equalTo($cacheKey)) - ; - $cache - ->expects($this->at(3)) - ->method('save') - ->with($this->equalTo('[C]'.$cacheKey)) - ; - - $reader = new CachedReader(new AnnotationReader(), $cache, true); - $route = new Route(); - $route->pattern = '/someprefix'; - $this->assertEquals(array($route), $reader->getClassAnnotations(new \ReflectionClass($name))); - } - - protected function getReader() - { - $this->cache = new ArrayCache(); - return new CachedReader(new AnnotationReader(), $this->cache); - } -} \ No newline at end of file diff --git a/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/DocLexerTest.php b/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/DocLexerTest.php deleted file mode 100644 index 844619d..0000000 --- a/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/DocLexerTest.php +++ /dev/null @@ -1,157 +0,0 @@ -setInput("@Name"); - $this->assertNull($lexer->token); - $this->assertNull($lexer->lookahead); - - $this->assertTrue($lexer->moveNext()); - $this->assertNull($lexer->token); - $this->assertEquals('@', $lexer->lookahead['value']); - - $this->assertTrue($lexer->moveNext()); - $this->assertEquals('@', $lexer->token['value']); - $this->assertEquals('Name', $lexer->lookahead['value']); - - $this->assertFalse($lexer->moveNext()); - } - - public function testScannerTokenizesDocBlockWhitConstants() - { - $lexer = new DocLexer(); - $docblock = '@AnnotationWithConstants(PHP_EOL, ClassWithConstants::SOME_VALUE, ClassWithConstants::CONSTANT_, ClassWithConstants::CONST_ANT3, \Doctrine\Tests\Common\Annotations\Fixtures\IntefaceWithConstants::SOME_VALUE)'; - - $tokens = array ( - array( - 'value' => '@', - 'position' => 0, - 'type' => DocLexer::T_AT, - ), - array( - 'value' => 'AnnotationWithConstants', - 'position' => 1, - 'type' => DocLexer::T_IDENTIFIER, - ), - array( - 'value' => '(', - 'position' => 24, - 'type' => DocLexer::T_OPEN_PARENTHESIS, - ), - array( - 'value' => 'PHP_EOL', - 'position' => 25, - 'type' => DocLexer::T_IDENTIFIER, - ), - array( - 'value' => ',', - 'position' => 32, - 'type' => DocLexer::T_COMMA, - ), - array( - 'value' => 'ClassWithConstants::SOME_VALUE', - 'position' => 34, - 'type' => DocLexer::T_IDENTIFIER, - ), - array( - 'value' => ',', - 'position' => 64, - 'type' => DocLexer::T_COMMA, - ), - array( - 'value' => 'ClassWithConstants::CONSTANT_', - 'position' => 66, - 'type' => DocLexer::T_IDENTIFIER, - ), - array( - 'value' => ',', - 'position' => 95, - 'type' => DocLexer::T_COMMA, - ), - array( - 'value' => 'ClassWithConstants::CONST_ANT3', - 'position' => 97, - 'type' => DocLexer::T_IDENTIFIER, - ), - array( - 'value' => ',', - 'position' => 127, - 'type' => DocLexer::T_COMMA, - ), - array( - 'value' => '\\Doctrine\\Tests\\Common\\Annotations\\Fixtures\\IntefaceWithConstants::SOME_VALUE', - 'position' => 129, - 'type' => DocLexer::T_IDENTIFIER, - ), - array( - 'value' => ')', - 'position' => 206, - 'type' => DocLexer::T_CLOSE_PARENTHESIS, - ) - - ); - - $lexer->setInput($docblock); - - foreach ($tokens as $expected) { - $lexer->moveNext(); - $lookahead = $lexer->lookahead; - $this->assertEquals($expected['value'], $lookahead['value']); - $this->assertEquals($expected['type'], $lookahead['type']); - $this->assertEquals($expected['position'], $lookahead['position']); - } - - $this->assertFalse($lexer->moveNext()); - } - - - public function testScannerTokenizesDocBlockWhitInvalidIdentifier() - { - $lexer = new DocLexer(); - $docblock = '@Foo\3.42'; - - $tokens = array ( - array( - 'value' => '@', - 'position' => 0, - 'type' => DocLexer::T_AT, - ), - array( - 'value' => 'Foo', - 'position' => 1, - 'type' => DocLexer::T_IDENTIFIER, - ), - array( - 'value' => '\\', - 'position' => 4, - 'type' => DocLexer::T_NAMESPACE_SEPARATOR, - ), - array( - 'value' => 3.42, - 'position' => 5, - 'type' => DocLexer::T_FLOAT, - ) - ); - - $lexer->setInput($docblock); - - foreach ($tokens as $expected) { - $lexer->moveNext(); - $lookahead = $lexer->lookahead; - $this->assertEquals($expected['value'], $lookahead['value']); - $this->assertEquals($expected['type'], $lookahead['type']); - $this->assertEquals($expected['position'], $lookahead['position']); - } - - $this->assertFalse($lexer->moveNext()); - } - -} \ No newline at end of file diff --git a/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/DocParserTest.php b/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/DocParserTest.php deleted file mode 100644 index 7d670a9..0000000 --- a/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/DocParserTest.php +++ /dev/null @@ -1,1359 +0,0 @@ -createTestParser(); - - // Nested arrays with nested annotations - $result = $parser->parse('@Name(foo={1,2, {"key"=@Name}})'); - $annot = $result[0]; - - $this->assertTrue($annot instanceof Name); - $this->assertNull($annot->value); - $this->assertEquals(3, count($annot->foo)); - $this->assertEquals(1, $annot->foo[0]); - $this->assertEquals(2, $annot->foo[1]); - $this->assertTrue(is_array($annot->foo[2])); - - $nestedArray = $annot->foo[2]; - $this->assertTrue(isset($nestedArray['key'])); - $this->assertTrue($nestedArray['key'] instanceof Name); - } - - public function testBasicAnnotations() - { - $parser = $this->createTestParser(); - - // Marker annotation - $result = $parser->parse("@Name"); - $annot = $result[0]; - $this->assertTrue($annot instanceof Name); - $this->assertNull($annot->value); - $this->assertNull($annot->foo); - - // Associative arrays - $result = $parser->parse('@Name(foo={"key1" = "value1"})'); - $annot = $result[0]; - $this->assertNull($annot->value); - $this->assertTrue(is_array($annot->foo)); - $this->assertTrue(isset($annot->foo['key1'])); - - // Numerical arrays - $result = $parser->parse('@Name({2="foo", 4="bar"})'); - $annot = $result[0]; - $this->assertTrue(is_array($annot->value)); - $this->assertEquals('foo', $annot->value[2]); - $this->assertEquals('bar', $annot->value[4]); - $this->assertFalse(isset($annot->value[0])); - $this->assertFalse(isset($annot->value[1])); - $this->assertFalse(isset($annot->value[3])); - - // Multiple values - $result = $parser->parse('@Name(@Name, @Name)'); - $annot = $result[0]; - - $this->assertTrue($annot instanceof Name); - $this->assertTrue(is_array($annot->value)); - $this->assertTrue($annot->value[0] instanceof Name); - $this->assertTrue($annot->value[1] instanceof Name); - - // Multiple types as values - $result = $parser->parse('@Name(foo="Bar", @Name, {"key1"="value1", "key2"="value2"})'); - $annot = $result[0]; - - $this->assertTrue($annot instanceof Name); - $this->assertTrue(is_array($annot->value)); - $this->assertTrue($annot->value[0] instanceof Name); - $this->assertTrue(is_array($annot->value[1])); - $this->assertEquals('value1', $annot->value[1]['key1']); - $this->assertEquals('value2', $annot->value[1]['key2']); - - // Complete docblock - $docblock = <<parse($docblock); - $this->assertEquals(1, count($result)); - $annot = $result[0]; - $this->assertTrue($annot instanceof Name); - $this->assertEquals("bar", $annot->foo); - $this->assertNull($annot->value); - } - - public function testDefaultValueAnnotations() - { - $parser = $this->createTestParser(); - - // Array as first value - $result = $parser->parse('@Name({"key1"="value1"})'); - $annot = $result[0]; - - $this->assertTrue($annot instanceof Name); - $this->assertTrue(is_array($annot->value)); - $this->assertEquals('value1', $annot->value['key1']); - - // Array as first value and additional values - $result = $parser->parse('@Name({"key1"="value1"}, foo="bar")'); - $annot = $result[0]; - - $this->assertTrue($annot instanceof Name); - $this->assertTrue(is_array($annot->value)); - $this->assertEquals('value1', $annot->value['key1']); - $this->assertEquals('bar', $annot->foo); - } - - public function testNamespacedAnnotations() - { - $parser = new DocParser; - $parser->setIgnoreNotImportedAnnotations(true); - - $docblock = << - * @Doctrine\Tests\Common\Annotations\Name(foo="bar") - * @ignore - */ -DOCBLOCK; - - $result = $parser->parse($docblock); - $this->assertEquals(1, count($result)); - $annot = $result[0]; - $this->assertTrue($annot instanceof Name); - $this->assertEquals("bar", $annot->foo); - } - - /** - * @group debug - */ - public function testTypicalMethodDocBlock() - { - $parser = $this->createTestParser(); - - $docblock = <<parse($docblock); - $this->assertEquals(2, count($result)); - $this->assertTrue(isset($result[0])); - $this->assertTrue(isset($result[1])); - $annot = $result[0]; - $this->assertTrue($annot instanceof Name); - $this->assertEquals("bar", $annot->foo); - $marker = $result[1]; - $this->assertTrue($marker instanceof Marker); - } - - - public function testAnnotationWithoutConstructor() - { - $parser = $this->createTestParser(); - - - $docblock = <<parse($docblock); - $this->assertEquals(count($result), 1); - $annot = $result[0]; - - $this->assertNotNull($annot); - $this->assertTrue($annot instanceof SomeAnnotationClassNameWithoutConstructor); - - $this->assertNull($annot->name); - $this->assertNotNull($annot->data); - $this->assertEquals($annot->data, "Some data"); - - - - -$docblock = <<parse($docblock); - $this->assertEquals(count($result), 1); - $annot = $result[0]; - - $this->assertNotNull($annot); - $this->assertTrue($annot instanceof SomeAnnotationClassNameWithoutConstructor); - - $this->assertEquals($annot->name, "Some Name"); - $this->assertEquals($annot->data, "Some data"); - - - - -$docblock = <<parse($docblock); - $this->assertEquals(count($result), 1); - $annot = $result[0]; - - $this->assertEquals($annot->data, "Some data"); - $this->assertNull($annot->name); - - - $docblock = <<parse($docblock); - $this->assertEquals(count($result), 1); - $annot = $result[0]; - - $this->assertEquals($annot->name, "Some name"); - $this->assertNull($annot->data); - - $docblock = <<parse($docblock); - $this->assertEquals(count($result), 1); - $annot = $result[0]; - - $this->assertEquals($annot->data, "Some data"); - $this->assertNull($annot->name); - - - - $docblock = <<parse($docblock); - $this->assertEquals(count($result), 1); - $annot = $result[0]; - - $this->assertEquals($annot->name, "Some name"); - $this->assertEquals($annot->data, "Some data"); - - - $docblock = <<parse($docblock); - $this->assertEquals(count($result), 1); - $annot = $result[0]; - - $this->assertEquals($annot->name, "Some name"); - $this->assertEquals($annot->data, "Some data"); - - $docblock = <<parse($docblock); - $this->assertEquals(count($result), 1); - $this->assertTrue($result[0] instanceof SomeAnnotationClassNameWithoutConstructorAndProperties); - } - - public function testAnnotationTarget() - { - - $parser = new DocParser; - $parser->setImports(array( - '__NAMESPACE__' => 'Doctrine\Tests\Common\Annotations\Fixtures', - )); - $class = new \ReflectionClass('Doctrine\Tests\Common\Annotations\Fixtures\ClassWithValidAnnotationTarget'); - - - $context = 'class ' . $class->getName(); - $docComment = $class->getDocComment(); - - $parser->setTarget(Target::TARGET_CLASS); - $this->assertNotNull($parser->parse($docComment,$context)); - - - $property = $class->getProperty('foo'); - $docComment = $property->getDocComment(); - $context = 'property ' . $class->getName() . "::\$" . $property->getName(); - - $parser->setTarget(Target::TARGET_PROPERTY); - $this->assertNotNull($parser->parse($docComment,$context)); - - - - $method = $class->getMethod('someFunction'); - $docComment = $property->getDocComment(); - $context = 'method ' . $class->getName() . '::' . $method->getName() . '()'; - - $parser->setTarget(Target::TARGET_METHOD); - $this->assertNotNull($parser->parse($docComment,$context)); - - - try { - $class = new \ReflectionClass('Doctrine\Tests\Common\Annotations\Fixtures\ClassWithInvalidAnnotationTargetAtClass'); - $context = 'class ' . $class->getName(); - $docComment = $class->getDocComment(); - - $parser->setTarget(Target::TARGET_CLASS); - $parser->parse($docComment, $context); - - $this->fail(); - } catch (\Doctrine\Common\Annotations\AnnotationException $exc) { - $this->assertNotNull($exc->getMessage()); - } - - - try { - - $class = new \ReflectionClass('Doctrine\Tests\Common\Annotations\Fixtures\ClassWithInvalidAnnotationTargetAtMethod'); - $method = $class->getMethod('functionName'); - $docComment = $method->getDocComment(); - $context = 'method ' . $class->getName() . '::' . $method->getName() . '()'; - - $parser->setTarget(Target::TARGET_METHOD); - $parser->parse($docComment, $context); - - $this->fail(); - } catch (\Doctrine\Common\Annotations\AnnotationException $exc) { - $this->assertNotNull($exc->getMessage()); - } - - - try { - $class = new \ReflectionClass('Doctrine\Tests\Common\Annotations\Fixtures\ClassWithInvalidAnnotationTargetAtProperty'); - $property = $class->getProperty('foo'); - $docComment = $property->getDocComment(); - $context = 'property ' . $class->getName() . "::\$" . $property->getName(); - - $parser->setTarget(Target::TARGET_PROPERTY); - $parser->parse($docComment, $context); - - $this->fail(); - } catch (\Doctrine\Common\Annotations\AnnotationException $exc) { - $this->assertNotNull($exc->getMessage()); - } - - } - - public function getAnnotationVarTypeProviderValid() - { - //({attribute name}, {attribute value}) - return array( - // mixed type - array('mixed', '"String Value"'), - array('mixed', 'true'), - array('mixed', 'false'), - array('mixed', '1'), - array('mixed', '1.2'), - array('mixed', '@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll'), - - // boolean type - array('boolean', 'true'), - array('boolean', 'false'), - - // alias for internal type boolean - array('bool', 'true'), - array('bool', 'false'), - - // integer type - array('integer', '0'), - array('integer', '1'), - array('integer', '123456789'), - array('integer', '9223372036854775807'), - - // alias for internal type double - array('float', '0.1'), - array('float', '1.2'), - array('float', '123.456'), - - // string type - array('string', '"String Value"'), - array('string', '"true"'), - array('string', '"123"'), - - // array type - array('array', '{@AnnotationExtendsAnnotationTargetAll}'), - array('array', '{@AnnotationExtendsAnnotationTargetAll,@AnnotationExtendsAnnotationTargetAll}'), - - array('arrayOfIntegers', '1'), - array('arrayOfIntegers', '{1}'), - array('arrayOfIntegers', '{1,2,3,4}'), - array('arrayOfAnnotations', '@AnnotationExtendsAnnotationTargetAll'), - array('arrayOfAnnotations', '{@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll}'), - array('arrayOfAnnotations', '{@AnnotationExtendsAnnotationTargetAll, @Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll}'), - - // annotation instance - array('annotation', '@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll'), - array('annotation', '@AnnotationExtendsAnnotationTargetAll'), - ); - } - - public function getAnnotationVarTypeProviderInvalid() - { - //({attribute name}, {type declared type}, {attribute value} , {given type or class}) - return array( - // boolean type - array('boolean','boolean','1','integer'), - array('boolean','boolean','1.2','double'), - array('boolean','boolean','"str"','string'), - array('boolean','boolean','{1,2,3}','array'), - array('boolean','boolean','@Name', 'an instance of Doctrine\Tests\Common\Annotations\Name'), - - // alias for internal type boolean - array('bool','bool', '1','integer'), - array('bool','bool', '1.2','double'), - array('bool','bool', '"str"','string'), - array('bool','bool', '{"str"}','array'), - - // integer type - array('integer','integer', 'true','boolean'), - array('integer','integer', 'false','boolean'), - array('integer','integer', '1.2','double'), - array('integer','integer', '"str"','string'), - array('integer','integer', '{"str"}','array'), - array('integer','integer', '{1,2,3,4}','array'), - - // alias for internal type double - array('float','float', 'true','boolean'), - array('float','float', 'false','boolean'), - array('float','float', '123','integer'), - array('float','float', '"str"','string'), - array('float','float', '{"str"}','array'), - array('float','float', '{12.34}','array'), - array('float','float', '{1,2,3}','array'), - - // string type - array('string','string', 'true','boolean'), - array('string','string', 'false','boolean'), - array('string','string', '12','integer'), - array('string','string', '1.2','double'), - array('string','string', '{"str"}','array'), - array('string','string', '{1,2,3,4}','array'), - - // annotation instance - array('annotation','Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll', 'true','boolean'), - array('annotation','Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll', 'false','boolean'), - array('annotation','Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll', '12','integer'), - array('annotation','Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll', '1.2','double'), - array('annotation','Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll', '{"str"}','array'), - array('annotation','Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll', '{1,2,3,4}','array'), - array('annotation','Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll', '@Name','an instance of Doctrine\Tests\Common\Annotations\Name'), - ); - } - - public function getAnnotationVarTypeArrayProviderInvalid() - { - //({attribute name}, {type declared type}, {attribute value} , {given type or class}) - return array( - array('arrayOfIntegers', 'integer', 'true', 'boolean'), - array('arrayOfIntegers', 'integer', 'false', 'boolean'), - array('arrayOfIntegers', 'integer', '{true,true}', 'boolean'), - array('arrayOfIntegers', 'integer', '{1,true}', 'boolean'), - array('arrayOfIntegers', 'integer', '{1,2,1.2}', 'double'), - array('arrayOfIntegers', 'integer', '{1,2,"str"}', 'string'), - - array('arrayOfStrings', 'string', 'true', 'boolean'), - array('arrayOfStrings', 'string', 'false', 'boolean'), - array('arrayOfStrings', 'string', '{true,true}', 'boolean'), - array('arrayOfStrings', 'string', '{"foo",true}', 'boolean'), - array('arrayOfStrings', 'string', '{"foo","bar",1.2}', 'double'), - array('arrayOfStrings', 'string', '1', 'integer'), - - array('arrayOfAnnotations', 'Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll', 'true', 'boolean'), - array('arrayOfAnnotations', 'Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll', 'false', 'boolean'), - array('arrayOfAnnotations', 'Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll', '{@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll,true}', 'boolean'), - array('arrayOfAnnotations', 'Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll', '{@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll,true}', 'boolean'), - array('arrayOfAnnotations', 'Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll', '{@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll,1.2}', 'double'), - array('arrayOfAnnotations', 'Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll', '{@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll,@AnnotationExtendsAnnotationTargetAll,"str"}', 'string'), - ); - } - - /** - * @dataProvider getAnnotationVarTypeProviderValid - */ - public function testAnnotationWithVarType($attribute, $value) - { - $parser = $this->createTestParser(); - $context = 'property SomeClassName::$invalidProperty.'; - $docblock = sprintf('@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithVarType(%s = %s)',$attribute, $value); - $parser->setTarget(Target::TARGET_PROPERTY); - - $result = $parser->parse($docblock, $context); - - $this->assertTrue(sizeof($result) === 1); - $this->assertInstanceOf('Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithVarType', $result[0]); - $this->assertNotNull($result[0]->$attribute); - } - - /** - * @dataProvider getAnnotationVarTypeProviderInvalid - */ - public function testAnnotationWithVarTypeError($attribute,$type,$value,$given) - { - $parser = $this->createTestParser(); - $context = 'property SomeClassName::invalidProperty.'; - $docblock = sprintf('@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithVarType(%s = %s)',$attribute, $value); - $parser->setTarget(Target::TARGET_PROPERTY); - - try { - $parser->parse($docblock, $context); - $this->fail(); - } catch (\Doctrine\Common\Annotations\AnnotationException $exc) { - $this->assertContains("[Type Error] Attribute \"$attribute\" of @Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithVarType declared on property SomeClassName::invalidProperty. expects a(n) $type, but got $given.", $exc->getMessage()); - } - } - - - /** - * @dataProvider getAnnotationVarTypeArrayProviderInvalid - */ - public function testAnnotationWithVarTypeArrayError($attribute,$type,$value,$given) - { - $parser = $this->createTestParser(); - $context = 'property SomeClassName::invalidProperty.'; - $docblock = sprintf('@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithVarType(%s = %s)',$attribute, $value); - $parser->setTarget(Target::TARGET_PROPERTY); - - try { - $parser->parse($docblock, $context); - $this->fail(); - } catch (\Doctrine\Common\Annotations\AnnotationException $exc) { - $this->assertContains("[Type Error] Attribute \"$attribute\" of @Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithVarType declared on property SomeClassName::invalidProperty. expects either a(n) $type, or an array of {$type}s, but got $given.", $exc->getMessage()); - } - } - - /** - * @dataProvider getAnnotationVarTypeProviderValid - */ - public function testAnnotationWithAttributes($attribute, $value) - { - $parser = $this->createTestParser(); - $context = 'property SomeClassName::$invalidProperty.'; - $docblock = sprintf('@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithAttributes(%s = %s)',$attribute, $value); - $parser->setTarget(Target::TARGET_PROPERTY); - - $result = $parser->parse($docblock, $context); - - $this->assertTrue(sizeof($result) === 1); - $this->assertInstanceOf('Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithAttributes', $result[0]); - $getter = "get".ucfirst($attribute); - $this->assertNotNull($result[0]->$getter()); - } - - /** - * @dataProvider getAnnotationVarTypeProviderInvalid - */ - public function testAnnotationWithAttributesError($attribute,$type,$value,$given) - { - $parser = $this->createTestParser(); - $context = 'property SomeClassName::invalidProperty.'; - $docblock = sprintf('@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithAttributes(%s = %s)',$attribute, $value); - $parser->setTarget(Target::TARGET_PROPERTY); - - try { - $parser->parse($docblock, $context); - $this->fail(); - } catch (\Doctrine\Common\Annotations\AnnotationException $exc) { - $this->assertContains("[Type Error] Attribute \"$attribute\" of @Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithAttributes declared on property SomeClassName::invalidProperty. expects a(n) $type, but got $given.", $exc->getMessage()); - } - } - - - /** - * @dataProvider getAnnotationVarTypeArrayProviderInvalid - */ - public function testAnnotationWithAttributesWithVarTypeArrayError($attribute,$type,$value,$given) - { - $parser = $this->createTestParser(); - $context = 'property SomeClassName::invalidProperty.'; - $docblock = sprintf('@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithAttributes(%s = %s)',$attribute, $value); - $parser->setTarget(Target::TARGET_PROPERTY); - - try { - $parser->parse($docblock, $context); - $this->fail(); - } catch (\Doctrine\Common\Annotations\AnnotationException $exc) { - $this->assertContains("[Type Error] Attribute \"$attribute\" of @Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithAttributes declared on property SomeClassName::invalidProperty. expects either a(n) $type, or an array of {$type}s, but got $given.", $exc->getMessage()); - } - } - - public function testAnnotationWithRequiredAttributes() - { - $parser = $this->createTestParser(); - $context = 'property SomeClassName::invalidProperty.'; - $parser->setTarget(Target::TARGET_PROPERTY); - - - $docblock = '@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithRequiredAttributes("Some Value", annot = @Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAnnotation)'; - $result = $parser->parse($docblock); - - $this->assertTrue(sizeof($result) === 1); - $this->assertInstanceOf('Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithRequiredAttributes', $result[0]); - $this->assertEquals("Some Value",$result[0]->getValue()); - $this->assertInstanceOf('Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAnnotation', $result[0]->getAnnot()); - - - $docblock = '@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithRequiredAttributes("Some Value")'; - try { - $result = $parser->parse($docblock,$context); - $this->fail(); - } catch (\Doctrine\Common\Annotations\AnnotationException $exc) { - $this->assertContains('Attribute "annot" of @Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithRequiredAttributes declared on property SomeClassName::invalidProperty. expects a(n) Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAnnotation. This value should not be null.', $exc->getMessage()); - } - - $docblock = '@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithRequiredAttributes(annot = @Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAnnotation)'; - try { - $result = $parser->parse($docblock,$context); - $this->fail(); - } catch (\Doctrine\Common\Annotations\AnnotationException $exc) { - $this->assertContains('Attribute "value" of @Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithRequiredAttributes declared on property SomeClassName::invalidProperty. expects a(n) string. This value should not be null.', $exc->getMessage()); - } - - } - - public function testAnnotationWithRequiredAttributesWithoutContructor() - { - $parser = $this->createTestParser(); - $context = 'property SomeClassName::invalidProperty.'; - $parser->setTarget(Target::TARGET_PROPERTY); - - - $docblock = '@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithRequiredAttributesWithoutContructor("Some Value", annot = @Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAnnotation)'; - $result = $parser->parse($docblock); - - $this->assertTrue(sizeof($result) === 1); - $this->assertInstanceOf('Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithRequiredAttributesWithoutContructor', $result[0]); - $this->assertEquals("Some Value", $result[0]->value); - $this->assertInstanceOf('Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAnnotation', $result[0]->annot); - - - $docblock = '@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithRequiredAttributesWithoutContructor("Some Value")'; - try { - $result = $parser->parse($docblock,$context); - $this->fail(); - } catch (\Doctrine\Common\Annotations\AnnotationException $exc) { - $this->assertContains('Attribute "annot" of @Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithRequiredAttributesWithoutContructor declared on property SomeClassName::invalidProperty. expects a(n) Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAnnotation. This value should not be null.', $exc->getMessage()); - } - - $docblock = '@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithRequiredAttributesWithoutContructor(annot = @Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAnnotation)'; - try { - $result = $parser->parse($docblock,$context); - $this->fail(); - } catch (\Doctrine\Common\Annotations\AnnotationException $exc) { - $this->assertContains('Attribute "value" of @Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithRequiredAttributesWithoutContructor declared on property SomeClassName::invalidProperty. expects a(n) string. This value should not be null.', $exc->getMessage()); - } - - } - - /** - * @expectedException \Doctrine\Common\Annotations\AnnotationException - * @expectedExceptionMessage Attribute "value" of @Doctrine\Tests\Common\Annotations\Fixtures\AnnotationEnum declared on property SomeClassName::invalidProperty. accept only [ONE, TWO, THREE], but got FOUR. - */ - public function testAnnotationEnumeratorException() - { - $parser = $this->createTestParser(); - $context = 'property SomeClassName::invalidProperty.'; - $docblock = '@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationEnum("FOUR")'; - - $parser->setIgnoreNotImportedAnnotations(false); - $parser->setTarget(Target::TARGET_PROPERTY); - $parser->parse($docblock, $context); - } - - /** - * @expectedException \Doctrine\Common\Annotations\AnnotationException - * @expectedExceptionMessage Attribute "value" of @Doctrine\Tests\Common\Annotations\Fixtures\AnnotationEnumLiteral declared on property SomeClassName::invalidProperty. accept only [AnnotationEnumLiteral::ONE, AnnotationEnumLiteral::TWO, AnnotationEnumLiteral::THREE], but got 4. - */ - public function testAnnotationEnumeratorLiteralException() - { - $parser = $this->createTestParser(); - $context = 'property SomeClassName::invalidProperty.'; - $docblock = '@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationEnumLiteral(4)'; - - $parser->setIgnoreNotImportedAnnotations(false); - $parser->setTarget(Target::TARGET_PROPERTY); - $parser->parse($docblock, $context); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage @Enum supports only scalar values "array" given. - */ - public function testAnnotationEnumInvalidTypeDeclarationException() - { - $parser = $this->createTestParser(); - $docblock = '@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationEnumInvalid("foo")'; - - $parser->setIgnoreNotImportedAnnotations(false); - $parser->parse($docblock); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Undefined enumerator value "3" for literal "AnnotationEnumLiteral::THREE". - */ - public function testAnnotationEnumInvalidLiteralDeclarationException() - { - $parser = $this->createTestParser(); - $docblock = '@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationEnumLiteralInvalid("foo")'; - - $parser->setIgnoreNotImportedAnnotations(false); - $parser->parse($docblock); - } - - public function getConstantsProvider() - { - $provider[] = array( - '@AnnotationWithConstants(PHP_EOL)', - PHP_EOL - ); - $provider[] = array( - '@AnnotationWithConstants(AnnotationWithConstants::INTEGER)', - AnnotationWithConstants::INTEGER - ); - $provider[] = array( - '@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithConstants(AnnotationWithConstants::STRING)', - AnnotationWithConstants::STRING - ); - $provider[] = array( - '@AnnotationWithConstants(Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithConstants::FLOAT)', - AnnotationWithConstants::FLOAT - ); - $provider[] = array( - '@AnnotationWithConstants(ClassWithConstants::SOME_VALUE)', - ClassWithConstants::SOME_VALUE - ); - $provider[] = array( - '@AnnotationWithConstants(ClassWithConstants::OTHER_KEY_)', - ClassWithConstants::OTHER_KEY_ - ); - $provider[] = array( - '@AnnotationWithConstants(ClassWithConstants::OTHER_KEY_2)', - ClassWithConstants::OTHER_KEY_2 - ); - $provider[] = array( - '@AnnotationWithConstants(Doctrine\Tests\Common\Annotations\Fixtures\ClassWithConstants::SOME_VALUE)', - ClassWithConstants::SOME_VALUE - ); - $provider[] = array( - '@AnnotationWithConstants(IntefaceWithConstants::SOME_VALUE)', - IntefaceWithConstants::SOME_VALUE - ); - $provider[] = array( - '@AnnotationWithConstants(\Doctrine\Tests\Common\Annotations\Fixtures\IntefaceWithConstants::SOME_VALUE)', - IntefaceWithConstants::SOME_VALUE - ); - $provider[] = array( - '@AnnotationWithConstants({AnnotationWithConstants::STRING, AnnotationWithConstants::INTEGER, AnnotationWithConstants::FLOAT})', - array(AnnotationWithConstants::STRING, AnnotationWithConstants::INTEGER, AnnotationWithConstants::FLOAT) - ); - $provider[] = array( - '@AnnotationWithConstants({ - AnnotationWithConstants::STRING = AnnotationWithConstants::INTEGER - })', - array(AnnotationWithConstants::STRING => AnnotationWithConstants::INTEGER) - ); - $provider[] = array( - '@AnnotationWithConstants({ - Doctrine\Tests\Common\Annotations\Fixtures\IntefaceWithConstants::SOME_KEY = AnnotationWithConstants::INTEGER - })', - array(IntefaceWithConstants::SOME_KEY => AnnotationWithConstants::INTEGER) - ); - $provider[] = array( - '@AnnotationWithConstants({ - \Doctrine\Tests\Common\Annotations\Fixtures\IntefaceWithConstants::SOME_KEY = AnnotationWithConstants::INTEGER - })', - array(IntefaceWithConstants::SOME_KEY => AnnotationWithConstants::INTEGER) - ); - $provider[] = array( - '@AnnotationWithConstants({ - AnnotationWithConstants::STRING = AnnotationWithConstants::INTEGER, - ClassWithConstants::SOME_KEY = ClassWithConstants::SOME_VALUE, - Doctrine\Tests\Common\Annotations\Fixtures\ClassWithConstants::SOME_KEY = IntefaceWithConstants::SOME_VALUE - })', - array( - AnnotationWithConstants::STRING => AnnotationWithConstants::INTEGER, - ClassWithConstants::SOME_KEY => ClassWithConstants::SOME_VALUE, - ClassWithConstants::SOME_KEY => IntefaceWithConstants::SOME_VALUE - ) - ); - $provider[] = array( - '@AnnotationWithConstants(AnnotationWithConstants::class)', - 'Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithConstants' - ); - $provider[] = array( - '@AnnotationWithConstants({AnnotationWithConstants::class = AnnotationWithConstants::class})', - array('Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithConstants' => 'Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithConstants') - ); - $provider[] = array( - '@AnnotationWithConstants(Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithConstants::class)', - 'Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithConstants' - ); - $provider[] = array( - '@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithConstants(Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithConstants::class)', - 'Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithConstants' - ); - return $provider; - } - - /** - * @dataProvider getConstantsProvider - */ - public function testSupportClassConstants($docblock, $expected) - { - $parser = $this->createTestParser(); - $parser->setImports(array( - 'classwithconstants' => 'Doctrine\Tests\Common\Annotations\Fixtures\ClassWithConstants', - 'intefacewithconstants' => 'Doctrine\Tests\Common\Annotations\Fixtures\IntefaceWithConstants', - 'annotationwithconstants' => 'Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithConstants' - )); - - $result = $parser->parse($docblock); - $this->assertInstanceOf('\Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithConstants', $annotation = $result[0]); - $this->assertEquals($expected, $annotation->value); - } - - /** - * @expectedException \Doctrine\Common\Annotations\AnnotationException - * @expectedExceptionMessage The annotation @SomeAnnotationClassNameWithoutConstructorAndProperties declared on does not accept any values, but got {"value":"Foo"}. - */ - public function testWithoutConstructorWhenIsNotDefaultValue() - { - $parser = $this->createTestParser(); - $docblock = <<setTarget(Target::TARGET_CLASS); - $parser->parse($docblock); - } - - /** - * @expectedException \Doctrine\Common\Annotations\AnnotationException - * @expectedExceptionMessage The annotation @SomeAnnotationClassNameWithoutConstructorAndProperties declared on does not accept any values, but got {"value":"Foo"}. - */ - public function testWithoutConstructorWhenHasNoProperties() - { - $parser = $this->createTestParser(); - $docblock = <<setTarget(Target::TARGET_CLASS); - $parser->parse($docblock); - } - - /** - * @expectedException \Doctrine\Common\Annotations\AnnotationException - * @expectedExceptionMessage Expected namespace separator or identifier, got ')' at position 24 in class @Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithTargetSyntaxError. - */ - public function testAnnotationTargetSyntaxError() - { - $parser = $this->createTestParser(); - $context = 'class ' . 'SomeClassName'; - $docblock = <<setTarget(Target::TARGET_CLASS); - $parser->parse($docblock,$context); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Invalid Target "Foo". Available targets: [ALL, CLASS, METHOD, PROPERTY, ANNOTATION] - */ - public function testAnnotationWithInvalidTargetDeclarationError() - { - $parser = $this->createTestParser(); - $context = 'class ' . 'SomeClassName'; - $docblock = <<setTarget(Target::TARGET_CLASS); - $parser->parse($docblock,$context); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage @Target expects either a string value, or an array of strings, "NULL" given. - */ - public function testAnnotationWithTargetEmptyError() - { - $parser = $this->createTestParser(); - $context = 'class ' . 'SomeClassName'; - $docblock = <<setTarget(Target::TARGET_CLASS); - $parser->parse($docblock,$context); - } - - /** - * @group DDC-575 - */ - public function testRegressionDDC575() - { - $parser = $this->createTestParser(); - - $docblock = <<parse($docblock); - - $this->assertInstanceOf("Doctrine\Tests\Common\Annotations\Name", $result[0]); - - $docblock = <<parse($docblock); - - $this->assertInstanceOf("Doctrine\Tests\Common\Annotations\Name", $result[0]); - } - - /** - * @group DDC-77 - */ - public function testAnnotationWithoutClassIsIgnoredWithoutWarning() - { - $parser = new DocParser(); - $parser->setIgnoreNotImportedAnnotations(true); - $result = $parser->parse("@param"); - - $this->assertEquals(0, count($result)); - } - - /** - * @group DCOM-168 - */ - public function testNotAnAnnotationClassIsIgnoredWithoutWarning() - { - $parser = new DocParser(); - $parser->setIgnoreNotImportedAnnotations(true); - $parser->setIgnoredAnnotationNames(array('PHPUnit_Framework_TestCase' => true)); - $result = $parser->parse('@PHPUnit_Framework_TestCase'); - - $this->assertEquals(0, count($result)); - } - - /** - * @expectedException \Doctrine\Common\Annotations\AnnotationException - * @expectedExceptionMessage Expected PlainValue, got ''' at position 10. - */ - public function testAnnotationDontAcceptSingleQuotes() - { - $parser = $this->createTestParser(); - $parser->parse("@Name(foo='bar')"); - } - - /** - * @group DCOM-41 - */ - public function testAnnotationDoesntThrowExceptionWhenAtSignIsNotFollowedByIdentifier() - { - $parser = new DocParser(); - $result = $parser->parse("'@'"); - - $this->assertEquals(0, count($result)); - } - - /** - * @group DCOM-41 - * @expectedException \Doctrine\Common\Annotations\AnnotationException - */ - public function testAnnotationThrowsExceptionWhenAtSignIsNotFollowedByIdentifierInNestedAnnotation() - { - $parser = new DocParser(); - $parser->parse("@Doctrine\Tests\Common\Annotations\Name(@')"); - } - - /** - * @group DCOM-56 - */ - public function testAutoloadAnnotation() - { - $this->assertFalse(class_exists('Doctrine\Tests\Common\Annotations\Fixture\Annotation\Autoload', false), 'Pre-condition: Doctrine\Tests\Common\Annotations\Fixture\Annotation\Autoload not allowed to be loaded.'); - - $parser = new DocParser(); - - AnnotationRegistry::registerAutoloadNamespace('Doctrine\Tests\Common\Annotations\Fixtures\Annotation', __DIR__ . '/../../../../'); - - $parser->setImports(array( - 'autoload' => 'Doctrine\Tests\Common\Annotations\Fixtures\Annotation\Autoload', - )); - $annotations = $parser->parse('@Autoload'); - - $this->assertEquals(1, count($annotations)); - $this->assertInstanceOf('Doctrine\Tests\Common\Annotations\Fixtures\Annotation\Autoload', $annotations[0]); - } - - public function createTestParser() - { - $parser = new DocParser(); - $parser->setIgnoreNotImportedAnnotations(true); - $parser->setImports(array( - 'name' => 'Doctrine\Tests\Common\Annotations\Name', - '__NAMESPACE__' => 'Doctrine\Tests\Common\Annotations', - )); - - return $parser; - } - - /** - * @group DDC-78 - * @expectedException \Doctrine\Common\Annotations\AnnotationException - * @expectedExceptionMessage Expected PlainValue, got ''' at position 10 in class \Doctrine\Tests\Common\Annotations\Name - */ - public function testSyntaxErrorWithContextDescription() - { - $parser = $this->createTestParser(); - $parser->parse("@Name(foo='bar')", "class \Doctrine\Tests\Common\Annotations\Name"); - } - - /** - * @group DDC-183 - */ - public function testSyntaxErrorWithUnknownCharacters() - { - $docblock = <<setInput(trim($docblock, '/ *')); - //var_dump($lexer); - - try { - $parser = $this->createTestParser(); - $parser->parse($docblock); - } catch (\Exception $e) { - $this->fail($e->getMessage()); - } - } - - /** - * @group DCOM-14 - */ - public function testIgnorePHPDocThrowTag() - { - $docblock = <<createTestParser(); - $parser->parse($docblock); - } catch (\Exception $e) { - $this->fail($e->getMessage()); - } - } - - /** - * @group DCOM-38 - */ - public function testCastInt() - { - $parser = $this->createTestParser(); - - $result = $parser->parse("@Name(foo=1234)"); - $annot = $result[0]; - $this->assertInternalType('int', $annot->foo); - } - - /** - * @group DCOM-38 - */ - public function testCastNegativeInt() - { - $parser = $this->createTestParser(); - - $result = $parser->parse("@Name(foo=-1234)"); - $annot = $result[0]; - $this->assertInternalType('int', $annot->foo); - } - - /** - * @group DCOM-38 - */ - public function testCastFloat() - { - $parser = $this->createTestParser(); - - $result = $parser->parse("@Name(foo=1234.345)"); - $annot = $result[0]; - $this->assertInternalType('float', $annot->foo); - } - - /** - * @group DCOM-38 - */ - public function testCastNegativeFloat() - { - $parser = $this->createTestParser(); - - $result = $parser->parse("@Name(foo=-1234.345)"); - $annot = $result[0]; - $this->assertInternalType('float', $annot->foo); - - $result = $parser->parse("@Marker(-1234.345)"); - $annot = $result[0]; - $this->assertInternalType('float', $annot->value); - } - - public function testReservedKeywordsInAnnotations() - { - $parser = $this->createTestParser(); - - $result = $parser->parse('@Doctrine\Tests\Common\Annotations\True'); - $this->assertTrue($result[0] instanceof True); - $result = $parser->parse('@Doctrine\Tests\Common\Annotations\False'); - $this->assertTrue($result[0] instanceof False); - $result = $parser->parse('@Doctrine\Tests\Common\Annotations\Null'); - $this->assertTrue($result[0] instanceof Null); - - $result = $parser->parse('@True'); - $this->assertTrue($result[0] instanceof True); - $result = $parser->parse('@False'); - $this->assertTrue($result[0] instanceof False); - $result = $parser->parse('@Null'); - $this->assertTrue($result[0] instanceof Null); - } - - /** - * @expectedException \Doctrine\Common\Annotations\AnnotationException - * @expectedExceptionMessage [Creation Error] The annotation @SomeAnnotationClassNameWithoutConstructor declared on some class does not have a property named "invalidaProperty". Available properties: data, name - */ - public function testSetValuesExeption() - { - $docblock = <<createTestParser()->parse($docblock, 'some class'); - } - - /** - * @expectedException \Doctrine\Common\Annotations\AnnotationException - * @expectedExceptionMessage [Syntax Error] Expected Doctrine\Common\Annotations\DocLexer::T_IDENTIFIER or Doctrine\Common\Annotations\DocLexer::T_TRUE or Doctrine\Common\Annotations\DocLexer::T_FALSE or Doctrine\Common\Annotations\DocLexer::T_NULL, got '3.42' at position 5. - */ - public function testInvalidIdentifierInAnnotation() - { - $parser = $this->createTestParser(); - $parser->parse('@Foo\3.42'); - } - - public function testTrailingCommaIsAllowed() - { - $parser = $this->createTestParser(); - - $annots = $parser->parse('@Name({ - "Foo", - "Bar", - })'); - $this->assertEquals(1, count($annots)); - $this->assertEquals(array('Foo', 'Bar'), $annots[0]->value); - } - - public function testDefaultAnnotationValueIsNotOverwritten() - { - $parser = $this->createTestParser(); - - $annots = $parser->parse('@Doctrine\Tests\Common\Annotations\Fixtures\Annotation\AnnotWithDefaultValue'); - $this->assertEquals(1, count($annots)); - $this->assertEquals('bar', $annots[0]->foo); - } - - public function testArrayWithColon() - { - $parser = $this->createTestParser(); - - $annots = $parser->parse('@Name({"foo": "bar"})'); - $this->assertEquals(1, count($annots)); - $this->assertEquals(array('foo' => 'bar'), $annots[0]->value); - } - - /** - * @expectedException \Doctrine\Common\Annotations\AnnotationException - * @expectedExceptionMessage [Semantical Error] Couldn't find constant foo. - */ - public function testInvalidContantName() - { - $parser = $this->createTestParser(); - $parser->parse('@Name(foo: "bar")'); - } - - /** - * Tests parsing empty arrays. - */ - public function testEmptyArray() - { - $parser = $this->createTestParser(); - - $annots = $parser->parse('@Name({"foo": {}})'); - $this->assertEquals(1, count($annots)); - $this->assertEquals(array('foo' => array()), $annots[0]->value); - } - - public function testKeyHasNumber() - { - $parser = $this->createTestParser(); - $annots = $parser->parse('@SettingsAnnotation(foo="test", bar2="test")'); - - $this->assertEquals(1, count($annots)); - $this->assertEquals(array('foo' => 'test', 'bar2' => 'test'), $annots[0]->settings); - } -} - -/** @Annotation */ -class SettingsAnnotation -{ - public $settings; - - public function __construct($settings) - { - $this->settings = $settings; - } -} - -/** @Annotation */ -class SomeAnnotationClassNameWithoutConstructor -{ - public $data; - public $name; -} - -/** @Annotation */ -class SomeAnnotationWithConstructorWithoutParams -{ - function __construct() - { - $this->data = "Some data"; - } - public $data; - public $name; -} - -/** @Annotation */ -class SomeAnnotationClassNameWithoutConstructorAndProperties{} - -/** - * @Annotation - * @Target("Foo") - */ -class AnnotationWithInvalidTargetDeclaration{} - -/** - * @Annotation - * @Target - */ -class AnnotationWithTargetEmpty{} - -/** @Annotation */ -class AnnotationExtendsAnnotationTargetAll extends \Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll -{ -} - -/** @Annotation */ -class Name extends \Doctrine\Common\Annotations\Annotation { - public $foo; -} - -/** @Annotation */ -class Marker { - public $value; -} - -/** @Annotation */ -class True {} - -/** @Annotation */ -class False {} - -/** @Annotation */ -class Null {} - -namespace Doctrine\Tests\Common\Annotations\FooBar; - -/** @Annotation */ -class Name extends \Doctrine\Common\Annotations\Annotation { -} diff --git a/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/DummyClass.php b/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/DummyClass.php deleted file mode 100644 index 17223f6..0000000 --- a/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/DummyClass.php +++ /dev/null @@ -1,48 +0,0 @@ -cacheDir = sys_get_temp_dir() . "/annotations_". uniqid(); - @mkdir($this->cacheDir); - return new FileCacheReader(new AnnotationReader(), $this->cacheDir); - } - - public function tearDown() - { - foreach (glob($this->cacheDir.'/*.php') AS $file) { - unlink($file); - } - rmdir($this->cacheDir); - } - - /** - * @group DCOM-81 - */ - public function testAttemptToCreateAnnotationCacheDir() - { - $this->cacheDir = sys_get_temp_dir() . "/not_existed_dir_". uniqid(); - - $this->assertFalse(is_dir($this->cacheDir)); - - new FileCacheReader(new AnnotationReader(), $this->cacheDir); - - $this->assertTrue(is_dir($this->cacheDir)); - } -} \ No newline at end of file diff --git a/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/AnnotWithDefaultValue.php b/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/AnnotWithDefaultValue.php deleted file mode 100644 index 44108e1..0000000 --- a/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/AnnotWithDefaultValue.php +++ /dev/null @@ -1,10 +0,0 @@ -roles = $values['value']; - } -} \ No newline at end of file diff --git a/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/Template.php b/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/Template.php deleted file mode 100644 index b507e60..0000000 --- a/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/Template.php +++ /dev/null @@ -1,14 +0,0 @@ -name = isset($values['value']) ? $values['value'] : null; - } -} \ No newline at end of file diff --git a/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/Version.php b/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/Version.php deleted file mode 100644 index 09ef031..0000000 --- a/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/Version.php +++ /dev/null @@ -1,11 +0,0 @@ -"), - @Attribute("arrayOfStrings", type = "string[]"), - @Attribute("annotation", type = "Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll"), - @Attribute("arrayOfAnnotations", type = "array"), - }) - */ -final class AnnotationWithAttributes -{ - - public final function __construct(array $data) - { - foreach ($data as $key => $value) { - $this->$key = $value; - } - } - - private $mixed; - private $boolean; - private $bool; - private $float; - private $string; - private $integer; - private $array; - private $annotation; - private $arrayOfIntegers; - private $arrayOfStrings; - private $arrayOfAnnotations; - - /** - * @return mixed - */ - public function getMixed() - { - return $this->mixed; - } - - /** - * @return boolean - */ - public function getBoolean() - { - return $this->boolean; - } - - /** - * @return bool - */ - public function getBool() - { - return $this->bool; - } - - /** - * @return float - */ - public function getFloat() - { - return $this->float; - } - - /** - * @return string - */ - public function getString() - { - return $this->string; - } - - public function getInteger() - { - return $this->integer; - } - - /** - * @return array - */ - public function getArray() - { - return $this->array; - } - - /** - * @return Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll - */ - public function getAnnotation() - { - return $this->annotation; - } - - /** - * @return string[] - */ - public function getArrayOfStrings() - { - return $this->arrayOfIntegers; - } - - /** - * @return array - */ - public function getArrayOfIntegers() - { - return $this->arrayOfIntegers; - } - - /** - * @return array - */ - public function getArrayOfAnnotations() - { - return $this->arrayOfAnnotations; - } - -} \ No newline at end of file diff --git a/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationWithConstants.php b/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationWithConstants.php deleted file mode 100644 index 9c94558..0000000 --- a/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationWithConstants.php +++ /dev/null @@ -1,20 +0,0 @@ - $value) { - $this->$key = $value; - } - } - - /** - * @var string - */ - private $value; - - /** - * - * @var Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAnnotation - */ - private $annot; - - /** - * @return string - */ - public function getValue() - { - return $this->value; - } - - /** - * @return Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAnnotation - */ - public function getAnnot() - { - return $this->annot; - } - -} \ No newline at end of file diff --git a/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationWithRequiredAttributesWithoutContructor.php b/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationWithRequiredAttributesWithoutContructor.php deleted file mode 100644 index bf458ee..0000000 --- a/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationWithRequiredAttributesWithoutContructor.php +++ /dev/null @@ -1,24 +0,0 @@ - - */ - public $arrayOfIntegers; - - /** - * @var string[] - */ - public $arrayOfStrings; - - /** - * @var array - */ - public $arrayOfAnnotations; - -} \ No newline at end of file diff --git a/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/Fixtures/Api.php b/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/Fixtures/Api.php deleted file mode 100644 index 534ad14..0000000 --- a/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/Fixtures/Api.php +++ /dev/null @@ -1,10 +0,0 @@ -events->filter(function ($item) use ($year, $month, $day) { - $leftDate = new \DateTime($year.'-'.$month.'-'.$day.' 00:00'); - $rigthDate = new \DateTime($year.'-'.$month.'-'.$day.' +1 day 00:00'); - return ( ( $leftDate <= $item->getDateStart() ) && ( $item->getDateStart() < $rigthDate ) ); - - } - ); - return $extractEvents; - } - -} \ No newline at end of file diff --git a/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithConstants.php b/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithConstants.php deleted file mode 100644 index 719d68f..0000000 --- a/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithConstants.php +++ /dev/null @@ -1,11 +0,0 @@ - - */ -class Controller -{ - /** - * @Route("/", name="_demo") - * @Template() - */ - public function indexAction() - { - return array(); - } - - /** - * @Route("/hello/{name}", name="_demo_hello") - * @Template() - */ - public function helloAction($name) - { - return array('name' => $name); - } - - /** - * @Route("/contact", name="_demo_contact") - * @Template() - */ - public function contactAction() - { - $form = ContactForm::create($this->get('form.context'), 'contact'); - - $form->bind($this->container->get('request'), $form); - if ($form->isValid()) { - $form->send($this->get('mailer')); - - $this->get('session')->setFlash('notice', 'Message sent!'); - - return new RedirectResponse($this->generateUrl('_demo')); - } - - return array('form' => $form); - } - - /** - * Creates the ACL for the passed object identity - * - * @param ObjectIdentityInterface $oid - * @return void - */ - private function createObjectIdentity(ObjectIdentityInterface $oid) - { - $classId = $this->createOrRetrieveClassId($oid->getType()); - - $this->connection->executeQuery($this->getInsertObjectIdentitySql($oid->getIdentifier(), $classId, true)); - } - - /** - * Returns the primary key for the passed class type. - * - * If the type does not yet exist in the database, it will be created. - * - * @param string $classType - * @return integer - */ - private function createOrRetrieveClassId($classType) - { - if (false !== $id = $this->connection->executeQuery($this->getSelectClassIdSql($classType))->fetchColumn()) { - return $id; - } - - $this->connection->executeQuery($this->getInsertClassSql($classType)); - - return $this->connection->executeQuery($this->getSelectClassIdSql($classType))->fetchColumn(); - } - - /** - * Returns the primary key for the passed security identity. - * - * If the security identity does not yet exist in the database, it will be - * created. - * - * @param SecurityIdentityInterface $sid - * @return integer - */ - private function createOrRetrieveSecurityIdentityId(SecurityIdentityInterface $sid) - { - if (false !== $id = $this->connection->executeQuery($this->getSelectSecurityIdentityIdSql($sid))->fetchColumn()) { - return $id; - } - - $this->connection->executeQuery($this->getInsertSecurityIdentitySql($sid)); - - return $this->connection->executeQuery($this->getSelectSecurityIdentityIdSql($sid))->fetchColumn(); - } - - /** - * Deletes all ACEs for the given object identity primary key. - * - * @param integer $oidPK - * @return void - */ - private function deleteAccessControlEntries($oidPK) - { - $this->connection->executeQuery($this->getDeleteAccessControlEntriesSql($oidPK)); - } - - /** - * Deletes the object identity from the database. - * - * @param integer $pk - * @return void - */ - private function deleteObjectIdentity($pk) - { - $this->connection->executeQuery($this->getDeleteObjectIdentitySql($pk)); - } - - /** - * Deletes all entries from the relations table from the database. - * - * @param integer $pk - * @return void - */ - private function deleteObjectIdentityRelations($pk) - { - $this->connection->executeQuery($this->getDeleteObjectIdentityRelationsSql($pk)); - } - - /** - * This regenerates the ancestor table which is used for fast read access. - * - * @param AclInterface $acl - * @return void - */ - private function regenerateAncestorRelations(AclInterface $acl) - { - $pk = $acl->getId(); - $this->connection->executeQuery($this->getDeleteObjectIdentityRelationsSql($pk)); - $this->connection->executeQuery($this->getInsertObjectIdentityRelationSql($pk, $pk)); - - $parentAcl = $acl->getParentAcl(); - while (null !== $parentAcl) { - $this->connection->executeQuery($this->getInsertObjectIdentityRelationSql($pk, $parentAcl->getId())); - - $parentAcl = $parentAcl->getParentAcl(); - } - } - - /** - * This processes changes on an ACE related property (classFieldAces, or objectFieldAces). - * - * @param string $name - * @param array $changes - * @return void - */ - private function updateFieldAceProperty($name, array $changes) - { - $sids = new \SplObjectStorage(); - $classIds = new \SplObjectStorage(); - $currentIds = array(); - foreach ($changes[1] as $field => $new) { - for ($i=0,$c=count($new); $i<$c; $i++) { - $ace = $new[$i]; - - if (null === $ace->getId()) { - if ($sids->contains($ace->getSecurityIdentity())) { - $sid = $sids->offsetGet($ace->getSecurityIdentity()); - } else { - $sid = $this->createOrRetrieveSecurityIdentityId($ace->getSecurityIdentity()); - } - - $oid = $ace->getAcl()->getObjectIdentity(); - if ($classIds->contains($oid)) { - $classId = $classIds->offsetGet($oid); - } else { - $classId = $this->createOrRetrieveClassId($oid->getType()); - } - - $objectIdentityId = $name === 'classFieldAces' ? null : $ace->getAcl()->getId(); - - $this->connection->executeQuery($this->getInsertAccessControlEntrySql($classId, $objectIdentityId, $field, $i, $sid, $ace->getStrategy(), $ace->getMask(), $ace->isGranting(), $ace->isAuditSuccess(), $ace->isAuditFailure())); - $aceId = $this->connection->executeQuery($this->getSelectAccessControlEntryIdSql($classId, $objectIdentityId, $field, $i))->fetchColumn(); - $this->loadedAces[$aceId] = $ace; - - $aceIdProperty = new \ReflectionProperty('Symfony\Component\Security\Acl\Domain\Entry', 'id'); - $aceIdProperty->setAccessible(true); - $aceIdProperty->setValue($ace, intval($aceId)); - } else { - $currentIds[$ace->getId()] = true; - } - } - } - - foreach ($changes[0] as $old) { - for ($i=0,$c=count($old); $i<$c; $i++) { - $ace = $old[$i]; - - if (!isset($currentIds[$ace->getId()])) { - $this->connection->executeQuery($this->getDeleteAccessControlEntrySql($ace->getId())); - unset($this->loadedAces[$ace->getId()]); - } - } - } - } - - /** - * This processes changes on an ACE related property (classAces, or objectAces). - * - * @param string $name - * @param array $changes - * @return void - */ - private function updateAceProperty($name, array $changes) - { - list($old, $new) = $changes; - - $sids = new \SplObjectStorage(); - $classIds = new \SplObjectStorage(); - $currentIds = array(); - for ($i=0,$c=count($new); $i<$c; $i++) { - $ace = $new[$i]; - - if (null === $ace->getId()) { - if ($sids->contains($ace->getSecurityIdentity())) { - $sid = $sids->offsetGet($ace->getSecurityIdentity()); - } else { - $sid = $this->createOrRetrieveSecurityIdentityId($ace->getSecurityIdentity()); - } - - $oid = $ace->getAcl()->getObjectIdentity(); - if ($classIds->contains($oid)) { - $classId = $classIds->offsetGet($oid); - } else { - $classId = $this->createOrRetrieveClassId($oid->getType()); - } - - $objectIdentityId = $name === 'classAces' ? null : $ace->getAcl()->getId(); - - $this->connection->executeQuery($this->getInsertAccessControlEntrySql($classId, $objectIdentityId, null, $i, $sid, $ace->getStrategy(), $ace->getMask(), $ace->isGranting(), $ace->isAuditSuccess(), $ace->isAuditFailure())); - $aceId = $this->connection->executeQuery($this->getSelectAccessControlEntryIdSql($classId, $objectIdentityId, null, $i))->fetchColumn(); - $this->loadedAces[$aceId] = $ace; - - $aceIdProperty = new \ReflectionProperty($ace, 'id'); - $aceIdProperty->setAccessible(true); - $aceIdProperty->setValue($ace, intval($aceId)); - } else { - $currentIds[$ace->getId()] = true; - } - } - - for ($i=0,$c=count($old); $i<$c; $i++) { - $ace = $old[$i]; - - if (!isset($currentIds[$ace->getId()])) { - $this->connection->executeQuery($this->getDeleteAccessControlEntrySql($ace->getId())); - unset($this->loadedAces[$ace->getId()]); - } - } - } - - /** - * Persists the changes which were made to ACEs to the database. - * - * @param \SplObjectStorage $aces - * @return void - */ - private function updateAces(\SplObjectStorage $aces) - { - foreach ($aces as $ace) { - $propertyChanges = $aces->offsetGet($ace); - $sets = array(); - - if (isset($propertyChanges['mask'])) { - $sets[] = sprintf('mask = %d', $propertyChanges['mask'][1]); - } - if (isset($propertyChanges['strategy'])) { - $sets[] = sprintf('granting_strategy = %s', $this->connection->quote($propertyChanges['strategy'])); - } - if (isset($propertyChanges['aceOrder'])) { - $sets[] = sprintf('ace_order = %d', $propertyChanges['aceOrder'][1]); - } - if (isset($propertyChanges['auditSuccess'])) { - $sets[] = sprintf('audit_success = %s', $this->connection->getDatabasePlatform()->convertBooleans($propertyChanges['auditSuccess'][1])); - } - if (isset($propertyChanges['auditFailure'])) { - $sets[] = sprintf('audit_failure = %s', $this->connection->getDatabasePlatform()->convertBooleans($propertyChanges['auditFailure'][1])); - } - - $this->connection->executeQuery($this->getUpdateAccessControlEntrySql($ace->getId(), $sets)); - } - } -} \ No newline at end of file diff --git a/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/Fixtures/DifferentNamespacesPerFileWithClassAsFirst.php b/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/Fixtures/DifferentNamespacesPerFileWithClassAsFirst.php deleted file mode 100644 index bda2cc2..0000000 --- a/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/Fixtures/DifferentNamespacesPerFileWithClassAsFirst.php +++ /dev/null @@ -1,15 +0,0 @@ -test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test2() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test3() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test4() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test5() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test6() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test7() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test8() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - - } - - public function test9() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test10() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test11() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test12() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test13() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test14() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test15() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test16() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test17() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - - } - - public function test18() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test19() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test20() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test21() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test22() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test23() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test24() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test25() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test26() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test27() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - - } - - public function test28() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test29() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test30() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test31() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test32() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test33() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test34() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test35() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test36() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test37() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - - } - - public function test38() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test39() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } -} diff --git a/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/Fixtures/NoAnnotation.php b/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/Fixtures/NoAnnotation.php deleted file mode 100644 index 1dae104..0000000 --- a/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/Fixtures/NoAnnotation.php +++ /dev/null @@ -1,5 +0,0 @@ -test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test2() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test3() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test4() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test5() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test6() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test7() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test8() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - - } - - public function test9() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test10() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test11() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test12() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test13() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test14() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test15() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test16() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test17() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - - } - - public function test18() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test19() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test20() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test21() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test22() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test23() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test24() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test25() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test26() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test27() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - - } - - public function test28() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test29() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test30() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test31() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test32() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test33() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test34() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test35() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test36() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test37() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - - } - - public function test38() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } - - public function test39() - { - echo $this->test1; - echo $this->test2; - echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - foreach ($array as $key => $value) { - echo $key . ' => ' . $value; - } - - $val = (string)self::TEST1; - $val .= (string)self::TEST2; - $val .= (string)self::TEST3; - $val .= (string)self::TEST4; - $val .= (string)self::TEST5; - $val .= (string)self::TEST6; - $val .= (string)self::TEST7; - $val .= (string)self::TEST8; - $val .= (string)self::TEST9; - - strtolower($val); - - return $val; - } -} diff --git a/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/Fixtures/TestInterface.php b/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/Fixtures/TestInterface.php deleted file mode 100644 index 58c5e6a..0000000 --- a/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/Fixtures/TestInterface.php +++ /dev/null @@ -1,13 +0,0 @@ -getMethod(); - - $time = microtime(true); - for ($i=0,$c=500; $i<$c; $i++) { - $reader->getMethodAnnotations($method); - } - $time = microtime(true) - $time; - - $this->printResults('cached reader (in-memory)', $time, $c); - } - - /** - * @group performance - */ - public function testCachedReadPerformanceWithFileCache() - { - $method = $this->getMethod(); - - // prime cache - $reader = new FileCacheReader(new AnnotationReader(), sys_get_temp_dir()); - $reader->getMethodAnnotations($method); - - $time = microtime(true); - for ($i=0,$c=500; $i<$c; $i++) { - $reader = new FileCacheReader(new AnnotationReader(), sys_get_temp_dir()); - $reader->getMethodAnnotations($method); - clearstatcache(); - } - $time = microtime(true) - $time; - - $this->printResults('cached reader (file)', $time, $c); - } - - /** - * @group performance - */ - public function testReadPerformance() - { - $method = $this->getMethod(); - - $time = microtime(true); - for ($i=0,$c=150; $i<$c; $i++) { - $reader = new AnnotationReader(); - $reader->getMethodAnnotations($method); - } - $time = microtime(true) - $time; - - $this->printResults('reader', $time, $c); - } - - /** - * @group performance - */ - public function testDocParsePerformance() - { - $imports = array( - 'ignorephpdoc' => 'Annotations\Annotation\IgnorePhpDoc', - 'ignoreannotation' => 'Annotations\Annotation\IgnoreAnnotation', - 'route' => 'Doctrine\Tests\Common\Annotations\Fixtures\Annotation\Route', - 'template' => 'Doctrine\Tests\Common\Annotations\Fixtures\Annotation\Template', - '__NAMESPACE__' => 'Doctrine\Tests\Common\Annotations\Fixtures', - ); - $ignored = array( - 'access', 'author', 'copyright', 'deprecated', 'example', 'ignore', - 'internal', 'link', 'see', 'since', 'tutorial', 'version', 'package', - 'subpackage', 'name', 'global', 'param', 'return', 'staticvar', - 'static', 'var', 'throws', 'inheritdoc', - ); - - $method = $this->getMethod(); - $methodComment = $method->getDocComment(); - $classComment = $method->getDeclaringClass()->getDocComment(); - - $time = microtime(true); - for ($i=0,$c=200; $i<$c; $i++) { - $parser = new DocParser(); - $parser->setImports($imports); - $parser->setIgnoredAnnotationNames($ignored); - $parser->setIgnoreNotImportedAnnotations(true); - - $parser->parse($methodComment); - $parser->parse($classComment); - } - $time = microtime(true) - $time; - - $this->printResults('doc-parser', $time, $c); - } - - /** - * @group performance - */ - public function testDocLexerPerformance() - { - $method = $this->getMethod(); - $methodComment = $method->getDocComment(); - $classComment = $method->getDeclaringClass()->getDocComment(); - - $time = microtime(true); - for ($i=0,$c=500; $i<$c; $i++) { - $lexer = new DocLexer(); - $lexer->setInput($methodComment); - $lexer->setInput($classComment); - } - $time = microtime(true) - $time; - - $this->printResults('doc-lexer', $time, $c); - } - - /** - * @group performance - */ - public function testPhpParserPerformanceWithShortCut() - { - $class = new \ReflectionClass('Doctrine\Tests\Common\Annotations\Fixtures\NamespacedSingleClassLOC1000'); - - $time = microtime(true); - for ($i=0,$c=500; $i<$c; $i++) { - $parser = new PhpParser(); - $parser->parseClass($class); - } - $time = microtime(true) - $time; - - $this->printResults('doc-parser-with-short-cut', $time, $c); - } - - /** - * @group performance - */ - public function testPhpParserPerformanceWithoutShortCut() - { - $class = new \ReflectionClass('SingleClassLOC1000'); - - $time = microtime(true); - for ($i=0,$c=500; $i<$c; $i++) { - $parser = new PhpParser(); - $parser->parseClass($class); - } - $time = microtime(true) - $time; - - $this->printResults('doc-parser-without-short-cut', $time, $c); - } - - private function getMethod() - { - return new \ReflectionMethod('Doctrine\Tests\Common\Annotations\Fixtures\Controller', 'helloAction'); - } - - private function printResults($test, $time, $iterations) - { - if (0 == $iterations) { - throw new \InvalidArgumentException('$iterations cannot be zero.'); - } - - $title = $test." results:\n"; - $iterationsText = sprintf("Iterations: %d\n", $iterations); - $totalTime = sprintf("Total Time: %.3f s\n", $time); - $iterationTime = sprintf("Time per iteration: %.3f ms\n", $time/$iterations * 1000); - - $max = max(strlen($title), strlen($iterationTime)) - 1; - - echo "\n".str_repeat('-', $max)."\n"; - echo $title; - echo str_repeat('=', $max)."\n"; - echo $iterationsText; - echo $totalTime; - echo $iterationTime; - echo str_repeat('-', $max)."\n"; - } -} \ No newline at end of file diff --git a/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/PhpParserTest.php b/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/PhpParserTest.php deleted file mode 100644 index dc01f8b..0000000 --- a/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/PhpParserTest.php +++ /dev/null @@ -1,207 +0,0 @@ -assertEquals(array( - 'route' => __NAMESPACE__ . '\Fixtures\Annotation\Route', - 'secure' => __NAMESPACE__ . '\Fixtures\Annotation\Secure', - ), $parser->parseClass($class)); - } - - public function testParseClassWithMultipleImportsInUseStatement() - { - $class = new ReflectionClass(__NAMESPACE__ . '\Fixtures\MultipleImportsInUseStatement'); - $parser = new PhpParser(); - - $this->assertEquals(array( - 'route' => __NAMESPACE__ . '\Fixtures\Annotation\Route', - 'secure' => __NAMESPACE__ . '\Fixtures\Annotation\Secure', - ), $parser->parseClass($class)); - } - - public function testParseClassWhenNotUserDefined() - { - $parser = new PhpParser(); - $this->assertEquals(array(), $parser->parseClass(new \ReflectionClass('\stdClass'))); - } - - public function testClassFileDoesNotExist() - { - $class = $this->getMockBuilder('\ReflectionClass') - ->disableOriginalConstructor() - ->getMock(); - $class->expects($this->once()) - ->method('getFilename') - ->will($this->returnValue('/valid/class/Fake.php(35) : eval()d code')); - - $parser = new PhpParser(); - $this->assertEquals(array(), $parser->parseClass($class)); - } - - public function testParseClassWhenClassIsNotNamespaced() - { - $parser = new PhpParser(); - $class = new ReflectionClass('\AnnotationsTestsFixturesNonNamespacedClass'); - - $this->assertEquals(array( - 'route' => __NAMESPACE__ . '\Fixtures\Annotation\Route', - 'template' => __NAMESPACE__ . '\Fixtures\Annotation\Template', - ), $parser->parseClass($class)); - } - - public function testParseClassWhenClassIsInterface() - { - $parser = new PhpParser(); - $class = new ReflectionClass(__NAMESPACE__ . '\Fixtures\TestInterface'); - - $this->assertEquals(array( - 'secure' => __NAMESPACE__ . '\Fixtures\Annotation\Secure', - ), $parser->parseClass($class)); - } - - public function testClassWithFullyQualifiedUseStatements() - { - $parser = new PhpParser(); - $class = new ReflectionClass(__NAMESPACE__ . '\Fixtures\ClassWithFullyQualifiedUseStatements'); - - $this->assertEquals(array( - 'secure' => '\\' . __NAMESPACE__ . '\Fixtures\Annotation\Secure', - 'route' => '\\' . __NAMESPACE__ . '\Fixtures\Annotation\Route', - 'template' => '\\' . __NAMESPACE__ . '\Fixtures\Annotation\Template', - ), $parser->parseClass($class)); - } - - public function testNamespaceAndClassCommentedOut() - { - $parser = new PhpParser(); - $class = new ReflectionClass(__NAMESPACE__ . '\Fixtures\NamespaceAndClassCommentedOut'); - - $this->assertEquals(array( - 'route' => __NAMESPACE__ . '\Fixtures\Annotation\Route', - 'template' => __NAMESPACE__ . '\Fixtures\Annotation\Template', - ), $parser->parseClass($class)); - } - - public function testEqualNamespacesPerFileWithClassAsFirst() - { - $parser = new PhpParser(); - $class = new ReflectionClass(__NAMESPACE__ . '\Fixtures\EqualNamespacesPerFileWithClassAsFirst'); - - $this->assertEquals(array( - 'secure' => __NAMESPACE__ . '\Fixtures\Annotation\Secure', - 'route' => __NAMESPACE__ . '\Fixtures\Annotation\Route', - ), $parser->parseClass($class)); - } - - public function testEqualNamespacesPerFileWithClassAsLast() - { - $parser = new PhpParser(); - $class = new ReflectionClass(__NAMESPACE__ . '\Fixtures\EqualNamespacesPerFileWithClassAsLast'); - - $this->assertEquals(array( - 'route' => __NAMESPACE__ . '\Fixtures\Annotation\Route', - 'template' => __NAMESPACE__ . '\Fixtures\Annotation\Template', - ), $parser->parseClass($class)); - } - - public function testDifferentNamespacesPerFileWithClassAsFirst() - { - $parser = new PhpParser(); - $class = new ReflectionClass(__NAMESPACE__ . '\Fixtures\DifferentNamespacesPerFileWithClassAsFirst'); - - $this->assertEquals(array( - 'secure' => __NAMESPACE__ . '\Fixtures\Annotation\Secure', - ), $parser->parseClass($class)); - } - - public function testDifferentNamespacesPerFileWithClassAsLast() - { - $parser = new PhpParser(); - $class = new ReflectionClass(__NAMESPACE__ . '\Fixtures\DifferentNamespacesPerFileWithClassAsLast'); - - $this->assertEquals(array( - 'template' => __NAMESPACE__ . '\Fixtures\Annotation\Template', - ), $parser->parseClass($class)); - } - - public function testGlobalNamespacesPerFileWithClassAsFirst() - { - $parser = new PhpParser(); - $class = new \ReflectionClass('\GlobalNamespacesPerFileWithClassAsFirst'); - - $this->assertEquals(array( - 'secure' => __NAMESPACE__ . '\Fixtures\Annotation\Secure', - 'route' => __NAMESPACE__ . '\Fixtures\Annotation\Route', - ), $parser->parseClass($class)); - } - - public function testGlobalNamespacesPerFileWithClassAsLast() - { - $parser = new PhpParser(); - $class = new ReflectionClass('\GlobalNamespacesPerFileWithClassAsLast'); - - $this->assertEquals(array( - 'route' => __NAMESPACE__ . '\Fixtures\Annotation\Route', - 'template' => __NAMESPACE__ . '\Fixtures\Annotation\Template', - ), $parser->parseClass($class)); - } - - public function testNamespaceWithClosureDeclaration() - { - $parser = new PhpParser(); - $class = new ReflectionClass(__NAMESPACE__ . '\Fixtures\NamespaceWithClosureDeclaration'); - - $this->assertEquals(array( - 'secure' => __NAMESPACE__ . '\Fixtures\Annotation\Secure', - 'route' => __NAMESPACE__ . '\Fixtures\Annotation\Route', - 'template' => __NAMESPACE__ . '\Fixtures\Annotation\Template', - ), $parser->parseClass($class)); - } - - public function testIfPointerResetsOnMultipleParsingTries() - { - $parser = new PhpParser(); - $class = new ReflectionClass(__NAMESPACE__ . '\Fixtures\NamespaceWithClosureDeclaration'); - - $this->assertEquals(array( - 'secure' => __NAMESPACE__ . '\Fixtures\Annotation\Secure', - 'route' => __NAMESPACE__ . '\Fixtures\Annotation\Route', - 'template' => __NAMESPACE__ . '\Fixtures\Annotation\Template', - ), $parser->parseClass($class)); - - $this->assertEquals(array( - 'secure' => __NAMESPACE__ . '\Fixtures\Annotation\Secure', - 'route' => __NAMESPACE__ . '\Fixtures\Annotation\Route', - 'template' => __NAMESPACE__ . '\Fixtures\Annotation\Template', - ), $parser->parseClass($class)); - } - - /** - * @group DCOM-97 - * @group regression - */ - public function testClassWithClosure() - { - $parser = new PhpParser(); - $class = new ReflectionClass(__NAMESPACE__ . '\Fixtures\ClassWithClosure'); - - $this->assertEquals(array( - 'annotationtargetall' => __NAMESPACE__ . '\Fixtures\AnnotationTargetAll', - 'annotationtargetannotation' => __NAMESPACE__ . '\Fixtures\AnnotationTargetAnnotation', - ), $parser->parseClass($class)); - } -} \ No newline at end of file diff --git a/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/SimpleAnnotationReaderTest.php b/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/SimpleAnnotationReaderTest.php deleted file mode 100644 index 51b932a..0000000 --- a/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/SimpleAnnotationReaderTest.php +++ /dev/null @@ -1,102 +0,0 @@ -markTestSkipped('The simplified annotation reader would always autoload annotations'); - } - - /** - * @group DDC-1660 - * @group regression - * - * Contrary to the behavior of the default annotation reader, @version is not ignored - */ - public function testInvalidAnnotationButIgnored() - { - $reader = $this->getReader(); - $class = new \ReflectionClass('Doctrine\Tests\Common\Annotations\Fixtures\ClassDDC1660'); - - $this->assertTrue(class_exists('Doctrine\Tests\Common\Annotations\Fixtures\Annotation\Version')); - $this->assertCount(1, $reader->getClassAnnotations($class)); - $this->assertCount(1, $reader->getMethodAnnotations($class->getMethod('bar'))); - $this->assertCount(1, $reader->getPropertyAnnotations($class->getProperty('foo'))); - } - - protected function getReader() - { - $reader = new SimpleAnnotationReader(); - $reader->addNamespace(__NAMESPACE__); - $reader->addNamespace(__NAMESPACE__ . '\Fixtures'); - $reader->addNamespace(__NAMESPACE__ . '\Fixtures\Annotation'); - - return $reader; - } -} \ No newline at end of file diff --git a/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/Ticket/DCOM55Test.php b/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/Ticket/DCOM55Test.php deleted file mode 100644 index a6159d5..0000000 --- a/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/Ticket/DCOM55Test.php +++ /dev/null @@ -1,66 +0,0 @@ -getClassAnnotations($class); - } - - public function testAnnotation() - { - $class = new \ReflectionClass(__NAMESPACE__ . '\\DCOM55Consumer'); - $reader = new AnnotationReader(); - $annots = $reader->getClassAnnotations($class); - - $this->assertEquals(1, count($annots)); - $this->assertInstanceOf(__NAMESPACE__.'\\DCOM55Annotation', $annots[0]); - } - - public function testParseAnnotationDocblocks() - { - $class = new \ReflectionClass(__NAMESPACE__ . '\\DCOM55Annotation'); - $reader = new AnnotationReader(); - $annots = $reader->getClassAnnotations($class); - - $this->assertEquals(0, count($annots)); - } -} - -/** - * @Controller - */ -class Dummy -{ - -} - -/** - * @Annotation - */ -class DCOM55Annotation -{ - -} - -/** - * @DCOM55Annotation - */ -class DCOM55Consumer -{ - -} \ No newline at end of file diff --git a/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/Ticket/DCOM58Entity.php b/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/Ticket/DCOM58Entity.php deleted file mode 100644 index 708bcc9..0000000 --- a/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/Ticket/DCOM58Entity.php +++ /dev/null @@ -1,8 +0,0 @@ -getClassAnnotations(new \ReflectionClass(__NAMESPACE__."\MappedClass")); - - foreach ($result as $annot) { - $classAnnotations[get_class($annot)] = $annot; - } - - $this->assertTrue(!isset($classAnnotations['']), 'Class "xxx" is not a valid entity or mapped super class.'); - } - - public function testIssueGlobalNamespace() - { - $docblock = "@Entity"; - $parser = new DocParser(); - $parser->setImports(array( - "__NAMESPACE__" =>"Doctrine\Tests\Common\Annotations\Ticket\Doctrine\ORM\Mapping" - )); - - $annots = $parser->parse($docblock); - - $this->assertEquals(1, count($annots)); - $this->assertInstanceOf("Doctrine\Tests\Common\Annotations\Ticket\Doctrine\ORM\Mapping\Entity", $annots[0]); - } - - public function testIssueNamespaces() - { - $docblock = "@Entity"; - $parser = new DocParser(); - $parser->addNamespace("Doctrine\Tests\Common\Annotations\Ticket\Doctrine\ORM"); - - $annots = $parser->parse($docblock); - - $this->assertEquals(1, count($annots)); - $this->assertInstanceOf("Doctrine\Tests\Common\Annotations\Ticket\Doctrine\ORM\Entity", $annots[0]); - } - - public function testIssueMultipleNamespaces() - { - $docblock = "@Entity"; - $parser = new DocParser(); - $parser->addNamespace("Doctrine\Tests\Common\Annotations\Ticket\Doctrine\ORM\Mapping"); - $parser->addNamespace("Doctrine\Tests\Common\Annotations\Ticket\Doctrine\ORM"); - - $annots = $parser->parse($docblock); - - $this->assertEquals(1, count($annots)); - $this->assertInstanceOf("Doctrine\Tests\Common\Annotations\Ticket\Doctrine\ORM\Mapping\Entity", $annots[0]); - } - - public function testIssueWithNamespacesOrImports() - { - $docblock = "@Entity"; - $parser = new DocParser(); - $annots = $parser->parse($docblock); - - $this->assertEquals(1, count($annots)); - $this->assertInstanceOf("Entity", $annots[0]); - $this->assertEquals(1, count($annots)); - } - - - public function testIssueSimpleAnnotationReader() - { - $reader = new SimpleAnnotationReader(); - $reader->addNamespace('Doctrine\Tests\Common\Annotations\Ticket\Doctrine\ORM\Mapping'); - $annots = $reader->getClassAnnotations(new \ReflectionClass(__NAMESPACE__."\MappedClass")); - - $this->assertEquals(1, count($annots)); - $this->assertInstanceOf("Doctrine\Tests\Common\Annotations\Ticket\Doctrine\ORM\Mapping\Entity", $annots[0]); - } - -} - -/** - * @Entity - */ -class MappedClass -{ - -} - - -namespace Doctrine\Tests\Common\Annotations\Ticket\Doctrine\ORM\Mapping; -/** -* @Annotation -*/ -class Entity -{ - -} - -namespace Doctrine\Tests\Common\Annotations\Ticket\Doctrine\ORM; -/** -* @Annotation -*/ -class Entity -{ - -} diff --git a/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/TopLevelAnnotation.php b/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/TopLevelAnnotation.php deleted file mode 100644 index ff3ca37..0000000 --- a/core/vendor/doctrine/annotations/tests/Doctrine/Tests/Common/Annotations/TopLevelAnnotation.php +++ /dev/null @@ -1,8 +0,0 @@ -> ./tests/travis/php.ini ;fi" - - composer self-update - - composer --prefer-source --dev install - - sh -c "if [ $TRAVIS_PHP_VERSION != 'hhvm' ]; then phpenv config-add ./tests/travis/php.ini; fi" - -script: - - ./vendor/bin/phpunit -c ./tests/travis/phpunit.travis.xml -v - -after_script: - - php vendor/bin/coveralls -v - -matrix: - allow_failures: - - php: hhvm diff --git a/core/vendor/doctrine/cache/LICENSE b/core/vendor/doctrine/cache/LICENSE deleted file mode 100644 index 4a91f0b..0000000 --- a/core/vendor/doctrine/cache/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2006-2012 Doctrine Project - -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/core/vendor/doctrine/cache/README.md b/core/vendor/doctrine/cache/README.md deleted file mode 100644 index 94f80a3..0000000 --- a/core/vendor/doctrine/cache/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# Doctrine Cache - -Master: [![Build Status](https://secure.travis-ci.org/doctrine/cache.png?branch=master)](http://travis-ci.org/doctrine/cache) [![Coverage Status](https://coveralls.io/repos/doctrine/cache/badge.png?branch=master)](https://coveralls.io/r/doctrine/cache?branch=master) - -[![Latest Stable Version](https://poser.pugx.org/doctrine/cache/v/stable.png)](https://packagist.org/packages/doctrine/cache) [![Total Downloads](https://poser.pugx.org/doctrine/cache/downloads.png)](https://packagist.org/packages/doctrine/cache) - -Cache component extracted from the Doctrine Common project. - -## Changelog - -### v1.2 - -* Added support for MongoDB as Cache Provider -* Fix namespace version reset diff --git a/core/vendor/doctrine/cache/build.properties b/core/vendor/doctrine/cache/build.properties deleted file mode 100644 index 2d98c36..0000000 --- a/core/vendor/doctrine/cache/build.properties +++ /dev/null @@ -1,3 +0,0 @@ -# Version class and file -project.version_class = Doctrine\\Common\\Cache\\Version -project.version_file = lib/Doctrine/Common/Cache/Version.php diff --git a/core/vendor/doctrine/cache/build.xml b/core/vendor/doctrine/cache/build.xml deleted file mode 100644 index a7c52e3..0000000 --- a/core/vendor/doctrine/cache/build.xml +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/core/vendor/doctrine/cache/composer.json b/core/vendor/doctrine/cache/composer.json deleted file mode 100644 index 25b9de8..0000000 --- a/core/vendor/doctrine/cache/composer.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "doctrine/cache", - "type": "library", - "description": "Caching library offering an object-oriented API for many cache backends", - "keywords": ["cache", "caching"], - "homepage": "http://www.doctrine-project.org", - "license": "MIT", - "authors": [ - {"name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com"}, - {"name": "Roman Borschel", "email": "roman@code-factory.org"}, - {"name": "Benjamin Eberlei", "email": "kontakt@beberlei.de"}, - {"name": "Jonathan Wage", "email": "jonwage@gmail.com"}, - {"name": "Johannes Schmitt", "email": "schmittjoh@gmail.com"} - ], - "require": { - "php": ">=5.3.2" - }, - "require-dev": { - "phpunit/phpunit": ">=3.7", - "satooshi/php-coveralls": "~0.6" - }, - "conflict": { - "doctrine/common": ">2.2,<2.4" - }, - "autoload": { - "psr-0": { "Doctrine\\Common\\Cache\\": "lib/" } - }, - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - } -} diff --git a/core/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ApcCache.php b/core/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ApcCache.php deleted file mode 100644 index 1f19db6..0000000 --- a/core/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ApcCache.php +++ /dev/null @@ -1,98 +0,0 @@ -. - */ - -namespace Doctrine\Common\Cache; - -/** - * APC cache provider. - * - * @link www.doctrine-project.org - * @since 2.0 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author David Abdemoulaie - */ -class ApcCache extends CacheProvider -{ - /** - * {@inheritdoc} - */ - protected function doFetch($id) - { - return apc_fetch($id); - } - - /** - * {@inheritdoc} - */ - protected function doContains($id) - { - return apc_exists($id); - } - - /** - * {@inheritdoc} - */ - protected function doSave($id, $data, $lifeTime = 0) - { - return (bool) apc_store($id, $data, (int) $lifeTime); - } - - /** - * {@inheritdoc} - */ - protected function doDelete($id) - { - return apc_delete($id); - } - - /** - * {@inheritdoc} - */ - protected function doFlush() - { - return apc_clear_cache() && apc_clear_cache('user'); - } - - /** - * {@inheritdoc} - */ - protected function doGetStats() - { - $info = apc_cache_info(); - $sma = apc_sma_info(); - - // @TODO - Temporary fix @see https://github.com/krakjoe/apcu/pull/42 - if (PHP_VERSION_ID >= 50500) { - $info['num_hits'] = isset($info['num_hits']) ? $info['num_hits'] : $info['nhits']; - $info['num_misses'] = isset($info['num_misses']) ? $info['num_misses'] : $info['nmisses']; - $info['start_time'] = isset($info['start_time']) ? $info['start_time'] : $info['stime']; - } - - return array( - Cache::STATS_HITS => $info['num_hits'], - Cache::STATS_MISSES => $info['num_misses'], - Cache::STATS_UPTIME => $info['start_time'], - Cache::STATS_MEMORY_USAGE => $info['mem_size'], - Cache::STATS_MEMORY_AVAILABLE => $sma['avail_mem'], - ); - } -} diff --git a/core/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ArrayCache.php b/core/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ArrayCache.php deleted file mode 100644 index e824377..0000000 --- a/core/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ArrayCache.php +++ /dev/null @@ -1,93 +0,0 @@ -. - */ - -namespace Doctrine\Common\Cache; - -/** - * Array cache driver. - * - * @link www.doctrine-project.org - * @since 2.0 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author David Abdemoulaie - */ -class ArrayCache extends CacheProvider -{ - /** - * @var array $data - */ - private $data = array(); - - /** - * {@inheritdoc} - */ - protected function doFetch($id) - { - return $this->doContains($id) ? $this->data[$id] : false; - } - - /** - * {@inheritdoc} - */ - protected function doContains($id) - { - return isset($this->data[$id]) || array_key_exists($id, $this->data); - } - - /** - * {@inheritdoc} - */ - protected function doSave($id, $data, $lifeTime = 0) - { - $this->data[$id] = $data; - - return true; - } - - /** - * {@inheritdoc} - */ - protected function doDelete($id) - { - unset($this->data[$id]); - - return true; - } - - /** - * {@inheritdoc} - */ - protected function doFlush() - { - $this->data = array(); - - return true; - } - - /** - * {@inheritdoc} - */ - protected function doGetStats() - { - return null; - } -} diff --git a/core/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Cache.php b/core/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Cache.php deleted file mode 100644 index 0785f26..0000000 --- a/core/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Cache.php +++ /dev/null @@ -1,111 +0,0 @@ -. - */ - -namespace Doctrine\Common\Cache; - -/** - * Interface for cache drivers. - * - * @link www.doctrine-project.org - * @since 2.0 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Fabio B. Silva - */ -interface Cache -{ - const STATS_HITS = 'hits'; - const STATS_MISSES = 'misses'; - const STATS_UPTIME = 'uptime'; - const STATS_MEMORY_USAGE = 'memory_usage'; - const STATS_MEMORY_AVAILABLE = 'memory_available'; - /** - * Only for backward compatibility (may be removed in next major release) - * - * @deprecated - */ - const STATS_MEMORY_AVAILIABLE = 'memory_available'; - - /** - * Fetches an entry from the cache. - * - * @param string $id The id of the cache entry to fetch. - * - * @return mixed The cached data or FALSE, if no cache entry exists for the given id. - */ - function fetch($id); - - /** - * Tests if an entry exists in the cache. - * - * @param string $id The cache id of the entry to check for. - * - * @return boolean TRUE if a cache entry exists for the given cache id, FALSE otherwise. - */ - function contains($id); - - /** - * Puts data into the cache. - * - * @param string $id The cache id. - * @param mixed $data The cache entry/data. - * @param int $lifeTime The cache lifetime. - * If != 0, sets a specific lifetime for this cache entry (0 => infinite lifeTime). - * - * @return boolean TRUE if the entry was successfully stored in the cache, FALSE otherwise. - */ - function save($id, $data, $lifeTime = 0); - - /** - * Deletes a cache entry. - * - * @param string $id The cache id. - * - * @return boolean TRUE if the cache entry was successfully deleted, FALSE otherwise. - */ - function delete($id); - - /** - * Retrieves cached information from the data store. - * - * The server's statistics array has the following values: - * - * - hits - * Number of keys that have been requested and found present. - * - * - misses - * Number of items that have been requested and not found. - * - * - uptime - * Time that the server is running. - * - * - memory_usage - * Memory used by this server to store items. - * - * - memory_available - * Memory allowed to use for storage. - * - * @since 2.2 - * - * @return array|null An associative array with server's statistics if available, NULL otherwise. - */ - function getStats(); -} diff --git a/core/vendor/doctrine/cache/lib/Doctrine/Common/Cache/CacheProvider.php b/core/vendor/doctrine/cache/lib/Doctrine/Common/Cache/CacheProvider.php deleted file mode 100644 index f896bc7..0000000 --- a/core/vendor/doctrine/cache/lib/Doctrine/Common/Cache/CacheProvider.php +++ /dev/null @@ -1,241 +0,0 @@ -. - */ - -namespace Doctrine\Common\Cache; - -/** - * Base class for cache provider implementations. - * - * @since 2.2 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Fabio B. Silva - */ -abstract class CacheProvider implements Cache -{ - const DOCTRINE_NAMESPACE_CACHEKEY = 'DoctrineNamespaceCacheKey[%s]'; - - /** - * The namespace to prefix all cache ids with. - * - * @var string - */ - private $namespace = ''; - - /** - * The namespace version. - * - * @var integer|null - */ - private $namespaceVersion; - - /** - * Sets the namespace to prefix all cache ids with. - * - * @param string $namespace - * - * @return void - */ - public function setNamespace($namespace) - { - $this->namespace = (string) $namespace; - $this->namespaceVersion = null; - } - - /** - * Retrieves the namespace that prefixes all cache ids. - * - * @return string - */ - public function getNamespace() - { - return $this->namespace; - } - - /** - * {@inheritdoc} - */ - public function fetch($id) - { - return $this->doFetch($this->getNamespacedId($id)); - } - - /** - * {@inheritdoc} - */ - public function contains($id) - { - return $this->doContains($this->getNamespacedId($id)); - } - - /** - * {@inheritdoc} - */ - public function save($id, $data, $lifeTime = 0) - { - return $this->doSave($this->getNamespacedId($id), $data, $lifeTime); - } - - /** - * {@inheritdoc} - */ - public function delete($id) - { - return $this->doDelete($this->getNamespacedId($id)); - } - - /** - * {@inheritdoc} - */ - public function getStats() - { - return $this->doGetStats(); - } - - /** - * Flushes all cache entries. - * - * @return boolean TRUE if the cache entries were successfully flushed, FALSE otherwise. - */ - public function flushAll() - { - return $this->doFlush(); - } - - /** - * Deletes all cache entries. - * - * @return boolean TRUE if the cache entries were successfully deleted, FALSE otherwise. - */ - public function deleteAll() - { - $namespaceCacheKey = $this->getNamespaceCacheKey(); - $namespaceVersion = $this->getNamespaceVersion() + 1; - - $this->namespaceVersion = $namespaceVersion; - - return $this->doSave($namespaceCacheKey, $namespaceVersion); - } - - /** - * Prefixes the passed id with the configured namespace value. - * - * @param string $id The id to namespace. - * - * @return string The namespaced id. - */ - private function getNamespacedId($id) - { - $namespaceVersion = $this->getNamespaceVersion(); - - return sprintf('%s[%s][%s]', $this->namespace, $id, $namespaceVersion); - } - - /** - * Returns the namespace cache key. - * - * @return string - */ - private function getNamespaceCacheKey() - { - return sprintf(self::DOCTRINE_NAMESPACE_CACHEKEY, $this->namespace); - } - - /** - * Returns the namespace version. - * - * @return integer - */ - private function getNamespaceVersion() - { - if (null !== $this->namespaceVersion) { - return $this->namespaceVersion; - } - - $namespaceCacheKey = $this->getNamespaceCacheKey(); - $namespaceVersion = $this->doFetch($namespaceCacheKey); - - if (false === $namespaceVersion) { - $namespaceVersion = 1; - - $this->doSave($namespaceCacheKey, $namespaceVersion); - } - - $this->namespaceVersion = $namespaceVersion; - - return $this->namespaceVersion; - } - - /** - * Fetches an entry from the cache. - * - * @param string $id The id of the cache entry to fetch. - * - * @return string|boolean The cached data or FALSE, if no cache entry exists for the given id. - */ - abstract protected function doFetch($id); - - /** - * Tests if an entry exists in the cache. - * - * @param string $id The cache id of the entry to check for. - * - * @return boolean TRUE if a cache entry exists for the given cache id, FALSE otherwise. - */ - abstract protected function doContains($id); - - /** - * Puts data into the cache. - * - * @param string $id The cache id. - * @param string $data The cache entry/data. - * @param int $lifeTime The lifetime. If != 0, sets a specific lifetime for this - * cache entry (0 => infinite lifeTime). - * - * @return boolean TRUE if the entry was successfully stored in the cache, FALSE otherwise. - */ - abstract protected function doSave($id, $data, $lifeTime = 0); - - /** - * Deletes a cache entry. - * - * @param string $id The cache id. - * - * @return boolean TRUE if the cache entry was successfully deleted, FALSE otherwise. - */ - abstract protected function doDelete($id); - - /** - * Flushes all cache entries. - * - * @return boolean TRUE if the cache entry was successfully deleted, FALSE otherwise. - */ - abstract protected function doFlush(); - - /** - * Retrieves cached information from the data store. - * - * @since 2.2 - * - * @return array|null An associative array with server's statistics if available, NULL otherwise. - */ - abstract protected function doGetStats(); -} diff --git a/core/vendor/doctrine/cache/lib/Doctrine/Common/Cache/CouchbaseCache.php b/core/vendor/doctrine/cache/lib/Doctrine/Common/Cache/CouchbaseCache.php deleted file mode 100644 index c21691d..0000000 --- a/core/vendor/doctrine/cache/lib/Doctrine/Common/Cache/CouchbaseCache.php +++ /dev/null @@ -1,121 +0,0 @@ -. - */ - -namespace Doctrine\Common\Cache; - -use \Couchbase; - -/** - * Couchbase cache provider. - * - * @link www.doctrine-project.org - * @since 2.4 - * @author Michael Nitschinger - */ -class CouchbaseCache extends CacheProvider -{ - /** - * @var Couchbase|null - */ - private $couchbase; - - /** - * Sets the Couchbase instance to use. - * - * @param Couchbase $couchbase - * - * @return void - */ - public function setCouchbase(Couchbase $couchbase) - { - $this->couchbase = $couchbase; - } - - /** - * Gets the Couchbase instance used by the cache. - * - * @return Couchbase|null - */ - public function getCouchbase() - { - return $this->couchbase; - } - - /** - * {@inheritdoc} - */ - protected function doFetch($id) - { - return $this->couchbase->get($id) ?: false; - } - - /** - * {@inheritdoc} - */ - protected function doContains($id) - { - return (null !== $this->couchbase->get($id)); - } - - /** - * {@inheritdoc} - */ - protected function doSave($id, $data, $lifeTime = 0) - { - if ($lifeTime > 30 * 24 * 3600) { - $lifeTime = time() + $lifeTime; - } - return $this->couchbase->set($id, $data, (int) $lifeTime); - } - - /** - * {@inheritdoc} - */ - protected function doDelete($id) - { - return $this->couchbase->delete($id); - } - - /** - * {@inheritdoc} - */ - protected function doFlush() - { - return $this->couchbase->flush(); - } - - /** - * {@inheritdoc} - */ - protected function doGetStats() - { - $stats = $this->couchbase->getStats(); - $servers = $this->couchbase->getServers(); - $server = explode(":", $servers[0]); - $key = $server[0] . ":" . "11210"; - $stats = $stats[$key]; - return array( - Cache::STATS_HITS => $stats['get_hits'], - Cache::STATS_MISSES => $stats['get_misses'], - Cache::STATS_UPTIME => $stats['uptime'], - Cache::STATS_MEMORY_USAGE => $stats['bytes'], - Cache::STATS_MEMORY_AVAILABLE => $stats['limit_maxbytes'], - ); - } -} diff --git a/core/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php b/core/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php deleted file mode 100644 index d91d0bc..0000000 --- a/core/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php +++ /dev/null @@ -1,158 +0,0 @@ -. - */ - -namespace Doctrine\Common\Cache; - -/** - * Base file cache driver. - * - * @since 2.3 - * @author Fabio B. Silva - */ -abstract class FileCache extends CacheProvider -{ - /** - * The cache directory. - * - * @var string - */ - protected $directory; - - /** - * The cache file extension. - * - * @var string|null - */ - protected $extension; - - /** - * Constructor. - * - * @param string $directory The cache directory. - * @param string|null $extension The cache file extension. - * - * @throws \InvalidArgumentException - */ - public function __construct($directory, $extension = null) - { - if ( ! is_dir($directory) && ! @mkdir($directory, 0777, true)) { - throw new \InvalidArgumentException(sprintf( - 'The directory "%s" does not exist and could not be created.', - $directory - )); - } - - if ( ! is_writable($directory)) { - throw new \InvalidArgumentException(sprintf( - 'The directory "%s" is not writable.', - $directory - )); - } - - $this->directory = realpath($directory); - $this->extension = $extension ?: $this->extension; - } - - /** - * Gets the cache directory. - * - * @return string - */ - public function getDirectory() - { - return $this->directory; - } - - /** - * Gets the cache file extension. - * - * @return string|null - */ - public function getExtension() - { - return $this->extension; - } - - /** - * @param string $id - * - * @return string - */ - protected function getFilename($id) - { - $hash = hash('sha256', $id); - $path = implode(str_split($hash, 16), DIRECTORY_SEPARATOR); - $path = $this->directory . DIRECTORY_SEPARATOR . $path; - $id = preg_replace('@[\\\/:"*?<>|]+@', '', $id); - - return $path . DIRECTORY_SEPARATOR . $id . $this->extension; - } - - /** - * {@inheritdoc} - */ - protected function doDelete($id) - { - return @unlink($this->getFilename($id)); - } - - /** - * {@inheritdoc} - */ - protected function doFlush() - { - foreach ($this->getIterator() as $name => $file) { - @unlink($name); - } - - return true; - } - - /** - * {@inheritdoc} - */ - protected function doGetStats() - { - $usage = 0; - foreach ($this->getIterator() as $file) { - $usage += $file->getSize(); - } - - $free = disk_free_space($this->directory); - - return array( - Cache::STATS_HITS => null, - Cache::STATS_MISSES => null, - Cache::STATS_UPTIME => null, - Cache::STATS_MEMORY_USAGE => $usage, - Cache::STATS_MEMORY_AVAILABLE => $free, - ); - } - - /** - * @return \Iterator - */ - private function getIterator() - { - $pattern = '/^.+\\' . $this->extension . '$/i'; - $iterator = new \RecursiveDirectoryIterator($this->directory); - $iterator = new \RecursiveIteratorIterator($iterator); - return new \RegexIterator($iterator, $pattern); - } -} diff --git a/core/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FilesystemCache.php b/core/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FilesystemCache.php deleted file mode 100644 index 07eda8e..0000000 --- a/core/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FilesystemCache.php +++ /dev/null @@ -1,125 +0,0 @@ -. - */ - -namespace Doctrine\Common\Cache; - -/** - * Filesystem cache driver. - * - * @since 2.3 - * @author Fabio B. Silva - */ -class FilesystemCache extends FileCache -{ - const EXTENSION = '.doctrinecache.data'; - - /** - * {@inheritdoc} - */ - protected $extension = self::EXTENSION; - - /** - * {@inheritdoc} - */ - protected function doFetch($id) - { - $data = ''; - $lifetime = -1; - $filename = $this->getFilename($id); - - if ( ! is_file($filename)) { - return false; - } - - $resource = fopen($filename, "r"); - - if (false !== ($line = fgets($resource))) { - $lifetime = (integer) $line; - } - - if ($lifetime !== 0 && $lifetime < time()) { - fclose($resource); - - return false; - } - - while (false !== ($line = fgets($resource))) { - $data .= $line; - } - - fclose($resource); - - return unserialize($data); - } - - /** - * {@inheritdoc} - */ - protected function doContains($id) - { - $lifetime = -1; - $filename = $this->getFilename($id); - - if ( ! is_file($filename)) { - return false; - } - - $resource = fopen($filename, "r"); - - if (false !== ($line = fgets($resource))) { - $lifetime = (integer) $line; - } - - fclose($resource); - - return $lifetime === 0 || $lifetime > time(); - } - - /** - * {@inheritdoc} - */ - protected function doSave($id, $data, $lifeTime = 0) - { - if ($lifeTime > 0) { - $lifeTime = time() + $lifeTime; - } - - $data = serialize($data); - $filename = $this->getFilename($id); - $filepath = pathinfo($filename, PATHINFO_DIRNAME); - - if ( ! is_dir($filepath)) { - if (false === @mkdir($filepath, 0777, true) && !is_dir($filepath)) { - return false; - } - } elseif ( ! is_writable($filepath)) { - return false; - } - - $tmpFile = tempnam($filepath, basename($filename)); - - if ((file_put_contents($tmpFile, $lifeTime . PHP_EOL . $data) !== false) && @rename($tmpFile, $filename)) { - @chmod($filename, 0666 & ~umask()); - - return true; - } - - return false; - } -} diff --git a/core/vendor/doctrine/cache/lib/Doctrine/Common/Cache/MemcacheCache.php b/core/vendor/doctrine/cache/lib/Doctrine/Common/Cache/MemcacheCache.php deleted file mode 100644 index f839a65..0000000 --- a/core/vendor/doctrine/cache/lib/Doctrine/Common/Cache/MemcacheCache.php +++ /dev/null @@ -1,121 +0,0 @@ -. - */ - -namespace Doctrine\Common\Cache; - -use \Memcache; - -/** - * Memcache cache provider. - * - * @link www.doctrine-project.org - * @since 2.0 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author David Abdemoulaie - */ -class MemcacheCache extends CacheProvider -{ - /** - * @var Memcache|null - */ - private $memcache; - - /** - * Sets the memcache instance to use. - * - * @param Memcache $memcache - * - * @return void - */ - public function setMemcache(Memcache $memcache) - { - $this->memcache = $memcache; - } - - /** - * Gets the memcache instance used by the cache. - * - * @return Memcache|null - */ - public function getMemcache() - { - return $this->memcache; - } - - /** - * {@inheritdoc} - */ - protected function doFetch($id) - { - return $this->memcache->get($id); - } - - /** - * {@inheritdoc} - */ - protected function doContains($id) - { - return (bool) $this->memcache->get($id); - } - - /** - * {@inheritdoc} - */ - protected function doSave($id, $data, $lifeTime = 0) - { - if ($lifeTime > 30 * 24 * 3600) { - $lifeTime = time() + $lifeTime; - } - return $this->memcache->set($id, $data, 0, (int) $lifeTime); - } - - /** - * {@inheritdoc} - */ - protected function doDelete($id) - { - return $this->memcache->delete($id); - } - - /** - * {@inheritdoc} - */ - protected function doFlush() - { - return $this->memcache->flush(); - } - - /** - * {@inheritdoc} - */ - protected function doGetStats() - { - $stats = $this->memcache->getStats(); - return array( - Cache::STATS_HITS => $stats['get_hits'], - Cache::STATS_MISSES => $stats['get_misses'], - Cache::STATS_UPTIME => $stats['uptime'], - Cache::STATS_MEMORY_USAGE => $stats['bytes'], - Cache::STATS_MEMORY_AVAILABLE => $stats['limit_maxbytes'], - ); - } -} diff --git a/core/vendor/doctrine/cache/lib/Doctrine/Common/Cache/MemcachedCache.php b/core/vendor/doctrine/cache/lib/Doctrine/Common/Cache/MemcachedCache.php deleted file mode 100644 index f7e5500..0000000 --- a/core/vendor/doctrine/cache/lib/Doctrine/Common/Cache/MemcachedCache.php +++ /dev/null @@ -1,124 +0,0 @@ -. - */ - -namespace Doctrine\Common\Cache; - -use \Memcached; - -/** - * Memcached cache provider. - * - * @link www.doctrine-project.org - * @since 2.2 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author David Abdemoulaie - */ -class MemcachedCache extends CacheProvider -{ - /** - * @var Memcached|null - */ - private $memcached; - - /** - * Sets the memcache instance to use. - * - * @param Memcached $memcached - * - * @return void - */ - public function setMemcached(Memcached $memcached) - { - $this->memcached = $memcached; - } - - /** - * Gets the memcached instance used by the cache. - * - * @return Memcached|null - */ - public function getMemcached() - { - return $this->memcached; - } - - /** - * {@inheritdoc} - */ - protected function doFetch($id) - { - return $this->memcached->get($id); - } - - /** - * {@inheritdoc} - */ - protected function doContains($id) - { - return (false !== $this->memcached->get($id)); - } - - /** - * {@inheritdoc} - */ - protected function doSave($id, $data, $lifeTime = 0) - { - if ($lifeTime > 30 * 24 * 3600) { - $lifeTime = time() + $lifeTime; - } - return $this->memcached->set($id, $data, (int) $lifeTime); - } - - /** - * {@inheritdoc} - */ - protected function doDelete($id) - { - return $this->memcached->delete($id); - } - - /** - * {@inheritdoc} - */ - protected function doFlush() - { - return $this->memcached->flush(); - } - - /** - * {@inheritdoc} - */ - protected function doGetStats() - { - $stats = $this->memcached->getStats(); - $servers = $this->memcached->getServerList(); - $key = $servers[0]['host'] . ':' . $servers[0]['port']; - $stats = $stats[$key]; - return array( - Cache::STATS_HITS => $stats['get_hits'], - Cache::STATS_MISSES => $stats['get_misses'], - Cache::STATS_UPTIME => $stats['uptime'], - Cache::STATS_MEMORY_USAGE => $stats['bytes'], - Cache::STATS_MEMORY_AVAILABLE => $stats['limit_maxbytes'], - ); - } -} diff --git a/core/vendor/doctrine/cache/lib/Doctrine/Common/Cache/MongoDBCache.php b/core/vendor/doctrine/cache/lib/Doctrine/Common/Cache/MongoDBCache.php deleted file mode 100644 index 0c7ac0a..0000000 --- a/core/vendor/doctrine/cache/lib/Doctrine/Common/Cache/MongoDBCache.php +++ /dev/null @@ -1,191 +0,0 @@ -. - */ - -namespace Doctrine\Common\Cache; - -use MongoBinData; -use MongoCollection; -use MongoDate; - -/** - * MongoDB cache provider. - * - * @since 1.1 - * @author Jeremy Mikola - */ -class MongoDBCache extends CacheProvider -{ - /** - * The data field will store the serialized PHP value. - */ - const DATA_FIELD = 'd'; - - /** - * The expiration field will store a MongoDate value indicating when the - * cache entry should expire. - * - * With MongoDB 2.2+, entries can be automatically deleted by MongoDB by - * indexing this field wit the "expireAfterSeconds" option equal to zero. - * This will direct MongoDB to regularly query for and delete any entries - * whose date is older than the current time. Entries without a date value - * in this field will be ignored. - * - * The cache provider will also check dates on its own, in case expired - * entries are fetched before MongoDB's TTLMonitor pass can expire them. - * - * @see http://docs.mongodb.org/manual/tutorial/expire-data/ - */ - const EXPIRATION_FIELD = 'e'; - - /** - * @var MongoCollection - */ - private $collection; - - /** - * Constructor. - * - * This provider will default to the write concern and read preference - * options set on the MongoCollection instance (or inherited from MongoDB or - * MongoClient). Using an unacknowledged write concern (< 1) may make the - * return values of delete() and save() unreliable. Reading from secondaries - * may make contain() and fetch() unreliable. - * - * @see http://www.php.net/manual/en/mongo.readpreferences.php - * @see http://www.php.net/manual/en/mongo.writeconcerns.php - * @param MongoCollection $collection - */ - public function __construct(MongoCollection $collection) - { - $this->collection = $collection; - } - - /** - * {@inheritdoc} - */ - protected function doFetch($id) - { - $document = $this->collection->findOne(array('_id' => $id), array(self::DATA_FIELD, self::EXPIRATION_FIELD)); - - if ($document === null) { - return false; - } - - if ($this->isExpired($document)) { - $this->doDelete($id); - return false; - } - - return unserialize($document[self::DATA_FIELD]->bin); - } - - /** - * {@inheritdoc} - */ - protected function doContains($id) - { - $document = $this->collection->findOne(array('_id' => $id), array(self::EXPIRATION_FIELD)); - - if ($document === null) { - return false; - } - - if ($this->isExpired($document)) { - $this->doDelete($id); - return false; - } - - return true; - } - - /** - * {@inheritdoc} - */ - protected function doSave($id, $data, $lifeTime = 0) - { - $result = $this->collection->update( - array('_id' => $id), - array('$set' => array( - self::EXPIRATION_FIELD => ($lifeTime > 0 ? new MongoDate(time() + $lifeTime) : null), - self::DATA_FIELD => new MongoBinData(serialize($data), MongoBinData::BYTE_ARRAY), - )), - array('upsert' => true, 'multiple' => false) - ); - - return isset($result['ok']) ? $result['ok'] == 1 : true; - } - - /** - * {@inheritdoc} - */ - protected function doDelete($id) - { - $result = $this->collection->remove(array('_id' => $id)); - - return isset($result['n']) ? $result['n'] == 1 : true; - } - - /** - * {@inheritdoc} - */ - protected function doFlush() - { - // Use remove() in lieu of drop() to maintain any collection indexes - $result = $this->collection->remove(); - - return isset($result['ok']) ? $result['ok'] == 1 : true; - } - - /** - * {@inheritdoc} - */ - protected function doGetStats() - { - $serverStatus = $this->collection->db->command(array( - 'serverStatus' => 1, - 'locks' => 0, - 'metrics' => 0, - 'recordStats' => 0, - 'repl' => 0, - )); - - $collStats = $this->collection->db->command(array('collStats' => 1)); - - return array( - Cache::STATS_HITS => null, - Cache::STATS_MISSES => null, - Cache::STATS_UPTIME => (isset($serverStatus['uptime']) ? (integer) $serverStatus['uptime'] : null), - Cache::STATS_MEMORY_USAGE => (isset($collStats['size']) ? (integer) $collStats['size'] : null), - Cache::STATS_MEMORY_AVAILABLE => null, - ); - } - - /** - * Check if the document is expired. - * - * @param array $document - * @return boolean - */ - private function isExpired(array $document) - { - return isset($document[self::EXPIRATION_FIELD]) && - $document[self::EXPIRATION_FIELD] instanceof MongoDate && - $document[self::EXPIRATION_FIELD]->sec < time(); - } -} diff --git a/core/vendor/doctrine/cache/lib/Doctrine/Common/Cache/PhpFileCache.php b/core/vendor/doctrine/cache/lib/Doctrine/Common/Cache/PhpFileCache.php deleted file mode 100644 index f017d83..0000000 --- a/core/vendor/doctrine/cache/lib/Doctrine/Common/Cache/PhpFileCache.php +++ /dev/null @@ -1,107 +0,0 @@ -. - */ - -namespace Doctrine\Common\Cache; - -/** - * Php file cache driver. - * - * @since 2.3 - * @author Fabio B. Silva - */ -class PhpFileCache extends FileCache -{ - const EXTENSION = '.doctrinecache.php'; - - /** - * {@inheritdoc} - */ - protected $extension = self::EXTENSION; - - /** - * {@inheritdoc} - */ - protected function doFetch($id) - { - $filename = $this->getFilename($id); - - if ( ! is_file($filename)) { - return false; - } - - $value = include $filename; - - if ($value['lifetime'] !== 0 && $value['lifetime'] < time()) { - return false; - } - - return $value['data']; - } - - /** - * {@inheritdoc} - */ - protected function doContains($id) - { - $filename = $this->getFilename($id); - - if ( ! is_file($filename)) { - return false; - } - - $value = include $filename; - - return $value['lifetime'] === 0 || $value['lifetime'] > time(); - } - - /** - * {@inheritdoc} - */ - protected function doSave($id, $data, $lifeTime = 0) - { - if ($lifeTime > 0) { - $lifeTime = time() + $lifeTime; - } - - if (is_object($data) && ! method_exists($data, '__set_state')) { - throw new \InvalidArgumentException( - "Invalid argument given, PhpFileCache only allows objects that implement __set_state() " . - "and fully support var_export(). You can use the FilesystemCache to save arbitrary object " . - "graphs using serialize()/deserialize()." - ); - } - - $filename = $this->getFilename($id); - $filepath = pathinfo($filename, PATHINFO_DIRNAME); - - if ( ! is_dir($filepath)) { - mkdir($filepath, 0777, true); - } - - $value = array( - 'lifetime' => $lifeTime, - 'data' => $data - ); - - $value = var_export($value, true); - $code = sprintf('. - */ - -namespace Doctrine\Common\Cache; - -use Redis; - -/** - * Redis cache provider. - * - * @link www.doctrine-project.org - * @since 2.2 - * @author Osman Ungur - */ -class RedisCache extends CacheProvider -{ - /** - * @var Redis|null - */ - private $redis; - - /** - * Sets the redis instance to use. - * - * @param Redis $redis - * - * @return void - */ - public function setRedis(Redis $redis) - { - $redis->setOption(Redis::OPT_SERIALIZER, $this->getSerializerValue()); - $this->redis = $redis; - } - - /** - * Gets the redis instance used by the cache. - * - * @return Redis|null - */ - public function getRedis() - { - return $this->redis; - } - - /** - * {@inheritdoc} - */ - protected function doFetch($id) - { - return $this->redis->get($id); - } - - /** - * {@inheritdoc} - */ - protected function doContains($id) - { - return $this->redis->exists($id); - } - - /** - * {@inheritdoc} - */ - protected function doSave($id, $data, $lifeTime = 0) - { - if ($lifeTime > 0) { - return $this->redis->setex($id, $lifeTime, $data); - } - - return $this->redis->set($id, $data); - } - - /** - * {@inheritdoc} - */ - protected function doDelete($id) - { - return $this->redis->delete($id) > 0; - } - - /** - * {@inheritdoc} - */ - protected function doFlush() - { - return $this->redis->flushDB(); - } - - /** - * {@inheritdoc} - */ - protected function doGetStats() - { - $info = $this->redis->info(); - return array( - Cache::STATS_HITS => false, - Cache::STATS_MISSES => false, - Cache::STATS_UPTIME => $info['uptime_in_seconds'], - Cache::STATS_MEMORY_USAGE => $info['used_memory'], - Cache::STATS_MEMORY_AVAILABLE => false - ); - } - - /** - * Returns the serializer constant to use. If Redis is compiled with - * igbinary support, that is used. Otherwise the default PHP serializer is - * used. - * - * @return integer One of the Redis::SERIALIZER_* constants - */ - protected function getSerializerValue() - { - return defined('Redis::SERIALIZER_IGBINARY') ? Redis::SERIALIZER_IGBINARY : Redis::SERIALIZER_PHP; - } -} diff --git a/core/vendor/doctrine/cache/lib/Doctrine/Common/Cache/RiakCache.php b/core/vendor/doctrine/cache/lib/Doctrine/Common/Cache/RiakCache.php deleted file mode 100644 index 8bb6b4b..0000000 --- a/core/vendor/doctrine/cache/lib/Doctrine/Common/Cache/RiakCache.php +++ /dev/null @@ -1,250 +0,0 @@ -. - */ - -namespace Doctrine\Common\Cache; - -use Riak\Bucket; -use Riak\Connection; -use Riak\Input; -use Riak\Exception; -use Riak\Object; - -/** - * Riak cache provider. - * - * @link www.doctrine-project.org - * @since 1.1 - * @author Guilherme Blanco - */ -class RiakCache extends CacheProvider -{ - const EXPIRES_HEADER = 'X-Riak-Meta-Expires'; - - /** - * @var \Riak\Bucket - */ - private $bucket; - - /** - * Sets the riak bucket instance to use. - * - * @param \Riak\Bucket $bucket - */ - public function __construct(Bucket $bucket) - { - $this->bucket = $bucket; - } - - /** - * {@inheritdoc} - */ - protected function doFetch($id) - { - try { - $response = $this->bucket->get($id); - - // No objects found - if ( ! $response->hasObject()) { - return false; - } - - // Check for attempted siblings - $object = ($response->hasSiblings()) - ? $this->resolveConflict($id, $response->getVClock(), $response->getObjectList()) - : $response->getFirstObject(); - - // Check for expired object - if ($this->isExpired($object)) { - $this->bucket->delete($object); - - return false; - } - - return unserialize($object->getContent()); - } catch (Exception\RiakException $e) { - // Covers: - // - Riak\ConnectionException - // - Riak\CommunicationException - // - Riak\UnexpectedResponseException - // - Riak\NotFoundException - } - - return false; - } - - /** - * {@inheritdoc} - */ - protected function doContains($id) - { - try { - // We only need the HEAD, not the entire object - $input = new Input\GetInput(); - - $input->setReturnHead(true); - - $response = $this->bucket->get($id, $input); - - // No objects found - if ( ! $response->hasObject()) { - return false; - } - - $object = $response->getFirstObject(); - - // Check for expired object - if ($this->isExpired($object)) { - $this->bucket->delete($object); - - return false; - } - - return true; - } catch (Exception\RiakException $e) { - // Do nothing - } - - return false; - } - - /** - * {@inheritdoc} - */ - protected function doSave($id, $data, $lifeTime = 0) - { - try { - $object = new Object($id); - - $object->setContent(serialize($data)); - - if ($lifeTime > 0) { - $object->addMetadata(self::EXPIRES_HEADER, (string) (time() + $lifeTime)); - } - - $this->bucket->put($object); - - return true; - } catch (Exception\RiakException $e) { - // Do nothing - } - - return false; - } - - /** - * {@inheritdoc} - */ - protected function doDelete($id) - { - try { - $this->bucket->delete($id); - - return true; - } catch (Exception\BadArgumentsException $e) { - // Key did not exist on cluster already - } catch (Exception\RiakException $e) { - // Covers: - // - Riak\Exception\ConnectionException - // - Riak\Exception\CommunicationException - // - Riak\Exception\UnexpectedResponseException - } - - return false; - } - - /** - * {@inheritdoc} - */ - protected function doFlush() - { - try { - $keyList = $this->bucket->getKeyList(); - - foreach ($keyList as $key) { - $this->bucket->delete($key); - } - - return true; - } catch (Exception\RiakException $e) { - // Do nothing - } - - return false; - } - - /** - * {@inheritdoc} - */ - protected function doGetStats() - { - // Only exposed through HTTP stats API, not Protocol Buffers API - return null; - } - - /** - * Check if a given Riak Object have expired. - * - * @param \Riak\Object $object - * - * @return boolean - */ - private function isExpired(Object $object) - { - $metadataMap = $object->getMetadataMap(); - - return isset($metadataMap[self::EXPIRES_HEADER]) - && $metadataMap[self::EXPIRES_HEADER] < time(); - } - - /** - * On-read conflict resolution. Applied approach here is last write wins. - * Specific needs may override this method to apply alternate conflict resolutions. - * - * {@internal Riak does not attempt to resolve a write conflict, and store - * it as sibling of conflicted one. By following this approach, it is up to - * the next read to resolve the conflict. When this happens, your fetched - * object will have a list of siblings (read as a list of objects). - * In our specific case, we do not care about the intermediate ones since - * they are all the same read from storage, and we do apply a last sibling - * (last write) wins logic. - * If by any means our resolution generates another conflict, it'll up to - * next read to properly solve it.} - * - * @param string $id - * @param string $vClock - * @param array $objectList - * - * @return \Riak\Object - */ - protected function resolveConflict($id, $vClock, array $objectList) - { - // Our approach here is last-write wins - $winner = $objectList[count($objectList)]; - - $putInput = new Input\PutInput(); - $putInput->setVClock($vClock); - - $mergedObject = new Object($id); - $mergedObject->setContent($winner->getContent()); - - $this->bucket->put($mergedObject, $putInput); - - return $mergedObject; - } -} diff --git a/core/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Version.php b/core/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Version.php deleted file mode 100644 index d742fa0..0000000 --- a/core/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Version.php +++ /dev/null @@ -1,25 +0,0 @@ -. - */ - -namespace Doctrine\Common\Cache; - -class Version -{ - const VERSION = '1.4.0-DEV'; -} diff --git a/core/vendor/doctrine/cache/lib/Doctrine/Common/Cache/WinCacheCache.php b/core/vendor/doctrine/cache/lib/Doctrine/Common/Cache/WinCacheCache.php deleted file mode 100644 index ae32772..0000000 --- a/core/vendor/doctrine/cache/lib/Doctrine/Common/Cache/WinCacheCache.php +++ /dev/null @@ -1,91 +0,0 @@ -. - */ - -namespace Doctrine\Common\Cache; - -/** - * WinCache cache provider. - * - * @link www.doctrine-project.org - * @since 2.2 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author David Abdemoulaie - */ -class WinCacheCache extends CacheProvider -{ - /** - * {@inheritdoc} - */ - protected function doFetch($id) - { - return wincache_ucache_get($id); - } - - /** - * {@inheritdoc} - */ - protected function doContains($id) - { - return wincache_ucache_exists($id); - } - - /** - * {@inheritdoc} - */ - protected function doSave($id, $data, $lifeTime = 0) - { - return (bool) wincache_ucache_set($id, $data, (int) $lifeTime); - } - - /** - * {@inheritdoc} - */ - protected function doDelete($id) - { - return wincache_ucache_delete($id); - } - - /** - * {@inheritdoc} - */ - protected function doFlush() - { - return wincache_ucache_clear(); - } - - /** - * {@inheritdoc} - */ - protected function doGetStats() - { - $info = wincache_ucache_info(); - $meminfo = wincache_ucache_meminfo(); - - return array( - Cache::STATS_HITS => $info['total_hit_count'], - Cache::STATS_MISSES => $info['total_miss_count'], - Cache::STATS_UPTIME => $info['total_cache_uptime'], - Cache::STATS_MEMORY_USAGE => $meminfo['memory_total'], - Cache::STATS_MEMORY_AVAILABLE => $meminfo['memory_free'], - ); - } -} diff --git a/core/vendor/doctrine/cache/lib/Doctrine/Common/Cache/XcacheCache.php b/core/vendor/doctrine/cache/lib/Doctrine/Common/Cache/XcacheCache.php deleted file mode 100644 index 833b02a..0000000 --- a/core/vendor/doctrine/cache/lib/Doctrine/Common/Cache/XcacheCache.php +++ /dev/null @@ -1,109 +0,0 @@ -. - */ - -namespace Doctrine\Common\Cache; - -/** - * Xcache cache driver. - * - * @link www.doctrine-project.org - * @since 2.0 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author David Abdemoulaie - */ -class XcacheCache extends CacheProvider -{ - /** - * {@inheritdoc} - */ - protected function doFetch($id) - { - return $this->doContains($id) ? unserialize(xcache_get($id)) : false; - } - - /** - * {@inheritdoc} - */ - protected function doContains($id) - { - return xcache_isset($id); - } - - /** - * {@inheritdoc} - */ - protected function doSave($id, $data, $lifeTime = 0) - { - return xcache_set($id, serialize($data), (int) $lifeTime); - } - - /** - * {@inheritdoc} - */ - protected function doDelete($id) - { - return xcache_unset($id); - } - - /** - * {@inheritdoc} - */ - protected function doFlush() - { - $this->checkAuthorization(); - - xcache_clear_cache(XC_TYPE_VAR, 0); - - return true; - } - - /** - * Checks that xcache.admin.enable_auth is Off. - * - * @return void - * - * @throws \BadMethodCallException When xcache.admin.enable_auth is On. - */ - protected function checkAuthorization() - { - if (ini_get('xcache.admin.enable_auth')) { - throw new \BadMethodCallException('To use all features of \Doctrine\Common\Cache\XcacheCache, you must set "xcache.admin.enable_auth" to "Off" in your php.ini.'); - } - } - - /** - * {@inheritdoc} - */ - protected function doGetStats() - { - $this->checkAuthorization(); - - $info = xcache_info(XC_TYPE_VAR, 0); - return array( - Cache::STATS_HITS => $info['hits'], - Cache::STATS_MISSES => $info['misses'], - Cache::STATS_UPTIME => null, - Cache::STATS_MEMORY_USAGE => $info['size'], - Cache::STATS_MEMORY_AVAILABLE => $info['avail'], - ); - } -} diff --git a/core/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ZendDataCache.php b/core/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ZendDataCache.php deleted file mode 100644 index 6e35ac8..0000000 --- a/core/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ZendDataCache.php +++ /dev/null @@ -1,83 +0,0 @@ -. - */ - -namespace Doctrine\Common\Cache; - -/** - * Zend Data Cache cache driver. - * - * @link www.doctrine-project.org - * @since 2.0 - * @author Ralph Schindler - * @author Guilherme Blanco - */ -class ZendDataCache extends CacheProvider -{ - /** - * {@inheritdoc} - */ - protected function doFetch($id) - { - return zend_shm_cache_fetch($id); - } - - /** - * {@inheritdoc} - */ - protected function doContains($id) - { - return (false !== zend_shm_cache_fetch($id)); - } - - /** - * {@inheritdoc} - */ - protected function doSave($id, $data, $lifeTime = 0) - { - return zend_shm_cache_store($id, $data, $lifeTime); - } - - /** - * {@inheritdoc} - */ - protected function doDelete($id) - { - return zend_shm_cache_delete($id); - } - - /** - * {@inheritdoc} - */ - protected function doFlush() - { - $namespace = $this->getNamespace(); - if (empty($namespace)) { - return zend_shm_cache_clear(); - } - return zend_shm_cache_clear($namespace); - } - - /** - * {@inheritdoc} - */ - protected function doGetStats() - { - return null; - } -} diff --git a/core/vendor/doctrine/cache/phpunit.xml.dist b/core/vendor/doctrine/cache/phpunit.xml.dist deleted file mode 100644 index 34d7f4c..0000000 --- a/core/vendor/doctrine/cache/phpunit.xml.dist +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - ./tests/Doctrine/ - - - - - - ./lib/Doctrine/ - - - diff --git a/core/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/ApcCacheTest.php b/core/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/ApcCacheTest.php deleted file mode 100644 index df81262..0000000 --- a/core/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/ApcCacheTest.php +++ /dev/null @@ -1,20 +0,0 @@ -markTestSkipped('The ' . __CLASS__ .' requires the use of APC'); - } - } - - protected function _getCacheDriver() - { - return new ApcCache(); - } -} \ No newline at end of file diff --git a/core/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/ArrayCacheTest.php b/core/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/ArrayCacheTest.php deleted file mode 100644 index a6c3097..0000000 --- a/core/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/ArrayCacheTest.php +++ /dev/null @@ -1,26 +0,0 @@ -_getCacheDriver(); - $stats = $cache->getStats(); - - $this->assertNull($stats); - } - - protected function isSharedStorage() - { - return false; - } -} \ No newline at end of file diff --git a/core/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/BaseFileCacheTest.php b/core/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/BaseFileCacheTest.php deleted file mode 100644 index eaedd99..0000000 --- a/core/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/BaseFileCacheTest.php +++ /dev/null @@ -1,40 +0,0 @@ -directory = sys_get_temp_dir() . '/doctrine_cache_'. uniqid(); - } while (file_exists($this->directory)); - } - - public function tearDown() - { - if ( ! is_dir($this->directory)) { - return; - } - - $iterator = new RecursiveDirectoryIterator($this->directory); - - foreach (new RecursiveIteratorIterator($iterator, RecursiveIteratorIterator::CHILD_FIRST) as $file) { - if ($file->isFile()) { - @unlink($file->getRealPath()); - } elseif ($file->isDir()) { - @rmdir($file->getRealPath()); - } - } - } - - protected function isSharedStorage() - { - return false; - } -} diff --git a/core/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/CacheTest.php b/core/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/CacheTest.php deleted file mode 100644 index 59ca4dc..0000000 --- a/core/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/CacheTest.php +++ /dev/null @@ -1,242 +0,0 @@ -_getCacheDriver(); - - // Test saving a value, checking if it exists, and fetching it back - $this->assertTrue($cache->save('key', 'value')); - $this->assertTrue($cache->contains('key')); - $this->assertEquals('value', $cache->fetch('key')); - - // Test updating the value of a cache entry - $this->assertTrue($cache->save('key', 'value-changed')); - $this->assertTrue($cache->contains('key')); - $this->assertEquals('value-changed', $cache->fetch('key')); - - // Test deleting a value - $this->assertTrue($cache->delete('key')); - $this->assertFalse($cache->contains('key')); - } - - public function provideCrudValues() - { - return array( - 'array' => array(array('one', 2, 3.0)), - 'string' => array('value'), - 'integer' => array(1), - 'float' => array(1.5), - 'object' => array(new ArrayObject()), - 'null' => array(null), - ); - } - - public function testDeleteAll() - { - $cache = $this->_getCacheDriver(); - - $this->assertTrue($cache->save('key1', 1)); - $this->assertTrue($cache->save('key2', 2)); - $this->assertTrue($cache->deleteAll()); - $this->assertFalse($cache->contains('key1')); - $this->assertFalse($cache->contains('key2')); - } - - public function testDeleteAllAndNamespaceVersioningBetweenCaches() - { - if ( ! $this->isSharedStorage()) { - $this->markTestSkipped('The ' . __CLASS__ .' does not use shared storage'); - } - - $cache1 = $this->_getCacheDriver(); - $cache2 = $this->_getCacheDriver(); - - $this->assertTrue($cache1->save('key1', 1)); - $this->assertTrue($cache2->save('key2', 2)); - - /* Both providers are initialized with the same namespace version, so - * they can see entries set by each other. - */ - $this->assertTrue($cache1->contains('key1')); - $this->assertTrue($cache1->contains('key2')); - $this->assertTrue($cache2->contains('key1')); - $this->assertTrue($cache2->contains('key2')); - - /* Deleting all entries through one provider will only increment the - * namespace version on that object (and in the cache itself, which new - * instances will use to initialize). The second provider will retain - * its original version and still see stale data. - */ - $this->assertTrue($cache1->deleteAll()); - $this->assertFalse($cache1->contains('key1')); - $this->assertFalse($cache1->contains('key2')); - $this->assertTrue($cache2->contains('key1')); - $this->assertTrue($cache2->contains('key2')); - - /* A new cache provider should not see the deleted entries, since its - * namespace version will be initialized. - */ - $cache3 = $this->_getCacheDriver(); - $this->assertFalse($cache3->contains('key1')); - $this->assertFalse($cache3->contains('key2')); - } - - public function testFlushAll() - { - $cache = $this->_getCacheDriver(); - - $this->assertTrue($cache->save('key1', 1)); - $this->assertTrue($cache->save('key2', 2)); - $this->assertTrue($cache->flushAll()); - $this->assertFalse($cache->contains('key1')); - $this->assertFalse($cache->contains('key2')); - } - - public function testFlushAllAndNamespaceVersioningBetweenCaches() - { - if ( ! $this->isSharedStorage()) { - $this->markTestSkipped('The ' . __CLASS__ .' does not use shared storage'); - } - - $cache1 = $this->_getCacheDriver(); - $cache2 = $this->_getCacheDriver(); - - /* Deleting all elements from the first provider should increment its - * namespace version before saving the first entry. - */ - $cache1->deleteAll(); - $this->assertTrue($cache1->save('key1', 1)); - - /* The second provider will be initialized with the same namespace - * version upon its first save operation. - */ - $this->assertTrue($cache2->save('key2', 2)); - - /* Both providers have the same namespace version and can see entires - * set by each other. - */ - $this->assertTrue($cache1->contains('key1')); - $this->assertTrue($cache1->contains('key2')); - $this->assertTrue($cache2->contains('key1')); - $this->assertTrue($cache2->contains('key2')); - - /* Flushing all entries through one cache will remove all entries from - * the cache but leave their namespace version as-is. - */ - $this->assertTrue($cache1->flushAll()); - $this->assertFalse($cache1->contains('key1')); - $this->assertFalse($cache1->contains('key2')); - $this->assertFalse($cache2->contains('key1')); - $this->assertFalse($cache2->contains('key2')); - - /* Inserting a new entry will use the same, incremented namespace - * version, and it will be visible to both providers. - */ - $this->assertTrue($cache1->save('key1', 1)); - $this->assertTrue($cache1->contains('key1')); - $this->assertTrue($cache2->contains('key1')); - - /* A new cache provider will be initialized with the original namespace - * version and not share any visibility with the first two providers. - */ - $cache3 = $this->_getCacheDriver(); - $this->assertFalse($cache3->contains('key1')); - $this->assertFalse($cache3->contains('key2')); - $this->assertTrue($cache3->save('key3', 3)); - $this->assertTrue($cache3->contains('key3')); - } - - public function testNamespace() - { - $cache = $this->_getCacheDriver(); - - $cache->setNamespace('ns1_'); - - $this->assertTrue($cache->save('key1', 1)); - $this->assertTrue($cache->contains('key1')); - - $cache->setNamespace('ns2_'); - - $this->assertFalse($cache->contains('key1')); - } - - public function testDeleteAllNamespace() - { - $cache = $this->_getCacheDriver(); - - $cache->setNamespace('ns1'); - $this->assertFalse($cache->contains('key1')); - $cache->save('key1', 'test'); - $this->assertTrue($cache->contains('key1')); - - $cache->setNamespace('ns2'); - $this->assertFalse($cache->contains('key1')); - $cache->save('key1', 'test'); - $this->assertTrue($cache->contains('key1')); - - $cache->setNamespace('ns1'); - $this->assertTrue($cache->contains('key1')); - $cache->deleteAll(); - $this->assertFalse($cache->contains('key1')); - - $cache->setNamespace('ns2'); - $this->assertTrue($cache->contains('key1')); - $cache->deleteAll(); - $this->assertFalse($cache->contains('key1')); - } - - /** - * @group DCOM-43 - */ - public function testGetStats() - { - $cache = $this->_getCacheDriver(); - $stats = $cache->getStats(); - - $this->assertArrayHasKey(Cache::STATS_HITS, $stats); - $this->assertArrayHasKey(Cache::STATS_MISSES, $stats); - $this->assertArrayHasKey(Cache::STATS_UPTIME, $stats); - $this->assertArrayHasKey(Cache::STATS_MEMORY_USAGE, $stats); - $this->assertArrayHasKey(Cache::STATS_MEMORY_AVAILABLE, $stats); - } - - public function testFetchMissShouldReturnFalse() - { - $cache = $this->_getCacheDriver(); - - /* Ensure that caches return boolean false instead of null on a fetch - * miss to be compatible with ORM integration. - */ - $result = $cache->fetch('nonexistent_key'); - - $this->assertFalse($result); - $this->assertNotNull($result); - } - - /** - * Return whether multiple cache providers share the same storage. - * - * This is used for skipping certain tests for shared storage behavior. - * - * @return boolean - */ - protected function isSharedStorage() - { - return true; - } - - /** - * @return \Doctrine\Common\Cache\CacheProvider - */ - abstract protected function _getCacheDriver(); -} diff --git a/core/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/CouchbaseCacheTest.php b/core/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/CouchbaseCacheTest.php deleted file mode 100644 index 40d5a69..0000000 --- a/core/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/CouchbaseCacheTest.php +++ /dev/null @@ -1,47 +0,0 @@ -couchbase = new Couchbase('127.0.0.1', 'Administrator', 'password', 'default'); - } catch(Exception $ex) { - $this->markTestSkipped('Could not instantiate the Couchbase cache because of: ' . $ex); - } - } else { - $this->markTestSkipped('The ' . __CLASS__ .' requires the use of the couchbase extension'); - } - } - - public function testNoExpire() - { - $cache = $this->_getCacheDriver(); - $cache->save('noexpire', 'value', 0); - sleep(1); - $this->assertTrue($cache->contains('noexpire'), 'Couchbase provider should support no-expire'); - } - - public function testLongLifetime() - { - $cache = $this->_getCacheDriver(); - $cache->save('key', 'value', 30 * 24 * 3600 + 1); - - $this->assertTrue($cache->contains('key'), 'Couchbase provider should support TTL > 30 days'); - } - - protected function _getCacheDriver() - { - $driver = new CouchbaseCache(); - $driver->setCouchbase($this->couchbase); - return $driver; - } -} \ No newline at end of file diff --git a/core/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/FileCacheTest.php b/core/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/FileCacheTest.php deleted file mode 100644 index 6f9df81..0000000 --- a/core/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/FileCacheTest.php +++ /dev/null @@ -1,107 +0,0 @@ -driver = $this->getMock( - 'Doctrine\Common\Cache\FileCache', - array('doFetch', 'doContains', 'doSave'), - array(), '', false - ); - } - - public function getProviderFileName() - { - return array( - //The characters :\/<>"*?| are not valid in Windows filenames. - array('key:1', 'key1'), - array('key\2', 'key2'), - array('key/3', 'key3'), - array('key<4', 'key4'), - array('key>5', 'key5'), - array('key"6', 'key6'), - array('key*7', 'key7'), - array('key?8', 'key8'), - array('key|9', 'key9'), - array('key[0]','key[0]'), - ); - } - - /** - * @dataProvider getProviderFileName - */ - public function testInvalidFilename($key, $expected) - { - $cache = $this->driver; - $method = new \ReflectionMethod($cache, 'getFilename'); - - $method->setAccessible(true); - - $value = $method->invoke($cache, $key); - $actual = pathinfo($value, PATHINFO_FILENAME); - - $this->assertEquals($expected, $actual); - } - - public function testFilenameCollision() - { - $data['key:0'] = 'key0'; - $data['key\0'] = 'key0'; - $data['key/0'] = 'key0'; - $data['key<0'] = 'key0'; - $data['key>0'] = 'key0'; - $data['key"0'] = 'key0'; - $data['key*0'] = 'key0'; - $data['key?0'] = 'key0'; - $data['key|0'] = 'key0'; - - $paths = array(); - $cache = $this->driver; - $method = new \ReflectionMethod($cache, 'getFilename'); - - $method->setAccessible(true); - - foreach ($data as $key => $expected) { - $path = $method->invoke($cache, $key); - $actual = pathinfo($path, PATHINFO_FILENAME); - - $this->assertNotContains($path, $paths); - $this->assertEquals($expected, $actual); - - $paths[] = $path; - } - } - - public function testFilenameShouldCreateThePathWithFourSubDirectories() - { - $cache = $this->driver; - $method = new \ReflectionMethod($cache, 'getFilename'); - $key = 'item-key'; - $expectedDir[] = '84e0e2e893febb73'; - $expectedDir[] = '7a0fee0c89d53f4b'; - $expectedDir[] = 'b7fcb44c57cdf3d3'; - $expectedDir[] = '2ce7363f5d597760'; - $expectedDir = implode(DIRECTORY_SEPARATOR, $expectedDir); - - $method->setAccessible(true); - - $path = $method->invoke($cache, $key); - $filename = pathinfo($path, PATHINFO_FILENAME); - $dirname = pathinfo($path, PATHINFO_DIRNAME); - - $this->assertEquals('item-key', $filename); - $this->assertEquals(DIRECTORY_SEPARATOR . $expectedDir, $dirname); - $this->assertEquals(DIRECTORY_SEPARATOR . $expectedDir . DIRECTORY_SEPARATOR . $key, $path); - } -} \ No newline at end of file diff --git a/core/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/FilesystemCacheTest.php b/core/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/FilesystemCacheTest.php deleted file mode 100644 index e3b74cd..0000000 --- a/core/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/FilesystemCacheTest.php +++ /dev/null @@ -1,75 +0,0 @@ -_getCacheDriver(); - - // Test save - $cache->save('test_key', 'testing this out', 10); - - // Test contains to test that save() worked - $this->assertTrue($cache->contains('test_key')); - - // Test fetch - $this->assertEquals('testing this out', $cache->fetch('test_key')); - - // access private methods - $getFilename = new \ReflectionMethod($cache, 'getFilename'); - $getNamespacedId = new \ReflectionMethod($cache, 'getNamespacedId'); - - $getFilename->setAccessible(true); - $getNamespacedId->setAccessible(true); - - $id = $getNamespacedId->invoke($cache, 'test_key'); - $filename = $getFilename->invoke($cache, $id); - - $data = ''; - $lifetime = 0; - $resource = fopen($filename, "r"); - - if (false !== ($line = fgets($resource))) { - $lifetime = (integer) $line; - } - - while (false !== ($line = fgets($resource))) { - $data .= $line; - } - - $this->assertNotEquals(0, $lifetime, "previous lifetime could not be loaded"); - - // update lifetime - $lifetime = $lifetime - 20; - file_put_contents($filename, $lifetime . PHP_EOL . $data); - - // test expired data - $this->assertFalse($cache->contains('test_key')); - $this->assertFalse($cache->fetch('test_key')); - } - - public function testGetStats() - { - $cache = $this->_getCacheDriver(); - $stats = $cache->getStats(); - - $this->assertNull($stats[Cache::STATS_HITS]); - $this->assertNull($stats[Cache::STATS_MISSES]); - $this->assertNull($stats[Cache::STATS_UPTIME]); - $this->assertEquals(0, $stats[Cache::STATS_MEMORY_USAGE]); - $this->assertGreaterThan(0, $stats[Cache::STATS_MEMORY_AVAILABLE]); - } - - protected function _getCacheDriver() - { - return new FilesystemCache($this->directory); - } -} diff --git a/core/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/MemcacheCacheTest.php b/core/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/MemcacheCacheTest.php deleted file mode 100644 index b0da1b9..0000000 --- a/core/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/MemcacheCacheTest.php +++ /dev/null @@ -1,54 +0,0 @@ -markTestSkipped('The ' . __CLASS__ .' requires the use of memcache'); - } - - $this->memcache = new Memcache(); - - if (@$this->memcache->connect('localhost', 11211) === false) { - unset($this->memcache); - $this->markTestSkipped('The ' . __CLASS__ .' cannot connect to memcache'); - } - } - - public function tearDown() - { - if ($this->memcache instanceof Memcache) { - $this->memcache->flush(); - } - } - - public function testNoExpire() - { - $cache = $this->_getCacheDriver(); - $cache->save('noexpire', 'value', 0); - sleep(1); - $this->assertTrue($cache->contains('noexpire'), 'Memcache provider should support no-expire'); - } - - public function testLongLifetime() - { - $cache = $this->_getCacheDriver(); - $cache->save('key', 'value', 30 * 24 * 3600 + 1); - $this->assertTrue($cache->contains('key'), 'Memcache provider should support TTL > 30 days'); - } - - protected function _getCacheDriver() - { - $driver = new MemcacheCache(); - $driver->setMemcache($this->memcache); - return $driver; - } -} diff --git a/core/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/MemcachedCacheTest.php b/core/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/MemcachedCacheTest.php deleted file mode 100644 index 071329f..0000000 --- a/core/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/MemcachedCacheTest.php +++ /dev/null @@ -1,56 +0,0 @@ -markTestSkipped('The ' . __CLASS__ .' requires the use of memcached'); - } - - $this->memcached = new Memcached(); - $this->memcached->setOption(Memcached::OPT_COMPRESSION, false); - $this->memcached->addServer('127.0.0.1', 11211); - - if (@fsockopen('127.0.0.1', 11211) === false) { - unset($this->memcached); - $this->markTestSkipped('The ' . __CLASS__ .' cannot connect to memcache'); - } - } - - public function tearDown() - { - if ($this->memcached instanceof Memcached) { - $this->memcached->flush(); - } - } - - public function testNoExpire() - { - $cache = $this->_getCacheDriver(); - $cache->save('noexpire', 'value', 0); - sleep(1); - $this->assertTrue($cache->contains('noexpire'), 'Memcache provider should support no-expire'); - } - - public function testLongLifetime() - { - $cache = $this->_getCacheDriver(); - $cache->save('key', 'value', 30 * 24 * 3600 + 1); - $this->assertTrue($cache->contains('key'), 'Memcache provider should support TTL > 30 days'); - } - - protected function _getCacheDriver() - { - $driver = new MemcachedCache(); - $driver->setMemcached($this->memcached); - return $driver; - } -} diff --git a/core/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/MongoDBCacheTest.php b/core/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/MongoDBCacheTest.php deleted file mode 100644 index 8c2f6e0..0000000 --- a/core/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/MongoDBCacheTest.php +++ /dev/null @@ -1,61 +0,0 @@ -=')) { - $this->markTestSkipped('The ' . __CLASS__ .' requires the use of mongo >= 1.3.0'); - } - - $mongo = new MongoClient(); - $this->collection = $mongo->selectCollection('doctrine_common_cache', 'test'); - } - - public function tearDown() - { - if ($this->collection instanceof MongoCollection) { - $this->collection->drop(); - } - } - - public function testSaveWithNonUtf8String() - { - // Invalid 2-octet sequence - $data = "\xc3\x28"; - - $cache = $this->_getCacheDriver(); - - $this->assertTrue($cache->save('key', $data)); - $this->assertEquals($data, $cache->fetch('key')); - } - - public function testGetStats() - { - $cache = $this->_getCacheDriver(); - $stats = $cache->getStats(); - - $this->assertNull($stats[Cache::STATS_HITS]); - $this->assertNull($stats[Cache::STATS_MISSES]); - $this->assertGreaterThan(0, $stats[Cache::STATS_UPTIME]); - $this->assertEquals(0, $stats[Cache::STATS_MEMORY_USAGE]); - $this->assertNull($stats[Cache::STATS_MEMORY_AVAILABLE]); - } - - protected function _getCacheDriver() - { - return new MongoDBCache($this->collection); - } -} diff --git a/core/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/PhpFileCacheTest.php b/core/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/PhpFileCacheTest.php deleted file mode 100644 index f49ce25..0000000 --- a/core/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/PhpFileCacheTest.php +++ /dev/null @@ -1,118 +0,0 @@ -_getCacheDriver(); - - // Test save - $cache->save('test_key', 'testing this out', 10); - - // Test contains to test that save() worked - $this->assertTrue($cache->contains('test_key')); - - // Test fetch - $this->assertEquals('testing this out', $cache->fetch('test_key')); - - // access private methods - $getFilename = new \ReflectionMethod($cache, 'getFilename'); - $getNamespacedId = new \ReflectionMethod($cache, 'getNamespacedId'); - - $getFilename->setAccessible(true); - $getNamespacedId->setAccessible(true); - - $id = $getNamespacedId->invoke($cache, 'test_key'); - $path = $getFilename->invoke($cache, $id); - $value = include $path; - - // update lifetime - $value['lifetime'] = $value['lifetime'] - 20; - file_put_contents($path, 'assertFalse($cache->contains('test_key')); - $this->assertFalse($cache->fetch('test_key')); - } - - public function testImplementsSetState() - { - $cache = $this->_getCacheDriver(); - - // Test save - $cache->save('test_set_state', new SetStateClass(array(1,2,3))); - - //Test __set_state call - $this->assertCount(0, SetStateClass::$values); - - // Test fetch - $value = $cache->fetch('test_set_state'); - $this->assertInstanceOf('Doctrine\Tests\Common\Cache\SetStateClass', $value); - $this->assertEquals(array(1,2,3), $value->getValue()); - - //Test __set_state call - $this->assertCount(1, SetStateClass::$values); - - // Test contains - $this->assertTrue($cache->contains('test_set_state')); - } - - public function testNotImplementsSetState() - { - $cache = $this->_getCacheDriver(); - - $this->setExpectedException('InvalidArgumentException'); - $cache->save('test_not_set_state', new NotSetStateClass(array(1,2,3))); - } - - public function testGetStats() - { - $cache = $this->_getCacheDriver(); - $stats = $cache->getStats(); - - $this->assertNull($stats[Cache::STATS_HITS]); - $this->assertNull($stats[Cache::STATS_MISSES]); - $this->assertNull($stats[Cache::STATS_UPTIME]); - $this->assertEquals(0, $stats[Cache::STATS_MEMORY_USAGE]); - $this->assertGreaterThan(0, $stats[Cache::STATS_MEMORY_AVAILABLE]); - } - - protected function _getCacheDriver() - { - return new PhpFileCache($this->directory); - } -} - -class NotSetStateClass -{ - private $value; - - public function __construct($value) - { - $this->value = $value; - } - - public function getValue() - { - return $this->value; - } -} - -class SetStateClass extends NotSetStateClass -{ - public static $values = array(); - - public static function __set_state($data) - { - self::$values = $data; - return new self($data['value']); - } -} diff --git a/core/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/RedisCacheTest.php b/core/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/RedisCacheTest.php deleted file mode 100644 index 45bbc75..0000000 --- a/core/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/RedisCacheTest.php +++ /dev/null @@ -1,30 +0,0 @@ -_redis = new \Redis(); - $ok = @$this->_redis->connect('127.0.0.1'); - if (!$ok) { - $this->markTestSkipped('The ' . __CLASS__ .' requires the use of redis'); - } - } else { - $this->markTestSkipped('The ' . __CLASS__ .' requires the use of redis'); - } - } - - protected function _getCacheDriver() - { - $driver = new RedisCache(); - $driver->setRedis($this->_redis); - return $driver; - } -} diff --git a/core/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/RiakCacheTest.php b/core/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/RiakCacheTest.php deleted file mode 100644 index dce8cc0..0000000 --- a/core/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/RiakCacheTest.php +++ /dev/null @@ -1,64 +0,0 @@ -markTestSkipped('The ' . __CLASS__ .' requires the use of Riak'); - } - - try { - $this->connection = new Connection('127.0.0.1', 8087); - $this->bucket = new Bucket($this->connection, 'test'); - } catch (Exception\RiakException $e) { - $this->markTestSkipped('The ' . __CLASS__ .' requires the use of Riak'); - } - } - - /** - * {@inheritdoc} - */ - public function testGetStats() - { - $cache = $this->_getCacheDriver(); - $stats = $cache->getStats(); - - $this->assertNull($stats); - } - - /** - * Retrieve RiakCache instance. - * - * @return \Doctrine\Common\Cache\RiakCache - */ - protected function _getCacheDriver() - { - return new RiakCache($this->bucket); - } -} diff --git a/core/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/WinCacheCacheTest.php b/core/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/WinCacheCacheTest.php deleted file mode 100644 index cb363df..0000000 --- a/core/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/WinCacheCacheTest.php +++ /dev/null @@ -1,20 +0,0 @@ -markTestSkipped('The ' . __CLASS__ .' requires the use of Wincache'); - } - } - - protected function _getCacheDriver() - { - return new WincacheCache(); - } -} \ No newline at end of file diff --git a/core/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/XcacheCacheTest.php b/core/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/XcacheCacheTest.php deleted file mode 100644 index 6259848..0000000 --- a/core/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/XcacheCacheTest.php +++ /dev/null @@ -1,20 +0,0 @@ -markTestSkipped('The ' . __CLASS__ .' requires the use of xcache'); - } - } - - protected function _getCacheDriver() - { - return new XcacheCache(); - } -} \ No newline at end of file diff --git a/core/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/ZendDataCacheTest.php b/core/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/ZendDataCacheTest.php deleted file mode 100644 index cd66e15..0000000 --- a/core/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/ZendDataCacheTest.php +++ /dev/null @@ -1,28 +0,0 @@ -markTestSkipped('The ' . __CLASS__ .' requires the use of Zend Data Cache which only works in apache2handler SAPI'); - } - } - - public function testGetStats() - { - $cache = $this->_getCacheDriver(); - $stats = $cache->getStats(); - - $this->assertNull($stats); - } - - protected function _getCacheDriver() - { - return new ZendDataCache(); - } -} \ No newline at end of file diff --git a/core/vendor/doctrine/cache/tests/Doctrine/Tests/DoctrineTestCase.php b/core/vendor/doctrine/cache/tests/Doctrine/Tests/DoctrineTestCase.php deleted file mode 100644 index e8323d2..0000000 --- a/core/vendor/doctrine/cache/tests/Doctrine/Tests/DoctrineTestCase.php +++ /dev/null @@ -1,10 +0,0 @@ -add('Doctrine\\Tests\\', __DIR__ . '/../../'); -unset($classLoader); diff --git a/core/vendor/doctrine/cache/tests/travis/php.ini b/core/vendor/doctrine/cache/tests/travis/php.ini deleted file mode 100644 index ef5d9a1..0000000 --- a/core/vendor/doctrine/cache/tests/travis/php.ini +++ /dev/null @@ -1,6 +0,0 @@ -extension="mongo.so" -extension="memcache.so" -extension="memcached.so" - -apc.enabled=1 -apc.enable_cli=1 diff --git a/core/vendor/doctrine/cache/tests/travis/phpunit.travis.xml b/core/vendor/doctrine/cache/tests/travis/phpunit.travis.xml deleted file mode 100644 index a01faa5..0000000 --- a/core/vendor/doctrine/cache/tests/travis/phpunit.travis.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - ../Doctrine/ - - - - - - ../../lib/Doctrine/ - - - - - - performance - - - diff --git a/core/vendor/doctrine/collections/.gitignore b/core/vendor/doctrine/collections/.gitignore deleted file mode 100644 index 48b8bf9..0000000 --- a/core/vendor/doctrine/collections/.gitignore +++ /dev/null @@ -1 +0,0 @@ -vendor/ diff --git a/core/vendor/doctrine/collections/.travis.yml b/core/vendor/doctrine/collections/.travis.yml deleted file mode 100644 index 470c987..0000000 --- a/core/vendor/doctrine/collections/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: php - -php: - - 5.3 - - 5.4 - - 5.5 - - hhvm - -before_script: - - composer --prefer-source --dev install diff --git a/core/vendor/doctrine/collections/LICENSE b/core/vendor/doctrine/collections/LICENSE deleted file mode 100644 index 5e781fc..0000000 --- a/core/vendor/doctrine/collections/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2006-2013 Doctrine Project - -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/core/vendor/doctrine/collections/README.md b/core/vendor/doctrine/collections/README.md deleted file mode 100644 index 627d45b..0000000 --- a/core/vendor/doctrine/collections/README.md +++ /dev/null @@ -1,17 +0,0 @@ -# Doctrine Collections - -Collections Abstraction library - -## Changelog - -### v1.2 - -* Add a new ``AbstractLazyCollection`` - -### v1.1 - -* Deprecated ``Comparison::IS``, because it's only there for SQL semantics. - These are fixed in the ORM instead. -* Add ``Comparison::CONTAINS`` to perform partial string matches: - - $criteria->andWhere($criteria->expr()->contains('property', 'Foo')); diff --git a/core/vendor/doctrine/collections/composer.json b/core/vendor/doctrine/collections/composer.json deleted file mode 100644 index dd30961..0000000 --- a/core/vendor/doctrine/collections/composer.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "doctrine/collections", - "type": "library", - "description": "Collections Abstraction library", - "keywords": ["collections", "array", "iterator"], - "homepage": "http://www.doctrine-project.org", - "license": "MIT", - "authors": [ - {"name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com"}, - {"name": "Roman Borschel", "email": "roman@code-factory.org"}, - {"name": "Benjamin Eberlei", "email": "kontakt@beberlei.de"}, - {"name": "Jonathan Wage", "email": "jonwage@gmail.com"}, - {"name": "Johannes Schmitt", "email": "schmittjoh@gmail.com"} - ], - "require": { - "php": ">=5.3.2" - }, - "autoload": { - "psr-0": { "Doctrine\\Common\\Collections\\": "lib/" } - }, - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - } -} diff --git a/core/vendor/doctrine/collections/lib/Doctrine/Common/Collections/AbstractLazyCollection.php b/core/vendor/doctrine/collections/lib/Doctrine/Common/Collections/AbstractLazyCollection.php deleted file mode 100644 index 0052a29..0000000 --- a/core/vendor/doctrine/collections/lib/Doctrine/Common/Collections/AbstractLazyCollection.php +++ /dev/null @@ -1,343 +0,0 @@ -. - */ - -namespace Doctrine\Common\Collections; - -use Closure; - -/** - * Lazy collection that is backed by a concrete collection - * - * @author Michaël Gallego - * @since 1.2 - */ -abstract class AbstractLazyCollection implements Collection -{ - /** - * The backed collection to use - * - * @var Collection - */ - protected $collection; - - /** - * @var bool - */ - private $initialized = false; - - /** - * {@inheritDoc} - */ - public function count() - { - $this->initialize(); - return $this->collection->count(); - } - - /** - * {@inheritDoc} - */ - public function add($element) - { - $this->initialize(); - return $this->collection->add($element); - } - - /** - * {@inheritDoc} - */ - public function clear() - { - $this->initialize(); - $this->collection->clear(); - } - - /** - * {@inheritDoc} - */ - public function contains($element) - { - $this->initialize(); - return $this->collection->contains($element); - } - - /** - * {@inheritDoc} - */ - public function isEmpty() - { - $this->initialize(); - return $this->collection->isEmpty(); - } - - /** - * {@inheritDoc} - */ - public function remove($key) - { - $this->initialize(); - return $this->collection->remove($key); - } - - /** - * {@inheritDoc} - */ - public function removeElement($element) - { - $this->initialize(); - return $this->collection->removeElement($element); - } - - /** - * {@inheritDoc} - */ - public function containsKey($key) - { - $this->initialize(); - return $this->collection->containsKey($key); - } - - /** - * {@inheritDoc} - */ - public function get($key) - { - $this->initialize(); - return $this->collection->get($key); - } - - /** - * {@inheritDoc} - */ - public function getKeys() - { - $this->initialize(); - return $this->collection->getKeys(); - } - - /** - * {@inheritDoc} - */ - public function getValues() - { - $this->initialize(); - return $this->collection->getValues(); - } - - /** - * {@inheritDoc} - */ - public function set($key, $value) - { - $this->initialize(); - $this->collection->set($key, $value); - } - - /** - * {@inheritDoc} - */ - public function toArray() - { - $this->initialize(); - return $this->collection->toArray(); - } - - /** - * {@inheritDoc} - */ - public function first() - { - $this->initialize(); - return $this->collection->first(); - } - - /** - * {@inheritDoc} - */ - public function last() - { - $this->initialize(); - return $this->collection->last(); - } - - /** - * {@inheritDoc} - */ - public function key() - { - $this->initialize(); - return $this->collection->key(); - } - - /** - * {@inheritDoc} - */ - public function current() - { - $this->initialize(); - return $this->collection->current(); - } - - /** - * {@inheritDoc} - */ - public function next() - { - $this->initialize(); - return $this->collection->next(); - } - - /** - * {@inheritDoc} - */ - public function exists(Closure $p) - { - $this->initialize(); - return $this->collection->exists($p); - } - - /** - * {@inheritDoc} - */ - public function filter(Closure $p) - { - $this->initialize(); - return $this->collection->filter($p); - } - - /** - * {@inheritDoc} - */ - public function forAll(Closure $p) - { - $this->initialize(); - return $this->collection->forAll($p); - } - - /** - * {@inheritDoc} - */ - public function map(Closure $func) - { - $this->initialize(); - return $this->collection->map($func); - } - - /** - * {@inheritDoc} - */ - public function partition(Closure $p) - { - $this->initialize(); - return $this->collection->partition($p); - } - - /** - * {@inheritDoc} - */ - public function indexOf($element) - { - $this->initialize(); - return $this->collection->indexOf($element); - } - - /** - * {@inheritDoc} - */ - public function slice($offset, $length = null) - { - $this->initialize(); - return $this->collection->slice($offset, $length); - } - - /** - * {@inheritDoc} - */ - public function getIterator() - { - $this->initialize(); - return $this->collection->getIterator(); - } - - /** - * {@inheritDoc} - */ - public function offsetExists($offset) - { - $this->initialize(); - return $this->collection->offsetExists($offset); - } - - /** - * {@inheritDoc} - */ - public function offsetGet($offset) - { - $this->initialize(); - return $this->collection->offsetGet($offset); - } - - /** - * {@inheritDoc} - */ - public function offsetSet($offset, $value) - { - $this->initialize(); - $this->collection->offsetSet($offset, $value); - } - - /** - * {@inheritDoc} - */ - public function offsetUnset($offset) - { - $this->initialize(); - $this->collection->offsetUnset($offset); - } - - /** - * Is the lazy collection already initialized? - * - * @return bool - */ - public function isInitialized() - { - return $this->initialized; - } - - /** - * Initialize the collection - * - * @return void - */ - protected function initialize() - { - if (!$this->initialized) { - $this->doInitialize(); - $this->initialized = true; - } - } - - /** - * Do the initialization logic - * - * @return void - */ - abstract protected function doInitialize(); -} diff --git a/core/vendor/doctrine/collections/lib/Doctrine/Common/Collections/ArrayCollection.php b/core/vendor/doctrine/collections/lib/Doctrine/Common/Collections/ArrayCollection.php deleted file mode 100644 index 9c2c8e1..0000000 --- a/core/vendor/doctrine/collections/lib/Doctrine/Common/Collections/ArrayCollection.php +++ /dev/null @@ -1,385 +0,0 @@ -. - */ - -namespace Doctrine\Common\Collections; - -use Closure, ArrayIterator; -use Doctrine\Common\Collections\Expr\ClosureExpressionVisitor; - -/** - * An ArrayCollection is a Collection implementation that wraps a regular PHP array. - * - * @since 2.0 - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class ArrayCollection implements Collection, Selectable -{ - /** - * An array containing the entries of this collection. - * - * @var array - */ - private $_elements; - - /** - * Initializes a new ArrayCollection. - * - * @param array $elements - */ - public function __construct(array $elements = array()) - { - $this->_elements = $elements; - } - - /** - * {@inheritDoc} - */ - public function toArray() - { - return $this->_elements; - } - - /** - * {@inheritDoc} - */ - public function first() - { - return reset($this->_elements); - } - - /** - * {@inheritDoc} - */ - public function last() - { - return end($this->_elements); - } - - /** - * {@inheritDoc} - */ - public function key() - { - return key($this->_elements); - } - - /** - * {@inheritDoc} - */ - public function next() - { - return next($this->_elements); - } - - /** - * {@inheritDoc} - */ - public function current() - { - return current($this->_elements); - } - - /** - * {@inheritDoc} - */ - public function remove($key) - { - if (isset($this->_elements[$key]) || array_key_exists($key, $this->_elements)) { - $removed = $this->_elements[$key]; - unset($this->_elements[$key]); - - return $removed; - } - - return null; - } - - /** - * {@inheritDoc} - */ - public function removeElement($element) - { - $key = array_search($element, $this->_elements, true); - - if ($key !== false) { - unset($this->_elements[$key]); - - return true; - } - - return false; - } - - /** - * Required by interface ArrayAccess. - * - * {@inheritDoc} - */ - public function offsetExists($offset) - { - return $this->containsKey($offset); - } - - /** - * Required by interface ArrayAccess. - * - * {@inheritDoc} - */ - public function offsetGet($offset) - { - return $this->get($offset); - } - - /** - * Required by interface ArrayAccess. - * - * {@inheritDoc} - */ - public function offsetSet($offset, $value) - { - if ( ! isset($offset)) { - return $this->add($value); - } - return $this->set($offset, $value); - } - - /** - * Required by interface ArrayAccess. - * - * {@inheritDoc} - */ - public function offsetUnset($offset) - { - return $this->remove($offset); - } - - /** - * {@inheritDoc} - */ - public function containsKey($key) - { - return isset($this->_elements[$key]) || array_key_exists($key, $this->_elements); - } - - /** - * {@inheritDoc} - */ - public function contains($element) - { - return in_array($element, $this->_elements, true); - } - - /** - * {@inheritDoc} - */ - public function exists(Closure $p) - { - foreach ($this->_elements as $key => $element) { - if ($p($key, $element)) { - return true; - } - } - return false; - } - - /** - * {@inheritDoc} - */ - public function indexOf($element) - { - return array_search($element, $this->_elements, true); - } - - /** - * {@inheritDoc} - */ - public function get($key) - { - if (isset($this->_elements[$key])) { - return $this->_elements[$key]; - } - return null; - } - - /** - * {@inheritDoc} - */ - public function getKeys() - { - return array_keys($this->_elements); - } - - /** - * {@inheritDoc} - */ - public function getValues() - { - return array_values($this->_elements); - } - - /** - * {@inheritDoc} - */ - public function count() - { - return count($this->_elements); - } - - /** - * {@inheritDoc} - */ - public function set($key, $value) - { - $this->_elements[$key] = $value; - } - - /** - * {@inheritDoc} - */ - public function add($value) - { - $this->_elements[] = $value; - return true; - } - - /** - * {@inheritDoc} - */ - public function isEmpty() - { - return ! $this->_elements; - } - - /** - * Required by interface IteratorAggregate. - * - * {@inheritDoc} - */ - public function getIterator() - { - return new ArrayIterator($this->_elements); - } - - /** - * {@inheritDoc} - */ - public function map(Closure $func) - { - return new static(array_map($func, $this->_elements)); - } - - /** - * {@inheritDoc} - */ - public function filter(Closure $p) - { - return new static(array_filter($this->_elements, $p)); - } - - /** - * {@inheritDoc} - */ - public function forAll(Closure $p) - { - foreach ($this->_elements as $key => $element) { - if ( ! $p($key, $element)) { - return false; - } - } - - return true; - } - - /** - * {@inheritDoc} - */ - public function partition(Closure $p) - { - $coll1 = $coll2 = array(); - foreach ($this->_elements as $key => $element) { - if ($p($key, $element)) { - $coll1[$key] = $element; - } else { - $coll2[$key] = $element; - } - } - return array(new static($coll1), new static($coll2)); - } - - /** - * Returns a string representation of this object. - * - * @return string - */ - public function __toString() - { - return __CLASS__ . '@' . spl_object_hash($this); - } - - /** - * {@inheritDoc} - */ - public function clear() - { - $this->_elements = array(); - } - - /** - * {@inheritDoc} - */ - public function slice($offset, $length = null) - { - return array_slice($this->_elements, $offset, $length, true); - } - - /** - * {@inheritDoc} - */ - public function matching(Criteria $criteria) - { - $expr = $criteria->getWhereExpression(); - $filtered = $this->_elements; - - if ($expr) { - $visitor = new ClosureExpressionVisitor(); - $filter = $visitor->dispatch($expr); - $filtered = array_filter($filtered, $filter); - } - - if ($orderings = $criteria->getOrderings()) { - $next = null; - foreach (array_reverse($orderings) as $field => $ordering) { - $next = ClosureExpressionVisitor::sortByField($field, $ordering == 'DESC' ? -1 : 1, $next); - } - - usort($filtered, $next); - } - - $offset = $criteria->getFirstResult(); - $length = $criteria->getMaxResults(); - - if ($offset || $length) { - $filtered = array_slice($filtered, (int)$offset, $length); - } - - return new static($filtered); - } -} diff --git a/core/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Collection.php b/core/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Collection.php deleted file mode 100644 index a0808b3..0000000 --- a/core/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Collection.php +++ /dev/null @@ -1,260 +0,0 @@ -. - */ - -namespace Doctrine\Common\Collections; - -use Closure, Countable, IteratorAggregate, ArrayAccess; - -/** - * The missing (SPL) Collection/Array/OrderedMap interface. - * - * A Collection resembles the nature of a regular PHP array. That is, - * it is essentially an ordered map that can also be used - * like a list. - * - * A Collection has an internal iterator just like a PHP array. In addition, - * a Collection can be iterated with external iterators, which is preferrable. - * To use an external iterator simply use the foreach language construct to - * iterate over the collection (which calls {@link getIterator()} internally) or - * explicitly retrieve an iterator though {@link getIterator()} which can then be - * used to iterate over the collection. - * You can not rely on the internal iterator of the collection being at a certain - * position unless you explicitly positioned it before. Prefer iteration with - * external iterators. - * - * @since 2.0 - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -interface Collection extends Countable, IteratorAggregate, ArrayAccess -{ - /** - * Adds an element at the end of the collection. - * - * @param mixed $element The element to add. - * - * @return boolean Always TRUE. - */ - function add($element); - - /** - * Clears the collection, removing all elements. - * - * @return void - */ - function clear(); - - /** - * Checks whether an element is contained in the collection. - * This is an O(n) operation, where n is the size of the collection. - * - * @param mixed $element The element to search for. - * - * @return boolean TRUE if the collection contains the element, FALSE otherwise. - */ - function contains($element); - - /** - * Checks whether the collection is empty (contains no elements). - * - * @return boolean TRUE if the collection is empty, FALSE otherwise. - */ - function isEmpty(); - - /** - * Removes the element at the specified index from the collection. - * - * @param string|integer $key The kex/index of the element to remove. - * - * @return mixed The removed element or NULL, if the collection did not contain the element. - */ - function remove($key); - - /** - * Removes the specified element from the collection, if it is found. - * - * @param mixed $element The element to remove. - * - * @return boolean TRUE if this collection contained the specified element, FALSE otherwise. - */ - function removeElement($element); - - /** - * Checks whether the collection contains an element with the specified key/index. - * - * @param string|integer $key The key/index to check for. - * - * @return boolean TRUE if the collection contains an element with the specified key/index, - * FALSE otherwise. - */ - function containsKey($key); - - /** - * Gets the element at the specified key/index. - * - * @param string|integer $key The key/index of the element to retrieve. - * - * @return mixed - */ - function get($key); - - /** - * Gets all keys/indices of the collection. - * - * @return array The keys/indices of the collection, in the order of the corresponding - * elements in the collection. - */ - function getKeys(); - - /** - * Gets all values of the collection. - * - * @return array The values of all elements in the collection, in the order they - * appear in the collection. - */ - function getValues(); - - /** - * Sets an element in the collection at the specified key/index. - * - * @param string|integer $key The key/index of the element to set. - * @param mixed $value The element to set. - * - * @return void - */ - function set($key, $value); - - /** - * Gets a native PHP array representation of the collection. - * - * @return array - */ - function toArray(); - - /** - * Sets the internal iterator to the first element in the collection and returns this element. - * - * @return mixed - */ - function first(); - - /** - * Sets the internal iterator to the last element in the collection and returns this element. - * - * @return mixed - */ - function last(); - - /** - * Gets the key/index of the element at the current iterator position. - * - * @return int|string - */ - function key(); - - /** - * Gets the element of the collection at the current iterator position. - * - * @return mixed - */ - function current(); - - /** - * Moves the internal iterator position to the next element and returns this element. - * - * @return mixed - */ - function next(); - - /** - * Tests for the existence of an element that satisfies the given predicate. - * - * @param Closure $p The predicate. - * - * @return boolean TRUE if the predicate is TRUE for at least one element, FALSE otherwise. - */ - function exists(Closure $p); - - /** - * Returns all the elements of this collection that satisfy the predicate p. - * The order of the elements is preserved. - * - * @param Closure $p The predicate used for filtering. - * - * @return Collection A collection with the results of the filter operation. - */ - function filter(Closure $p); - - /** - * Tests whether the given predicate p holds for all elements of this collection. - * - * @param Closure $p The predicate. - * - * @return boolean TRUE, if the predicate yields TRUE for all elements, FALSE otherwise. - */ - function forAll(Closure $p); - - /** - * Applies the given function to each element in the collection and returns - * a new collection with the elements returned by the function. - * - * @param Closure $func - * - * @return Collection - */ - function map(Closure $func); - - /** - * Partitions this collection in two collections according to a predicate. - * Keys are preserved in the resulting collections. - * - * @param Closure $p The predicate on which to partition. - * - * @return array An array with two elements. The first element contains the collection - * of elements where the predicate returned TRUE, the second element - * contains the collection of elements where the predicate returned FALSE. - */ - function partition(Closure $p); - - /** - * Gets the index/key of a given element. The comparison of two elements is strict, - * that means not only the value but also the type must match. - * For objects this means reference equality. - * - * @param mixed $element The element to search for. - * - * @return int|string|bool The key/index of the element or FALSE if the element was not found. - */ - function indexOf($element); - - /** - * Extracts a slice of $length elements starting at position $offset from the Collection. - * - * If $length is null it returns all elements from $offset to the end of the Collection. - * Keys have to be preserved by this method. Calling this method will only return the - * selected slice and NOT change the elements contained in the collection slice is called on. - * - * @param int $offset The offset to start from. - * @param int|null $length The maximum number of elements to return, or null for no limit. - * - * @return array - */ - function slice($offset, $length = null); -} diff --git a/core/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Criteria.php b/core/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Criteria.php deleted file mode 100644 index 42929bd..0000000 --- a/core/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Criteria.php +++ /dev/null @@ -1,245 +0,0 @@ -. - */ - -namespace Doctrine\Common\Collections; - -use Doctrine\Common\Collections\Expr\Expression; -use Doctrine\Common\Collections\Expr\CompositeExpression; - -/** - * Criteria for filtering Selectable collections. - * - * @author Benjamin Eberlei - * @since 2.3 - */ -class Criteria -{ - /** - * @var string - */ - const ASC = 'ASC'; - - /** - * @var string - */ - const DESC = 'DESC'; - - /** - * @var \Doctrine\Common\Collections\ExpressionBuilder|null - */ - private static $expressionBuilder; - - /** - * @var \Doctrine\Common\Collections\Expr\Expression|null - */ - private $expression; - - /** - * @var array|null - */ - private $orderings; - - /** - * @var int|null - */ - private $firstResult; - - /** - * @var int|null - */ - private $maxResults; - - /** - * Creates an instance of the class. - * - * @return Criteria - */ - public static function create() - { - return new static(); - } - - /** - * Returns the expression builder. - * - * @return \Doctrine\Common\Collections\ExpressionBuilder - */ - public static function expr() - { - if (self::$expressionBuilder === null) { - self::$expressionBuilder = new ExpressionBuilder(); - } - return self::$expressionBuilder; - } - - /** - * Construct a new Criteria. - * - * @param Expression $expression - * @param array|null $orderings - * @param int|null $firstResult - * @param int|null $maxResults - */ - public function __construct(Expression $expression = null, array $orderings = null, $firstResult = null, $maxResults = null) - { - $this->expression = $expression; - $this->orderings = $orderings; - $this->firstResult = $firstResult; - $this->maxResults = $maxResults; - } - - /** - * Sets the where expression to evaluate when this Criteria is searched for. - * - * @param Expression $expression - * - * @return Criteria - */ - public function where(Expression $expression) - { - $this->expression = $expression; - return $this; - } - - /** - * Appends the where expression to evaluate when this Criteria is searched for - * using an AND with previous expression. - * - * @param Expression $expression - * - * @return Criteria - */ - public function andWhere(Expression $expression) - { - if ($this->expression === null) { - return $this->where($expression); - } - - $this->expression = new CompositeExpression(CompositeExpression::TYPE_AND, array( - $this->expression, $expression - )); - - return $this; - } - - /** - * Appends the where expression to evaluate when this Criteria is searched for - * using an OR with previous expression. - * - * @param Expression $expression - * - * @return Criteria - */ - public function orWhere(Expression $expression) - { - if ($this->expression === null) { - return $this->where($expression); - } - - $this->expression = new CompositeExpression(CompositeExpression::TYPE_OR, array( - $this->expression, $expression - )); - - return $this; - } - - /** - * Gets the expression attached to this Criteria. - * - * @return Expression|null - */ - public function getWhereExpression() - { - return $this->expression; - } - - /** - * Gets the current orderings of this Criteria. - * - * @return array - */ - public function getOrderings() - { - return $this->orderings; - } - - /** - * Sets the ordering of the result of this Criteria. - * - * Keys are field and values are the order, being either ASC or DESC. - * - * @see Criteria::ASC - * @see Criteria::DESC - * - * @param array $orderings - * - * @return Criteria - */ - public function orderBy(array $orderings) - { - $this->orderings = $orderings; - return $this; - } - - /** - * Gets the current first result option of this Criteria. - * - * @return int|null - */ - public function getFirstResult() - { - return $this->firstResult; - } - - /** - * Set the number of first result that this Criteria should return. - * - * @param int|null $firstResult The value to set. - * - * @return Criteria - */ - public function setFirstResult($firstResult) - { - $this->firstResult = $firstResult; - return $this; - } - - /** - * Gets maxResults. - * - * @return int|null - */ - public function getMaxResults() - { - return $this->maxResults; - } - - /** - * Sets maxResults. - * - * @param int|null $maxResults The value to set. - * - * @return Criteria - */ - public function setMaxResults($maxResults) - { - $this->maxResults = $maxResults; - return $this; - } -} diff --git a/core/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/ClosureExpressionVisitor.php b/core/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/ClosureExpressionVisitor.php deleted file mode 100644 index 5099458..0000000 --- a/core/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/ClosureExpressionVisitor.php +++ /dev/null @@ -1,227 +0,0 @@ -. - */ - -namespace Doctrine\Common\Collections\Expr; - -/** - * Walks an expression graph and turns it into a PHP closure. - * - * This closure can be used with {@Collection#filter()} and is used internally - * by {@ArrayCollection#select()}. - * - * @author Benjamin Eberlei - * @since 2.3 - */ -class ClosureExpressionVisitor extends ExpressionVisitor -{ - /** - * Accesses the field of a given object. This field has to be public - * directly or indirectly (through an accessor get*, is*, or a magic - * method, __get, __call). - * - * @param object $object - * @param string $field - * - * @return mixed - */ - public static function getObjectFieldValue($object, $field) - { - if (is_array($object)) { - return $object[$field]; - } - - $accessors = array('get', 'is'); - - foreach ($accessors as $accessor) { - $accessor .= $field; - - if ( ! method_exists($object, $accessor)) { - continue; - } - - return $object->$accessor(); - } - - // __call should be triggered for get. - $accessor = $accessors[0] . $field; - - if (method_exists($object, '__call')) { - return $object->$accessor(); - } - - if ($object instanceof \ArrayAccess) { - return $object[$field]; - } - - return $object->$field; - } - - /** - * Helper for sorting arrays of objects based on multiple fields + orientations. - * - * @param string $name - * @param int $orientation - * @param \Closure $next - * - * @return \Closure - */ - public static function sortByField($name, $orientation = 1, \Closure $next = null) - { - if (!$next) { - $next = function() { - return 0; - }; - } - - return function ($a, $b) use ($name, $next, $orientation) { - $aValue = ClosureExpressionVisitor::getObjectFieldValue($a, $name); - $bValue = ClosureExpressionVisitor::getObjectFieldValue($b, $name); - - if ($aValue === $bValue) { - return $next($a, $b); - } - - return (($aValue > $bValue) ? 1 : -1) * $orientation; - }; - } - - /** - * {@inheritDoc} - */ - public function walkComparison(Comparison $comparison) - { - $field = $comparison->getField(); - $value = $comparison->getValue()->getValue(); // shortcut for walkValue() - - switch ($comparison->getOperator()) { - case Comparison::EQ: - return function ($object) use ($field, $value) { - return ClosureExpressionVisitor::getObjectFieldValue($object, $field) === $value; - }; - - case Comparison::NEQ: - return function ($object) use ($field, $value) { - return ClosureExpressionVisitor::getObjectFieldValue($object, $field) !== $value; - }; - - case Comparison::LT: - return function ($object) use ($field, $value) { - return ClosureExpressionVisitor::getObjectFieldValue($object, $field) < $value; - }; - - case Comparison::LTE: - return function ($object) use ($field, $value) { - return ClosureExpressionVisitor::getObjectFieldValue($object, $field) <= $value; - }; - - case Comparison::GT: - return function ($object) use ($field, $value) { - return ClosureExpressionVisitor::getObjectFieldValue($object, $field) > $value; - }; - - case Comparison::GTE: - return function ($object) use ($field, $value) { - return ClosureExpressionVisitor::getObjectFieldValue($object, $field) >= $value; - }; - - case Comparison::IN: - return function ($object) use ($field, $value) { - return in_array(ClosureExpressionVisitor::getObjectFieldValue($object, $field), $value); - }; - - case Comparison::NIN: - return function ($object) use ($field, $value) { - return ! in_array(ClosureExpressionVisitor::getObjectFieldValue($object, $field), $value); - }; - - case Comparison::CONTAINS: - return function ($object) use ($field, $value) { - return false !== strpos(ClosureExpressionVisitor::getObjectFieldValue($object, $field), $value); - }; - - default: - throw new \RuntimeException("Unknown comparison operator: " . $comparison->getOperator()); - } - } - - /** - * {@inheritDoc} - */ - public function walkValue(Value $value) - { - return $value->getValue(); - } - - /** - * {@inheritDoc} - */ - public function walkCompositeExpression(CompositeExpression $expr) - { - $expressionList = array(); - - foreach ($expr->getExpressionList() as $child) { - $expressionList[] = $this->dispatch($child); - } - - switch($expr->getType()) { - case CompositeExpression::TYPE_AND: - return $this->andExpressions($expressionList); - - case CompositeExpression::TYPE_OR: - return $this->orExpressions($expressionList); - - default: - throw new \RuntimeException("Unknown composite " . $expr->getType()); - } - } - - /** - * @param array $expressions - * - * @return callable - */ - private function andExpressions($expressions) - { - return function ($object) use ($expressions) { - foreach ($expressions as $expression) { - if ( ! $expression($object)) { - return false; - } - } - return true; - }; - } - - /** - * @param array $expressions - * - * @return callable - */ - private function orExpressions($expressions) - { - return function ($object) use ($expressions) { - foreach ($expressions as $expression) { - if ($expression($object)) { - return true; - } - } - return false; - }; - } -} diff --git a/core/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/Comparison.php b/core/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/Comparison.php deleted file mode 100644 index d54ecf2..0000000 --- a/core/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/Comparison.php +++ /dev/null @@ -1,103 +0,0 @@ -. - */ - -namespace Doctrine\Common\Collections\Expr; - -/** - * Comparison of a field with a value by the given operator. - * - * @author Benjamin Eberlei - * @since 2.3 - */ -class Comparison implements Expression -{ - const EQ = '='; - const NEQ = '<>'; - const LT = '<'; - const LTE = '<='; - const GT = '>'; - const GTE = '>='; - const IS = '='; // no difference with EQ - const IN = 'IN'; - const NIN = 'NIN'; - const CONTAINS = 'CONTAINS'; - - /** - * @var string - */ - private $field; - - /** - * @var string - */ - private $op; - - /** - * @var Value - */ - private $value; - - /** - * @param string $field - * @param string $operator - * @param mixed $value - */ - public function __construct($field, $operator, $value) - { - if ( ! ($value instanceof Value)) { - $value = new Value($value); - } - - $this->field = $field; - $this->op = $operator; - $this->value = $value; - } - - /** - * @return string - */ - public function getField() - { - return $this->field; - } - - /** - * @return Value - */ - public function getValue() - { - return $this->value; - } - - /** - * @return string - */ - public function getOperator() - { - return $this->op; - } - - /** - * {@inheritDoc} - */ - public function visit(ExpressionVisitor $visitor) - { - return $visitor->walkComparison($this); - } -} diff --git a/core/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/CompositeExpression.php b/core/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/CompositeExpression.php deleted file mode 100644 index 3613c02..0000000 --- a/core/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/CompositeExpression.php +++ /dev/null @@ -1,90 +0,0 @@ -. - */ - -namespace Doctrine\Common\Collections\Expr; - -/** - * Expression of Expressions combined by AND or OR operation. - * - * @author Benjamin Eberlei - * @since 2.3 - */ -class CompositeExpression implements Expression -{ - const TYPE_AND = 'AND'; - const TYPE_OR = 'OR'; - - /** - * @var string - */ - private $type; - - /** - * @var Expression[] - */ - private $expressions = array(); - - /** - * @param string $type - * @param array $expressions - * - * @throws \RuntimeException - */ - public function __construct($type, array $expressions) - { - $this->type = $type; - - foreach ($expressions as $expr) { - if ($expr instanceof Value) { - throw new \RuntimeException("Values are not supported expressions as children of and/or expressions."); - } - if ( ! ($expr instanceof Expression)) { - throw new \RuntimeException("No expression given to CompositeExpression."); - } - - $this->expressions[] = $expr; - } - } - - /** - * Returns the list of expressions nested in this composite. - * - * @return Expression[] - */ - public function getExpressionList() - { - return $this->expressions; - } - - /** - * @return string - */ - public function getType() - { - return $this->type; - } - - /** - * {@inheritDoc} - */ - public function visit(ExpressionVisitor $visitor) - { - return $visitor->walkCompositeExpression($this); - } -} diff --git a/core/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/Expression.php b/core/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/Expression.php deleted file mode 100644 index 68db767..0000000 --- a/core/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/Expression.php +++ /dev/null @@ -1,35 +0,0 @@ -. - */ - -namespace Doctrine\Common\Collections\Expr; - -/** - * Expression for the {@link Selectable} interface. - * - * @author Benjamin Eberlei - */ -interface Expression -{ - /** - * @param ExpressionVisitor $visitor - * - * @return mixed - */ - public function visit(ExpressionVisitor $visitor); -} diff --git a/core/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/ExpressionVisitor.php b/core/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/ExpressionVisitor.php deleted file mode 100644 index 080afdc..0000000 --- a/core/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/ExpressionVisitor.php +++ /dev/null @@ -1,82 +0,0 @@ -. - */ - -namespace Doctrine\Common\Collections\Expr; - -/** - * An Expression visitor walks a graph of expressions and turns them into a - * query for the underlying implementation. - * - * @author Benjamin Eberlei - */ -abstract class ExpressionVisitor -{ - /** - * Converts a comparison expression into the target query language output. - * - * @param Comparison $comparison - * - * @return mixed - */ - abstract public function walkComparison(Comparison $comparison); - - /** - * Converts a value expression into the target query language part. - * - * @param Value $value - * - * @return mixed - */ - abstract public function walkValue(Value $value); - - /** - * Converts a composite expression into the target query language output. - * - * @param CompositeExpression $expr - * - * @return mixed - */ - abstract public function walkCompositeExpression(CompositeExpression $expr); - - /** - * Dispatches walking an expression to the appropriate handler. - * - * @param Expression $expr - * - * @return mixed - * - * @throws \RuntimeException - */ - public function dispatch(Expression $expr) - { - switch (true) { - case ($expr instanceof Comparison): - return $this->walkComparison($expr); - - case ($expr instanceof Value): - return $this->walkValue($expr); - - case ($expr instanceof CompositeExpression): - return $this->walkCompositeExpression($expr); - - default: - throw new \RuntimeException("Unknown Expression " . get_class($expr)); - } - } -} diff --git a/core/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/Value.php b/core/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/Value.php deleted file mode 100644 index 7f6e831..0000000 --- a/core/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/Value.php +++ /dev/null @@ -1,52 +0,0 @@ -. - */ - -namespace Doctrine\Common\Collections\Expr; - -class Value implements Expression -{ - /** - * @var mixed - */ - private $value; - - /** - * @param mixed $value - */ - public function __construct($value) - { - $this->value = $value; - } - - /** - * @return mixed - */ - public function getValue() - { - return $this->value; - } - - /** - * {@inheritDoc} - */ - public function visit(ExpressionVisitor $visitor) - { - return $visitor->walkValue($this); - } -} diff --git a/core/vendor/doctrine/collections/lib/Doctrine/Common/Collections/ExpressionBuilder.php b/core/vendor/doctrine/collections/lib/Doctrine/Common/Collections/ExpressionBuilder.php deleted file mode 100644 index 6539e3c..0000000 --- a/core/vendor/doctrine/collections/lib/Doctrine/Common/Collections/ExpressionBuilder.php +++ /dev/null @@ -1,166 +0,0 @@ -. - */ - -namespace Doctrine\Common\Collections; - -use Doctrine\Common\Collections\Expr\Comparison; -use Doctrine\Common\Collections\Expr\CompositeExpression; -use Doctrine\Common\Collections\Expr\Value; - -/** - * Builder for Expressions in the {@link Selectable} interface. - * - * Important Notice for interoperable code: You have to use scalar - * values only for comparisons, otherwise the behavior of the comparision - * may be different between implementations (Array vs ORM vs ODM). - * - * @author Benjamin Eberlei - * @since 2.3 - */ -class ExpressionBuilder -{ - /** - * @param mixed $x - * - * @return CompositeExpression - */ - public function andX($x = null) - { - return new CompositeExpression(CompositeExpression::TYPE_AND, func_get_args()); - } - - /** - * @param mixed $x - * - * @return CompositeExpression - */ - public function orX($x = null) - { - return new CompositeExpression(CompositeExpression::TYPE_OR, func_get_args()); - } - - /** - * @param string $field - * @param mixed $value - * - * @return Comparison - */ - public function eq($field, $value) - { - return new Comparison($field, Comparison::EQ, new Value($value)); - } - - /** - * @param string $field - * @param mixed $value - * - * @return Comparison - */ - public function gt($field, $value) - { - return new Comparison($field, Comparison::GT, new Value($value)); - } - - /** - * @param string $field - * @param mixed $value - * - * @return Comparison - */ - public function lt($field, $value) - { - return new Comparison($field, Comparison::LT, new Value($value)); - } - - /** - * @param string $field - * @param mixed $value - * - * @return Comparison - */ - public function gte($field, $value) - { - return new Comparison($field, Comparison::GTE, new Value($value)); - } - - /** - * @param string $field - * @param mixed $value - * - * @return Comparison - */ - public function lte($field, $value) - { - return new Comparison($field, Comparison::LTE, new Value($value)); - } - - /** - * @param string $field - * @param mixed $value - * - * @return Comparison - */ - public function neq($field, $value) - { - return new Comparison($field, Comparison::NEQ, new Value($value)); - } - - /** - * @param string $field - * - * @return Comparison - */ - public function isNull($field) - { - return new Comparison($field, Comparison::EQ, new Value(null)); - } - - /** - * @param string $field - * @param mixed $values - * - * @return Comparison - */ - public function in($field, array $values) - { - return new Comparison($field, Comparison::IN, new Value($values)); - } - - /** - * @param string $field - * @param mixed $values - * - * @return Comparison - */ - public function notIn($field, array $values) - { - return new Comparison($field, Comparison::NIN, new Value($values)); - } - - /** - * @param string $field - * @param mixed $value - * - * @return Comparison - */ - public function contains($field, $value) - { - return new Comparison($field, Comparison::CONTAINS, new Value($value)); - } -} diff --git a/core/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Selectable.php b/core/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Selectable.php deleted file mode 100644 index 401d46e..0000000 --- a/core/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Selectable.php +++ /dev/null @@ -1,48 +0,0 @@ -. - */ - -namespace Doctrine\Common\Collections; - -/** - * Interface for collections that allow efficient filtering with an expression API. - * - * Goal of this interface is a backend independent method to fetch elements - * from a collections. {@link Expression} is crafted in a way that you can - * implement queries from both in-memory and database-backed collections. - * - * For database backed collections this allows very efficient access by - * utilizing the query APIs, for example SQL in the ORM. Applications using - * this API can implement efficient database access without having to ask the - * EntityManager or Repositories. - * - * @author Benjamin Eberlei - * @since 2.3 - */ -interface Selectable -{ - /** - * Selects all elements from a selectable that match the expression and - * returns a new collection containing these elements. - * - * @param Criteria $criteria - * - * @return Collection - */ - function matching(Criteria $criteria); -} diff --git a/core/vendor/doctrine/collections/phpunit.xml.dist b/core/vendor/doctrine/collections/phpunit.xml.dist deleted file mode 100644 index 36968e9..0000000 --- a/core/vendor/doctrine/collections/phpunit.xml.dist +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - ./tests/Doctrine/ - - - - - - ./lib/Doctrine/ - - - - - - performance - - - diff --git a/core/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/AbstractLazyCollectionTest.php b/core/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/AbstractLazyCollectionTest.php deleted file mode 100644 index 4de82cc..0000000 --- a/core/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/AbstractLazyCollectionTest.php +++ /dev/null @@ -1,20 +0,0 @@ -assertFalse($collection->isInitialized()); - $this->assertCount(3, $collection); - - $collection->add('bar'); - $this->assertTrue($collection->isInitialized()); - $this->assertCount(4, $collection); - } -} diff --git a/core/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/ClosureExpressionVisitorTest.php b/core/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/ClosureExpressionVisitorTest.php deleted file mode 100644 index b640043..0000000 --- a/core/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/ClosureExpressionVisitorTest.php +++ /dev/null @@ -1,243 +0,0 @@ -. - */ - -namespace Doctrine\Tests\Common\Collections; - -use Doctrine\Common\Collections\Expr\ClosureExpressionVisitor; -use Doctrine\Common\Collections\ExpressionBuilder; - -/** - * @group DDC-1637 - */ -class ClosureExpressionVisitorTest extends \PHPUnit_Framework_TestCase -{ - private $visitor; - private $builder; - - public function setUp() - { - $this->visitor = new ClosureExpressionVisitor(); - $this->builder = new ExpressionBuilder(); - } - - public function testGetObjectFieldValueIsAccessor() - { - $object = new TestObject(1, 2, true); - - $this->assertTrue($this->visitor->getObjectFieldValue($object, 'baz')); - } - - public function testGetObjectFieldValueMagicCallMethod() - { - $object = new TestObject(1, 2, true, 3); - - $this->assertEquals(3, $this->visitor->getObjectFieldValue($object, 'qux')); - } - - public function testWalkEqualsComparison() - { - $closure = $this->visitor->walkComparison($this->builder->eq("foo", 1)); - - $this->assertTrue($closure(new TestObject(1))); - $this->assertFalse($closure(new TestObject(2))); - } - - public function testWalkNotEqualsComparison() - { - $closure = $this->visitor->walkComparison($this->builder->neq("foo", 1)); - - $this->assertFalse($closure(new TestObject(1))); - $this->assertTrue($closure(new TestObject(2))); - } - - public function testWalkLessThanComparison() - { - $closure = $this->visitor->walkComparison($this->builder->lt("foo", 1)); - - $this->assertFalse($closure(new TestObject(1))); - $this->assertTrue($closure(new TestObject(0))); - } - - public function testWalkLessThanEqualsComparison() - { - $closure = $this->visitor->walkComparison($this->builder->lte("foo", 1)); - - $this->assertFalse($closure(new TestObject(2))); - $this->assertTrue($closure(new TestObject(1))); - $this->assertTrue($closure(new TestObject(0))); - } - - public function testWalkGreaterThanEqualsComparison() - { - $closure = $this->visitor->walkComparison($this->builder->gte("foo", 1)); - - $this->assertTrue($closure(new TestObject(2))); - $this->assertTrue($closure(new TestObject(1))); - $this->assertFalse($closure(new TestObject(0))); - } - - public function testWalkGreaterThanComparison() - { - $closure = $this->visitor->walkComparison($this->builder->gt("foo", 1)); - - $this->assertTrue($closure(new TestObject(2))); - $this->assertFalse($closure(new TestObject(1))); - $this->assertFalse($closure(new TestObject(0))); - } - - public function testWalkInComparison() - { - $closure = $this->visitor->walkComparison($this->builder->in("foo", array(1, 2, 3))); - - $this->assertTrue($closure(new TestObject(2))); - $this->assertTrue($closure(new TestObject(1))); - $this->assertFalse($closure(new TestObject(0))); - } - - public function testWalkNotInComparison() - { - $closure = $this->visitor->walkComparison($this->builder->notIn("foo", array(1, 2, 3))); - - $this->assertFalse($closure(new TestObject(1))); - $this->assertFalse($closure(new TestObject(2))); - $this->assertTrue($closure(new TestObject(0))); - $this->assertTrue($closure(new TestObject(4))); - } - - public function testWalkContainsComparison() - { - $closure = $this->visitor->walkComparison($this->builder->contains('foo', 'hello')); - - $this->assertTrue($closure(new TestObject('hello world'))); - $this->assertFalse($closure(new TestObject('world'))); - } - - public function testWalkAndCompositeExpression() - { - $closure = $this->visitor->walkCompositeExpression( - $this->builder->andX( - $this->builder->eq("foo", 1), - $this->builder->eq("bar", 1) - ) - ); - - $this->assertTrue($closure(new TestObject(1, 1))); - $this->assertFalse($closure(new TestObject(1, 0))); - $this->assertFalse($closure(new TestObject(0, 1))); - $this->assertFalse($closure(new TestObject(0, 0))); - } - - public function testWalkOrCompositeExpression() - { - $closure = $this->visitor->walkCompositeExpression( - $this->builder->orX( - $this->builder->eq("foo", 1), - $this->builder->eq("bar", 1) - ) - ); - - $this->assertTrue($closure(new TestObject(1, 1))); - $this->assertTrue($closure(new TestObject(1, 0))); - $this->assertTrue($closure(new TestObject(0, 1))); - $this->assertFalse($closure(new TestObject(0, 0))); - } - - public function testSortByFieldAscending() - { - $objects = array(new TestObject("b"), new TestObject("a"), new TestObject("c")); - $sort = ClosureExpressionVisitor::sortByField("foo"); - - usort($objects, $sort); - - $this->assertEquals("a", $objects[0]->getFoo()); - $this->assertEquals("b", $objects[1]->getFoo()); - $this->assertEquals("c", $objects[2]->getFoo()); - } - - public function testSortByFieldDescending() - { - $objects = array(new TestObject("b"), new TestObject("a"), new TestObject("c")); - $sort = ClosureExpressionVisitor::sortByField("foo", -1); - - usort($objects, $sort); - - $this->assertEquals("c", $objects[0]->getFoo()); - $this->assertEquals("b", $objects[1]->getFoo()); - $this->assertEquals("a", $objects[2]->getFoo()); - } - - public function testSortDelegate() - { - $objects = array(new TestObject("a", "c"), new TestObject("a", "b"), new TestObject("a", "a")); - $sort = ClosureExpressionVisitor::sortByField("bar", 1); - $sort = ClosureExpressionVisitor::sortByField("foo", 1, $sort); - - usort($objects, $sort); - - $this->assertEquals("a", $objects[0]->getBar()); - $this->assertEquals("b", $objects[1]->getBar()); - $this->assertEquals("c", $objects[2]->getBar()); - } - - public function testArrayComparison() - { - $closure = $this->visitor->walkComparison($this->builder->eq("foo", 42)); - - $this->assertTrue($closure(array('foo' => 42))); - } -} - -class TestObject -{ - private $foo; - private $bar; - private $baz; - private $qux; - - public function __construct($foo = null, $bar = null, $baz = null, $qux = null) - { - $this->foo = $foo; - $this->bar = $bar; - $this->baz = $baz; - $this->qux = $qux; - } - - public function __call($name, $arguments) - { - if ('getqux' === $name) { - return $this->qux; - } - } - - public function getFoo() - { - return $this->foo; - } - - public function getBar() - { - return $this->bar; - } - - public function isBaz() - { - return $this->baz; - } -} - diff --git a/core/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/CollectionTest.php b/core/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/CollectionTest.php deleted file mode 100644 index d98246c..0000000 --- a/core/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/CollectionTest.php +++ /dev/null @@ -1,264 +0,0 @@ -_coll = new \Doctrine\Common\Collections\ArrayCollection; - } - - public function testIssetAndUnset() - { - $this->assertFalse(isset($this->_coll[0])); - $this->_coll->add('testing'); - $this->assertTrue(isset($this->_coll[0])); - unset($this->_coll[0]); - $this->assertFalse(isset($this->_coll[0])); - } - - public function testToString() - { - $this->_coll->add('testing'); - $this->assertTrue(is_string((string) $this->_coll)); - } - - public function testRemovingNonExistentEntryReturnsNull() - { - $this->assertEquals(null, $this->_coll->remove('testing_does_not_exist')); - } - - public function testExists() - { - $this->_coll->add("one"); - $this->_coll->add("two"); - $exists = $this->_coll->exists(function($k, $e) { return $e == "one"; }); - $this->assertTrue($exists); - $exists = $this->_coll->exists(function($k, $e) { return $e == "other"; }); - $this->assertFalse($exists); - } - - public function testMap() - { - $this->_coll->add(1); - $this->_coll->add(2); - $res = $this->_coll->map(function($e) { return $e * 2; }); - $this->assertEquals(array(2, 4), $res->toArray()); - } - - public function testFilter() - { - $this->_coll->add(1); - $this->_coll->add("foo"); - $this->_coll->add(3); - $res = $this->_coll->filter(function($e) { return is_numeric($e); }); - $this->assertEquals(array(0 => 1, 2 => 3), $res->toArray()); - } - - public function testFirstAndLast() - { - $this->_coll->add('one'); - $this->_coll->add('two'); - - $this->assertEquals($this->_coll->first(), 'one'); - $this->assertEquals($this->_coll->last(), 'two'); - } - - public function testArrayAccess() - { - $this->_coll[] = 'one'; - $this->_coll[] = 'two'; - - $this->assertEquals($this->_coll[0], 'one'); - $this->assertEquals($this->_coll[1], 'two'); - - unset($this->_coll[0]); - $this->assertEquals($this->_coll->count(), 1); - } - - public function testContainsKey() - { - $this->_coll[5] = 'five'; - $this->assertTrue($this->_coll->containsKey(5)); - } - - public function testContains() - { - $this->_coll[0] = 'test'; - $this->assertTrue($this->_coll->contains('test')); - } - - public function testSearch() - { - $this->_coll[0] = 'test'; - $this->assertEquals(0, $this->_coll->indexOf('test')); - } - - public function testGet() - { - $this->_coll[0] = 'test'; - $this->assertEquals('test', $this->_coll->get(0)); - } - - public function testGetKeys() - { - $this->_coll[] = 'one'; - $this->_coll[] = 'two'; - $this->assertEquals(array(0, 1), $this->_coll->getKeys()); - } - - public function testGetValues() - { - $this->_coll[] = 'one'; - $this->_coll[] = 'two'; - $this->assertEquals(array('one', 'two'), $this->_coll->getValues()); - } - - public function testCount() - { - $this->_coll[] = 'one'; - $this->_coll[] = 'two'; - $this->assertEquals($this->_coll->count(), 2); - $this->assertEquals(count($this->_coll), 2); - } - - public function testForAll() - { - $this->_coll[] = 'one'; - $this->_coll[] = 'two'; - $this->assertEquals($this->_coll->forAll(function($k, $e) { return is_string($e); }), true); - $this->assertEquals($this->_coll->forAll(function($k, $e) { return is_array($e); }), false); - } - - public function testPartition() - { - $this->_coll[] = true; - $this->_coll[] = false; - $partition = $this->_coll->partition(function($k, $e) { return $e == true; }); - $this->assertEquals($partition[0][0], true); - $this->assertEquals($partition[1][0], false); - } - - public function testClear() - { - $this->_coll[] = 'one'; - $this->_coll[] = 'two'; - $this->_coll->clear(); - $this->assertEquals($this->_coll->isEmpty(), true); - } - - public function testRemove() - { - $this->_coll[] = 'one'; - $this->_coll[] = 'two'; - $el = $this->_coll->remove(0); - - $this->assertEquals('one', $el); - $this->assertEquals($this->_coll->contains('one'), false); - $this->assertNull($this->_coll->remove(0)); - } - - public function testRemoveElement() - { - $this->_coll[] = 'one'; - $this->_coll[] = 'two'; - - $this->assertTrue($this->_coll->removeElement('two')); - $this->assertFalse($this->_coll->contains('two')); - $this->assertFalse($this->_coll->removeElement('two')); - } - - public function testSlice() - { - $this->_coll[] = 'one'; - $this->_coll[] = 'two'; - $this->_coll[] = 'three'; - - $slice = $this->_coll->slice(0, 1); - $this->assertInternalType('array', $slice); - $this->assertEquals(array('one'), $slice); - - $slice = $this->_coll->slice(1); - $this->assertEquals(array(1 => 'two', 2 => 'three'), $slice); - - $slice = $this->_coll->slice(1, 1); - $this->assertEquals(array(1 => 'two'), $slice); - } - - public function fillMatchingFixture() - { - $std1 = new \stdClass(); - $std1->foo = "bar"; - $this->_coll[] = $std1; - - $std2 = new \stdClass(); - $std2->foo = "baz"; - $this->_coll[] = $std2; - } - - /** - * @group DDC-1637 - */ - public function testMatching() - { - $this->fillMatchingFixture(); - - $col = $this->_coll->matching(new Criteria(Criteria::expr()->eq("foo", "bar"))); - $this->assertInstanceOf('Doctrine\Common\Collections\Collection', $col); - $this->assertNotSame($col, $this->_coll); - $this->assertEquals(1, count($col)); - } - - /** - * @group DDC-1637 - */ - public function testMatchingOrdering() - { - $this->fillMatchingFixture(); - - $col = $this->_coll->matching(new Criteria(null, array('foo' => 'DESC'))); - - $this->assertInstanceOf('Doctrine\Common\Collections\Collection', $col); - $this->assertNotSame($col, $this->_coll); - $this->assertEquals(2, count($col)); - $this->assertEquals('baz', $col[0]->foo); - $this->assertEquals('bar', $col[1]->foo); - } - - /** - * @group DDC-1637 - */ - public function testMatchingSlice() - { - $this->fillMatchingFixture(); - - $col = $this->_coll->matching(new Criteria(null, null, 1, 1)); - - $this->assertInstanceOf('Doctrine\Common\Collections\Collection', $col); - $this->assertNotSame($col, $this->_coll); - $this->assertEquals(1, count($col)); - $this->assertEquals('baz', $col[0]->foo); - } - - public function testCanRemoveNullValuesByKey() - { - $this->_coll->add(null); - $this->_coll->remove(0); - $this->assertTrue($this->_coll->isEmpty()); - } - - public function testCanVerifyExistingKeysWithNullValues() - { - $this->_coll->set('key', null); - $this->assertTrue($this->_coll->containsKey('key')); - } -} diff --git a/core/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/CriteriaTest.php b/core/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/CriteriaTest.php deleted file mode 100644 index 03fb6ca..0000000 --- a/core/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/CriteriaTest.php +++ /dev/null @@ -1,82 +0,0 @@ -assertInstanceOf("Doctrine\Common\Collections\Criteria", $criteria); - } - - public function testConstructor() - { - $expr = new Comparison("field", "=", "value"); - $criteria = new Criteria($expr, array("foo" => "ASC"), 10, 20); - - $this->assertSame($expr, $criteria->getWhereExpression()); - $this->assertEquals(array("foo" => "ASC"), $criteria->getOrderings()); - $this->assertEquals(10, $criteria->getFirstResult()); - $this->assertEquals(20, $criteria->getMaxResults()); - } - - public function testWhere() - { - $expr = new Comparison("field", "=", "value"); - $criteria = new Criteria(); - - $criteria->where($expr); - - $this->assertSame($expr, $criteria->getWhereExpression()); - } - - public function testAndWhere() - { - $expr = new Comparison("field", "=", "value"); - $criteria = new Criteria(); - - $criteria->where($expr); - $expr = $criteria->getWhereExpression(); - $criteria->andWhere($expr); - - $where = $criteria->getWhereExpression(); - $this->assertInstanceOf('Doctrine\Common\Collections\Expr\CompositeExpression', $where); - - $this->assertEquals(CompositeExpression::TYPE_AND, $where->getType()); - $this->assertSame(array($expr, $expr), $where->getExpressionList()); - } - - public function testOrWhere() - { - $expr = new Comparison("field", "=", "value"); - $criteria = new Criteria(); - - $criteria->where($expr); - $expr = $criteria->getWhereExpression(); - $criteria->orWhere($expr); - - $where = $criteria->getWhereExpression(); - $this->assertInstanceOf('Doctrine\Common\Collections\Expr\CompositeExpression', $where); - - $this->assertEquals(CompositeExpression::TYPE_OR, $where->getType()); - $this->assertSame(array($expr, $expr), $where->getExpressionList()); - } - - public function testOrderings() - { - $criteria = Criteria::create() - ->orderBy(array("foo" => "ASC")); - - $this->assertEquals(array("foo" => "ASC"), $criteria->getOrderings()); - } - - public function testExpr() - { - $this->assertInstanceOf('Doctrine\Common\Collections\ExpressionBuilder', Criteria::expr()); - } -} diff --git a/core/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/ExpressionBuilderTest.php b/core/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/ExpressionBuilderTest.php deleted file mode 100644 index 06d4155..0000000 --- a/core/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/ExpressionBuilderTest.php +++ /dev/null @@ -1,122 +0,0 @@ -builder = new ExpressionBuilder(); - } - - public function testAndX() - { - $expr = $this->builder->andX($this->builder->eq("a", "b")); - - $this->assertInstanceOf("Doctrine\Common\Collections\Expr\CompositeExpression", $expr); - $this->assertEquals(CompositeExpression::TYPE_AND, $expr->getType()); - } - - public function testOrX() - { - $expr = $this->builder->orX($this->builder->eq("a", "b")); - - $this->assertInstanceOf("Doctrine\Common\Collections\Expr\CompositeExpression", $expr); - $this->assertEquals(CompositeExpression::TYPE_OR, $expr->getType()); - } - - public function testInvalidAndXArgument() - { - $this->setExpectedException("RuntimeException"); - $this->builder->andX("foo"); - } - - public function testEq() - { - $expr = $this->builder->eq("a", "b"); - - $this->assertInstanceOf("Doctrine\Common\Collections\Expr\Comparison", $expr); - $this->assertEquals(Comparison::EQ, $expr->getOperator()); - } - - public function testNeq() - { - $expr = $this->builder->neq("a", "b"); - - $this->assertInstanceOf("Doctrine\Common\Collections\Expr\Comparison", $expr); - $this->assertEquals(Comparison::NEQ, $expr->getOperator()); - } - - public function testLt() - { - $expr = $this->builder->lt("a", "b"); - - $this->assertInstanceOf("Doctrine\Common\Collections\Expr\Comparison", $expr); - $this->assertEquals(Comparison::LT, $expr->getOperator()); - } - - public function testGt() - { - $expr = $this->builder->gt("a", "b"); - - $this->assertInstanceOf("Doctrine\Common\Collections\Expr\Comparison", $expr); - $this->assertEquals(Comparison::GT, $expr->getOperator()); - } - - public function testGte() - { - $expr = $this->builder->gte("a", "b"); - - $this->assertInstanceOf("Doctrine\Common\Collections\Expr\Comparison", $expr); - $this->assertEquals(Comparison::GTE, $expr->getOperator()); - } - - public function testLte() - { - $expr = $this->builder->lte("a", "b"); - - $this->assertInstanceOf("Doctrine\Common\Collections\Expr\Comparison", $expr); - $this->assertEquals(Comparison::LTE, $expr->getOperator()); - } - - public function testIn() - { - $expr = $this->builder->in("a", array("b")); - - $this->assertInstanceOf("Doctrine\Common\Collections\Expr\Comparison", $expr); - $this->assertEquals(Comparison::IN, $expr->getOperator()); - } - - public function testNotIn() - { - $expr = $this->builder->notIn("a", array("b")); - - $this->assertInstanceOf("Doctrine\Common\Collections\Expr\Comparison", $expr); - $this->assertEquals(Comparison::NIN, $expr->getOperator()); - } - - public function testIsNull() - { - $expr = $this->builder->isNull("a"); - - $this->assertInstanceOf("Doctrine\Common\Collections\Expr\Comparison", $expr); - $this->assertEquals(Comparison::EQ, $expr->getOperator()); - } - - public function testContains() - { - $expr = $this->builder->contains("a", "b"); - - $this->assertInstanceOf("Doctrine\Common\Collections\Expr\Comparison", $expr); - $this->assertEquals(Comparison::CONTAINS, $expr->getOperator()); - } -} - diff --git a/core/vendor/doctrine/collections/tests/Doctrine/Tests/DoctrineTestCase.php b/core/vendor/doctrine/collections/tests/Doctrine/Tests/DoctrineTestCase.php deleted file mode 100644 index e8323d2..0000000 --- a/core/vendor/doctrine/collections/tests/Doctrine/Tests/DoctrineTestCase.php +++ /dev/null @@ -1,10 +0,0 @@ -collection = new ArrayCollection(array('a', 'b', 'c')); - } -} diff --git a/core/vendor/doctrine/collections/tests/Doctrine/Tests/TestInit.php b/core/vendor/doctrine/collections/tests/Doctrine/Tests/TestInit.php deleted file mode 100644 index 973b5fe..0000000 --- a/core/vendor/doctrine/collections/tests/Doctrine/Tests/TestInit.php +++ /dev/null @@ -1,21 +0,0 @@ -setDefaultAnnotationNamespace('Doctrine\ORM\Mapping\\'); - // new code necessary starting here - $reader->setIgnoreNotImportedAnnotations(true); - $reader->setEnableParsePhpImports(false); - $reader = new \Doctrine\Common\Annotations\CachedReader( - new \Doctrine\Common\Annotations\IndexedReader($reader), new ArrayCache() - ); - -## Annotation Base class or @Annotation - -Beginning after 2.1-RC2 you have to either extend ``Doctrine\Common\Annotations\Annotation`` or add @Annotation to your annotations class-level docblock, otherwise the class will simply be ignored. - -## Removed methods on AnnotationReader - -* AnnotationReader::setAutoloadAnnotations() -* AnnotationReader::getAutoloadAnnotations() -* AnnotationReader::isAutoloadAnnotations() - -## AnnotationRegistry - -Autoloading through the PHP autoloader is removed from the 2.1 AnnotationReader. Instead you have to use the global AnnotationRegistry for loading purposes: - - \Doctrine\Common\Annotations\AnnotationRegistry::registerFile($fileWithAnnotations); - \Doctrine\Common\Annotations\AnnotationRegistry::registerAutoloadNamespace($namespace, $dirs = null); - \Doctrine\Common\Annotations\AnnotationRegistry::registerAutoloadNamespaces($namespaces); - \Doctrine\Common\Annotations\AnnotationRegistry::registerLoader($callable); - -The $callable for registering a loader accepts a class as first and only parameter and must try to silently autoload it. On success true has to be returned. -The registerAutoloadNamespace function registers a PSR-0 compatible silent autoloader for all classes with the given namespace in the given directories. -If null is passed as directory the include path will be used. - diff --git a/core/vendor/doctrine/common/UPGRADE_TO_2_2 b/core/vendor/doctrine/common/UPGRADE_TO_2_2 deleted file mode 100644 index 1d93a13..0000000 --- a/core/vendor/doctrine/common/UPGRADE_TO_2_2 +++ /dev/null @@ -1,61 +0,0 @@ -This document details all the possible changes that you should investigate when -updating your project from Doctrine Common 2.1 to 2.2: - -## Annotation Changes - -- AnnotationReader::setIgnoreNotImportedAnnotations has been removed, you need to - add ignore annotation names which are supposed to be ignored via - AnnotationReader::addGlobalIgnoredName - -- AnnotationReader::setAutoloadAnnotations was deprecated by the AnnotationRegistry - in 2.1 and has been removed in 2.2 - -- AnnotationReader::setEnableParsePhpImports was added to ease transition to the new - annotation mechanism in 2.1 and is removed in 2.2 - -- AnnotationReader::isParsePhpImportsEnabled is removed (see above) - -- AnnotationReader::setDefaultAnnotationNamespace was deprecated in favor of explicit - configuration in 2.1 and will be removed in 2.2 (for isolated projects where you - have full-control over _all_ available annotations, we offer a dedicated reader - class ``SimpleAnnotationReader``) - -- AnnotationReader::setAnnotationCreationFunction was deprecated in 2.1 and will be - removed in 2.2. We only offer two creation mechanisms which cannot be changed - anymore to allow the same reader instance to work with all annotations regardless - of which library they are coming from. - -- AnnotationReader::setAnnotationNamespaceAlias was deprecated in 2.1 and will be - removed in 2.2 (see setDefaultAnnotationNamespace) - -- If you use a class as annotation which has not the @Annotation marker in it's - class block, we will now throw an exception instead of silently ignoring it. You - can however still achieve the previous behavior using the @IgnoreAnnotation, or - AnnotationReader::addGlobalIgnoredName (the exception message will contain detailed - instructions when you run into this problem). - -## Cache Changes - -- Renamed old AbstractCache to CacheProvider - -- Dropped the support to the following functions of all cache providers: - - - CacheProvider::deleteByWildcard - - - CacheProvider::deleteByRegEx - - - CacheProvider::deleteByPrefix - - - CacheProvider::deleteBySuffix - -- CacheProvider::deleteAll will not remove ALL entries, it will only mark them as invalid - -- CacheProvider::flushAll will remove ALL entries, namespaced or not - -- Added support to MemcachedCache - -- Added support to WincacheCache - -## ClassLoader Changes - -- ClassLoader::fileExistsInIncludePath() no longer exists. Use the native stream_resolve_include_path() PHP function \ No newline at end of file diff --git a/core/vendor/doctrine/common/build.properties b/core/vendor/doctrine/common/build.properties deleted file mode 100644 index ef51d20..0000000 --- a/core/vendor/doctrine/common/build.properties +++ /dev/null @@ -1,3 +0,0 @@ -# Version class and file -project.version_class = Doctrine\\Common\\Version -project.version_file = lib/Doctrine/Common/Version.php diff --git a/core/vendor/doctrine/common/build.xml b/core/vendor/doctrine/common/build.xml deleted file mode 100644 index 429b768..0000000 --- a/core/vendor/doctrine/common/build.xml +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/core/vendor/doctrine/common/composer.json b/core/vendor/doctrine/common/composer.json deleted file mode 100644 index 325c75c..0000000 --- a/core/vendor/doctrine/common/composer.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "doctrine/common", - "type": "library", - "description": "Common Library for Doctrine projects", - "keywords": ["collections", "spl", "eventmanager", "annotations", "persistence"], - "homepage": "http://www.doctrine-project.org", - "license": "MIT", - "authors": [ - {"name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com"}, - {"name": "Roman Borschel", "email": "roman@code-factory.org"}, - {"name": "Benjamin Eberlei", "email": "kontakt@beberlei.de"}, - {"name": "Jonathan Wage", "email": "jonwage@gmail.com"}, - {"name": "Johannes Schmitt", "email": "schmittjoh@gmail.com"} - ], - "require": { - "php": ">=5.3.2", - "doctrine/inflector": "1.*", - "doctrine/cache": "1.*", - "doctrine/collections": "1.*", - "doctrine/lexer": "1.*", - "doctrine/annotations": "1.*" - }, - "minimum-stability": "dev", - "require-dev": { - "phpunit/phpunit": "~3.7" - }, - "autoload": { - "psr-0": { "Doctrine\\Common\\": "lib/" } - }, - "extra": { - "branch-alias": { - "dev-master": "2.4.x-dev" - } - }, - "archive": { - "exclude": ["!vendor", "tests", "*phpunit.xml", ".travis.yml", "build.xml", "build.properties", "composer.phar"] - } -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/ClassLoader.php b/core/vendor/doctrine/common/lib/Doctrine/Common/ClassLoader.php deleted file mode 100644 index 632805e..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/ClassLoader.php +++ /dev/null @@ -1,288 +0,0 @@ -. - */ - -namespace Doctrine\Common; - -/** - * A ClassLoader is an autoloader for class files that can be - * installed on the SPL autoload stack. It is a class loader that either loads only classes - * of a specific namespace or all namespaces and it is suitable for working together - * with other autoloaders in the SPL autoload stack. - * - * If no include path is configured through the constructor or {@link setIncludePath}, a ClassLoader - * relies on the PHP include_path. - * - * @author Roman Borschel - * @since 2.0 - */ -class ClassLoader -{ - /** - * PHP file extension. - * - * @var string - */ - protected $fileExtension = '.php'; - - /** - * Current namespace. - * - * @var string|null - */ - protected $namespace; - - /** - * Current include path. - * - * @var string|null - */ - protected $includePath; - - /** - * PHP namespace separator. - * - * @var string - */ - protected $namespaceSeparator = '\\'; - - /** - * Creates a new ClassLoader that loads classes of the - * specified namespace from the specified include path. - * - * If no include path is given, the ClassLoader relies on the PHP include_path. - * If neither a namespace nor an include path is given, the ClassLoader will - * be responsible for loading all classes, thereby relying on the PHP include_path. - * - * @param string|null $ns The namespace of the classes to load. - * @param string|null $includePath The base include path to use. - */ - public function __construct($ns = null, $includePath = null) - { - $this->namespace = $ns; - $this->includePath = $includePath; - } - - /** - * Sets the namespace separator used by classes in the namespace of this ClassLoader. - * - * @param string $sep The separator to use. - * - * @return void - */ - public function setNamespaceSeparator($sep) - { - $this->namespaceSeparator = $sep; - } - - /** - * Gets the namespace separator used by classes in the namespace of this ClassLoader. - * - * @return string - */ - public function getNamespaceSeparator() - { - return $this->namespaceSeparator; - } - - /** - * Sets the base include path for all class files in the namespace of this ClassLoader. - * - * @param string|null $includePath - * - * @return void - */ - public function setIncludePath($includePath) - { - $this->includePath = $includePath; - } - - /** - * Gets the base include path for all class files in the namespace of this ClassLoader. - * - * @return string|null - */ - public function getIncludePath() - { - return $this->includePath; - } - - /** - * Sets the file extension of class files in the namespace of this ClassLoader. - * - * @param string $fileExtension - * - * @return void - */ - public function setFileExtension($fileExtension) - { - $this->fileExtension = $fileExtension; - } - - /** - * Gets the file extension of class files in the namespace of this ClassLoader. - * - * @return string - */ - public function getFileExtension() - { - return $this->fileExtension; - } - - /** - * Registers this ClassLoader on the SPL autoload stack. - * - * @return void - */ - public function register() - { - spl_autoload_register(array($this, 'loadClass')); - } - - /** - * Removes this ClassLoader from the SPL autoload stack. - * - * @return void - */ - public function unregister() - { - spl_autoload_unregister(array($this, 'loadClass')); - } - - /** - * Loads the given class or interface. - * - * @param string $className The name of the class to load. - * - * @return boolean TRUE if the class has been successfully loaded, FALSE otherwise. - */ - public function loadClass($className) - { - if ($this->namespace !== null && strpos($className, $this->namespace.$this->namespaceSeparator) !== 0) { - return false; - } - - require ($this->includePath !== null ? $this->includePath . DIRECTORY_SEPARATOR : '') - . str_replace($this->namespaceSeparator, DIRECTORY_SEPARATOR, $className) - . $this->fileExtension; - - return true; - } - - /** - * Asks this ClassLoader whether it can potentially load the class (file) with - * the given name. - * - * @param string $className The fully-qualified name of the class. - * - * @return boolean TRUE if this ClassLoader can load the class, FALSE otherwise. - */ - public function canLoadClass($className) - { - if ($this->namespace !== null && strpos($className, $this->namespace.$this->namespaceSeparator) !== 0) { - return false; - } - - $file = str_replace($this->namespaceSeparator, DIRECTORY_SEPARATOR, $className) . $this->fileExtension; - - if ($this->includePath !== null) { - return is_file($this->includePath . DIRECTORY_SEPARATOR . $file); - } - - return (false !== stream_resolve_include_path($file)); - } - - /** - * Checks whether a class with a given name exists. A class "exists" if it is either - * already defined in the current request or if there is an autoloader on the SPL - * autoload stack that is a) responsible for the class in question and b) is able to - * load a class file in which the class definition resides. - * - * If the class is not already defined, each autoloader in the SPL autoload stack - * is asked whether it is able to tell if the class exists. If the autoloader is - * a ClassLoader, {@link canLoadClass} is used, otherwise the autoload - * function of the autoloader is invoked and expected to return a value that - * evaluates to TRUE if the class (file) exists. As soon as one autoloader reports - * that the class exists, TRUE is returned. - * - * Note that, depending on what kinds of autoloaders are installed on the SPL - * autoload stack, the class (file) might already be loaded as a result of checking - * for its existence. This is not the case with a ClassLoader, who separates - * these responsibilities. - * - * @param string $className The fully-qualified name of the class. - * - * @return boolean TRUE if the class exists as per the definition given above, FALSE otherwise. - */ - public static function classExists($className) - { - if (class_exists($className, false) || interface_exists($className, false)) { - return true; - } - - foreach (spl_autoload_functions() as $loader) { - if (is_array($loader)) { // array(???, ???) - if (is_object($loader[0])) { - if ($loader[0] instanceof ClassLoader) { // array($obj, 'methodName') - if ($loader[0]->canLoadClass($className)) { - return true; - } - } else if ($loader[0]->{$loader[1]}($className)) { - return true; - } - } else if ($loader[0]::$loader[1]($className)) { // array('ClassName', 'methodName') - return true; - } - } else if ($loader instanceof \Closure) { // function($className) {..} - if ($loader($className)) { - return true; - } - } else if (is_string($loader) && $loader($className)) { // "MyClass::loadClass" - return true; - } - - if (class_exists($className, false) || interface_exists($className, false)) { - return true; - } - } - - return false; - } - - /** - * Gets the ClassLoader from the SPL autoload stack that is responsible - * for (and is able to load) the class with the given name. - * - * @param string $className The name of the class. - * - * @return ClassLoader The ClassLoader for the class or NULL if no such ClassLoader exists. - */ - public static function getClassLoader($className) - { - foreach (spl_autoload_functions() as $loader) { - if (is_array($loader) - && $loader[0] instanceof ClassLoader - && $loader[0]->canLoadClass($className) - ) { - return $loader[0]; - } - } - - return null; - } -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/CommonException.php b/core/vendor/doctrine/common/lib/Doctrine/Common/CommonException.php deleted file mode 100644 index 2a1a08e..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/CommonException.php +++ /dev/null @@ -1,29 +0,0 @@ -. - */ - -namespace Doctrine\Common; - -/** - * Base exception class for package Doctrine\Common. - * - * @author heinrich - */ -class CommonException extends \Exception -{ -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Comparable.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Comparable.php deleted file mode 100644 index 8cd02c9..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Comparable.php +++ /dev/null @@ -1,46 +0,0 @@ -. - */ - -namespace Doctrine\Common; - -/** - * Comparable interface that allows to compare two value objects to each other for similarity. - * - * @link www.doctrine-project.org - * @since 2.2 - * @author Benjamin Eberlei - * @author Guilherme Blanco - */ -interface Comparable -{ - /** - * Compares the current object to the passed $other. - * - * Returns 0 if they are semantically equal, 1 if the other object - * is less than the current one, or -1 if its more than the current one. - * - * This method should not check for identity using ===, only for semantical equality for example - * when two different DateTime instances point to the exact same Date + TZ. - * - * @param mixed $other - * - * @return int - */ - public function compareTo($other); -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/EventArgs.php b/core/vendor/doctrine/common/lib/Doctrine/Common/EventArgs.php deleted file mode 100644 index 75506e6..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/EventArgs.php +++ /dev/null @@ -1,67 +0,0 @@ -. - */ - -namespace Doctrine\Common; - -/** - * EventArgs is the base class for classes containing event data. - * - * This class contains no event data. It is used by events that do not pass state - * information to an event handler when an event is raised. The single empty EventArgs - * instance can be obtained through {@link getEmptyInstance}. - * - * @link www.doctrine-project.org - * @since 2.0 - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class EventArgs -{ - /** - * Single instance of EventArgs. - * - * @var EventArgs - */ - private static $_emptyEventArgsInstance; - - /** - * Gets the single, empty and immutable EventArgs instance. - * - * This instance will be used when events are dispatched without any parameter, - * like this: EventManager::dispatchEvent('eventname'); - * - * The benefit from this is that only one empty instance is instantiated and shared - * (otherwise there would be instances for every dispatched in the abovementioned form). - * - * @see EventManager::dispatchEvent - * - * @link http://msdn.microsoft.com/en-us/library/system.eventargs.aspx - * - * @return EventArgs - */ - public static function getEmptyInstance() - { - if ( ! self::$_emptyEventArgsInstance) { - self::$_emptyEventArgsInstance = new EventArgs; - } - - return self::$_emptyEventArgsInstance; - } -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/EventManager.php b/core/vendor/doctrine/common/lib/Doctrine/Common/EventManager.php deleted file mode 100644 index 69eb17e..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/EventManager.php +++ /dev/null @@ -1,154 +0,0 @@ -. - */ - -namespace Doctrine\Common; - -/** - * The EventManager is the central point of Doctrine's event listener system. - * Listeners are registered on the manager and events are dispatched through the - * manager. - * - * @link www.doctrine-project.org - * @since 2.0 - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class EventManager -{ - /** - * Map of registered listeners. - * => - * - * @var array - */ - private $_listeners = array(); - - /** - * Dispatches an event to all registered listeners. - * - * @param string $eventName The name of the event to dispatch. The name of the event is - * the name of the method that is invoked on listeners. - * @param EventArgs|null $eventArgs The event arguments to pass to the event handlers/listeners. - * If not supplied, the single empty EventArgs instance is used. - * - * @return boolean - */ - public function dispatchEvent($eventName, EventArgs $eventArgs = null) - { - if (isset($this->_listeners[$eventName])) { - $eventArgs = $eventArgs === null ? EventArgs::getEmptyInstance() : $eventArgs; - - foreach ($this->_listeners[$eventName] as $listener) { - $listener->$eventName($eventArgs); - } - } - } - - /** - * Gets the listeners of a specific event or all listeners. - * - * @param string|null $event The name of the event. - * - * @return array The event listeners for the specified event, or all event listeners. - */ - public function getListeners($event = null) - { - return $event ? $this->_listeners[$event] : $this->_listeners; - } - - /** - * Checks whether an event has any registered listeners. - * - * @param string $event - * - * @return boolean TRUE if the specified event has any listeners, FALSE otherwise. - */ - public function hasListeners($event) - { - return isset($this->_listeners[$event]) && $this->_listeners[$event]; - } - - /** - * Adds an event listener that listens on the specified events. - * - * @param string|array $events The event(s) to listen on. - * @param object $listener The listener object. - * - * @return void - */ - public function addEventListener($events, $listener) - { - // Picks the hash code related to that listener - $hash = spl_object_hash($listener); - - foreach ((array) $events as $event) { - // Overrides listener if a previous one was associated already - // Prevents duplicate listeners on same event (same instance only) - $this->_listeners[$event][$hash] = $listener; - } - } - - /** - * Removes an event listener from the specified events. - * - * @param string|array $events - * @param object $listener - * - * @return void - */ - public function removeEventListener($events, $listener) - { - // Picks the hash code related to that listener - $hash = spl_object_hash($listener); - - foreach ((array) $events as $event) { - // Check if actually have this listener associated - if (isset($this->_listeners[$event][$hash])) { - unset($this->_listeners[$event][$hash]); - } - } - } - - /** - * Adds an EventSubscriber. The subscriber is asked for all the events it is - * interested in and added as a listener for these events. - * - * @param \Doctrine\Common\EventSubscriber $subscriber The subscriber. - * - * @return void - */ - public function addEventSubscriber(EventSubscriber $subscriber) - { - $this->addEventListener($subscriber->getSubscribedEvents(), $subscriber); - } - - /** - * Removes an EventSubscriber. The subscriber is asked for all the events it is - * interested in and removed as a listener for these events. - * - * @param \Doctrine\Common\EventSubscriber $subscriber The subscriber. - * - * @return void - */ - public function removeEventSubscriber(EventSubscriber $subscriber) - { - $this->removeEventListener($subscriber->getSubscribedEvents(), $subscriber); - } -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/EventSubscriber.php b/core/vendor/doctrine/common/lib/Doctrine/Common/EventSubscriber.php deleted file mode 100644 index 55d0f7d..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/EventSubscriber.php +++ /dev/null @@ -1,42 +0,0 @@ -. - */ - -namespace Doctrine\Common; - -/** - * An EventSubscriber knows himself what events he is interested in. - * If an EventSubscriber is added to an EventManager, the manager invokes - * {@link getSubscribedEvents} and registers the subscriber as a listener for all - * returned events. - * - * @link www.doctrine-project.org - * @since 2.0 - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -interface EventSubscriber -{ - /** - * Returns an array of events this subscriber wants to listen to. - * - * @return array - */ - public function getSubscribedEvents(); -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Lexer.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Lexer.php deleted file mode 100644 index 0aa07f8..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Lexer.php +++ /dev/null @@ -1,37 +0,0 @@ -. - */ - -namespace Doctrine\Common; - -use Doctrine\Common\Lexer\AbstractLexer; - -/** - * Base class for writing simple lexers, i.e. for creating small DSLs. - * - * Lexer moved into its own Component Doctrine\Common\Lexer. This class - * only stays for being BC. - * - * @since 2.0 - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -abstract class Lexer extends AbstractLexer -{ -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/NotifyPropertyChanged.php b/core/vendor/doctrine/common/lib/Doctrine/Common/NotifyPropertyChanged.php deleted file mode 100644 index e25e999..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/NotifyPropertyChanged.php +++ /dev/null @@ -1,42 +0,0 @@ -. - */ - -namespace Doctrine\Common; - -/** - * Contract for classes that provide the service of notifying listeners of - * changes to their properties. - * - * @link www.doctrine-project.org - * @since 2.0 - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -interface NotifyPropertyChanged -{ - /** - * Adds a listener that wants to be notified about property changes. - * - * @param PropertyChangedListener $listener - * - * @return void - */ - public function addPropertyChangedListener(PropertyChangedListener $listener); -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/AbstractManagerRegistry.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/AbstractManagerRegistry.php deleted file mode 100644 index 15b5aa3..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/AbstractManagerRegistry.php +++ /dev/null @@ -1,259 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence; - -use Doctrine\Common\Persistence\ManagerRegistry; - -/** - * Abstract implementation of the ManagerRegistry contract. - * - * @link www.doctrine-project.org - * @since 2.2 - * @author Fabien Potencier - * @author Benjamin Eberlei - * @author Lukas Kahwe Smith - */ -abstract class AbstractManagerRegistry implements ManagerRegistry -{ - /** - * @var string - */ - private $name; - - /** - * @var array - */ - private $connections; - - /** - * @var array - */ - private $managers; - - /** - * @var string - */ - private $defaultConnection; - - /** - * @var string - */ - private $defaultManager; - - /** - * @var string - */ - private $proxyInterfaceName; - - /** - * Constructor. - * - * @param string $name - * @param array $connections - * @param array $managers - * @param string $defaultConnection - * @param string $defaultManager - * @param string $proxyInterfaceName - */ - public function __construct($name, array $connections, array $managers, $defaultConnection, $defaultManager, $proxyInterfaceName) - { - $this->name = $name; - $this->connections = $connections; - $this->managers = $managers; - $this->defaultConnection = $defaultConnection; - $this->defaultManager = $defaultManager; - $this->proxyInterfaceName = $proxyInterfaceName; - } - - /** - * Fetches/creates the given services. - * - * A service in this context is connection or a manager instance. - * - * @param string $name The name of the service. - * - * @return object The instance of the given service. - */ - abstract protected function getService($name); - - /** - * Resets the given services. - * - * A service in this context is connection or a manager instance. - * - * @param string $name The name of the service. - * - * @return void - */ - abstract protected function resetService($name); - - /** - * Gets the name of the registry. - * - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * {@inheritdoc} - */ - public function getConnection($name = null) - { - if (null === $name) { - $name = $this->defaultConnection; - } - - if (!isset($this->connections[$name])) { - throw new \InvalidArgumentException(sprintf('Doctrine %s Connection named "%s" does not exist.', $this->name, $name)); - } - - return $this->getService($this->connections[$name]); - } - - /** - * {@inheritdoc} - */ - public function getConnectionNames() - { - return $this->connections; - } - - /** - * {@inheritdoc} - */ - public function getConnections() - { - $connections = array(); - foreach ($this->connections as $name => $id) { - $connections[$name] = $this->getService($id); - } - - return $connections; - } - - /** - * {@inheritdoc} - */ - public function getDefaultConnectionName() - { - return $this->defaultConnection; - } - - /** - * {@inheritdoc} - */ - public function getDefaultManagerName() - { - return $this->defaultManager; - } - - /** - * {@inheritdoc} - * - * @throws \InvalidArgumentException - */ - public function getManager($name = null) - { - if (null === $name) { - $name = $this->defaultManager; - } - - if (!isset($this->managers[$name])) { - throw new \InvalidArgumentException(sprintf('Doctrine %s Manager named "%s" does not exist.', $this->name, $name)); - } - - return $this->getService($this->managers[$name]); - } - - /** - * {@inheritdoc} - */ - public function getManagerForClass($class) - { - // Check for namespace alias - if (strpos($class, ':') !== false) { - list($namespaceAlias, $simpleClassName) = explode(':', $class); - $class = $this->getAliasNamespace($namespaceAlias) . '\\' . $simpleClassName; - } - - $proxyClass = new \ReflectionClass($class); - if ($proxyClass->implementsInterface($this->proxyInterfaceName)) { - $class = $proxyClass->getParentClass()->getName(); - } - - foreach ($this->managers as $id) { - $manager = $this->getService($id); - - if (!$manager->getMetadataFactory()->isTransient($class)) { - return $manager; - } - } - } - - /** - * {@inheritdoc} - */ - public function getManagerNames() - { - return $this->managers; - } - - /** - * {@inheritdoc} - */ - public function getManagers() - { - $dms = array(); - foreach ($this->managers as $name => $id) { - $dms[$name] = $this->getService($id); - } - - return $dms; - } - - /** - * {@inheritdoc} - */ - public function getRepository($persistentObjectName, $persistentManagerName = null) - { - return $this->getManager($persistentManagerName)->getRepository($persistentObjectName); - } - - /** - * {@inheritdoc} - */ - public function resetManager($name = null) - { - if (null === $name) { - $name = $this->defaultManager; - } - - if (!isset($this->managers[$name])) { - throw new \InvalidArgumentException(sprintf('Doctrine %s Manager named "%s" does not exist.', $this->name, $name)); - } - - // force the creation of a new document manager - // if the current one is closed - $this->resetService($this->managers[$name]); - } -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ConnectionRegistry.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ConnectionRegistry.php deleted file mode 100644 index 7c25e98..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ConnectionRegistry.php +++ /dev/null @@ -1,62 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence; - -/** - * Contract covering connection for a Doctrine persistence layer ManagerRegistry class to implement. - * - * @link www.doctrine-project.org - * @since 2.2 - * @author Fabien Potencier - * @author Benjamin Eberlei - * @author Lukas Kahwe Smith - */ -interface ConnectionRegistry -{ - /** - * Gets the default connection name. - * - * @return string The default connection name. - */ - public function getDefaultConnectionName(); - - /** - * Gets the named connection. - * - * @param string $name The connection name (null for the default one). - * - * @return object - */ - public function getConnection($name = null); - - /** - * Gets an array of all registered connections. - * - * @return array An array of Connection instances. - */ - public function getConnections(); - - /** - * Gets all connection names. - * - * @return array An array of connection names. - */ - public function getConnectionNames(); -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/LifecycleEventArgs.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/LifecycleEventArgs.php deleted file mode 100644 index 52f41c0..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/LifecycleEventArgs.php +++ /dev/null @@ -1,89 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Event; - -use Doctrine\Common\EventArgs; -use Doctrine\Common\Persistence\ObjectManager; - -/** - * Lifecycle Events are triggered by the UnitOfWork during lifecycle transitions - * of entities. - * - * @link www.doctrine-project.org - * @since 2.2 - * @author Roman Borschel - * @author Benjamin Eberlei - */ -class LifecycleEventArgs extends EventArgs -{ - /** - * @var ObjectManager - */ - private $objectManager; - - /** - * @var object - */ - private $object; - - /** - * Constructor. - * - * @param object $object - * @param ObjectManager $objectManager - */ - public function __construct($object, ObjectManager $objectManager) - { - $this->object = $object; - $this->objectManager = $objectManager; - } - - /** - * Retrieves the associated entity. - * - * @deprecated - * - * @return object - */ - public function getEntity() - { - return $this->object; - } - - /** - * Retrieves the associated object. - * - * @return object - */ - public function getObject() - { - return $this->object; - } - - /** - * Retrieves the associated ObjectManager. - * - * @return ObjectManager - */ - public function getObjectManager() - { - return $this->objectManager; - } -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/LoadClassMetadataEventArgs.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/LoadClassMetadataEventArgs.php deleted file mode 100644 index 07770bb..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/LoadClassMetadataEventArgs.php +++ /dev/null @@ -1,75 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Event; - -use Doctrine\Common\EventArgs; -use Doctrine\Common\Persistence\ObjectManager; -use Doctrine\Common\Persistence\Mapping\ClassMetadata; - -/** - * Class that holds event arguments for a loadMetadata event. - * - * @author Jonathan H. Wage - * @since 2.2 - */ -class LoadClassMetadataEventArgs extends EventArgs -{ - /** - * @var ClassMetadata - */ - private $classMetadata; - - /** - * @var ObjectManager - */ - private $objectManager; - - /** - * Constructor. - * - * @param ClassMetadata $classMetadata - * @param ObjectManager $objectManager - */ - public function __construct(ClassMetadata $classMetadata, ObjectManager $objectManager) - { - $this->classMetadata = $classMetadata; - $this->objectManager = $objectManager; - } - - /** - * Retrieves the associated ClassMetadata. - * - * @return ClassMetadata - */ - public function getClassMetadata() - { - return $this->classMetadata; - } - - /** - * Retrieves the associated ObjectManager. - * - * @return ObjectManager - */ - public function getObjectManager() - { - return $this->objectManager; - } -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/ManagerEventArgs.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/ManagerEventArgs.php deleted file mode 100644 index 5527d4d..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/ManagerEventArgs.php +++ /dev/null @@ -1,59 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Event; - -use Doctrine\Common\EventArgs; -use Doctrine\Common\Persistence\ObjectManager; - -/** - * Provides event arguments for the preFlush event. - * - * @link www.doctrine-project.org - * @since 2.2 - * @author Roman Borschel - * @author Benjamin Eberlei - */ -class ManagerEventArgs extends EventArgs -{ - /** - * @var ObjectManager - */ - private $objectManager; - - /** - * Constructor. - * - * @param ObjectManager $objectManager - */ - public function __construct(ObjectManager $objectManager) - { - $this->objectManager = $objectManager; - } - - /** - * Retrieves the associated ObjectManager. - * - * @return ObjectManager - */ - public function getObjectManager() - { - return $this->objectManager; - } -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/OnClearEventArgs.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/OnClearEventArgs.php deleted file mode 100644 index b78bad9..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/OnClearEventArgs.php +++ /dev/null @@ -1,86 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Event; - -use Doctrine\Common\EventArgs; -use Doctrine\Common\Persistence\ObjectManager; - -/** - * Provides event arguments for the onClear event. - * - * @link www.doctrine-project.org - * @since 2.2 - * @author Roman Borschel - * @author Benjamin Eberlei - */ -class OnClearEventArgs extends EventArgs -{ - /** - * @var \Doctrine\Common\Persistence\ObjectManager - */ - private $objectManager; - - /** - * @var string|null - */ - private $entityClass; - - /** - * Constructor. - * - * @param ObjectManager $objectManager The object manager. - * @param string|null $entityClass The optional entity class. - */ - public function __construct($objectManager, $entityClass = null) - { - $this->objectManager = $objectManager; - $this->entityClass = $entityClass; - } - - /** - * Retrieves the associated ObjectManager. - * - * @return \Doctrine\Common\Persistence\ObjectManager - */ - public function getObjectManager() - { - return $this->objectManager; - } - - /** - * Returns the name of the entity class that is cleared, or null if all are cleared. - * - * @return string|null - */ - public function getEntityClass() - { - return $this->entityClass; - } - - /** - * Returns whether this event clears all entities. - * - * @return bool - */ - public function clearsAllEntities() - { - return ($this->entityClass === null); - } -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/PreUpdateEventArgs.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/PreUpdateEventArgs.php deleted file mode 100644 index d34de84..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/PreUpdateEventArgs.php +++ /dev/null @@ -1,138 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Event; - -use Doctrine\Common\EventArgs; -use Doctrine\Common\Persistence\ObjectManager; - -/** - * Class that holds event arguments for a preUpdate event. - * - * @author Guilherme Blanco - * @author Roman Borschel - * @author Benjamin Eberlei - * @since 2.2 - */ -class PreUpdateEventArgs extends LifecycleEventArgs -{ - /** - * @var array - */ - private $entityChangeSet; - - /** - * Constructor. - * - * @param object $entity - * @param ObjectManager $objectManager - * @param array $changeSet - */ - public function __construct($entity, ObjectManager $objectManager, array &$changeSet) - { - parent::__construct($entity, $objectManager); - - $this->entityChangeSet = &$changeSet; - } - - /** - * Retrieves the entity changeset. - * - * @return array - */ - public function getEntityChangeSet() - { - return $this->entityChangeSet; - } - - /** - * Checks if field has a changeset. - * - * @param string $field - * - * @return boolean - */ - public function hasChangedField($field) - { - return isset($this->entityChangeSet[$field]); - } - - /** - * Gets the old value of the changeset of the changed field. - * - * @param string $field - * - * @return mixed - */ - public function getOldValue($field) - { - $this->assertValidField($field); - - return $this->entityChangeSet[$field][0]; - } - - /** - * Gets the new value of the changeset of the changed field. - * - * @param string $field - * - * @return mixed - */ - public function getNewValue($field) - { - $this->assertValidField($field); - - return $this->entityChangeSet[$field][1]; - } - - /** - * Sets the new value of this field. - * - * @param string $field - * @param mixed $value - * - * @return void - */ - public function setNewValue($field, $value) - { - $this->assertValidField($field); - - $this->entityChangeSet[$field][1] = $value; - } - - /** - * Asserts the field exists in changeset. - * - * @param string $field - * - * @return void - * - * @throws \InvalidArgumentException - */ - private function assertValidField($field) - { - if ( ! isset($this->entityChangeSet[$field])) { - throw new \InvalidArgumentException(sprintf( - 'Field "%s" is not a valid field of the entity "%s" in PreUpdateEventArgs.', - $field, - get_class($this->getEntity()) - )); - } - } -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ManagerRegistry.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ManagerRegistry.php deleted file mode 100644 index fce854b..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ManagerRegistry.php +++ /dev/null @@ -1,111 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence; - -/** - * Contract covering object managers for a Doctrine persistence layer ManagerRegistry class to implement. - * - * @link www.doctrine-project.org - * @since 2.2 - * @author Fabien Potencier - * @author Benjamin Eberlei - * @author Lukas Kahwe Smith - */ -interface ManagerRegistry extends ConnectionRegistry -{ - /** - * Gets the default object manager name. - * - * @return string The default object manager name. - */ - public function getDefaultManagerName(); - - /** - * Gets a named object manager. - * - * @param string $name The object manager name (null for the default one). - * - * @return \Doctrine\Common\Persistence\ObjectManager - */ - public function getManager($name = null); - - /** - * Gets an array of all registered object managers. - * - * @return \Doctrine\Common\Persistence\ObjectManager[] An array of ObjectManager instances - */ - public function getManagers(); - - /** - * Resets a named object manager. - * - * This method is useful when an object manager has been closed - * because of a rollbacked transaction AND when you think that - * it makes sense to get a new one to replace the closed one. - * - * Be warned that you will get a brand new object manager as - * the existing one is not useable anymore. This means that any - * other object with a dependency on this object manager will - * hold an obsolete reference. You can inject the registry instead - * to avoid this problem. - * - * @param string|null $name The object manager name (null for the default one). - * - * @return \Doctrine\Common\Persistence\ObjectManager - */ - public function resetManager($name = null); - - /** - * Resolves a registered namespace alias to the full namespace. - * - * This method looks for the alias in all registered object managers. - * - * @param string $alias The alias. - * - * @return string The full namespace. - */ - public function getAliasNamespace($alias); - - /** - * Gets all connection names. - * - * @return array An array of connection names. - */ - public function getManagerNames(); - - /** - * Gets the ObjectRepository for an persistent object. - * - * @param string $persistentObject The name of the persistent object. - * @param string $persistentManagerName The object manager name (null for the default one). - * - * @return \Doctrine\Common\Persistence\ObjectRepository - */ - public function getRepository($persistentObject, $persistentManagerName = null); - - /** - * Gets the object manager associated with a given class. - * - * @param string $class A persistent object class name. - * - * @return \Doctrine\Common\Persistence\ObjectManager|null - */ - public function getManagerForClass($class); -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php deleted file mode 100644 index 01ad58f..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php +++ /dev/null @@ -1,401 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Mapping; - -use Doctrine\Common\Cache\Cache; -use Doctrine\Common\Util\ClassUtils; - -/** - * The ClassMetadataFactory is used to create ClassMetadata objects that contain all the - * metadata mapping informations of a class which describes how a class should be mapped - * to a relational database. - * - * This class was abstracted from the ORM ClassMetadataFactory. - * - * @since 2.2 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -abstract class AbstractClassMetadataFactory implements ClassMetadataFactory -{ - /** - * Salt used by specific Object Manager implementation. - * - * @var string - */ - protected $cacheSalt = '$CLASSMETADATA'; - - /** - * @var \Doctrine\Common\Cache\Cache|null - */ - private $cacheDriver; - - /** - * @var array - */ - private $loadedMetadata = array(); - - /** - * @var bool - */ - protected $initialized = false; - - /** - * @var ReflectionService|null - */ - private $reflectionService = null; - - /** - * Sets the cache driver used by the factory to cache ClassMetadata instances. - * - * @param \Doctrine\Common\Cache\Cache $cacheDriver - * - * @return void - */ - public function setCacheDriver(Cache $cacheDriver = null) - { - $this->cacheDriver = $cacheDriver; - } - - /** - * Gets the cache driver used by the factory to cache ClassMetadata instances. - * - * @return \Doctrine\Common\Cache\Cache|null - */ - public function getCacheDriver() - { - return $this->cacheDriver; - } - - /** - * Returns an array of all the loaded metadata currently in memory. - * - * @return array - */ - public function getLoadedMetadata() - { - return $this->loadedMetadata; - } - - /** - * Forces the factory to load the metadata of all classes known to the underlying - * mapping driver. - * - * @return array The ClassMetadata instances of all mapped classes. - */ - public function getAllMetadata() - { - if ( ! $this->initialized) { - $this->initialize(); - } - - $driver = $this->getDriver(); - $metadata = array(); - foreach ($driver->getAllClassNames() as $className) { - $metadata[] = $this->getMetadataFor($className); - } - - return $metadata; - } - - /** - * Lazy initialization of this stuff, especially the metadata driver, - * since these are not needed at all when a metadata cache is active. - * - * @return void - */ - abstract protected function initialize(); - - /** - * Gets the fully qualified class-name from the namespace alias. - * - * @param string $namespaceAlias - * @param string $simpleClassName - * - * @return string - */ - abstract protected function getFqcnFromAlias($namespaceAlias, $simpleClassName); - - /** - * Returns the mapping driver implementation. - * - * @return \Doctrine\Common\Persistence\Mapping\Driver\MappingDriver - */ - abstract protected function getDriver(); - - /** - * Wakes up reflection after ClassMetadata gets unserialized from cache. - * - * @param ClassMetadata $class - * @param ReflectionService $reflService - * - * @return void - */ - abstract protected function wakeupReflection(ClassMetadata $class, ReflectionService $reflService); - - /** - * Initializes Reflection after ClassMetadata was constructed. - * - * @param ClassMetadata $class - * @param ReflectionService $reflService - * - * @return void - */ - abstract protected function initializeReflection(ClassMetadata $class, ReflectionService $reflService); - - /** - * Checks whether the class metadata is an entity. - * - * This method should return false for mapped superclasses or embedded classes. - * - * @param ClassMetadata $class - * - * @return boolean - */ - abstract protected function isEntity(ClassMetadata $class); - - /** - * Gets the class metadata descriptor for a class. - * - * @param string $className The name of the class. - * - * @return \Doctrine\Common\Persistence\Mapping\ClassMetadata - */ - public function getMetadataFor($className) - { - if (isset($this->loadedMetadata[$className])) { - return $this->loadedMetadata[$className]; - } - - $realClassName = $className; - - // Check for namespace alias - if (strpos($className, ':') !== false) { - list($namespaceAlias, $simpleClassName) = explode(':', $className); - $realClassName = $this->getFqcnFromAlias($namespaceAlias, $simpleClassName); - } else { - $realClassName = ClassUtils::getRealClass($realClassName); - } - - if (isset($this->loadedMetadata[$realClassName])) { - // We do not have the alias name in the map, include it - $this->loadedMetadata[$className] = $this->loadedMetadata[$realClassName]; - - return $this->loadedMetadata[$realClassName]; - } - - if ($this->cacheDriver) { - if (($cached = $this->cacheDriver->fetch($realClassName . $this->cacheSalt)) !== false) { - $this->loadedMetadata[$realClassName] = $cached; - $this->wakeupReflection($cached, $this->getReflectionService()); - } else { - foreach ($this->loadMetadata($realClassName) as $loadedClassName) { - $this->cacheDriver->save( - $loadedClassName . $this->cacheSalt, $this->loadedMetadata[$loadedClassName], null - ); - } - } - } else { - $this->loadMetadata($realClassName); - } - - if ($className != $realClassName) { - // We do not have the alias name in the map, include it - $this->loadedMetadata[$className] = $this->loadedMetadata[$realClassName]; - } - - return $this->loadedMetadata[$className]; - } - - /** - * Checks whether the factory has the metadata for a class loaded already. - * - * @param string $className - * - * @return boolean TRUE if the metadata of the class in question is already loaded, FALSE otherwise. - */ - public function hasMetadataFor($className) - { - return isset($this->loadedMetadata[$className]); - } - - /** - * Sets the metadata descriptor for a specific class. - * - * NOTE: This is only useful in very special cases, like when generating proxy classes. - * - * @param string $className - * @param ClassMetadata $class - * - * @return void - */ - public function setMetadataFor($className, $class) - { - $this->loadedMetadata[$className] = $class; - } - - /** - * Gets an array of parent classes for the given entity class. - * - * @param string $name - * - * @return array - */ - protected function getParentClasses($name) - { - // Collect parent classes, ignoring transient (not-mapped) classes. - $parentClasses = array(); - foreach (array_reverse($this->getReflectionService()->getParentClasses($name)) as $parentClass) { - if ( ! $this->getDriver()->isTransient($parentClass)) { - $parentClasses[] = $parentClass; - } - } - return $parentClasses; - } - - /** - * Loads the metadata of the class in question and all it's ancestors whose metadata - * is still not loaded. - * - * Important: The class $name does not necesarily exist at this point here. - * Scenarios in a code-generation setup might have access to XML/YAML - * Mapping files without the actual PHP code existing here. That is why the - * {@see Doctrine\Common\Persistence\Mapping\ReflectionService} interface - * should be used for reflection. - * - * @param string $name The name of the class for which the metadata should get loaded. - * - * @return array - */ - protected function loadMetadata($name) - { - if ( ! $this->initialized) { - $this->initialize(); - } - - $loaded = array(); - - $parentClasses = $this->getParentClasses($name); - $parentClasses[] = $name; - - // Move down the hierarchy of parent classes, starting from the topmost class - $parent = null; - $rootEntityFound = false; - $visited = array(); - $reflService = $this->getReflectionService(); - foreach ($parentClasses as $className) { - if (isset($this->loadedMetadata[$className])) { - $parent = $this->loadedMetadata[$className]; - if ($this->isEntity($parent)) { - $rootEntityFound = true; - array_unshift($visited, $className); - } - continue; - } - - $class = $this->newClassMetadataInstance($className); - $this->initializeReflection($class, $reflService); - - $this->doLoadMetadata($class, $parent, $rootEntityFound, $visited); - - $this->loadedMetadata[$className] = $class; - - $parent = $class; - - if ($this->isEntity($class)) { - $rootEntityFound = true; - array_unshift($visited, $className); - } - - $this->wakeupReflection($class, $reflService); - - $loaded[] = $className; - } - - return $loaded; - } - - /** - * Actually loads the metadata from the underlying metadata. - * - * @param ClassMetadata $class - * @param ClassMetadata|null $parent - * @param bool $rootEntityFound - * @param array $nonSuperclassParents All parent class names - * that are not marked as mapped superclasses. - * - * @return void - */ - abstract protected function doLoadMetadata($class, $parent, $rootEntityFound, array $nonSuperclassParents); - - /** - * Creates a new ClassMetadata instance for the given class name. - * - * @param string $className - * - * @return ClassMetadata - */ - abstract protected function newClassMetadataInstance($className); - - /** - * {@inheritDoc} - */ - public function isTransient($class) - { - if ( ! $this->initialized) { - $this->initialize(); - } - - // Check for namespace alias - if (strpos($class, ':') !== false) { - list($namespaceAlias, $simpleClassName) = explode(':', $class); - $class = $this->getFqcnFromAlias($namespaceAlias, $simpleClassName); - } - - return $this->getDriver()->isTransient($class); - } - - /** - * Sets the reflectionService. - * - * @param ReflectionService $reflectionService - * - * @return void - */ - public function setReflectionService(ReflectionService $reflectionService) - { - $this->reflectionService = $reflectionService; - } - - /** - * Gets the reflection service associated with this metadata factory. - * - * @return ReflectionService - */ - public function getReflectionService() - { - if ($this->reflectionService === null) { - $this->reflectionService = new RuntimeReflectionService(); - } - return $this->reflectionService; - } -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ClassMetadata.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ClassMetadata.php deleted file mode 100644 index b8445f1..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ClassMetadata.php +++ /dev/null @@ -1,174 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Mapping; - -/** - * Contract for a Doctrine persistence layer ClassMetadata class to implement. - * - * @link www.doctrine-project.org - * @since 2.1 - * @author Benjamin Eberlei - * @author Jonathan Wage - */ -interface ClassMetadata -{ - /** - * Gets the fully-qualified class name of this persistent class. - * - * @return string - */ - public function getName(); - - /** - * Gets the mapped identifier field name. - * - * The returned structure is an array of the identifier field names. - * - * @return array - */ - public function getIdentifier(); - - /** - * Gets the ReflectionClass instance for this mapped class. - * - * @return \ReflectionClass - */ - public function getReflectionClass(); - - /** - * Checks if the given field name is a mapped identifier for this class. - * - * @param string $fieldName - * - * @return boolean - */ - public function isIdentifier($fieldName); - - /** - * Checks if the given field is a mapped property for this class. - * - * @param string $fieldName - * - * @return boolean - */ - public function hasField($fieldName); - - /** - * Checks if the given field is a mapped association for this class. - * - * @param string $fieldName - * - * @return boolean - */ - public function hasAssociation($fieldName); - - /** - * Checks if the given field is a mapped single valued association for this class. - * - * @param string $fieldName - * - * @return boolean - */ - public function isSingleValuedAssociation($fieldName); - - /** - * Checks if the given field is a mapped collection valued association for this class. - * - * @param string $fieldName - * - * @return boolean - */ - public function isCollectionValuedAssociation($fieldName); - - /** - * A numerically indexed list of field names of this persistent class. - * - * This array includes identifier fields if present on this class. - * - * @return array - */ - public function getFieldNames(); - - /** - * Returns an array of identifier field names numerically indexed. - * - * @return array - */ - public function getIdentifierFieldNames(); - - /** - * Returns a numerically indexed list of association names of this persistent class. - * - * This array includes identifier associations if present on this class. - * - * @return array - */ - public function getAssociationNames(); - - /** - * Returns a type name of this field. - * - * This type names can be implementation specific but should at least include the php types: - * integer, string, boolean, float/double, datetime. - * - * @param string $fieldName - * - * @return string - */ - public function getTypeOfField($fieldName); - - /** - * Returns the target class name of the given association. - * - * @param string $assocName - * - * @return string - */ - public function getAssociationTargetClass($assocName); - - /** - * Checks if the association is the inverse side of a bidirectional association. - * - * @param string $assocName - * - * @return boolean - */ - public function isAssociationInverseSide($assocName); - - /** - * Returns the target field of the owning side of the association. - * - * @param string $assocName - * - * @return string - */ - public function getAssociationMappedByTargetField($assocName); - - /** - * Returns the identifier of this object as an array with field name as key. - * - * Has to return an empty array if no identifier isset. - * - * @param object $object - * - * @return array - */ - public function getIdentifierValues($object); -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ClassMetadataFactory.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ClassMetadataFactory.php deleted file mode 100644 index 3d82881..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ClassMetadataFactory.php +++ /dev/null @@ -1,76 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Mapping; - -/** - * Contract for a Doctrine persistence layer ClassMetadata class to implement. - * - * @link www.doctrine-project.org - * @since 2.1 - * @author Benjamin Eberlei - * @author Jonathan Wage - */ -interface ClassMetadataFactory -{ - /** - * Forces the factory to load the metadata of all classes known to the underlying - * mapping driver. - * - * @return array The ClassMetadata instances of all mapped classes. - */ - public function getAllMetadata(); - - /** - * Gets the class metadata descriptor for a class. - * - * @param string $className The name of the class. - * - * @return ClassMetadata - */ - public function getMetadataFor($className); - - /** - * Checks whether the factory has the metadata for a class loaded already. - * - * @param string $className - * - * @return boolean TRUE if the metadata of the class in question is already loaded, FALSE otherwise. - */ - public function hasMetadataFor($className); - - /** - * Sets the metadata descriptor for a specific class. - * - * @param string $className - * - * @param ClassMetadata $class - */ - public function setMetadataFor($className, $class); - - /** - * Returns whether the class with the specified name should have its metadata loaded. - * This is only the case if it is either mapped directly or as a MappedSuperclass. - * - * @param string $className - * - * @return boolean - */ - public function isTransient($className); -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/AnnotationDriver.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/AnnotationDriver.php deleted file mode 100644 index 6668e61..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/AnnotationDriver.php +++ /dev/null @@ -1,257 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Mapping\Driver; - -use Doctrine\Common\Annotations\AnnotationReader; -use Doctrine\Common\Annotations\AnnotationRegistry; -use Doctrine\Common\Persistence\Mapping\MappingException; - -/** - * The AnnotationDriver reads the mapping metadata from docblock annotations. - * - * @since 2.2 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan H. Wage - * @author Roman Borschel - */ -abstract class AnnotationDriver implements MappingDriver -{ - /** - * The AnnotationReader. - * - * @var AnnotationReader - */ - protected $reader; - - /** - * The paths where to look for mapping files. - * - * @var array - */ - protected $paths = array(); - - /** - * The paths excluded from path where to look for mapping files. - * - * @var array - */ - protected $excludePaths = array(); - - /** - * The file extension of mapping documents. - * - * @var string - */ - protected $fileExtension = '.php'; - - /** - * Cache for AnnotationDriver#getAllClassNames(). - * - * @var array|null - */ - protected $classNames; - - /** - * Name of the entity annotations as keys. - * - * @var array - */ - protected $entityAnnotationClasses = array(); - - /** - * Initializes a new AnnotationDriver that uses the given AnnotationReader for reading - * docblock annotations. - * - * @param AnnotationReader $reader The AnnotationReader to use, duck-typed. - * @param string|array|null $paths One or multiple paths where mapping classes can be found. - */ - public function __construct($reader, $paths = null) - { - $this->reader = $reader; - if ($paths) { - $this->addPaths((array) $paths); - } - } - - /** - * Appends lookup paths to metadata driver. - * - * @param array $paths - * - * @return void - */ - public function addPaths(array $paths) - { - $this->paths = array_unique(array_merge($this->paths, $paths)); - } - - /** - * Retrieves the defined metadata lookup paths. - * - * @return array - */ - public function getPaths() - { - return $this->paths; - } - - /** - * Append exclude lookup paths to metadata driver. - * - * @param array $paths - */ - public function addExcludePaths(array $paths) - { - $this->excludePaths = array_unique(array_merge($this->excludePaths, $paths)); - } - - /** - * Retrieve the defined metadata lookup exclude paths. - * - * @return array - */ - public function getExcludePaths() - { - return $this->excludePaths; - } - - /** - * Retrieve the current annotation reader - * - * @return AnnotationReader - */ - public function getReader() - { - return $this->reader; - } - - /** - * Gets the file extension used to look for mapping files under. - * - * @return string - */ - public function getFileExtension() - { - return $this->fileExtension; - } - - /** - * Sets the file extension used to look for mapping files under. - * - * @param string $fileExtension The file extension to set. - * - * @return void - */ - public function setFileExtension($fileExtension) - { - $this->fileExtension = $fileExtension; - } - - /** - * Returns whether the class with the specified name is transient. Only non-transient - * classes, that is entities and mapped superclasses, should have their metadata loaded. - * - * A class is non-transient if it is annotated with an annotation - * from the {@see AnnotationDriver::entityAnnotationClasses}. - * - * @param string $className - * - * @return boolean - */ - public function isTransient($className) - { - $classAnnotations = $this->reader->getClassAnnotations(new \ReflectionClass($className)); - - foreach ($classAnnotations as $annot) { - if (isset($this->entityAnnotationClasses[get_class($annot)])) { - return false; - } - } - return true; - } - - /** - * {@inheritDoc} - */ - public function getAllClassNames() - { - if ($this->classNames !== null) { - return $this->classNames; - } - - if (!$this->paths) { - throw MappingException::pathRequired(); - } - - $classes = array(); - $includedFiles = array(); - - foreach ($this->paths as $path) { - if ( ! is_dir($path)) { - throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); - } - - $iterator = new \RegexIterator( - new \RecursiveIteratorIterator( - new \RecursiveDirectoryIterator($path, \FilesystemIterator::SKIP_DOTS), - \RecursiveIteratorIterator::LEAVES_ONLY - ), - '/^.+' . preg_quote($this->fileExtension) . '$/i', - \RecursiveRegexIterator::GET_MATCH - ); - - foreach ($iterator as $file) { - $sourceFile = $file[0]; - - if ( ! preg_match('(^phar:)i', $sourceFile)) { - $sourceFile = realpath($sourceFile); - } - - foreach ($this->excludePaths as $excludePath) { - $exclude = str_replace('\\', '/', realpath($excludePath)); - $current = str_replace('\\', '/', $sourceFile); - - if (strpos($current, $exclude) !== false) { - continue 2; - } - } - - require_once $sourceFile; - - $includedFiles[] = $sourceFile; - } - } - - $declared = get_declared_classes(); - - foreach ($declared as $className) { - $rc = new \ReflectionClass($className); - $sourceFile = $rc->getFileName(); - if (in_array($sourceFile, $includedFiles) && ! $this->isTransient($className)) { - $classes[] = $className; - } - } - - $this->classNames = $classes; - - return $classes; - } -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/DefaultFileLocator.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/DefaultFileLocator.php deleted file mode 100644 index 6a9e276..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/DefaultFileLocator.php +++ /dev/null @@ -1,173 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Mapping\Driver; - -use Doctrine\Common\Persistence\Mapping\MappingException; - -/** - * Locates the file that contains the metadata information for a given class name. - * - * This behavior is independent of the actual content of the file. It just detects - * the file which is responsible for the given class name. - * - * @author Benjamin Eberlei - * @author Johannes M. Schmitt - */ -class DefaultFileLocator implements FileLocator -{ - /** - * The paths where to look for mapping files. - * - * @var array - */ - protected $paths = array(); - - /** - * The file extension of mapping documents. - * - * @var string|null - */ - protected $fileExtension; - - /** - * Initializes a new FileDriver that looks in the given path(s) for mapping - * documents and operates in the specified operating mode. - * - * @param string|array $paths One or multiple paths where mapping documents can be found. - * @param string|null $fileExtension The file extension of mapping documents. - */ - public function __construct($paths, $fileExtension = null) - { - $this->addPaths((array) $paths); - $this->fileExtension = $fileExtension; - } - - /** - * Appends lookup paths to metadata driver. - * - * @param array $paths - * - * @return void - */ - public function addPaths(array $paths) - { - $this->paths = array_unique(array_merge($this->paths, $paths)); - } - - /** - * Retrieves the defined metadata lookup paths. - * - * @return array - */ - public function getPaths() - { - return $this->paths; - } - - /** - * Gets the file extension used to look for mapping files under. - * - * @return string|null - */ - public function getFileExtension() - { - return $this->fileExtension; - } - - /** - * Sets the file extension used to look for mapping files under. - * - * @param string|null $fileExtension The file extension to set. - * - * @return void - */ - public function setFileExtension($fileExtension) - { - $this->fileExtension = $fileExtension; - } - - /** - * {@inheritDoc} - */ - public function findMappingFile($className) - { - $fileName = str_replace('\\', '.', $className) . $this->fileExtension; - - // Check whether file exists - foreach ($this->paths as $path) { - if (is_file($path . DIRECTORY_SEPARATOR . $fileName)) { - return $path . DIRECTORY_SEPARATOR . $fileName; - } - } - - throw MappingException::mappingFileNotFound($className, $fileName); - } - - /** - * {@inheritDoc} - */ - public function getAllClassNames($globalBasename) - { - $classes = array(); - - if ($this->paths) { - foreach ($this->paths as $path) { - if ( ! is_dir($path)) { - throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); - } - - $iterator = new \RecursiveIteratorIterator( - new \RecursiveDirectoryIterator($path), - \RecursiveIteratorIterator::LEAVES_ONLY - ); - - foreach ($iterator as $file) { - $fileName = $file->getBasename($this->fileExtension); - - if ($fileName == $file->getBasename() || $fileName == $globalBasename) { - continue; - } - - // NOTE: All files found here means classes are not transient! - $classes[] = str_replace('.', '\\', $fileName); - } - } - } - - return $classes; - } - - /** - * {@inheritDoc} - */ - public function fileExists($className) - { - $fileName = str_replace('\\', '.', $className) . $this->fileExtension; - - // Check whether file exists - foreach ((array) $this->paths as $path) { - if (is_file($path . DIRECTORY_SEPARATOR . $fileName)) { - return true; - } - } - - return false; - } -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/FileDriver.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/FileDriver.php deleted file mode 100644 index ccc64fa..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/FileDriver.php +++ /dev/null @@ -1,211 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Mapping\Driver; - -use Doctrine\Common\Persistence\Mapping\MappingException; - -/** - * Base driver for file-based metadata drivers. - * - * A file driver operates in a mode where it loads the mapping files of individual - * classes on demand. This requires the user to adhere to the convention of 1 mapping - * file per class and the file names of the mapping files must correspond to the full - * class name, including namespace, with the namespace delimiters '\', replaced by dots '.'. - * - * @link www.doctrine-project.org - * @since 2.2 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan H. Wage - * @author Roman Borschel - */ -abstract class FileDriver implements MappingDriver -{ - /** - * @var FileLocator - */ - protected $locator; - - /** - * @var array|null - */ - protected $classCache; - - /** - * @var string|null - */ - protected $globalBasename; - - /** - * Initializes a new FileDriver that looks in the given path(s) for mapping - * documents and operates in the specified operating mode. - * - * @param string|array|FileLocator $locator A FileLocator or one/multiple paths - * where mapping documents can be found. - * @param string|null $fileExtension - */ - public function __construct($locator, $fileExtension = null) - { - if ($locator instanceof FileLocator) { - $this->locator = $locator; - } else { - $this->locator = new DefaultFileLocator((array)$locator, $fileExtension); - } - } - - /** - * Sets the global basename. - * - * @param string $file - * - * @return void - */ - public function setGlobalBasename($file) - { - $this->globalBasename = $file; - } - - /** - * Retrieves the global basename. - * - * @return string|null - */ - public function getGlobalBasename() - { - return $this->globalBasename; - } - - /** - * Gets the element of schema meta data for the class from the mapping file. - * This will lazily load the mapping file if it is not loaded yet. - * - * @param string $className - * - * @return array The element of schema meta data. - * - * @throws MappingException - */ - public function getElement($className) - { - if ($this->classCache === null) { - $this->initialize(); - } - - if (isset($this->classCache[$className])) { - return $this->classCache[$className]; - } - - $result = $this->loadMappingFile($this->locator->findMappingFile($className)); - if (!isset($result[$className])) { - throw MappingException::invalidMappingFile($className, str_replace('\\', '.', $className) . $this->locator->getFileExtension()); - } - - return $result[$className]; - } - - /** - * {@inheritDoc} - */ - public function isTransient($className) - { - if ($this->classCache === null) { - $this->initialize(); - } - - if (isset($this->classCache[$className])) { - return false; - } - - return !$this->locator->fileExists($className); - } - - /** - * {@inheritDoc} - */ - public function getAllClassNames() - { - if ($this->classCache === null) { - $this->initialize(); - } - - $classNames = (array)$this->locator->getAllClassNames($this->globalBasename); - if ($this->classCache) { - $classNames = array_merge(array_keys($this->classCache), $classNames); - } - return $classNames; - } - - /** - * Loads a mapping file with the given name and returns a map - * from class/entity names to their corresponding file driver elements. - * - * @param string $file The mapping file to load. - * - * @return array - */ - abstract protected function loadMappingFile($file); - - /** - * Initializes the class cache from all the global files. - * - * Using this feature adds a substantial performance hit to file drivers as - * more metadata has to be loaded into memory than might actually be - * necessary. This may not be relevant to scenarios where caching of - * metadata is in place, however hits very hard in scenarios where no - * caching is used. - * - * @return void - */ - protected function initialize() - { - $this->classCache = array(); - if (null !== $this->globalBasename) { - foreach ($this->locator->getPaths() as $path) { - $file = $path.'/'.$this->globalBasename.$this->locator->getFileExtension(); - if (is_file($file)) { - $this->classCache = array_merge( - $this->classCache, - $this->loadMappingFile($file) - ); - } - } - } - } - - /** - * Retrieves the locator used to discover mapping files by className. - * - * @return FileLocator - */ - public function getLocator() - { - return $this->locator; - } - - /** - * Sets the locator used to discover mapping files by className. - * - * @param FileLocator $locator - */ - public function setLocator(FileLocator $locator) - { - $this->locator = $locator; - } -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/FileLocator.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/FileLocator.php deleted file mode 100644 index f622856..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/FileLocator.php +++ /dev/null @@ -1,73 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Mapping\Driver; - -/** - * Locates the file that contains the metadata information for a given class name. - * - * This behavior is independent of the actual content of the file. It just detects - * the file which is responsible for the given class name. - * - * @author Benjamin Eberlei - * @author Johannes M. Schmitt - */ -interface FileLocator -{ - /** - * Locates mapping file for the given class name. - * - * @param string $className - * - * @return string - */ - public function findMappingFile($className); - - /** - * Gets all class names that are found with this file locator. - * - * @param string $globalBasename Passed to allow excluding the basename. - * - * @return array - */ - public function getAllClassNames($globalBasename); - - /** - * Checks if a file can be found for this class name. - * - * @param string $className - * - * @return bool - */ - public function fileExists($className); - - /** - * Gets all the paths that this file locator looks for mapping files. - * - * @return array - */ - public function getPaths(); - - /** - * Gets the file extension that mapping files are suffixed with. - * - * @return string - */ - public function getFileExtension(); -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriver.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriver.php deleted file mode 100644 index b5d7ec0..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriver.php +++ /dev/null @@ -1,58 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Mapping\Driver; - -use Doctrine\Common\Persistence\Mapping\ClassMetadata; - -/** - * Contract for metadata drivers. - * - * @since 2.2 - * @author Jonathan H. Wage - */ -interface MappingDriver -{ - /** - * Loads the metadata for the specified class into the provided container. - * - * @param string $className - * @param ClassMetadata $metadata - * - * @return void - */ - public function loadMetadataForClass($className, ClassMetadata $metadata); - - /** - * Gets the names of all mapped classes known to this driver. - * - * @return array The names of all mapped classes known to this driver. - */ - public function getAllClassNames(); - - /** - * Returns whether the class with the specified name should have its metadata loaded. - * This is only the case if it is either mapped as an Entity or a MappedSuperclass. - * - * @param string $className - * - * @return boolean - */ - public function isTransient($className); -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriverChain.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriverChain.php deleted file mode 100644 index 5fa9a7a..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriverChain.php +++ /dev/null @@ -1,166 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Mapping\Driver; - -use Doctrine\Common\Persistence\Mapping\Driver\MappingDriver; -use Doctrine\Common\Persistence\Mapping\ClassMetadata; -use Doctrine\Common\Persistence\Mapping\MappingException; - -/** - * The DriverChain allows you to add multiple other mapping drivers for - * certain namespaces. - * - * @since 2.2 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan H. Wage - * @author Roman Borschel - */ -class MappingDriverChain implements MappingDriver -{ - /** - * The default driver. - * - * @var MappingDriver|null - */ - private $defaultDriver = null; - - /** - * @var array - */ - private $drivers = array(); - - /** - * Gets the default driver. - * - * @return MappingDriver|null - */ - public function getDefaultDriver() - { - return $this->defaultDriver; - } - - /** - * Set the default driver. - * - * @param MappingDriver $driver - * - * @return void - */ - public function setDefaultDriver(MappingDriver $driver) - { - $this->defaultDriver = $driver; - } - - /** - * Adds a nested driver. - * - * @param MappingDriver $nestedDriver - * @param string $namespace - * - * @return void - */ - public function addDriver(MappingDriver $nestedDriver, $namespace) - { - $this->drivers[$namespace] = $nestedDriver; - } - - /** - * Gets the array of nested drivers. - * - * @return array $drivers - */ - public function getDrivers() - { - return $this->drivers; - } - - /** - * {@inheritDoc} - */ - public function loadMetadataForClass($className, ClassMetadata $metadata) - { - /* @var $driver MappingDriver */ - foreach ($this->drivers as $namespace => $driver) { - if (strpos($className, $namespace) === 0) { - $driver->loadMetadataForClass($className, $metadata); - return; - } - } - - if (null !== $this->defaultDriver) { - $this->defaultDriver->loadMetadataForClass($className, $metadata); - return; - } - - throw MappingException::classNotFoundInNamespaces($className, array_keys($this->drivers)); - } - - /** - * {@inheritDoc} - */ - public function getAllClassNames() - { - $classNames = array(); - $driverClasses = array(); - - /* @var $driver MappingDriver */ - foreach ($this->drivers AS $namespace => $driver) { - $oid = spl_object_hash($driver); - - if (!isset($driverClasses[$oid])) { - $driverClasses[$oid] = $driver->getAllClassNames(); - } - - foreach ($driverClasses[$oid] AS $className) { - if (strpos($className, $namespace) === 0) { - $classNames[$className] = true; - } - } - } - - if (null !== $this->defaultDriver) { - foreach ($this->defaultDriver->getAllClassNames() as $className) { - $classNames[$className] = true; - } - } - - return array_keys($classNames); - } - - /** - * {@inheritDoc} - */ - public function isTransient($className) - { - /* @var $driver MappingDriver */ - foreach ($this->drivers AS $namespace => $driver) { - if (strpos($className, $namespace) === 0) { - return $driver->isTransient($className); - } - } - - if ($this->defaultDriver !== null) { - return $this->defaultDriver->isTransient($className); - } - - return true; - } -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/PHPDriver.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/PHPDriver.php deleted file mode 100644 index 31651f3..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/PHPDriver.php +++ /dev/null @@ -1,70 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Mapping\Driver; - -use Doctrine\Common\Persistence\Mapping\ClassMetadata; - -/** - * The PHPDriver includes php files which just populate ClassMetadataInfo - * instances with plain PHP code. - * - * @link www.doctrine-project.org - * @since 2.0 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan H. Wage - * @author Roman Borschel - */ -class PHPDriver extends FileDriver -{ - /** - * {@inheritDoc} - */ - protected $metadata; - - /** - * {@inheritDoc} - */ - public function __construct($locator, $fileExtension = null) - { - $fileExtension = ".php"; - parent::__construct($locator, $fileExtension); - } - - /** - * {@inheritDoc} - */ - public function loadMetadataForClass($className, ClassMetadata $metadata) - { - $this->metadata = $metadata; - $this->loadMappingFile($this->locator->findMappingFile($className)); - } - - /** - * {@inheritDoc} - */ - protected function loadMappingFile($file) - { - $metadata = $this->metadata; - include $file; - - return array($metadata->getName() => $metadata); - } -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/StaticPHPDriver.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/StaticPHPDriver.php deleted file mode 100644 index df8f477..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/StaticPHPDriver.php +++ /dev/null @@ -1,142 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Mapping\Driver; - -use Doctrine\Common\Persistence\Mapping\ClassMetadata; -use Doctrine\Common\Persistence\Mapping\MappingException; - -/** - * The StaticPHPDriver calls a static loadMetadata() method on your entity - * classes where you can manually populate the ClassMetadata instance. - * - * @link www.doctrine-project.org - * @since 2.2 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan H. Wage - * @author Roman Borschel - */ -class StaticPHPDriver implements MappingDriver -{ - /** - * Paths of entity directories. - * - * @var array - */ - private $paths = array(); - - /** - * Map of all class names. - * - * @var array - */ - private $classNames; - - /** - * Constructor. - * - * @param array|string $paths - */ - public function __construct($paths) - { - $this->addPaths((array) $paths); - } - - /** - * Adds paths. - * - * @param array $paths - * - * @return void - */ - public function addPaths(array $paths) - { - $this->paths = array_unique(array_merge($this->paths, $paths)); - } - - /** - * {@inheritdoc} - */ - public function loadMetadataForClass($className, ClassMetadata $metadata) - { - $className::loadMetadata($metadata); - } - - /** - * {@inheritDoc} - * @todo Same code exists in AnnotationDriver, should we re-use it somehow or not worry about it? - */ - public function getAllClassNames() - { - if ($this->classNames !== null) { - return $this->classNames; - } - - if (!$this->paths) { - throw MappingException::pathRequired(); - } - - $classes = array(); - $includedFiles = array(); - - foreach ($this->paths as $path) { - if (!is_dir($path)) { - throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); - } - - $iterator = new \RecursiveIteratorIterator( - new \RecursiveDirectoryIterator($path), - \RecursiveIteratorIterator::LEAVES_ONLY - ); - - foreach ($iterator as $file) { - if ($file->getBasename('.php') == $file->getBasename()) { - continue; - } - - $sourceFile = realpath($file->getPathName()); - require_once $sourceFile; - $includedFiles[] = $sourceFile; - } - } - - $declared = get_declared_classes(); - - foreach ($declared as $className) { - $rc = new \ReflectionClass($className); - $sourceFile = $rc->getFileName(); - if (in_array($sourceFile, $includedFiles) && !$this->isTransient($className)) { - $classes[] = $className; - } - } - - $this->classNames = $classes; - - return $classes; - } - - /** - * {@inheritdoc} - */ - public function isTransient($className) - { - return ! method_exists($className, 'loadMetadata'); - } -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/SymfonyFileLocator.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/SymfonyFileLocator.php deleted file mode 100644 index dd4d741..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/SymfonyFileLocator.php +++ /dev/null @@ -1,217 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Mapping\Driver; - -use Doctrine\Common\Persistence\Mapping\MappingException; - -/** - * The Symfony File Locator makes a simplifying assumptions compared - * to the DefaultFileLocator. By assuming paths only contain entities of a certain - * namespace the mapping files consists of the short classname only. - * - * @author Fabien Potencier - * @author Benjamin Eberlei - * @license MIT - */ -class SymfonyFileLocator implements FileLocator -{ - /** - * The paths where to look for mapping files. - * - * @var array - */ - protected $paths = array(); - - /** - * A map of mapping directory path to namespace prefix used to expand class shortnames. - * - * @var array - */ - protected $prefixes = array(); - - /** - * File extension that is searched for. - * - * @var string|null - */ - protected $fileExtension; - - /** - * Constructor. - * - * @param array $prefixes - * @param string|null $fileExtension - */ - public function __construct(array $prefixes, $fileExtension = null) - { - $this->addNamespacePrefixes($prefixes); - $this->fileExtension = $fileExtension; - } - - /** - * Adds Namespace Prefixes. - * - * @param array $prefixes - * - * @return void - */ - public function addNamespacePrefixes(array $prefixes) - { - $this->prefixes = array_merge($this->prefixes, $prefixes); - $this->paths = array_merge($this->paths, array_keys($prefixes)); - } - - /** - * Gets Namespace Prefixes. - * - * @return array - */ - public function getNamespacePrefixes() - { - return $this->prefixes; - } - - /** - * {@inheritDoc} - */ - public function getPaths() - { - return $this->paths; - } - - /** - * {@inheritDoc} - */ - public function getFileExtension() - { - return $this->fileExtension; - } - - /** - * Sets the file extension used to look for mapping files under. - * - * @param string $fileExtension The file extension to set. - * - * @return void - */ - public function setFileExtension($fileExtension) - { - $this->fileExtension = $fileExtension; - } - - /** - * {@inheritDoc} - */ - public function fileExists($className) - { - $defaultFileName = str_replace('\\', '.', $className).$this->fileExtension; - foreach ($this->paths as $path) { - if (!isset($this->prefixes[$path])) { - // global namespace class - if (is_file($path.DIRECTORY_SEPARATOR.$defaultFileName)) { - return true; - } - - continue; - } - - $prefix = $this->prefixes[$path]; - - if (0 !== strpos($className, $prefix.'\\')) { - continue; - } - - $filename = $path.'/'.strtr(substr($className, strlen($prefix)+1), '\\', '.').$this->fileExtension; - return is_file($filename); - } - - return false; - } - - /** - * {@inheritDoc} - */ - public function getAllClassNames($globalBasename = null) - { - $classes = array(); - - if ($this->paths) { - foreach ((array) $this->paths as $path) { - if (!is_dir($path)) { - throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); - } - - $iterator = new \RecursiveIteratorIterator( - new \RecursiveDirectoryIterator($path), - \RecursiveIteratorIterator::LEAVES_ONLY - ); - - foreach ($iterator as $file) { - $fileName = $file->getBasename($this->fileExtension); - - if ($fileName == $file->getBasename() || $fileName == $globalBasename) { - continue; - } - - // NOTE: All files found here means classes are not transient! - if (isset($this->prefixes[$path])) { - $classes[] = $this->prefixes[$path].'\\'.str_replace('.', '\\', $fileName); - } else { - $classes[] = str_replace('.', '\\', $fileName); - } - } - } - } - - return $classes; - } - - /** - * {@inheritDoc} - */ - public function findMappingFile($className) - { - $defaultFileName = str_replace('\\', '.', $className).$this->fileExtension; - foreach ($this->paths as $path) { - if (!isset($this->prefixes[$path])) { - if (is_file($path.DIRECTORY_SEPARATOR.$defaultFileName)) { - return $path.DIRECTORY_SEPARATOR.$defaultFileName; - } - - continue; - } - - $prefix = $this->prefixes[$path]; - - if (0 !== strpos($className, $prefix.'\\')) { - continue; - } - - $filename = $path.'/'.strtr(substr($className, strlen($prefix)+1), '\\', '.').$this->fileExtension; - if (is_file($filename)) { - return $filename; - } - - throw MappingException::mappingFileNotFound($className, $filename); - } - - throw MappingException::mappingFileNotFound($className, substr($className, strrpos($className, '\\') + 1).$this->fileExtension); - } -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/MappingException.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/MappingException.php deleted file mode 100644 index c8c32b2..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/MappingException.php +++ /dev/null @@ -1,98 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Mapping; - -/** - * A MappingException indicates that something is wrong with the mapping setup. - * - * @since 2.2 - */ -class MappingException extends \Exception -{ - /** - * @param string $className - * @param array $namespaces - * - * @return MappingException - */ - public static function classNotFoundInNamespaces($className, $namespaces) - { - return new self("The class '" . $className . "' was not found in the ". - "chain configured namespaces " . implode(", ", $namespaces)); - } - - /** - * @return MappingException - */ - public static function pathRequired() - { - return new self("Specifying the paths to your entities is required ". - "in the AnnotationDriver to retrieve all class names."); - } - - /** - * @param string|null $path - * - * @return MappingException - */ - public static function fileMappingDriversRequireConfiguredDirectoryPath($path = null) - { - if ( ! empty($path)) { - $path = '[' . $path . ']'; - } - - return new self( - 'File mapping drivers must have a valid directory path, ' . - 'however the given path ' . $path . ' seems to be incorrect!' - ); - } - - /** - * @param string $entityName - * @param string $fileName - * - * @return MappingException - */ - public static function mappingFileNotFound($entityName, $fileName) - { - return new self("No mapping file found named '$fileName' for class '$entityName'."); - } - - /** - * @param string $entityName - * @param string $fileName - * - * @return MappingException - */ - public static function invalidMappingFile($entityName, $fileName) - { - return new self("Invalid mapping file '$fileName' for class '$entityName'."); - } - - /** - * @param string $className - * - * @return \Doctrine\Common\Persistence\Mapping\MappingException - */ - public static function nonExistingClass($className) - { - return new self("Class '$className' does not exist"); - } -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ReflectionService.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ReflectionService.php deleted file mode 100644 index 0088ed5..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ReflectionService.php +++ /dev/null @@ -1,87 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Mapping; - -/** - * Very simple reflection service abstraction. - * - * This is required inside metadata layers that may require either - * static or runtime reflection. - * - * @author Benjamin Eberlei - */ -interface ReflectionService -{ - /** - * Returns an array of the parent classes (not interfaces) for the given class. - * - * @param string $class - * - * @throws \Doctrine\Common\Persistence\Mapping\MappingException - * - * @return array - */ - public function getParentClasses($class); - - /** - * Returns the shortname of a class. - * - * @param string $class - * - * @return string - */ - public function getClassShortName($class); - - /** - * @param string $class - * - * @return string - */ - public function getClassNamespace($class); - - /** - * Returns a reflection class instance or null. - * - * @param string $class - * - * @return \ReflectionClass|null - */ - public function getClass($class); - - /** - * Returns an accessible property (setAccessible(true)) or null. - * - * @param string $class - * @param string $property - * - * @return \ReflectionProperty|null - */ - public function getAccessibleProperty($class, $property); - - /** - * Checks if the class have a public method with the given name. - * - * @param mixed $class - * @param mixed $method - * - * @return bool - */ - public function hasPublicMethod($class, $method); -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/RuntimeReflectionService.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/RuntimeReflectionService.php deleted file mode 100644 index b9acf9c..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/RuntimeReflectionService.php +++ /dev/null @@ -1,106 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Mapping; - -use ReflectionClass; -use ReflectionProperty; -use ReflectionMethod; -use ReflectionException; - -use Doctrine\Common\Reflection\RuntimePublicReflectionProperty; -use Doctrine\Common\Persistence\Mapping\MappingException; - -/** - * PHP Runtime Reflection Service. - * - * @author Benjamin Eberlei - */ -class RuntimeReflectionService implements ReflectionService -{ - /** - * {@inheritDoc} - */ - public function getParentClasses($class) - { - if ( ! class_exists($class)) { - throw MappingException::nonExistingClass($class); - } - - return class_parents($class); - } - - /** - * {@inheritDoc} - */ - public function getClassShortName($class) - { - $reflectionClass = new ReflectionClass($class); - - return $reflectionClass->getShortName(); - } - - /** - * {@inheritDoc} - */ - public function getClassNamespace($class) - { - $reflectionClass = new ReflectionClass($class); - - return $reflectionClass->getNamespaceName(); - } - - /** - * {@inheritDoc} - */ - public function getClass($class) - { - return new ReflectionClass($class); - } - - /** - * {@inheritDoc} - */ - public function getAccessibleProperty($class, $property) - { - $reflectionProperty = new ReflectionProperty($class, $property); - - if ($reflectionProperty->isPublic()) { - $reflectionProperty = new RuntimePublicReflectionProperty($class, $property); - } - - $reflectionProperty->setAccessible(true); - - return $reflectionProperty; - } - - /** - * {@inheritDoc} - */ - public function hasPublicMethod($class, $method) - { - try { - $reflectionMethod = new ReflectionMethod($class, $method); - } catch (ReflectionException $e) { - return false; - } - - return $reflectionMethod->isPublic(); - } -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/StaticReflectionService.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/StaticReflectionService.php deleted file mode 100644 index e5bcb06..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/StaticReflectionService.php +++ /dev/null @@ -1,83 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence\Mapping; - -/** - * PHP Runtime Reflection Service. - * - * @author Benjamin Eberlei - */ -class StaticReflectionService implements ReflectionService -{ - /** - * {@inheritDoc} - */ - public function getParentClasses($class) - { - return array(); - } - - /** - * {@inheritDoc} - */ - public function getClassShortName($className) - { - if (strpos($className, '\\') !== false) { - $className = substr($className, strrpos($className, "\\")+1); - } - return $className; - } - - /** - * {@inheritDoc} - */ - public function getClassNamespace($className) - { - $namespace = ''; - if (strpos($className, '\\') !== false) { - $namespace = strrev(substr( strrev($className), strpos(strrev($className), '\\')+1 )); - } - return $namespace; - } - - /** - * {@inheritDoc} - */ - public function getClass($class) - { - return null; - } - - /** - * {@inheritDoc} - */ - public function getAccessibleProperty($class, $property) - { - return null; - } - - /** - * {@inheritDoc} - */ - public function hasPublicMethod($class, $method) - { - return true; - } -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectManager.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectManager.php deleted file mode 100644 index 02208c9..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectManager.php +++ /dev/null @@ -1,169 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence; - -/** - * Contract for a Doctrine persistence layer ObjectManager class to implement. - * - * @link www.doctrine-project.org - * @since 2.1 - * @author Benjamin Eberlei - * @author Jonathan Wage - */ -interface ObjectManager -{ - /** - * Finds an object by its identifier. - * - * This is just a convenient shortcut for getRepository($className)->find($id). - * - * @param string $className The class name of the object to find. - * @param mixed $id The identity of the object to find. - * - * @return object The found object. - */ - public function find($className, $id); - - /** - * Tells the ObjectManager to make an instance managed and persistent. - * - * The object will be entered into the database as a result of the flush operation. - * - * NOTE: The persist operation always considers objects that are not yet known to - * this ObjectManager as NEW. Do not pass detached objects to the persist operation. - * - * @param object $object The instance to make managed and persistent. - * - * @return void - */ - public function persist($object); - - /** - * Removes an object instance. - * - * A removed object will be removed from the database as a result of the flush operation. - * - * @param object $object The object instance to remove. - * - * @return void - */ - public function remove($object); - - /** - * Merges the state of a detached object into the persistence context - * of this ObjectManager and returns the managed copy of the object. - * The object passed to merge will not become associated/managed with this ObjectManager. - * - * @param object $object - * - * @return object - */ - public function merge($object); - - /** - * Clears the ObjectManager. All objects that are currently managed - * by this ObjectManager become detached. - * - * @param string|null $objectName if given, only objects of this type will get detached. - * - * @return void - */ - public function clear($objectName = null); - - /** - * Detaches an object from the ObjectManager, causing a managed object to - * become detached. Unflushed changes made to the object if any - * (including removal of the object), will not be synchronized to the database. - * Objects which previously referenced the detached object will continue to - * reference it. - * - * @param object $object The object to detach. - * - * @return void - */ - public function detach($object); - - /** - * Refreshes the persistent state of an object from the database, - * overriding any local changes that have not yet been persisted. - * - * @param object $object The object to refresh. - * - * @return void - */ - public function refresh($object); - - /** - * Flushes all changes to objects that have been queued up to now to the database. - * This effectively synchronizes the in-memory state of managed objects with the - * database. - * - * @return void - */ - public function flush(); - - /** - * Gets the repository for a class. - * - * @param string $className - * - * @return \Doctrine\Common\Persistence\ObjectRepository - */ - public function getRepository($className); - - /** - * Returns the ClassMetadata descriptor for a class. - * - * The class name must be the fully-qualified class name without a leading backslash - * (as it is returned by get_class($obj)). - * - * @param string $className - * - * @return \Doctrine\Common\Persistence\Mapping\ClassMetadata - */ - public function getClassMetadata($className); - - /** - * Gets the metadata factory used to gather the metadata of classes. - * - * @return \Doctrine\Common\Persistence\Mapping\ClassMetadataFactory - */ - public function getMetadataFactory(); - - /** - * Helper method to initialize a lazy loading proxy or persistent collection. - * - * This method is a no-op for other objects. - * - * @param object $obj - * - * @return void - */ - public function initializeObject($obj); - - /** - * Checks if the object is part of the current UnitOfWork and therefore managed. - * - * @param object $object - * - * @return bool - */ - public function contains($object); -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectManagerAware.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectManagerAware.php deleted file mode 100644 index 9bc248a..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectManagerAware.php +++ /dev/null @@ -1,51 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence; - -use Doctrine\Common\Persistence\Mapping\ClassMetadata; - -/** - * Makes a Persistent Objects aware of its own object-manager. - * - * Using this interface the managing object manager and class metadata instances - * are injected into the persistent object after construction. This allows - * you to implement ActiveRecord functionality on top of the persistence-ignorance - * that Doctrine propagates. - * - * Word of Warning: This is a very powerful hook to change how you can work with your domain models. - * Using this hook will break the Single Responsibility Principle inside your Domain Objects - * and increase the coupling of database and objects. - * - * Every ObjectManager has to implement this functionality itself. - * - * @author Benjamin Eberlei - */ -interface ObjectManagerAware -{ - /** - * Injects responsible ObjectManager and the ClassMetadata into this persistent object. - * - * @param ObjectManager $objectManager - * @param ClassMetadata $classMetadata - * - * @return void - */ - public function injectObjectManager(ObjectManager $objectManager, ClassMetadata $classMetadata); -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectManagerDecorator.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectManagerDecorator.php deleted file mode 100644 index 8946475..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectManagerDecorator.php +++ /dev/null @@ -1,140 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence; - -/** - * Base class to simplify ObjectManager decorators - * - * @license http://opensource.org/licenses/MIT MIT - * @link www.doctrine-project.org - * @since 2.4 - * @author Lars Strojny - */ -abstract class ObjectManagerDecorator implements ObjectManager -{ - /** - * @var ObjectManager - */ - protected $wrapped; - - /** - * {@inheritdoc} - */ - public function find($className, $id) - { - return $this->wrapped->find($className, $id); - } - - /** - * {@inheritdoc} - */ - public function persist($object) - { - return $this->wrapped->persist($object); - } - - /** - * {@inheritdoc} - */ - public function remove($object) - { - return $this->wrapped->remove($object); - } - - /** - * {@inheritdoc} - */ - public function merge($object) - { - return $this->wrapped->merge($object); - } - - /** - * {@inheritdoc} - */ - public function clear($objectName = null) - { - return $this->wrapped->clear($objectName); - } - - /** - * {@inheritdoc} - */ - public function detach($object) - { - return $this->wrapped->detach($object); - } - - /** - * {@inheritdoc} - */ - public function refresh($object) - { - return $this->wrapped->refresh($object); - } - - /** - * {@inheritdoc} - */ - public function flush() - { - return $this->wrapped->flush(); - } - - /** - * {@inheritdoc} - */ - public function getRepository($className) - { - return $this->wrapped->getRepository($className); - } - - /** - * {@inheritdoc} - */ - public function getClassMetadata($className) - { - return $this->wrapped->getClassMetadata($className); - } - - /** - * {@inheritdoc} - */ - public function getMetadataFactory() - { - return $this->wrapped->getMetadataFactory(); - } - - /** - * {@inheritdoc} - */ - public function initializeObject($obj) - { - return $this->wrapped->initializeObject($obj); - } - - /** - * {@inheritdoc} - */ - public function contains($object) - { - return $this->wrapped->contains($object); - } -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectRepository.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectRepository.php deleted file mode 100644 index f607219..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectRepository.php +++ /dev/null @@ -1,81 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence; - -/** - * Contract for a Doctrine persistence layer ObjectRepository class to implement. - * - * @link www.doctrine-project.org - * @since 2.1 - * @author Benjamin Eberlei - * @author Jonathan Wage - */ -interface ObjectRepository -{ - /** - * Finds an object by its primary key / identifier. - * - * @param mixed $id The identifier. - * - * @return object The object. - */ - public function find($id); - - /** - * Finds all objects in the repository. - * - * @return array The objects. - */ - public function findAll(); - - /** - * Finds objects by a set of criteria. - * - * Optionally sorting and limiting details can be passed. An implementation may throw - * an UnexpectedValueException if certain values of the sorting or limiting details are - * not supported. - * - * @param array $criteria - * @param array|null $orderBy - * @param int|null $limit - * @param int|null $offset - * - * @return array The objects. - * - * @throws \UnexpectedValueException - */ - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null); - - /** - * Finds a single object by a set of criteria. - * - * @param array $criteria The criteria. - * - * @return object The object. - */ - public function findOneBy(array $criteria); - - /** - * Returns the class name of the object managed by the repository. - * - * @return string - */ - public function getClassName(); -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/PersistentObject.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/PersistentObject.php deleted file mode 100644 index 08c6942..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/PersistentObject.php +++ /dev/null @@ -1,254 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence; - -use Doctrine\Common\Persistence\Mapping\ClassMetadata; -use Doctrine\Common\Collections\ArrayCollection; -use Doctrine\Common\Collections\Collection; - -/** - * PersistentObject base class that implements getter/setter methods for all mapped fields and associations - * by overriding __call. - * - * This class is a forward compatible implementation of the PersistentObject trait. - * - * Limitations: - * - * 1. All persistent objects have to be associated with a single ObjectManager, multiple - * ObjectManagers are not supported. You can set the ObjectManager with `PersistentObject#setObjectManager()`. - * 2. Setters and getters only work if a ClassMetadata instance was injected into the PersistentObject. - * This is either done on `postLoad` of an object or by accessing the global object manager. - * 3. There are no hooks for setters/getters. Just implement the method yourself instead of relying on __call(). - * 4. Slower than handcoded implementations: An average of 7 method calls per access to a field and 11 for an association. - * 5. Only the inverse side associations get autoset on the owning side as well. Setting objects on the owning side - * will not set the inverse side associations. - * - * @example - * - * PersistentObject::setObjectManager($em); - * - * class Foo extends PersistentObject - * { - * private $id; - * } - * - * $foo = new Foo(); - * $foo->getId(); // method exists through __call - * - * @author Benjamin Eberlei - */ -abstract class PersistentObject implements ObjectManagerAware -{ - /** - * @var ObjectManager|null - */ - private static $objectManager = null; - - /** - * @var ClassMetadata|null - */ - private $cm = null; - - /** - * Sets the object manager responsible for all persistent object base classes. - * - * @param ObjectManager|null $objectManager - * - * @return void - */ - static public function setObjectManager(ObjectManager $objectManager = null) - { - self::$objectManager = $objectManager; - } - - /** - * @return ObjectManager|null - */ - static public function getObjectManager() - { - return self::$objectManager; - } - - /** - * Injects the Doctrine Object Manager. - * - * @param ObjectManager $objectManager - * @param ClassMetadata $classMetadata - * - * @return void - * - * @throws \RuntimeException - */ - public function injectObjectManager(ObjectManager $objectManager, ClassMetadata $classMetadata) - { - if ($objectManager !== self::$objectManager) { - throw new \RuntimeException("Trying to use PersistentObject with different ObjectManager instances. " . - "Was PersistentObject::setObjectManager() called?"); - } - - $this->cm = $classMetadata; - } - - /** - * Sets a persistent fields value. - * - * @param string $field - * @param array $args - * - * @return void - * - * @throws \BadMethodCallException When no persistent field exists by that name. - * @throws \InvalidArgumentException When the wrong target object type is passed to an association. - */ - private function set($field, $args) - { - $this->initializeDoctrine(); - - if ($this->cm->hasField($field) && !$this->cm->isIdentifier($field)) { - $this->$field = $args[0]; - } else if ($this->cm->hasAssociation($field) && $this->cm->isSingleValuedAssociation($field)) { - $targetClass = $this->cm->getAssociationTargetClass($field); - if (!($args[0] instanceof $targetClass) && $args[0] !== null) { - throw new \InvalidArgumentException("Expected persistent object of type '".$targetClass."'"); - } - $this->$field = $args[0]; - $this->completeOwningSide($field, $targetClass, $args[0]); - } else { - throw new \BadMethodCallException("no field with name '".$field."' exists on '".$this->cm->getName()."'"); - } - } - - /** - * Gets a persistent field value. - * - * @param string $field - * - * @return mixed - * - * @throws \BadMethodCallException When no persistent field exists by that name. - */ - private function get($field) - { - $this->initializeDoctrine(); - - if ( $this->cm->hasField($field) || $this->cm->hasAssociation($field) ) { - return $this->$field; - } else { - throw new \BadMethodCallException("no field with name '".$field."' exists on '".$this->cm->getName()."'"); - } - } - - /** - * If this is an inverse side association, completes the owning side. - * - * @param string $field - * @param ClassMetadata $targetClass - * @param object $targetObject - * - * @return void - */ - private function completeOwningSide($field, $targetClass, $targetObject) - { - // add this object on the owning side as well, for obvious infinite recursion - // reasons this is only done when called on the inverse side. - if ($this->cm->isAssociationInverseSide($field)) { - $mappedByField = $this->cm->getAssociationMappedByTargetField($field); - $targetMetadata = self::$objectManager->getClassMetadata($targetClass); - - $setter = ($targetMetadata->isCollectionValuedAssociation($mappedByField) ? "add" : "set").$mappedByField; - $targetObject->$setter($this); - } - } - - /** - * Adds an object to a collection. - * - * @param string $field - * @param array $args - * - * @return void - * - * @throws \BadMethodCallException - * @throws \InvalidArgumentException - */ - private function add($field, $args) - { - $this->initializeDoctrine(); - - if ($this->cm->hasAssociation($field) && $this->cm->isCollectionValuedAssociation($field)) { - $targetClass = $this->cm->getAssociationTargetClass($field); - if (!($args[0] instanceof $targetClass)) { - throw new \InvalidArgumentException("Expected persistent object of type '".$targetClass."'"); - } - if (!($this->$field instanceof Collection)) { - $this->$field = new ArrayCollection($this->$field ?: array()); - } - $this->$field->add($args[0]); - $this->completeOwningSide($field, $targetClass, $args[0]); - } else { - throw new \BadMethodCallException("There is no method add".$field."() on ".$this->cm->getName()); - } - } - - /** - * Initializes Doctrine Metadata for this class. - * - * @return void - * - * @throws \RuntimeException - */ - private function initializeDoctrine() - { - if ($this->cm !== null) { - return; - } - - if (!self::$objectManager) { - throw new \RuntimeException("No runtime object manager set. Call PersistentObject#setObjectManager()."); - } - - $this->cm = self::$objectManager->getClassMetadata(get_class($this)); - } - - /** - * Magic methods. - * - * @param string $method - * @param array $args - * - * @return mixed - * - * @throws \BadMethodCallException - */ - public function __call($method, $args) - { - $command = substr($method, 0, 3); - $field = lcfirst(substr($method, 3)); - if ($command == "set") { - $this->set($field, $args); - } else if ($command == "get") { - return $this->get($field); - } else if ($command == "add") { - $this->add($field, $args); - } else { - throw new \BadMethodCallException("There is no method ".$method." on ".$this->cm->getName()); - } - } -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Proxy.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Proxy.php deleted file mode 100644 index 3369eb9..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Proxy.php +++ /dev/null @@ -1,59 +0,0 @@ -. - */ - -namespace Doctrine\Common\Persistence; - -/** - * Interface for proxy classes. - * - * @author Roman Borschel - * @since 2.2 - */ -interface Proxy -{ - /** - * Marker for Proxy class names. - * - * @var string - */ - const MARKER = '__CG__'; - - /** - * Length of the proxy marker. - * - * @var integer - */ - const MARKER_LENGTH = 6; - - /** - * Initializes this proxy if its not yet initialized. - * - * Acts as a no-op if already initialized. - * - * @return void - */ - public function __load(); - - /** - * Returns whether this proxy is initialized or not. - * - * @return bool - */ - public function __isInitialized(); -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/PropertyChangedListener.php b/core/vendor/doctrine/common/lib/Doctrine/Common/PropertyChangedListener.php deleted file mode 100644 index 1a59cd4..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/PropertyChangedListener.php +++ /dev/null @@ -1,45 +0,0 @@ -. - */ - -namespace Doctrine\Common; - -/** - * Contract for classes that are potential listeners of a NotifyPropertyChanged - * implementor. - * - * @link www.doctrine-project.org - * @since 2.0 - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -interface PropertyChangedListener -{ - /** - * Notifies the listener of a property change. - * - * @param object $sender The object on which the property changed. - * @param string $propertyName The name of the property that changed. - * @param mixed $oldValue The old value of the property that changed. - * @param mixed $newValue The new value of the property that changed. - * - * @return void - */ - function propertyChanged($sender, $propertyName, $oldValue, $newValue); -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php deleted file mode 100644 index dd1ae1b..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php +++ /dev/null @@ -1,244 +0,0 @@ -. - */ - -namespace Doctrine\Common\Proxy; - -use Doctrine\Common\Persistence\Mapping\ClassMetadataFactory; -use Doctrine\Common\Proxy\Exception\InvalidArgumentException; -use Doctrine\Common\Proxy\Exception\OutOfBoundsException; -use Doctrine\Common\Util\ClassUtils; -use Doctrine\Common\Persistence\Mapping\ClassMetadata; - -/** - * Abstract factory for proxy objects. - * - * @author Benjamin Eberlei - */ -abstract class AbstractProxyFactory -{ - /** - * Never autogenerate a proxy and rely that it was generated by some - * process before deployment. - * - * @var integer - */ - const AUTOGENERATE_NEVER = 0; - - /** - * Always generates a new proxy in every request. - * - * This is only sane during development. - * - * @var integer - */ - const AUTOGENERATE_ALWAYS = 1; - - /** - * Autogenerate the proxy class when the proxy file does not exist. - * - * This strategy causes a file exists call whenever any proxy is used the - * first time in a request. - * - * @var integer - */ - const AUTOGENERATE_FILE_NOT_EXISTS = 2; - - /** - * Generate the proxy classes using eval(). - * - * This strategy is only sane for development, and even then it gives me - * the creeps a little. - * - * @var integer - */ - const AUTOGENERATE_EVAL = 3; - - /** - * @var \Doctrine\Common\Persistence\Mapping\ClassMetadataFactory - */ - private $metadataFactory; - - /** - * @var \Doctrine\Common\Proxy\ProxyGenerator the proxy generator responsible for creating the proxy classes/files. - */ - private $proxyGenerator; - - /** - * @var bool Whether to automatically (re)generate proxy classes. - */ - private $autoGenerate; - - /** - * @var \Doctrine\Common\Proxy\ProxyDefinition[] - */ - private $definitions = array(); - - /** - * @param \Doctrine\Common\Proxy\ProxyGenerator $proxyGenerator - * @param \Doctrine\Common\Persistence\Mapping\ClassMetadataFactory $metadataFactory - * @param bool|int $autoGenerate - */ - public function __construct(ProxyGenerator $proxyGenerator, ClassMetadataFactory $metadataFactory, $autoGenerate) - { - $this->proxyGenerator = $proxyGenerator; - $this->metadataFactory = $metadataFactory; - $this->autoGenerate = (int)$autoGenerate; - } - - /** - * Gets a reference proxy instance for the entity of the given type and identified by - * the given identifier. - * - * @param string $className - * @param array $identifier - * - * @return \Doctrine\Common\Proxy\Proxy - * - * @throws \Doctrine\Common\Proxy\Exception\OutOfBoundsException - */ - public function getProxy($className, array $identifier) - { - $definition = isset($this->definitions[$className]) - ? $this->definitions[$className] - : $this->getProxyDefinition($className); - $fqcn = $definition->proxyClassName; - $proxy = new $fqcn($definition->initializer, $definition->cloner); - - foreach ($definition->identifierFields as $idField) { - if (! isset($identifier[$idField])) { - throw OutOfBoundsException::missingPrimaryKeyValue($className, $idField); - } - - $definition->reflectionFields[$idField]->setValue($proxy, $identifier[$idField]); - } - - return $proxy; - } - - /** - * Generates proxy classes for all given classes. - * - * @param \Doctrine\Common\Persistence\Mapping\ClassMetadata[] $classes The classes (ClassMetadata instances) - * for which to generate proxies. - * @param string $proxyDir The target directory of the proxy classes. If not specified, the - * directory configured on the Configuration of the EntityManager used - * by this factory is used. - * @return int Number of generated proxies. - */ - public function generateProxyClasses(array $classes, $proxyDir = null) - { - $generated = 0; - - foreach ($classes as $class) { - if ($this->skipClass($class)) { - continue; - } - - $proxyFileName = $this->proxyGenerator->getProxyFileName($class->getName(), $proxyDir); - - $this->proxyGenerator->generateProxyClass($class, $proxyFileName); - - $generated += 1; - } - - return $generated; - } - - /** - * Reset initialization/cloning logic for an un-initialized proxy - * - * @param \Doctrine\Common\Proxy\Proxy $proxy - * - * @return \Doctrine\Common\Proxy\Proxy - * - * @throws \Doctrine\Common\Proxy\Exception\InvalidArgumentException - */ - public function resetUninitializedProxy(Proxy $proxy) - { - if ($proxy->__isInitialized()) { - throw InvalidArgumentException::unitializedProxyExpected($proxy); - } - - $className = ClassUtils::getClass($proxy); - $definition = isset($this->definitions[$className]) - ? $this->definitions[$className] - : $this->getProxyDefinition($className); - - $proxy->__setInitializer($definition->initializer); - $proxy->__setCloner($definition->cloner); - - return $proxy; - } - - /** - * Get a proxy definition for the given class name. - * - * @return ProxyDefinition - */ - private function getProxyDefinition($className) - { - $classMetadata = $this->metadataFactory->getMetadataFor($className); - $className = $classMetadata->getName(); // aliases and case sensitivity - - $this->definitions[$className] = $this->createProxyDefinition($className); - $proxyClassName = $this->definitions[$className]->proxyClassName; - - if ( ! class_exists($proxyClassName, false)) { - $fileName = $this->proxyGenerator->getProxyFileName($className); - - switch ($this->autoGenerate) { - case self::AUTOGENERATE_NEVER: - require $fileName; - break; - - case self::AUTOGENERATE_FILE_NOT_EXISTS: - if ( ! file_exists($fileName)) { - $this->proxyGenerator->generateProxyClass($classMetadata, $fileName); - } - require $fileName; - break; - - case self::AUTOGENERATE_ALWAYS: - $this->proxyGenerator->generateProxyClass($classMetadata, $fileName); - require $fileName; - break; - - case self::AUTOGENERATE_EVAL: - $this->proxyGenerator->generateProxyClass($classMetadata, false); - break; - } - } - - return $this->definitions[$className]; - } - - /** - * Determine if this class should be skipped during proxy generation. - * - * @param \Doctrine\Common\Persistence\Mapping\ClassMetadata $metadata - * @return bool - */ - abstract protected function skipClass(ClassMetadata $metadata); - - /** - * @return ProxyDefinition - */ - abstract protected function createProxyDefinition($className); -} - diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Autoloader.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Autoloader.php deleted file mode 100644 index 0aa930b..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Autoloader.php +++ /dev/null @@ -1,92 +0,0 @@ -. - */ - -namespace Doctrine\Common\Proxy; - -use Doctrine\Common\Proxy\Exception\InvalidArgumentException; - -/** - * Special Autoloader for Proxy classes, which are not PSR-0 compliant. - * - * @author Benjamin Eberlei - */ -class Autoloader -{ - /** - * Resolves proxy class name to a filename based on the following pattern. - * - * 1. Remove Proxy namespace from class name. - * 2. Remove namespace separators from remaining class name. - * 3. Return PHP filename from proxy-dir with the result from 2. - * - * @param string $proxyDir - * @param string $proxyNamespace - * @param string $className - * - * @return string - * - * @throws InvalidArgumentException - */ - public static function resolveFile($proxyDir, $proxyNamespace, $className) - { - if (0 !== strpos($className, $proxyNamespace)) { - throw InvalidArgumentException::notProxyClass($className, $proxyNamespace); - } - - $className = str_replace('\\', '', substr($className, strlen($proxyNamespace) + 1)); - - return $proxyDir . DIRECTORY_SEPARATOR . $className . '.php'; - } - - /** - * Registers and returns autoloader callback for the given proxy dir and namespace. - * - * @param string $proxyDir - * @param string $proxyNamespace - * @param callable|null $notFoundCallback Invoked when the proxy file is not found. - * - * @return \Closure - * - * @throws InvalidArgumentException - */ - public static function register($proxyDir, $proxyNamespace, $notFoundCallback = null) - { - $proxyNamespace = ltrim($proxyNamespace, '\\'); - - if ( ! (null === $notFoundCallback || is_callable($notFoundCallback))) { - throw InvalidArgumentException::invalidClassNotFoundCallback($notFoundCallback); - } - - $autoloader = function ($className) use ($proxyDir, $proxyNamespace, $notFoundCallback) { - if (0 === strpos($className, $proxyNamespace)) { - $file = Autoloader::resolveFile($proxyDir, $proxyNamespace, $className); - - if ($notFoundCallback && ! file_exists($file)) { - call_user_func($notFoundCallback, $proxyDir, $proxyNamespace, $className); - } - - require $file; - } - }; - - spl_autoload_register($autoloader); - - return $autoloader; - } -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Exception/InvalidArgumentException.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Exception/InvalidArgumentException.php deleted file mode 100644 index 24a2194..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Exception/InvalidArgumentException.php +++ /dev/null @@ -1,90 +0,0 @@ -. - */ - -namespace Doctrine\Common\Proxy\Exception; - -use Doctrine\Common\Persistence\Proxy; -use InvalidArgumentException as BaseInvalidArgumentException; - -/** - * Proxy Invalid Argument Exception. - * - * @link www.doctrine-project.org - * @since 2.4 - * @author Marco Pivetta - */ -class InvalidArgumentException extends BaseInvalidArgumentException implements ProxyException -{ - /** - * @return self - */ - public static function proxyDirectoryRequired() - { - return new self('You must configure a proxy directory. See docs for details'); - } - - /** - * @param string $className - * @param string $proxyNamespace - * - * @return self - */ - public static function notProxyClass($className, $proxyNamespace) - { - return new self(sprintf('The class "%s" is not part of the proxy namespace "%s"', $className, $proxyNamespace)); - } - - /** - * @param string $name - * - * @return self - */ - public static function invalidPlaceholder($name) - { - return new self(sprintf('Provided placeholder for "%s" must be either a string or a valid callable', $name)); - } - - /** - * @return self - */ - public static function proxyNamespaceRequired() - { - return new self('You must configure a proxy namespace'); - } - - /** - * @return self - */ - public static function unitializedProxyExpected(Proxy $proxy) - { - return new self(sprintf('Provided proxy of type "%s" must not be initialized.', get_class($proxy))); - } - - /** - * @param mixed $callback - * - * @return self - */ - public static function invalidClassNotFoundCallback($callback) - { - $type = is_object($callback) ? get_class($callback) : gettype($callback); - - return new self(sprintf('Invalid \$notFoundCallback given: must be a callable, "%s" given', $type)); - } -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Exception/OutOfBoundsException.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Exception/OutOfBoundsException.php deleted file mode 100644 index 348cfcb..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Exception/OutOfBoundsException.php +++ /dev/null @@ -1,43 +0,0 @@ -. - */ - -namespace Doctrine\Common\Proxy\Exception; - -use Doctrine\Common\Persistence\Proxy; -use OutOfBoundsException as BaseOutOfBoundsException; - -/** - * Proxy Invalid Argument Exception. - * - * @link www.doctrine-project.org - * @author Fredrik Wendel - */ -class OutOfBoundsException extends BaseOutOfBoundsException implements ProxyException -{ - /** - * @param string $className - * @param string $idField - * - * @return self - */ - public static function missingPrimaryKeyValue($className, $idField) - { - return new self(sprintf("Missing value for primary key %s on %s", $idField, $className)); - } -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Exception/ProxyException.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Exception/ProxyException.php deleted file mode 100644 index 0d1ff14..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Exception/ProxyException.php +++ /dev/null @@ -1,31 +0,0 @@ -. - */ - -namespace Doctrine\Common\Proxy\Exception; - -/** - * Base exception interface for proxy exceptions. - * - * @link www.doctrine-project.org - * @since 2.4 - * @author Marco Pivetta - */ -interface ProxyException -{ -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Exception/UnexpectedValueException.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Exception/UnexpectedValueException.php deleted file mode 100644 index 2b8e638..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Exception/UnexpectedValueException.php +++ /dev/null @@ -1,62 +0,0 @@ -. - */ - -namespace Doctrine\Common\Proxy\Exception; - -use UnexpectedValueException as BaseUnexpectedValueException; - -/** - * Proxy Unexpected Value Exception. - * - * @link www.doctrine-project.org - * @since 2.4 - * @author Marco Pivetta - */ -class UnexpectedValueException extends BaseUnexpectedValueException implements ProxyException -{ - /** - * @return self - */ - public static function proxyDirectoryNotWritable($proxyDirectory) - { - return new self(sprintf('Your proxy directory "%s" must be writable', $proxyDirectory)); - } - - /** - * @param string $className - * @param string $methodName - * @param string $parameterName - * @param \Exception $previous - * - * @return self - */ - public static function invalidParameterTypeHint($className, $methodName, $parameterName, \Exception $previous) - { - return new self( - sprintf( - 'The type hint of parameter "%s" in method "%s" in class "%s" is invalid.', - $parameterName, - $methodName, - $className - ), - 0, - $previous - ); - } -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Proxy.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Proxy.php deleted file mode 100644 index 8368430..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Proxy.php +++ /dev/null @@ -1,90 +0,0 @@ -. - */ - -namespace Doctrine\Common\Proxy; - -use Doctrine\Common\Persistence\Proxy as BaseProxy; -use Closure; - -/** - * Interface for proxy classes. - * - * @author Roman Borschel - * @author Marco Pivetta - * @since 2.4 - */ -interface Proxy extends BaseProxy -{ - /** - * Marks the proxy as initialized or not. - * - * @param boolean $initialized - * - * @return void - */ - public function __setInitialized($initialized); - - /** - * Sets the initializer callback to be used when initializing the proxy. That - * initializer should accept 3 parameters: $proxy, $method and $params. Those - * are respectively the proxy object that is being initialized, the method name - * that triggered initialization and the parameters passed to that method. - * - * @param Closure|null $initializer - * - * @return void - */ - public function __setInitializer(Closure $initializer = null); - - /** - * Retrieves the initializer callback used to initialize the proxy. - * - * @see __setInitializer - * - * @return Closure|null - */ - public function __getInitializer(); - - /** - * Sets the callback to be used when cloning the proxy. That initializer should accept - * a single parameter, which is the cloned proxy instance itself. - * - * @param Closure|null $cloner - * - * @return void - */ - public function __setCloner(Closure $cloner = null); - - /** - * Retrieves the callback to be used when cloning the proxy. - * - * @see __setCloner - * - * @return Closure|null - */ - public function __getCloner(); - - /** - * Retrieves the list of lazy loaded properties for a given proxy - * - * @return array Keys are the property names, and values are the default values - * for those properties. - */ - public function __getLazyProperties(); -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/ProxyDefinition.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/ProxyDefinition.php deleted file mode 100644 index 48b149a..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/ProxyDefinition.php +++ /dev/null @@ -1,70 +0,0 @@ -. - */ - -namespace Doctrine\Common\Proxy; - -/** - * Definition structure how to create a proxy. - * - * @author Benjamin Eberlei - */ -class ProxyDefinition -{ - /** - * @var string - */ - public $proxyClassName; - - /** - * @var array - */ - public $identifierFields; - - /** - * @var \ReflectionProperty[] - */ - public $reflectionFields; - - /** - * @var callable - */ - public $initializer; - - /** - * @var callable - */ - public $cloner; - - /** - * @param string $proxyClassName - * @param array $identifierFields - * @param array $reflectionFields - * @param callable $initializer - * @param callable $cloner - */ - public function __construct($proxyClassName, array $identifierFields, array $reflectionFields, $initializer, $cloner) - { - $this->proxyClassName = $proxyClassName; - $this->identifierFields = $identifierFields; - $this->reflectionFields = $reflectionFields; - $this->initializer = $initializer; - $this->cloner = $cloner; - } -} - diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/ProxyGenerator.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/ProxyGenerator.php deleted file mode 100644 index 4c5a239..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/ProxyGenerator.php +++ /dev/null @@ -1,932 +0,0 @@ -. - */ - -namespace Doctrine\Common\Proxy; - -use Doctrine\Common\Persistence\Mapping\ClassMetadata; -use Doctrine\Common\Util\ClassUtils; -use Doctrine\Common\Proxy\Exception\InvalidArgumentException; -use Doctrine\Common\Proxy\Exception\UnexpectedValueException; - -/** - * This factory is used to generate proxy classes. - * It builds proxies from given parameters, a template and class metadata. - * - * @author Marco Pivetta - * @since 2.4 - */ -class ProxyGenerator -{ - /** - * Used to match very simple id methods that don't need - * to be decorated since the identifier is known. - */ - const PATTERN_MATCH_ID_METHOD = '((public\s)?(function\s{1,}%s\s?\(\)\s{1,})\s{0,}{\s{0,}return\s{0,}\$this->%s;\s{0,}})i'; - - /** - * The namespace that contains all proxy classes. - * - * @var string - */ - private $proxyNamespace; - - /** - * The directory that contains all proxy classes. - * - * @var string - */ - private $proxyDirectory; - - /** - * Map of callables used to fill in placeholders set in the template. - * - * @var string[]|callable[] - */ - protected $placeholders = array( - 'baseProxyInterface' => 'Doctrine\Common\Proxy\Proxy', - 'additionalProperties' => '', - ); - - /** - * Template used as a blueprint to generate proxies. - * - * @var string - */ - protected $proxyClassTemplate = '; - -/** - * DO NOT EDIT THIS FILE - IT WAS CREATED BY DOCTRINE\'S PROXY GENERATOR - */ -class extends \ implements \ -{ - /** - * @var \Closure the callback responsible for loading properties in the proxy object. This callback is called with - * three parameters, being respectively the proxy object to be initialized, the method that triggered the - * initialization process and an array of ordered parameters that were passed to that method. - * - * @see \Doctrine\Common\Persistence\Proxy::__setInitializer - */ - public $__initializer__; - - /** - * @var \Closure the callback responsible of loading properties that need to be copied in the cloned object - * - * @see \Doctrine\Common\Persistence\Proxy::__setCloner - */ - public $__cloner__; - - /** - * @var boolean flag indicating if this object was already initialized - * - * @see \Doctrine\Common\Persistence\Proxy::__isInitialized - */ - public $__isInitialized__ = false; - - /** - * @var array properties to be lazy loaded, with keys being the property - * names and values being their default values - * - * @see \Doctrine\Common\Persistence\Proxy::__getLazyProperties - */ - public static $lazyPropertiesDefaults = array(); - - - - - - - - - - - - - - - - - - /** - * Forces initialization of the proxy - */ - public function __load() - { - $this->__initializer__ && $this->__initializer__->__invoke($this, \'__load\', array()); - } - - /** - * {@inheritDoc} - * @internal generated method: use only when explicitly handling proxy specific loading logic - */ - public function __isInitialized() - { - return $this->__isInitialized__; - } - - /** - * {@inheritDoc} - * @internal generated method: use only when explicitly handling proxy specific loading logic - */ - public function __setInitialized($initialized) - { - $this->__isInitialized__ = $initialized; - } - - /** - * {@inheritDoc} - * @internal generated method: use only when explicitly handling proxy specific loading logic - */ - public function __setInitializer(\Closure $initializer = null) - { - $this->__initializer__ = $initializer; - } - - /** - * {@inheritDoc} - * @internal generated method: use only when explicitly handling proxy specific loading logic - */ - public function __getInitializer() - { - return $this->__initializer__; - } - - /** - * {@inheritDoc} - * @internal generated method: use only when explicitly handling proxy specific loading logic - */ - public function __setCloner(\Closure $cloner = null) - { - $this->__cloner__ = $cloner; - } - - /** - * {@inheritDoc} - * @internal generated method: use only when explicitly handling proxy specific cloning logic - */ - public function __getCloner() - { - return $this->__cloner__; - } - - /** - * {@inheritDoc} - * @internal generated method: use only when explicitly handling proxy specific loading logic - * @static - */ - public function __getLazyProperties() - { - return self::$lazyPropertiesDefaults; - } - - -} -'; - - /** - * Initializes a new instance of the ProxyFactory class that is - * connected to the given EntityManager. - * - * @param string $proxyDirectory The directory to use for the proxy classes. It must exist. - * @param string $proxyNamespace The namespace to use for the proxy classes. - * - * @throws InvalidArgumentException - */ - public function __construct($proxyDirectory, $proxyNamespace) - { - if ( ! $proxyDirectory) { - throw InvalidArgumentException::proxyDirectoryRequired(); - } - - if ( ! $proxyNamespace) { - throw InvalidArgumentException::proxyNamespaceRequired(); - } - - $this->proxyDirectory = $proxyDirectory; - $this->proxyNamespace = $proxyNamespace; - } - - /** - * Sets a placeholder to be replaced in the template. - * - * @param string $name - * @param string|callable $placeholder - * - * @throws InvalidArgumentException - */ - public function setPlaceholder($name, $placeholder) - { - if ( ! is_string($placeholder) && ! is_callable($placeholder)) { - throw InvalidArgumentException::invalidPlaceholder($name); - } - - $this->placeholders[$name] = $placeholder; - } - - /** - * Sets the base template used to create proxy classes. - * - * @param string $proxyClassTemplate - */ - public function setProxyClassTemplate($proxyClassTemplate) - { - $this->proxyClassTemplate = (string) $proxyClassTemplate; - } - - /** - * Generates a proxy class file. - * - * @param \Doctrine\Common\Persistence\Mapping\ClassMetadata $class Metadata for the original class. - * @param string|bool $fileName Filename (full path) for the generated class. If none is given, eval() is used. - * - * @throws UnexpectedValueException - */ - public function generateProxyClass(ClassMetadata $class, $fileName = false) - { - preg_match_all('(<([a-zA-Z]+)>)', $this->proxyClassTemplate, $placeholderMatches); - - $placeholderMatches = array_combine($placeholderMatches[0], $placeholderMatches[1]); - $placeholders = array(); - - foreach ($placeholderMatches as $placeholder => $name) { - $placeholders[$placeholder] = isset($this->placeholders[$name]) - ? $this->placeholders[$name] - : array($this, 'generate' . $name); - } - - foreach ($placeholders as & $placeholder) { - if (is_callable($placeholder)) { - $placeholder = call_user_func($placeholder, $class); - } - } - - $proxyCode = strtr($this->proxyClassTemplate, $placeholders); - - if ( ! $fileName) { - $proxyClassName = $this->generateNamespace($class) . '\\' . $this->generateProxyShortClassName($class); - - if ( ! class_exists($proxyClassName)) { - eval(substr($proxyCode, 5)); - } - - return; - } - - $parentDirectory = dirname($fileName); - - if ( ! is_dir($parentDirectory) && (false === @mkdir($parentDirectory, 0775, true))) { - throw UnexpectedValueException::proxyDirectoryNotWritable($this->proxyDirectory); - } - - if ( ! is_writable($parentDirectory)) { - throw UnexpectedValueException::proxyDirectoryNotWritable($this->proxyDirectory); - } - - $tmpFileName = $fileName . '.' . uniqid('', true); - - file_put_contents($tmpFileName, $proxyCode); - rename($tmpFileName, $fileName); - } - - /** - * Generates the proxy short class name to be used in the template. - * - * @param \Doctrine\Common\Persistence\Mapping\ClassMetadata $class - * - * @return string - */ - private function generateProxyShortClassName(ClassMetadata $class) - { - $proxyClassName = ClassUtils::generateProxyClassName($class->getName(), $this->proxyNamespace); - $parts = explode('\\', strrev($proxyClassName), 2); - - return strrev($parts[0]); - } - - /** - * Generates the proxy namespace. - * - * @param \Doctrine\Common\Persistence\Mapping\ClassMetadata $class - * - * @return string - */ - private function generateNamespace(ClassMetadata $class) - { - $proxyClassName = ClassUtils::generateProxyClassName($class->getName(), $this->proxyNamespace); - $parts = explode('\\', strrev($proxyClassName), 2); - - return strrev($parts[1]); - } - - /** - * Generates the original class name. - * - * @param \Doctrine\Common\Persistence\Mapping\ClassMetadata $class - * - * @return string - */ - private function generateClassName(ClassMetadata $class) - { - return ltrim($class->getName(), '\\'); - } - - /** - * Generates the array representation of lazy loaded public properties and their default values. - * - * @param \Doctrine\Common\Persistence\Mapping\ClassMetadata $class - * - * @return string - */ - private function generateLazyPropertiesDefaults(ClassMetadata $class) - { - $lazyPublicProperties = $this->getLazyLoadedPublicProperties($class); - $values = array(); - - foreach ($lazyPublicProperties as $key => $value) { - $values[] = var_export($key, true) . ' => ' . var_export($value, true); - } - - return implode(', ', $values); - } - - /** - * Generates the constructor code (un-setting public lazy loaded properties, setting identifier field values). - * - * @param \Doctrine\Common\Persistence\Mapping\ClassMetadata $class - * - * @return string - */ - private function generateConstructorImpl(ClassMetadata $class) - { - $constructorImpl = <<<'EOT' - /** - * @param \Closure $initializer - * @param \Closure $cloner - */ - public function __construct($initializer = null, $cloner = null) - { - -EOT; - $toUnset = array(); - - foreach ($this->getLazyLoadedPublicProperties($class) as $lazyPublicProperty => $unused) { - $toUnset[] = '$this->' . $lazyPublicProperty; - } - - $constructorImpl .= (empty($toUnset) ? '' : ' unset(' . implode(', ', $toUnset) . ");\n") - . <<<'EOT' - - $this->__initializer__ = $initializer; - $this->__cloner__ = $cloner; - } -EOT; - - return $constructorImpl; - } - - /** - * Generates the magic getter invoked when lazy loaded public properties are requested. - * - * @param \Doctrine\Common\Persistence\Mapping\ClassMetadata $class - * - * @return string - */ - private function generateMagicGet(ClassMetadata $class) - { - $lazyPublicProperties = array_keys($this->getLazyLoadedPublicProperties($class)); - $reflectionClass = $class->getReflectionClass(); - $hasParentGet = false; - $returnReference = ''; - $inheritDoc = ''; - - if ($reflectionClass->hasMethod('__get')) { - $hasParentGet = true; - $inheritDoc = '{@inheritDoc}'; - - if ($reflectionClass->getMethod('__get')->returnsReference()) { - $returnReference = '& '; - } - } - - if (empty($lazyPublicProperties) && ! $hasParentGet) { - return ''; - } - - $magicGet = <<__getLazyProperties())) { - $this->__initializer__ && $this->__initializer__->__invoke($this, '__get', array($name)); - - return $this->$name; - } - - -EOT; - } - - if ($hasParentGet) { - $magicGet .= <<<'EOT' - $this->__initializer__ && $this->__initializer__->__invoke($this, '__get', array($name)); - - return parent::__get($name); - -EOT; - } else { - $magicGet .= <<<'EOT' - trigger_error(sprintf('Undefined property: %s::$%s', __CLASS__, $name), E_USER_NOTICE); - -EOT; - } - - $magicGet .= " }"; - - return $magicGet; - } - - /** - * Generates the magic setter (currently unused). - * - * @param \Doctrine\Common\Persistence\Mapping\ClassMetadata $class - * - * @return string - */ - private function generateMagicSet(ClassMetadata $class) - { - $lazyPublicProperties = $this->getLazyLoadedPublicProperties($class); - $hasParentSet = $class->getReflectionClass()->hasMethod('__set'); - - if (empty($lazyPublicProperties) && ! $hasParentSet) { - return ''; - } - - $inheritDoc = $hasParentSet ? '{@inheritDoc}' : ''; - $magicSet = <<__getLazyProperties())) { - $this->__initializer__ && $this->__initializer__->__invoke($this, '__set', array($name, $value)); - - $this->$name = $value; - - return; - } - - -EOT; - } - - if ($hasParentSet) { - $magicSet .= <<<'EOT' - $this->__initializer__ && $this->__initializer__->__invoke($this, '__set', array($name, $value)); - - return parent::__set($name, $value); -EOT; - } else { - $magicSet .= " \$this->\$name = \$value;"; - } - - $magicSet .= "\n }"; - - return $magicSet; - } - - /** - * Generates the magic issetter invoked when lazy loaded public properties are checked against isset(). - * - * @param \Doctrine\Common\Persistence\Mapping\ClassMetadata $class - * - * @return string - */ - private function generateMagicIsset(ClassMetadata $class) - { - $lazyPublicProperties = array_keys($this->getLazyLoadedPublicProperties($class)); - $hasParentIsset = $class->getReflectionClass()->hasMethod('__isset'); - - if (empty($lazyPublicProperties) && ! $hasParentIsset) { - return ''; - } - - $inheritDoc = $hasParentIsset ? '{@inheritDoc}' : ''; - $magicIsset = <<__getLazyProperties())) { - $this->__initializer__ && $this->__initializer__->__invoke($this, '__isset', array($name)); - - return isset($this->$name); - } - - -EOT; - } - - if ($hasParentIsset) { - $magicIsset .= <<<'EOT' - $this->__initializer__ && $this->__initializer__->__invoke($this, '__isset', array($name)); - - return parent::__isset($name); - -EOT; - } else { - $magicIsset .= " return false;"; - } - - return $magicIsset . "\n }"; - } - - /** - * Generates implementation for the `__sleep` method of proxies. - * - * @param \Doctrine\Common\Persistence\Mapping\ClassMetadata $class - * - * @return string - */ - private function generateSleepImpl(ClassMetadata $class) - { - $hasParentSleep = $class->getReflectionClass()->hasMethod('__sleep'); - $inheritDoc = $hasParentSleep ? '{@inheritDoc}' : ''; - $sleepImpl = <<__isInitialized__) { - $properties = array_diff($properties, array_keys($this->__getLazyProperties())); - } - - return $properties; - } -EOT; - } - - $allProperties = array('__isInitialized__'); - - /* @var $prop \ReflectionProperty */ - foreach ($class->getReflectionClass()->getProperties() as $prop) { - if ($prop->isStatic()) { - continue; - } - - $allProperties[] = $prop->isPrivate() - ? "\0" . $prop->getDeclaringClass()->getName() . "\0" . $prop->getName() - : $prop->getName(); - } - - $lazyPublicProperties = array_keys($this->getLazyLoadedPublicProperties($class)); - $protectedProperties = array_diff($allProperties, $lazyPublicProperties); - - foreach ($allProperties as &$property) { - $property = var_export($property, true); - } - - foreach ($protectedProperties as &$property) { - $property = var_export($property, true); - } - - $allProperties = implode(', ', $allProperties); - $protectedProperties = implode(', ', $protectedProperties); - - return $sleepImpl . <<__isInitialized__) { - return array($allProperties); - } - - return array($protectedProperties); - } -EOT; - } - - /** - * Generates implementation for the `__wakeup` method of proxies. - * - * @param \Doctrine\Common\Persistence\Mapping\ClassMetadata $class - * - * @return string - */ - private function generateWakeupImpl(ClassMetadata $class) - { - $unsetPublicProperties = array(); - $hasWakeup = $class->getReflectionClass()->hasMethod('__wakeup'); - - foreach (array_keys($this->getLazyLoadedPublicProperties($class)) as $lazyPublicProperty) { - $unsetPublicProperties[] = '$this->' . $lazyPublicProperty; - } - - $shortName = $this->generateProxyShortClassName($class); - $inheritDoc = $hasWakeup ? '{@inheritDoc}' : ''; - $wakeupImpl = <<__isInitialized__) { - \$this->__initializer__ = function ($shortName \$proxy) { - \$proxy->__setInitializer(null); - \$proxy->__setCloner(null); - - \$existingProperties = get_object_vars(\$proxy); - - foreach (\$proxy->__getLazyProperties() as \$property => \$defaultValue) { - if ( ! array_key_exists(\$property, \$existingProperties)) { - \$proxy->\$property = \$defaultValue; - } - } - }; - -EOT; - - if ( ! empty($unsetPublicProperties)) { - $wakeupImpl .= "\n unset(" . implode(', ', $unsetPublicProperties) . ");"; - } - - $wakeupImpl .= "\n }"; - - if ($hasWakeup) { - $wakeupImpl .= "\n parent::__wakeup();"; - } - - $wakeupImpl .= "\n }"; - - return $wakeupImpl; - } - - /** - * Generates implementation for the `__clone` method of proxies. - * - * @param \Doctrine\Common\Persistence\Mapping\ClassMetadata $class - * - * @return string - */ - private function generateCloneImpl(ClassMetadata $class) - { - $hasParentClone = $class->getReflectionClass()->hasMethod('__clone'); - $inheritDoc = $hasParentClone ? '{@inheritDoc}' : ''; - $callParentClone = $hasParentClone ? "\n parent::__clone();\n" : ''; - - return <<__cloner__ && \$this->__cloner__->__invoke(\$this, '__clone', array()); -$callParentClone } -EOT; - } - - /** - * Generates decorated methods by picking those available in the parent class. - * - * @param \Doctrine\Common\Persistence\Mapping\ClassMetadata $class - * - * @return string - */ - private function generateMethods(ClassMetadata $class) - { - $methods = ''; - $methodNames = array(); - $reflectionMethods = $class->getReflectionClass()->getMethods(\ReflectionMethod::IS_PUBLIC); - $skippedMethods = array( - '__sleep' => true, - '__clone' => true, - '__wakeup' => true, - '__get' => true, - '__set' => true, - '__isset' => true, - ); - - foreach ($reflectionMethods as $method) { - $name = $method->getName(); - - if ( - $method->isConstructor() || - isset($skippedMethods[strtolower($name)]) || - isset($methodNames[$name]) || - $method->isFinal() || - $method->isStatic() || - ( ! $method->isPublic()) - ) { - continue; - } - - $methodNames[$name] = true; - $methods .= "\n /**\n" - . " * {@inheritDoc}\n" - . " */\n" - . ' public function '; - - if ($method->returnsReference()) { - $methods .= '&'; - } - - $methods .= $name . '('; - - $firstParam = true; - $parameterString = ''; - $argumentString = ''; - $parameters = array(); - - foreach ($method->getParameters() as $param) { - if ($firstParam) { - $firstParam = false; - } else { - $parameterString .= ', '; - $argumentString .= ', '; - } - - try { - $paramClass = $param->getClass(); - } catch (\ReflectionException $previous) { - throw UnexpectedValueException::invalidParameterTypeHint( - $class->getName(), - $method->getName(), - $param->getName(), - $previous - ); - } - - // We need to pick the type hint class too - if (null !== $paramClass) { - $parameterString .= '\\' . $paramClass->getName() . ' '; - } elseif ($param->isArray()) { - $parameterString .= 'array '; - } elseif (method_exists($param, 'isCallable') && $param->isCallable()) { - $parameterString .= 'callable '; - } - - if ($param->isPassedByReference()) { - $parameterString .= '&'; - } - - $parameters[] = '$' . $param->getName(); - $parameterString .= '$' . $param->getName(); - $argumentString .= '$' . $param->getName(); - - if ($param->isDefaultValueAvailable()) { - $parameterString .= ' = ' . var_export($param->getDefaultValue(), true); - } - } - - $methods .= $parameterString . ')'; - $methods .= "\n" . ' {' . "\n"; - - if ($this->isShortIdentifierGetter($method, $class)) { - $identifier = lcfirst(substr($name, 3)); - $fieldType = $class->getTypeOfField($identifier); - $cast = in_array($fieldType, array('integer', 'smallint')) ? '(int) ' : ''; - - $methods .= ' if ($this->__isInitialized__ === false) {' . "\n"; - $methods .= ' return ' . $cast . ' parent::' . $method->getName() . "();\n"; - $methods .= ' }' . "\n\n"; - } - - $methods .= "\n \$this->__initializer__ " - . "&& \$this->__initializer__->__invoke(\$this, " . var_export($name, true) - . ", array(" . implode(', ', $parameters) . "));" - . "\n\n return parent::" . $name . '(' . $argumentString . ');' - . "\n" . ' }' . "\n"; - } - - return $methods; - } - - /** - * Generates the Proxy file name. - * - * @param string $className - * @param string $baseDirectory Optional base directory for proxy file name generation. - * If not specified, the directory configured on the Configuration of the - * EntityManager will be used by this factory. - * - * @return string - */ - public function getProxyFileName($className, $baseDirectory = null) - { - $baseDirectory = $baseDirectory ?: $this->proxyDirectory; - - return rtrim($baseDirectory, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . Proxy::MARKER - . str_replace('\\', '', $className) . '.php'; - } - - /** - * Checks if the method is a short identifier getter. - * - * What does this mean? For proxy objects the identifier is already known, - * however accessing the getter for this identifier usually triggers the - * lazy loading, leading to a query that may not be necessary if only the - * ID is interesting for the userland code (for example in views that - * generate links to the entity, but do not display anything else). - * - * @param \ReflectionMethod $method - * @param \Doctrine\Common\Persistence\Mapping\ClassMetadata $class - * - * @return boolean - */ - private function isShortIdentifierGetter($method, ClassMetadata $class) - { - $identifier = lcfirst(substr($method->getName(), 3)); - $startLine = $method->getStartLine(); - $endLine = $method->getEndLine(); - $cheapCheck = ( - $method->getNumberOfParameters() == 0 - && substr($method->getName(), 0, 3) == 'get' - && in_array($identifier, $class->getIdentifier(), true) - && $class->hasField($identifier) - && (($endLine - $startLine) <= 4) - ); - - if ($cheapCheck) { - $code = file($method->getDeclaringClass()->getFileName()); - $code = trim(implode(' ', array_slice($code, $startLine - 1, $endLine - $startLine + 1))); - - $pattern = sprintf(self::PATTERN_MATCH_ID_METHOD, $method->getName(), $identifier); - - if (preg_match($pattern, $code)) { - return true; - } - } - - return false; - } - - /** - * Generates the list of public properties to be lazy loaded, with their default values. - * - * @param \Doctrine\Common\Persistence\Mapping\ClassMetadata $class - * - * @return mixed[] - */ - private function getLazyLoadedPublicProperties(ClassMetadata $class) - { - $defaultProperties = $class->getReflectionClass()->getDefaultProperties(); - $properties = array(); - - foreach ($class->getReflectionClass()->getProperties(\ReflectionProperty::IS_PUBLIC) as $property) { - $name = $property->getName(); - - if (($class->hasField($name) || $class->hasAssociation($name)) && ! $class->isIdentifier($name)) { - $properties[$name] = $defaultProperties[$name]; - } - } - - return $properties; - } -} - diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Reflection/ClassFinderInterface.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Reflection/ClassFinderInterface.php deleted file mode 100644 index 639fd69..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Reflection/ClassFinderInterface.php +++ /dev/null @@ -1,37 +0,0 @@ -. - */ - -namespace Doctrine\Common\Reflection; - -/** - * Finds a class in a PSR-0 structure. - * - * @author Karoly Negyesi - */ -interface ClassFinderInterface -{ - /** - * Finds a class. - * - * @param string $class The name of the class. - * - * @return string|null The name of the class or NULL if not found. - */ - public function findFile($class); -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Reflection/Psr0FindFile.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Reflection/Psr0FindFile.php deleted file mode 100644 index 418bb0f..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Reflection/Psr0FindFile.php +++ /dev/null @@ -1,79 +0,0 @@ -. - */ - -namespace Doctrine\Common\Reflection; - -/** - * Finds a class in a PSR-0 structure. - * - * @author Karoly Negyesi - */ -class Psr0FindFile implements ClassFinderInterface -{ - /** - * The PSR-0 prefixes. - * - * @var array - */ - protected $prefixes; - - /** - * @param array $prefixes An array of prefixes. Each key is a PHP namespace and each value is - * a list of directories. - */ - public function __construct($prefixes) - { - $this->prefixes = $prefixes; - } - - /** - * {@inheritDoc} - */ - public function findFile($class) - { - $lastNsPos = strrpos($class, '\\'); - if ('\\' == $class[0]) { - $class = substr($class, 1); - } - - if (false !== $lastNsPos) { - // namespaced class name - $classPath = str_replace('\\', DIRECTORY_SEPARATOR, substr($class, 0, $lastNsPos)) . DIRECTORY_SEPARATOR; - $className = substr($class, $lastNsPos + 1); - } else { - // PEAR-like class name - $classPath = null; - $className = $class; - } - - $classPath .= str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php'; - - foreach ($this->prefixes as $prefix => $dirs) { - if (0 === strpos($class, $prefix)) { - foreach ($dirs as $dir) { - if (is_file($dir . DIRECTORY_SEPARATOR . $classPath)) { - return $dir . DIRECTORY_SEPARATOR . $classPath; - } - } - } - } - - return null; - } -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Reflection/ReflectionProviderInterface.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Reflection/ReflectionProviderInterface.php deleted file mode 100644 index 3d970ee..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Reflection/ReflectionProviderInterface.php +++ /dev/null @@ -1,48 +0,0 @@ -. - */ - -namespace Doctrine\Common\Reflection; - -interface ReflectionProviderInterface -{ - /** - * Gets the ReflectionClass equivalent for this class. - * - * @return \ReflectionClass - */ - public function getReflectionClass(); - - /** - * Gets the ReflectionMethod equivalent for this class. - * - * @param string $name - * - * @return \ReflectionMethod - */ - public function getReflectionMethod($name); - - /** - * Gets the ReflectionProperty equivalent for this class. - * - * @param string $name - * - * @return \ReflectionProperty - */ - public function getReflectionProperty($name); -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Reflection/RuntimePublicReflectionProperty.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Reflection/RuntimePublicReflectionProperty.php deleted file mode 100644 index f155c45..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Reflection/RuntimePublicReflectionProperty.php +++ /dev/null @@ -1,76 +0,0 @@ -. - */ - -namespace Doctrine\Common\Reflection; - -use ReflectionProperty; -use Doctrine\Common\Proxy\Proxy; - -/** - * PHP Runtime Reflection Public Property - special overrides for public properties. - * - * @author Marco Pivetta - * @since 2.4 - */ -class RuntimePublicReflectionProperty extends ReflectionProperty -{ - /** - * {@inheritDoc} - * - * Checks is the value actually exist before fetching it. - * This is to avoid calling `__get` on the provided $object if it - * is a {@see \Doctrine\Common\Proxy\Proxy}. - */ - public function getValue($object = null) - { - $name = $this->getName(); - - if ($object instanceof Proxy && ! $object->__isInitialized()) { - $originalInitializer = $object->__getInitializer(); - $object->__setInitializer(null); - $val = isset($object->$name) ? $object->$name : null; - $object->__setInitializer($originalInitializer); - - return $val; - } - - return isset($object->$name) ? parent::getValue($object) : null; - } - - /** - * {@inheritDoc} - * - * Avoids triggering lazy loading via `__set` if the provided object - * is a {@see \Doctrine\Common\Proxy\Proxy}. - * @link https://bugs.php.net/bug.php?id=63463 - */ - public function setValue($object, $value = null) - { - if ( ! ($object instanceof Proxy && ! $object->__isInitialized())) { - parent::setValue($object, $value); - - return; - } - - $originalInitializer = $object->__getInitializer(); - $object->__setInitializer(null); - parent::setValue($object, $value); - $object->__setInitializer($originalInitializer); - } -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionClass.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionClass.php deleted file mode 100644 index b65979a..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionClass.php +++ /dev/null @@ -1,433 +0,0 @@ -. - */ - -namespace Doctrine\Common\Reflection; - -use ReflectionClass; -use ReflectionException; - -class StaticReflectionClass extends ReflectionClass -{ - /** - * The static reflection parser object. - * - * @var StaticReflectionParser - */ - private $staticReflectionParser; - - /** - * @param StaticReflectionParser $staticReflectionParser - */ - public function __construct(StaticReflectionParser $staticReflectionParser) - { - $this->staticReflectionParser = $staticReflectionParser; - } - - /** - * {@inheritDoc} - */ - public function getName() - { - return $this->staticReflectionParser->getClassName(); - } - - /** - * {@inheritDoc} - */ - public function getDocComment() - { - return $this->staticReflectionParser->getDocComment(); - } - - /** - * {@inheritDoc} - */ - public function getNamespaceName() - { - return $this->staticReflectionParser->getNamespaceName(); - } - - /** - * @return array - */ - public function getUseStatements() - { - return $this->staticReflectionParser->getUseStatements(); - } - - /** - * {@inheritDoc} - */ - public function getMethod($name) - { - return $this->staticReflectionParser->getReflectionMethod($name); - } - - /** - * {@inheritDoc} - */ - public function getProperty($name) - { - return $this->staticReflectionParser->getReflectionProperty($name); - } - - /** - * {@inheritDoc} - */ - public static function export($argument, $return = false) - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function getConstant($name) - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function getConstants() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function getConstructor() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function getDefaultProperties() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function getEndLine() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function getExtension() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function getExtensionName() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function getFileName() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function getInterfaceNames() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function getInterfaces() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function getMethods($filter = null) - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function getModifiers() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function getParentClass() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function getProperties($filter = null) - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function getShortName() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function getStartLine() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function getStaticProperties() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function getStaticPropertyValue($name, $default = '') - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function getTraitAliases() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function getTraitNames() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function getTraits() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function hasConstant($name) - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function hasMethod($name) - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function hasProperty($name) - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function implementsInterface($interface) - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function inNamespace() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function isAbstract() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function isCloneable() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function isFinal() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function isInstance($object) - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function isInstantiable() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function isInterface() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function isInternal() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function isIterateable() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function isSubclassOf($class) - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function isTrait() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function isUserDefined() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function newInstance($args) - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function newInstanceArgs(array $args = array()) - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function newInstanceWithoutConstructor() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function setStaticPropertyValue($name, $value) - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function __toString() - { - throw new ReflectionException('Method not implemented'); - } -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionMethod.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionMethod.php deleted file mode 100644 index 311e1304..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionMethod.php +++ /dev/null @@ -1,362 +0,0 @@ -. - */ - -namespace Doctrine\Common\Reflection; - -use ReflectionMethod; -use ReflectionException; - -class StaticReflectionMethod extends ReflectionMethod -{ - /** - * The PSR-0 parser object. - * - * @var StaticReflectionParser - */ - protected $staticReflectionParser; - - /** - * The name of the method. - * - * @var string - */ - protected $methodName; - - /** - * @param StaticReflectionParser $staticReflectionParser - * @param string $methodName - */ - public function __construct(StaticReflectionParser $staticReflectionParser, $methodName) - { - $this->staticReflectionParser = $staticReflectionParser; - $this->methodName = $methodName; - } - - /** - * {@inheritDoc} - */ - public function getName() - { - return $this->methodName; - } - - /** - * @return StaticReflectionParser - */ - protected function getStaticReflectionParser() - { - return $this->staticReflectionParser->getStaticReflectionParserForDeclaringClass('method', $this->methodName); - } - - /** - * {@inheritDoc} - */ - public function getDeclaringClass() - { - return $this->getStaticReflectionParser()->getReflectionClass(); - } - - /** - * {@inheritDoc} - */ - public function getNamespaceName() - { - return $this->getStaticReflectionParser()->getNamespaceName(); - } - - /** - * {@inheritDoc} - */ - public function getDocComment() - { - return $this->getStaticReflectionParser()->getDocComment('method', $this->methodName); - } - - /** - * @return array - */ - public function getUseStatements() - { - return $this->getStaticReflectionParser()->getUseStatements(); - } - - /** - * {@inheritDoc} - */ - public static function export($class, $name, $return = false) - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function getClosure($object) - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function getModifiers() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function getPrototype() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function invoke($object, $parameter = null) - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function invokeArgs($object, array $args) - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function isAbstract() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function isConstructor() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function isDestructor() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function isFinal() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function isPrivate() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function isProtected() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function isPublic() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function isStatic() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function setAccessible($accessible) - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function __toString() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function getClosureThis() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function getEndLine() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function getExtension() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function getExtensionName() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function getFileName() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function getNumberOfParameters() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function getNumberOfRequiredParameters() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function getParameters() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function getShortName() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function getStartLine() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function getStaticVariables() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function inNamespace() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function isClosure() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function isDeprecated() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function isInternal() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function isUserDefined() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function returnsReference() - { - throw new ReflectionException('Method not implemented'); - } -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionParser.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionParser.php deleted file mode 100644 index aac1f90..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionParser.php +++ /dev/null @@ -1,307 +0,0 @@ -. - */ - -namespace Doctrine\Common\Reflection; - -use ReflectionException; -use Doctrine\Common\Annotations\TokenParser; - -/** - * Parses a file for namespaces/use/class declarations. - * - * @author Karoly Negyesi - */ -class StaticReflectionParser implements ReflectionProviderInterface -{ - /** - * The fully qualified class name. - * - * @var string - */ - protected $className; - - /** - * The short class name. - * - * @var string - */ - protected $shortClassName; - - /** - * Whether the caller only wants class annotations. - * - * @var boolean. - */ - protected $classAnnotationOptimize; - - /** - * Whether the parser has run. - * - * @var boolean - */ - protected $parsed = false; - - /** - * The namespace of the class. - * - * @var string - */ - protected $namespace = ''; - - /** - * The use statements of the class. - * - * @var array - */ - protected $useStatements = array(); - - /** - * The docComment of the class. - * - * @var string - */ - protected $docComment = array( - 'class' => '', - 'property' => array(), - 'method' => array() - ); - - /** - * The name of the class this class extends, if any. - * - * @var string - */ - protected $parentClassName = ''; - - /** - * The parent PSR-0 Parser. - * - * @var \Doctrine\Common\Reflection\StaticReflectionParser - */ - protected $parentStaticReflectionParser; - - /** - * Parses a class residing in a PSR-0 hierarchy. - * - * @param string $className The full, namespaced class name. - * @param ClassFinderInterface $finder A ClassFinder object which finds the class. - * @param boolean $classAnnotationOptimize Only retrieve the class docComment. - * Presumes there is only one statement per line. - */ - public function __construct($className, $finder, $classAnnotationOptimize = false) - { - $this->className = ltrim($className, '\\'); - $lastNsPos = strrpos($this->className, '\\'); - - if ($lastNsPos !== false) { - $this->namespace = substr($this->className, 0, $lastNsPos); - $this->shortClassName = substr($this->className, $lastNsPos + 1); - } else { - $this->shortClassName = $this->className; - } - - $this->finder = $finder; - $this->classAnnotationOptimize = $classAnnotationOptimize; - } - - /** - * @return void - */ - protected function parse() - { - if ($this->parsed || !$fileName = $this->finder->findFile($this->className)) { - return; - } - $this->parsed = true; - $contents = file_get_contents($fileName); - if ($this->classAnnotationOptimize) { - if (preg_match("/\A.*^\s*((abstract|final)\s+)?class\s+{$this->shortClassName}\s+/sm", $contents, $matches)) { - $contents = $matches[0]; - } - } - $tokenParser = new TokenParser($contents); - $docComment = ''; - while ($token = $tokenParser->next(false)) { - if (is_array($token)) { - switch ($token[0]) { - case T_USE: - $this->useStatements = array_merge($this->useStatements, $tokenParser->parseUseStatement()); - break; - case T_DOC_COMMENT: - $docComment = $token[1]; - break; - case T_CLASS: - $this->docComment['class'] = $docComment; - $docComment = ''; - break; - case T_VAR: - case T_PRIVATE: - case T_PROTECTED: - case T_PUBLIC: - $token = $tokenParser->next(); - if ($token[0] === T_VARIABLE) { - $propertyName = substr($token[1], 1); - $this->docComment['property'][$propertyName] = $docComment; - continue 2; - } - if ($token[0] !== T_FUNCTION) { - // For example, it can be T_FINAL. - continue 2; - } - // No break. - case T_FUNCTION: - // The next string after function is the name, but - // there can be & before the function name so find the - // string. - while (($token = $tokenParser->next()) && $token[0] !== T_STRING); - $methodName = $token[1]; - $this->docComment['method'][$methodName] = $docComment; - $docComment = ''; - break; - case T_EXTENDS: - $this->parentClassName = $tokenParser->parseClass(); - $nsPos = strpos($this->parentClassName, '\\'); - $fullySpecified = false; - if ($nsPos === 0) { - $fullySpecified = true; - } else { - if ($nsPos) { - $prefix = strtolower(substr($this->parentClassName, 0, $nsPos)); - $postfix = substr($this->parentClassName, $nsPos); - } else { - $prefix = strtolower($this->parentClassName); - $postfix = ''; - } - foreach ($this->useStatements as $alias => $use) { - if ($alias == $prefix) { - $this->parentClassName = '\\' . $use . $postfix; - $fullySpecified = true; - } - } - } - if (!$fullySpecified) { - $this->parentClassName = '\\' . $this->namespace . '\\' . $this->parentClassName; - } - break; - } - } - } - } - - /** - * @return StaticReflectionParser - */ - protected function getParentStaticReflectionParser() - { - if (empty($this->parentStaticReflectionParser)) { - $this->parentStaticReflectionParser = new static($this->parentClassName, $this->finder); - } - - return $this->parentStaticReflectionParser; - } - - /** - * @return string - */ - public function getClassName() - { - return $this->className; - } - - /** - * @return string - */ - public function getNamespaceName() - { - return $this->namespace; - } - - /** - * {@inheritDoc} - */ - public function getReflectionClass() - { - return new StaticReflectionClass($this); - } - - /** - * {@inheritDoc} - */ - public function getReflectionMethod($methodName) - { - return new StaticReflectionMethod($this, $methodName); - } - - /** - * {@inheritDoc} - */ - public function getReflectionProperty($propertyName) - { - return new StaticReflectionProperty($this, $propertyName); - } - - /** - * Gets the use statements from this file. - * - * @return array - */ - public function getUseStatements() - { - $this->parse(); - - return $this->useStatements; - } - - /** - * Gets the doc comment. - * - * @param string $type The type: 'class', 'property' or 'method'. - * @param string $name The name of the property or method, not needed for 'class'. - * - * @return string The doc comment, empty string if none. - */ - public function getDocComment($type = 'class', $name = '') - { - $this->parse(); - - return $name ? $this->docComment[$type][$name] : $this->docComment[$type]; - } - - /** - * Gets the PSR-0 parser for the declaring class. - * - * @param string $type The type: 'property' or 'method'. - * @param string $name The name of the property or method. - * - * @return StaticReflectionParser A static reflection parser for the declaring class. - * - * @throws ReflectionException - */ - public function getStaticReflectionParserForDeclaringClass($type, $name) - { - $this->parse(); - if (isset($this->docComment[$type][$name])) { - return $this; - } - if (!empty($this->parentClassName)) { - return $this->getParentStaticReflectionParser()->getStaticReflectionParserForDeclaringClass($type, $name); - } - throw new ReflectionException('Invalid ' . $type . ' "' . $name . '"'); - } -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionProperty.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionProperty.php deleted file mode 100644 index 1664822..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionProperty.php +++ /dev/null @@ -1,178 +0,0 @@ -. - */ - -namespace Doctrine\Common\Reflection; - -use ReflectionProperty; -use ReflectionException; - -class StaticReflectionProperty extends ReflectionProperty -{ - /** - * The PSR-0 parser object. - * - * @var StaticReflectionParser - */ - protected $staticReflectionParser; - - /** - * The name of the property. - * - * @var string|null - */ - protected $propertyName; - - /** - * @param StaticReflectionParser $staticReflectionParser - * @param string|null $propertyName - */ - public function __construct(StaticReflectionParser $staticReflectionParser, $propertyName) - { - $this->staticReflectionParser = $staticReflectionParser; - $this->propertyName = $propertyName; - } - - /** - * {@inheritDoc} - */ - public function getName() - { - return $this->propertyName; - } - - /** - * @return StaticReflectionParser - */ - protected function getStaticReflectionParser() - { - return $this->staticReflectionParser->getStaticReflectionParserForDeclaringClass('property', $this->propertyName); - } - - /** - * {@inheritDoc} - */ - public function getDeclaringClass() - { - return $this->getStaticReflectionParser()->getReflectionClass(); - } - - /** - * {@inheritDoc} - */ - public function getDocComment() - { - return $this->getStaticReflectionParser()->getDocComment('property', $this->propertyName); - } - - /** - * @return array - */ - public function getUseStatements() - { - return $this->getStaticReflectionParser()->getUseStatements(); - } - - /** - * {@inheritDoc} - */ - public static function export ($class, $name, $return = false) - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function getModifiers() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function getValue($object = null) - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function isDefault() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function isPrivate() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function isProtected() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function isPublic() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function isStatic() - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function setAccessible ($accessible) - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function setValue ($object, $value = null) - { - throw new ReflectionException('Method not implemented'); - } - - /** - * {@inheritDoc} - */ - public function __toString() - { - throw new ReflectionException('Method not implemented'); - } -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Util/ClassUtils.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Util/ClassUtils.php deleted file mode 100644 index 49dc7bb..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Util/ClassUtils.php +++ /dev/null @@ -1,109 +0,0 @@ -. - */ - -namespace Doctrine\Common\Util; - -use Doctrine\Common\Persistence\Proxy; - -/** - * Class and reflection related functionality for objects that - * might or not be proxy objects at the moment. - * - * @author Benjamin Eberlei - * @author Johannes Schmitt - */ -class ClassUtils -{ - /** - * Gets the real class name of a class name that could be a proxy. - * - * @param string $class - * - * @return string - */ - public static function getRealClass($class) - { - if (false === $pos = strrpos($class, '\\'.Proxy::MARKER.'\\')) { - return $class; - } - - return substr($class, $pos + Proxy::MARKER_LENGTH + 2); - } - - /** - * Gets the real class name of an object (even if its a proxy). - * - * @param object $object - * - * @return string - */ - public static function getClass($object) - { - return self::getRealClass(get_class($object)); - } - - /** - * Gets the real parent class name of a class or object. - * - * @param string $className - * - * @return string - */ - public static function getParentClass($className) - { - return get_parent_class( self::getRealClass( $className ) ); - } - - /** - * Creates a new reflection class. - * - * @param string $class - * - * @return \ReflectionClass - */ - public static function newReflectionClass($class) - { - return new \ReflectionClass( self::getRealClass( $class ) ); - } - - /** - * Creates a new reflection object. - * - * @param object $object - * - * @return \ReflectionObject - */ - public static function newReflectionObject($object) - { - return self::newReflectionClass( self::getClass( $object ) ); - } - - /** - * Given a class name and a proxy namespace returns the proxy name. - * - * @param string $className - * @param string $proxyNamespace - * - * @return string - */ - public static function generateProxyClassName($className, $proxyNamespace) - { - return rtrim($proxyNamespace, '\\') . '\\'.Proxy::MARKER.'\\' . ltrim($className, '\\'); - } -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Util/Debug.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Util/Debug.php deleted file mode 100644 index 8f25c9a..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Util/Debug.php +++ /dev/null @@ -1,142 +0,0 @@ -. - */ - -namespace Doctrine\Common\Util; - -use Doctrine\Common\Persistence\Proxy; - -/** - * Static class containing most used debug methods. - * - * @link www.doctrine-project.org - * @since 2.0 - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Giorgio Sironi - */ -final class Debug -{ - /** - * Private constructor (prevents instantiation). - */ - private function __construct() - { - } - - /** - * Prints a dump of the public, protected and private properties of $var. - * - * @link http://xdebug.org/ - * - * @param mixed $var The variable to dump. - * @param integer $maxDepth The maximum nesting level for object properties. - * @param boolean $stripTags Whether output should strip HTML tags. - */ - public static function dump($var, $maxDepth = 2, $stripTags = true) - { - ini_set('html_errors', 'On'); - - if (extension_loaded('xdebug')) { - ini_set('xdebug.var_display_max_depth', $maxDepth); - } - - $var = self::export($var, $maxDepth++); - - ob_start(); - var_dump($var); - $dump = ob_get_contents(); - ob_end_clean(); - - echo ($stripTags ? strip_tags(html_entity_decode($dump)) : $dump); - - ini_set('html_errors', 'Off'); - } - - /** - * @param mixed $var - * @param int $maxDepth - * - * @return mixed - */ - public static function export($var, $maxDepth) - { - $return = null; - $isObj = is_object($var); - - if ($isObj && in_array('Doctrine\Common\Collections\Collection', class_implements($var))) { - $var = $var->toArray(); - } - - if ($maxDepth) { - if (is_array($var)) { - $return = array(); - - foreach ($var as $k => $v) { - $return[$k] = self::export($v, $maxDepth - 1); - } - } else if ($isObj) { - $return = new \stdclass(); - if ($var instanceof \DateTime) { - $return->__CLASS__ = "DateTime"; - $return->date = $var->format('c'); - $return->timezone = $var->getTimeZone()->getName(); - } else { - $reflClass = ClassUtils::newReflectionObject($var); - $return->__CLASS__ = ClassUtils::getClass($var); - - if ($var instanceof Proxy) { - $return->__IS_PROXY__ = true; - $return->__PROXY_INITIALIZED__ = $var->__isInitialized(); - } - - if ($var instanceof \ArrayObject || $var instanceof \ArrayIterator) { - $return->__STORAGE__ = self::export($var->getArrayCopy(), $maxDepth - 1); - } - - foreach ($reflClass->getProperties() as $reflProperty) { - $name = $reflProperty->getName(); - - $reflProperty->setAccessible(true); - $return->$name = self::export($reflProperty->getValue($var), $maxDepth - 1); - } - } - } else { - $return = $var; - } - } else { - $return = is_object($var) ? get_class($var) - : (is_array($var) ? 'Array(' . count($var) . ')' : $var); - } - - return $return; - } - - /** - * Returns a string representation of an object. - * - * @param object $obj - * - * @return string - */ - public static function toString($obj) - { - return method_exists($obj, '__toString') ? (string) $obj : get_class($obj) . '@' . spl_object_hash($obj); - } -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Util/Inflector.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Util/Inflector.php deleted file mode 100644 index 082dc78..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Util/Inflector.php +++ /dev/null @@ -1,31 +0,0 @@ -. - */ - -namespace Doctrine\Common\Util; - -use Doctrine\Common\Inflector\Inflector as BaseInflector; - -/** - * Doctrine inflector has static methods for inflecting text. - * - * Kept for backwards compatibility reasons, was moved to its own component. - */ -class Inflector extends BaseInflector -{ -} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Version.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Version.php deleted file mode 100644 index ea1760a..0000000 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Version.php +++ /dev/null @@ -1,53 +0,0 @@ -. - */ - -namespace Doctrine\Common; - -/** - * Class to store and retrieve the version of Doctrine. - * - * @link www.doctrine-project.org - * @since 2.0 - * @author Benjamin Eberlei - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -class Version -{ - /** - * Current Doctrine Version. - */ - const VERSION = '2.4.2'; - - /** - * Compares a Doctrine version with the current one. - * - * @param string $version Doctrine version to compare. - * - * @return int -1 if older, 0 if it is the same, 1 if version passed as argument is newer. - */ - public static function compare($version) - { - $currentVersion = str_replace(' ', '', strtolower(self::VERSION)); - $version = str_replace(' ', '', $version); - - return version_compare($version, $currentVersion); - } -} diff --git a/core/vendor/doctrine/common/phpunit.xml.dist b/core/vendor/doctrine/common/phpunit.xml.dist deleted file mode 100644 index b9d3b34..0000000 --- a/core/vendor/doctrine/common/phpunit.xml.dist +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - ./tests/Doctrine/ - - - - - - ./lib/Doctrine/ - - - - - - performance - - - diff --git a/core/vendor/doctrine/common/tests/.gitignore b/core/vendor/doctrine/common/tests/.gitignore deleted file mode 100644 index 7210405..0000000 --- a/core/vendor/doctrine/common/tests/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -Doctrine/Tests/Proxies/ -Doctrine/Tests/ORM/Proxy/generated/ -Doctrine/Tests/ORM/Tools/Export/export diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/ClassLoaderTest.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/ClassLoaderTest.php deleted file mode 100644 index 1eb2216..0000000 --- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/ClassLoaderTest.php +++ /dev/null @@ -1,64 +0,0 @@ -setIncludePath(__DIR__); - $classLoader->setFileExtension('.class.php'); - $classLoader->setNamespaceSeparator('_'); - - $this->assertTrue($classLoader->canLoadClass('ClassLoaderTest_ClassA')); - $this->assertTrue($classLoader->canLoadClass('ClassLoaderTest_ClassB')); - $this->assertTrue($classLoader->canLoadClass('ClassLoaderTest_ClassC')); - $this->assertFalse($classLoader->canLoadClass('OtherClass')); - $this->assertEquals($classLoader->loadClass('ClassLoaderTest_ClassA'), true); - $this->assertEquals($classLoader->loadClass('ClassLoaderTest_ClassB'), true); - $this->assertEquals($classLoader->loadClass('ClassLoaderTest_ClassC'), true); - } - - public function testClassExists() - { - $this->assertFalse(ClassLoader::classExists('ClassLoaderTest\ClassD')); - $badLoader = function($className) { - require __DIR__ . '/ClassLoaderTest/ClassD.php'; - return true; - }; - spl_autoload_register($badLoader); - $this->assertTrue(ClassLoader::classExists('ClassLoaderTest\ClassD')); - spl_autoload_unregister($badLoader); - } - - public function testGetClassLoader() - { - $cl = new ClassLoader('ClassLoaderTest', __DIR__); - $cl->register(); - $this->assertTrue(ClassLoader::getClassLoader('ClassLoaderTest\ClassD') instanceof \Doctrine\Common\ClassLoader); - $this->assertNull(ClassLoader::getClassLoader('This\Class\Does\Not\Exist')); - $cl->unregister(); - } - - public function testClassExistsWithSilentAutoloader() - { - $test = $this; - $silentLoader = function ($className) use ($test) { - $test->assertSame('ClassLoaderTest\ClassE', $className); - require __DIR__ . '/ClassLoaderTest/ClassE.php'; - }; - $additionalLoader = function () use ($test) { - $test->fail('Should not call this loader, class was already loaded'); - }; - - $this->assertFalse(ClassLoader::classExists('ClassLoaderTest\ClassE')); - spl_autoload_register($silentLoader); - spl_autoload_register($additionalLoader); - $this->assertTrue(ClassLoader::classExists('ClassLoaderTest\ClassE')); - spl_autoload_unregister($additionalLoader); - spl_autoload_unregister($silentLoader); - } -} diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/ClassLoaderTest/ClassA.class.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/ClassLoaderTest/ClassA.class.php deleted file mode 100644 index 8554654..0000000 --- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/ClassLoaderTest/ClassA.class.php +++ /dev/null @@ -1,6 +0,0 @@ -_eventManager = new EventManager; - $this->_preFooInvoked = false; - $this->_postFooInvoked = false; - } - - public function testInitialState() - { - $this->assertEquals(array(), $this->_eventManager->getListeners()); - $this->assertFalse($this->_eventManager->hasListeners(self::preFoo)); - $this->assertFalse($this->_eventManager->hasListeners(self::postFoo)); - } - - public function testAddEventListener() - { - $this->_eventManager->addEventListener(array('preFoo', 'postFoo'), $this); - $this->assertTrue($this->_eventManager->hasListeners(self::preFoo)); - $this->assertTrue($this->_eventManager->hasListeners(self::postFoo)); - $this->assertEquals(1, count($this->_eventManager->getListeners(self::preFoo))); - $this->assertEquals(1, count($this->_eventManager->getListeners(self::postFoo))); - $this->assertEquals(2, count($this->_eventManager->getListeners())); - } - - public function testDispatchEvent() - { - $this->_eventManager->addEventListener(array('preFoo', 'postFoo'), $this); - $this->_eventManager->dispatchEvent(self::preFoo); - $this->assertTrue($this->_preFooInvoked); - $this->assertFalse($this->_postFooInvoked); - } - - public function testRemoveEventListener() - { - $this->_eventManager->addEventListener(array('preBar'), $this); - $this->assertTrue($this->_eventManager->hasListeners(self::preBar)); - $this->_eventManager->removeEventListener(array('preBar'), $this); - $this->assertFalse($this->_eventManager->hasListeners(self::preBar)); - } - - public function testAddEventSubscriber() - { - $eventSubscriber = new TestEventSubscriber(); - $this->_eventManager->addEventSubscriber($eventSubscriber); - $this->assertTrue($this->_eventManager->hasListeners(self::preFoo)); - $this->assertTrue($this->_eventManager->hasListeners(self::postFoo)); - } - - /* Listener methods */ - - public function preFoo(EventArgs $e) - { - $this->_preFooInvoked = true; - } - - public function postFoo(EventArgs $e) - { - $this->_postFooInvoked = true; - } -} - -class TestEventSubscriber implements \Doctrine\Common\EventSubscriber -{ - public function getSubscribedEvents() - { - return array('preFoo', 'postFoo'); - } -} \ No newline at end of file diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/AnnotationDriverTest.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/AnnotationDriverTest.php deleted file mode 100644 index ab6cc5c..0000000 --- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/AnnotationDriverTest.php +++ /dev/null @@ -1,29 +0,0 @@ -getAllClassNames(); - - $this->assertEquals(array('Doctrine\TestClass'), $classes); - } -} - -class SimpleAnnotationDriver extends AnnotationDriver -{ - protected $entityAnnotationClasses = array('Doctrine\Entity' => true); - - public function loadMetadataForClass($className, ClassMetadata $metadata) - { - } -} diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/ChainDriverTest.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/ChainDriverTest.php deleted file mode 100644 index f9edd10..0000000 --- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/ChainDriverTest.php +++ /dev/null @@ -1,152 +0,0 @@ -getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata'); - - $chain = new MappingDriverChain(); - - $driver1 = $this->getMock('Doctrine\Common\Persistence\Mapping\Driver\MappingDriver'); - $driver1->expects($this->never()) - ->method('loadMetadataForClass'); - $driver1->expectS($this->never()) - ->method('isTransient'); - - $driver2 = $this->getMock('Doctrine\Common\Persistence\Mapping\Driver\MappingDriver'); - $driver2->expects($this->at(0)) - ->method('loadMetadataForClass') - ->with($this->equalTo($className), $this->equalTo($classMetadata)); - $driver2->expects($this->at(1)) - ->method('isTransient') - ->with($this->equalTo($className)) - ->will($this->returnValue( true )); - - $chain->addDriver($driver1, 'Doctrine\Tests\Models\Company'); - $chain->addDriver($driver2, 'Doctrine\Tests\Common\Persistence\Mapping'); - - $chain->loadMetadataForClass($className, $classMetadata); - - $this->assertTrue( $chain->isTransient($className) ); - } - - public function testLoadMetadata_NoDelegatorFound_ThrowsMappingException() - { - $className = 'Doctrine\Tests\Common\Persistence\Mapping\DriverChainEntity'; - $classMetadata = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata'); - - $chain = new MappingDriverChain(); - - $this->setExpectedException('Doctrine\Common\Persistence\Mapping\MappingException'); - $chain->loadMetadataForClass($className, $classMetadata); - } - - public function testGatherAllClassNames() - { - $className = 'Doctrine\Tests\Common\Persistence\Mapping\DriverChainEntity'; - $classMetadata = $this->getMock('Doctrine\Common\Persistence\ClassMetadata'); - - $chain = new MappingDriverChain(); - - $driver1 = $this->getMock('Doctrine\Common\Persistence\Mapping\Driver\MappingDriver'); - $driver1->expects($this->once()) - ->method('getAllClassNames') - ->will($this->returnValue(array('Doctrine\Tests\Models\Company\Foo'))); - - $driver2 = $this->getMock('Doctrine\Common\Persistence\Mapping\Driver\MappingDriver'); - $driver2->expects($this->once()) - ->method('getAllClassNames') - ->will($this->returnValue(array('Doctrine\Tests\ORM\Mapping\Bar', 'Doctrine\Tests\ORM\Mapping\Baz', 'FooBarBaz'))); - - $chain->addDriver($driver1, 'Doctrine\Tests\Models\Company'); - $chain->addDriver($driver2, 'Doctrine\Tests\ORM\Mapping'); - - $this->assertEquals(array( - 'Doctrine\Tests\Models\Company\Foo', - 'Doctrine\Tests\ORM\Mapping\Bar', - 'Doctrine\Tests\ORM\Mapping\Baz' - ), $chain->getAllClassNames()); - } - - /** - * @group DDC-706 - */ - public function testIsTransient() - { - $driver1 = $this->getMock('Doctrine\Common\Persistence\Mapping\Driver\MappingDriver'); - $chain = new MappingDriverChain(); - $chain->addDriver($driver1, 'Doctrine\Tests\Models\CMS'); - - $this->assertTrue($chain->isTransient('stdClass'), "stdClass isTransient"); - } - - /** - * @group DDC-1412 - */ - public function testDefaultDriver() - { - $companyDriver = $this->getMock('Doctrine\Common\Persistence\Mapping\Driver\MappingDriver'); - $defaultDriver = $this->getMock('Doctrine\Common\Persistence\Mapping\Driver\MappingDriver'); - $entityClassName = 'Doctrine\Tests\ORM\Mapping\DriverChainEntity'; - $managerClassName = 'Doctrine\Tests\Models\Company\CompanyManager'; - $chain = new MappingDriverChain(); - - $companyDriver->expects($this->never()) - ->method('loadMetadataForClass'); - $companyDriver->expects($this->once()) - ->method('isTransient') - ->with($this->equalTo($managerClassName)) - ->will($this->returnValue(false)); - - $defaultDriver->expects($this->never()) - ->method('loadMetadataForClass'); - $defaultDriver->expects($this->once()) - ->method('isTransient') - ->with($this->equalTo($entityClassName)) - ->will($this->returnValue(true)); - - $this->assertNull($chain->getDefaultDriver()); - - $chain->setDefaultDriver($defaultDriver); - $chain->addDriver($companyDriver, 'Doctrine\Tests\Models\Company'); - - $this->assertSame($defaultDriver, $chain->getDefaultDriver()); - - $this->assertTrue($chain->isTransient($entityClassName)); - $this->assertFalse($chain->isTransient($managerClassName)); - } - - public function testDefaultDriverGetAllClassNames() - { - $companyDriver = $this->getMock('Doctrine\Common\Persistence\Mapping\Driver\MappingDriver'); - $defaultDriver = $this->getMock('Doctrine\Common\Persistence\Mapping\Driver\MappingDriver'); - $chain = new MappingDriverChain(); - - $companyDriver->expects($this->once()) - ->method('getAllClassNames') - ->will($this->returnValue(array('Doctrine\Tests\Models\Company\Foo'))); - - $defaultDriver->expects($this->once()) - ->method('getAllClassNames') - ->will($this->returnValue(array('Other\Class'))); - - $chain->setDefaultDriver($defaultDriver); - $chain->addDriver($companyDriver, 'Doctrine\Tests\Models\Company'); - - $classNames = $chain->getAllClassNames(); - - $this->assertEquals(array('Doctrine\Tests\Models\Company\Foo', 'Other\Class'), $classNames); - } -} - -class DriverChainEntity -{ - -} diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/ClassMetadataFactoryTest.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/ClassMetadataFactoryTest.php deleted file mode 100644 index c5a457f..0000000 --- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/ClassMetadataFactoryTest.php +++ /dev/null @@ -1,145 +0,0 @@ -getMock('Doctrine\Common\Persistence\Mapping\Driver\MappingDriver'); - $metadata = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata'); - $this->cmf = new TestClassMetadataFactory($driver, $metadata); - } - - public function testGetCacheDriver() - { - $this->assertNull($this->cmf->getCacheDriver()); - $cache = new ArrayCache(); - $this->cmf->setCacheDriver($cache); - $this->assertSame($cache, $this->cmf->getCacheDriver()); - } - - public function testGetMetadataFor() - { - $metadata = $this->cmf->getMetadataFor('stdClass'); - - $this->assertInstanceOf('Doctrine\Common\Persistence\Mapping\ClassMetadata', $metadata); - $this->assertTrue($this->cmf->hasMetadataFor('stdClass')); - } - - public function testGetMetadataForAbsentClass() - { - $this->setExpectedException('Doctrine\Common\Persistence\Mapping\MappingException'); - $this->cmf->getMetadataFor(__NAMESPACE__ . '\AbsentClass'); - } - - public function testGetParentMetadata() - { - $metadata = $this->cmf->getMetadataFor(__NAMESPACE__ . '\ChildEntity'); - - $this->assertInstanceOf('Doctrine\Common\Persistence\Mapping\ClassMetadata', $metadata); - $this->assertTrue($this->cmf->hasMetadataFor(__NAMESPACE__ . '\ChildEntity')); - $this->assertTrue($this->cmf->hasMetadataFor(__NAMESPACE__ . '\RootEntity')); - } - - public function testGetCachedMetadata() - { - $metadata = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata'); - $cache = new ArrayCache(); - $cache->save(__NAMESPACE__. '\ChildEntity$CLASSMETADATA', $metadata); - - $this->cmf->setCacheDriver($cache); - - $loadedMetadata = $this->cmf->getMetadataFor(__NAMESPACE__ . '\ChildEntity'); - $this->assertSame($loadedMetadata, $metadata); - } - - public function testCacheGetMetadataFor() - { - $cache = new ArrayCache(); - $this->cmf->setCacheDriver($cache); - - $loadedMetadata = $this->cmf->getMetadataFor(__NAMESPACE__ . '\ChildEntity'); - - $this->assertSame($loadedMetadata, $cache->fetch(__NAMESPACE__. '\ChildEntity$CLASSMETADATA')); - } - - public function testGetAliasedMetadata() - { - $loadedMetadata = $this->cmf->getMetadataFor('prefix:ChildEntity'); - - $this->assertTrue($this->cmf->hasMetadataFor(__NAMESPACE__ . '\ChildEntity')); - $this->assertTrue($this->cmf->hasMetadataFor('prefix:ChildEntity')); - } -} - -class TestClassMetadataFactory extends AbstractClassMetadataFactory -{ - public $driver; - public $metadata; - - public function __construct($driver, $metadata) - { - $this->driver = $driver; - $this->metadata = $metadata; - } - - protected function doLoadMetadata($class, $parent, $rootEntityFound, array $nonSuperclassParents) - { - - } - - protected function getFqcnFromAlias($namespaceAlias, $simpleClassName) - { - return __NAMESPACE__ . '\\' . $simpleClassName; - } - - protected function initialize() - { - - } - - protected function newClassMetadataInstance($className) - { - return $this->metadata; - } - - protected function getDriver() - { - return $this->driver; - } - protected function wakeupReflection(ClassMetadata $class, ReflectionService $reflService) - { - } - - protected function initializeReflection(ClassMetadata $class, ReflectionService $reflService) - { - } - - protected function isEntity(ClassMetadata $class) - { - return true; - } -} - -class RootEntity -{ - -} - -class ChildEntity extends RootEntity -{ - -} diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/DefaultFileLocatorTest.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/DefaultFileLocatorTest.php deleted file mode 100644 index 37072de..0000000 --- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/DefaultFileLocatorTest.php +++ /dev/null @@ -1,90 +0,0 @@ -assertEquals(array($path), $locator->getPaths()); - - $locator = new DefaultFileLocator($path); - $this->assertEquals(array($path), $locator->getPaths()); - } - - public function testGetFileExtension() - { - $locator = new DefaultFileLocator(array(), ".yml"); - $this->assertEquals(".yml", $locator->getFileExtension()); - $locator->setFileExtension(".xml"); - $this->assertEquals(".xml", $locator->getFileExtension()); - } - - public function testUniquePaths() - { - $path = __DIR__ . "/_files"; - - $locator = new DefaultFileLocator(array($path, $path)); - $this->assertEquals(array($path), $locator->getPaths()); - } - - public function testFindMappingFile() - { - $path = __DIR__ . "/_files"; - - $locator = new DefaultFileLocator(array($path), ".yml"); - - $this->assertEquals(__DIR__ . '/_files' . DIRECTORY_SEPARATOR . 'stdClass.yml', $locator->findMappingFile('stdClass')); - } - - public function testFindMappingFileNotFound() - { - $path = __DIR__ . "/_files"; - - $locator = new DefaultFileLocator(array($path), ".yml"); - - $this->setExpectedException( - 'Doctrine\Common\Persistence\Mapping\MappingException', - "No mapping file found named 'stdClass2.yml' for class 'stdClass2'" - ); - $locator->findMappingFile('stdClass2'); - } - - public function testGetAllClassNames() - { - $path = __DIR__ . "/_files"; - - $locator = new DefaultFileLocator(array($path), ".yml"); - $classes = $locator->getAllClassNames(null); - sort($classes); - - $this->assertEquals(array('global', 'stdClass'), $classes); - $this->assertEquals(array('stdClass'), $locator->getAllClassNames("global")); - } - - public function testGetAllClassNamesNonMatchingFileExtension() - { - $path = __DIR__ . "/_files"; - - $locator = new DefaultFileLocator(array($path), ".xml"); - $this->assertEquals(array(), $locator->getAllClassNames("global")); - } - - public function testFileExists() - { - $path = __DIR__ . "/_files"; - - $locator = new DefaultFileLocator(array($path), ".yml"); - - $this->assertTrue($locator->fileExists("stdClass")); - $this->assertFalse($locator->fileExists("stdClass2")); - $this->assertTrue($locator->fileExists("global")); - $this->assertFalse($locator->fileExists("global2")); - } -} diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/FileDriverTest.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/FileDriverTest.php deleted file mode 100644 index 020c242..0000000 --- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/FileDriverTest.php +++ /dev/null @@ -1,142 +0,0 @@ -assertNull($driver->getGlobalBasename()); - - $driver->setGlobalBasename("global"); - $this->assertEquals("global", $driver->getGlobalBasename()); - } - - public function testGetElementFromGlobalFile() - { - $driver = new TestFileDriver($this->newLocator()); - $driver->setGlobalBasename("global"); - - $element = $driver->getElement('stdGlobal'); - - $this->assertEquals('stdGlobal', $element); - } - - public function testGetElementFromFile() - { - $locator = $this->newLocator(); - $locator->expects($this->once()) - ->method('findMappingFile') - ->with($this->equalTo('stdClass')) - ->will($this->returnValue(__DIR__ . '/_files/stdClass.yml')); - - $driver = new TestFileDriver($locator); - - $this->assertEquals('stdClass', $driver->getElement('stdClass')); - } - - public function testGetAllClassNamesGlobalBasename() - { - $driver = new TestFileDriver($this->newLocator()); - $driver->setGlobalBasename("global"); - - $classNames = $driver->getAllClassNames(); - - $this->assertEquals(array('stdGlobal', 'stdGlobal2'), $classNames); - } - - public function testGetAllClassNamesFromMappingFile() - { - $locator = $this->newLocator(); - $locator->expects($this->any()) - ->method('getAllClassNames') - ->with($this->equalTo(null)) - ->will($this->returnValue(array('stdClass'))); - $driver = new TestFileDriver($locator); - - $classNames = $driver->getAllClassNames(); - - $this->assertEquals(array('stdClass'), $classNames); - } - - public function testGetAllClassNamesBothSources() - { - $locator = $this->newLocator(); - $locator->expects($this->any()) - ->method('getAllClassNames') - ->with($this->equalTo('global')) - ->will($this->returnValue(array('stdClass'))); - $driver = new TestFileDriver($locator); - $driver->setGlobalBasename("global"); - - $classNames = $driver->getAllClassNames(); - - $this->assertEquals(array('stdGlobal', 'stdGlobal2', 'stdClass'), $classNames); - } - - public function testIsNotTransient() - { - $locator = $this->newLocator(); - $locator->expects($this->once()) - ->method('fileExists') - ->with($this->equalTo('stdClass')) - ->will($this->returnValue( true )); - - $driver = new TestFileDriver($locator); - $driver->setGlobalBasename("global"); - - $this->assertFalse($driver->isTransient('stdClass')); - $this->assertFalse($driver->isTransient('stdGlobal')); - $this->assertFalse($driver->isTransient('stdGlobal2')); - } - - public function testIsTransient() - { - $locator = $this->newLocator(); - $locator->expects($this->once()) - ->method('fileExists') - ->with($this->equalTo('stdClass2')) - ->will($this->returnValue( false )); - - $driver = new TestFileDriver($locator); - - $this->assertTrue($driver->isTransient('stdClass2')); - } - - public function testNonLocatorFallback() - { - $driver = new TestFileDriver(__DIR__ . '/_files', '.yml'); - $this->assertTrue($driver->isTransient('stdClass2')); - $this->assertFalse($driver->isTransient('stdClass')); - } - - private function newLocator() - { - $locator = $this->getMock('Doctrine\Common\Persistence\Mapping\Driver\FileLocator'); - $locator->expects($this->any())->method('getFileExtension')->will($this->returnValue('.yml')); - $locator->expects($this->any())->method('getPaths')->will($this->returnValue(array(__DIR__ . "/_files"))); - return $locator; - } -} - -class TestFileDriver extends FileDriver -{ - protected function loadMappingFile($file) - { - if (strpos($file, "global.yml") !== false) { - return array('stdGlobal' => 'stdGlobal', 'stdGlobal2' => 'stdGlobal2'); - } - return array('stdClass' => 'stdClass'); - } - - public function loadMetadataForClass($className, ClassMetadata $metadata) - { - - } -} \ No newline at end of file diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/PHPDriverTest.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/PHPDriverTest.php deleted file mode 100644 index 8fc4d80..0000000 --- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/PHPDriverTest.php +++ /dev/null @@ -1,18 +0,0 @@ -getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata'); - $metadata->expects($this->once())->method('getFieldNames'); - - $driver = new PHPDriver(array(__DIR__ . "/_files")); - $driver->loadMetadataForClass('TestEntity', $metadata); - } -} \ No newline at end of file diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/RuntimeReflectionServiceTest.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/RuntimeReflectionServiceTest.php deleted file mode 100644 index 767ccd6..0000000 --- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/RuntimeReflectionServiceTest.php +++ /dev/null @@ -1,84 +0,0 @@ -. - */ - -namespace Doctrine\Tests\Common\Persistence\Mapping; - -use Doctrine\Common\Persistence\Mapping\RuntimeReflectionService; - -/** - * @group DCOM-93 - */ -class RuntimeReflectionServiceTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var RuntimeReflectionService - */ - private $reflectionService; - - public $unusedPublicProperty; - - public function setUp() - { - $this->reflectionService = new RuntimeReflectionService(); - } - - public function testShortname() - { - $this->assertEquals("RuntimeReflectionServiceTest", $this->reflectionService->getClassShortName(__CLASS__)); - } - - public function testClassNamespaceName() - { - $this->assertEquals("Doctrine\Tests\Common\Persistence\Mapping", $this->reflectionService->getClassNamespace(__CLASS__)); - } - - public function testGetParentClasses() - { - $classes = $this->reflectionService->getParentClasses(__CLASS__); - $this->assertTrue(count($classes) >= 1, "The test class ".__CLASS__." should have at least one parent."); - } - - public function testGetParentClassesForAbsentClass() - { - $this->setExpectedException('Doctrine\Common\Persistence\Mapping\MappingException'); - $this->reflectionService->getParentClasses(__NAMESPACE__ . '\AbsentClass'); - } - - public function testGetReflectionClass() - { - $class = $this->reflectionService->getClass(__CLASS__); - $this->assertInstanceOf("ReflectionClass", $class); - } - - public function testGetMethods() - { - $this->assertTrue($this->reflectionService->hasPublicMethod(__CLASS__, "testGetMethods")); - $this->assertFalse($this->reflectionService->hasPublicMethod(__CLASS__, "testGetMethods2")); - } - - public function testGetAccessibleProperty() - { - $reflProp = $this->reflectionService->getAccessibleProperty(__CLASS__, "reflectionService"); - $this->assertInstanceOf("ReflectionProperty", $reflProp); - - $reflProp = $this->reflectionService->getAccessibleProperty(__CLASS__, "unusedPublicProperty"); - $this->assertInstanceOf("Doctrine\Common\Reflection\RuntimePublicReflectionProperty", $reflProp); - } -} - diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/StaticPHPDriverTest.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/StaticPHPDriverTest.php deleted file mode 100644 index 9f1c568..0000000 --- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/StaticPHPDriverTest.php +++ /dev/null @@ -1,35 +0,0 @@ -getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata'); - $metadata->expects($this->once())->method('getFieldNames'); - - $driver = new StaticPHPDriver(array(__DIR__)); - $driver->loadMetadataForClass(__NAMESPACE__ . '\\TestEntity', $metadata); - } - - public function testGetAllClassNames() - { - $driver = new StaticPHPDriver(array(__DIR__)); - $classNames = $driver->getAllClassNames(); - - $this->assertContains( - 'Doctrine\Tests\Common\Persistence\Mapping\TestEntity', $classNames); - } -} - -class TestEntity -{ - static public function loadMetadata($metadata) - { - $metadata->getFieldNames(); - } -} \ No newline at end of file diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/StaticReflectionServiceTest.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/StaticReflectionServiceTest.php deleted file mode 100644 index 9054b6c..0000000 --- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/StaticReflectionServiceTest.php +++ /dev/null @@ -1,70 +0,0 @@ -. - */ - -namespace Doctrine\Tests\Common\Persistence\Mapping; - -use Doctrine\Common\Persistence\Mapping\StaticReflectionService; - -/** - * @group DCOM-93 - */ -class StaticReflectionServiceTest extends \PHPUnit_Framework_TestCase -{ - private $reflectionService; - - public function setUp() - { - $this->reflectionService = new StaticReflectionService(); - } - - public function testShortname() - { - $this->assertEquals("StaticReflectionServiceTest", $this->reflectionService->getClassShortName(__CLASS__)); - } - - public function testClassNamespaceName() - { - $this->assertEquals("Doctrine\Tests\Common\Persistence\Mapping", $this->reflectionService->getClassNamespace(__CLASS__)); - } - - public function testGetParentClasses() - { - $classes = $this->reflectionService->getParentClasses(__CLASS__); - $this->assertTrue(count($classes) == 0, "The test class ".__CLASS__." should have no parents according to static reflection."); - } - - public function testGetReflectionClass() - { - $class = $this->reflectionService->getClass(__CLASS__); - $this->assertNull($class); - } - - public function testGetMethods() - { - $this->assertTrue($this->reflectionService->hasPublicMethod(__CLASS__, "testGetMethods")); - $this->assertTrue($this->reflectionService->hasPublicMethod(__CLASS__, "testGetMethods2")); - } - - public function testGetAccessibleProperty() - { - $reflProp = $this->reflectionService->getAccessibleProperty(__CLASS__, "reflectionService"); - $this->assertNull($reflProp); - } -} - diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/SymfonyFileLocatorTest.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/SymfonyFileLocatorTest.php deleted file mode 100644 index b51162e..0000000 --- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/SymfonyFileLocatorTest.php +++ /dev/null @@ -1,88 +0,0 @@ - $prefix)); - $this->assertEquals(array($path), $locator->getPaths()); - - $locator = new SymfonyFileLocator(array($path => $prefix)); - $this->assertEquals(array($path), $locator->getPaths()); - } - - public function testGetPrefixes() - { - $path = __DIR__ . "/_files"; - $prefix = "Foo"; - - $locator = new SymfonyFileLocator(array($path => $prefix)); - $this->assertEquals(array($path => $prefix), $locator->getNamespacePrefixes()); - } - - public function testGetFileExtension() - { - $locator = new SymfonyFileLocator(array(), ".yml"); - $this->assertEquals(".yml", $locator->getFileExtension()); - $locator->setFileExtension(".xml"); - $this->assertEquals(".xml", $locator->getFileExtension()); - } - - public function testFileExists() - { - $path = __DIR__ . "/_files"; - $prefix = "Foo"; - - $locator = new SymfonyFileLocator(array($path => $prefix), ".yml"); - - $this->assertTrue($locator->fileExists("Foo\stdClass")); - $this->assertTrue($locator->fileExists("Foo\global")); - $this->assertFalse($locator->fileExists("Foo\stdClass2")); - $this->assertFalse($locator->fileExists("Foo\global2")); - } - - public function testGetAllClassNames() - { - $path = __DIR__ . "/_files"; - $prefix = "Foo"; - - $locator = new SymfonyFileLocator(array($path => $prefix), ".yml"); - $classes = $locator->getAllClassNames(null); - sort($classes); - - $this->assertEquals(array("Foo\\global", "Foo\\stdClass"), $classes); - $this->assertEquals(array("Foo\\stdClass"), $locator->getAllClassNames("global")); - } - - public function testFindMappingFile() - { - $path = __DIR__ . "/_files"; - $prefix = "Foo"; - - $locator = new SymfonyFileLocator(array($path => $prefix), ".yml"); - - $this->assertEquals(__DIR__ . "/_files/stdClass.yml", $locator->findMappingFile("Foo\\stdClass")); - } - - public function testFindMappingFileNotFound() - { - $path = __DIR__ . "/_files"; - $prefix = "Foo"; - - $locator = new SymfonyFileLocator(array($path => $prefix), ".yml"); - - $this->setExpectedException( - "Doctrine\Common\Persistence\Mapping\MappingException", - "No mapping file found named '".__DIR__."/_files/stdClass2.yml' for class 'Foo\stdClass2'." - ); - $locator->findMappingFile("Foo\\stdClass2"); - } -} diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/TestEntity.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/TestEntity.php deleted file mode 100644 index d0e9976..0000000 --- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/TestEntity.php +++ /dev/null @@ -1,3 +0,0 @@ -getFieldNames(); \ No newline at end of file diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/annotation/TestClass.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/annotation/TestClass.php deleted file mode 100644 index ff03568..0000000 --- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/annotation/TestClass.php +++ /dev/null @@ -1,17 +0,0 @@ -wrapped = $wrapped; - } -} - -class ObjectManagerDecoratorTest extends \PHPUnit_Framework_TestCase -{ - private $wrapped; - private $decorated; - - public function setUp() - { - $this->wrapped = $this->getMock('Doctrine\Common\Persistence\ObjectManager'); - $this->decorated = new NullObjectManagerDecorator($this->wrapped); - } - - public function getMethodParameters() - { - $class = new \ReflectionClass('Doctrine\Common\Persistence\ObjectManager'); - - $methods = array(); - foreach ($class->getMethods() as $method) { - if ($method->getNumberOfRequiredParameters() === 0) { - $methods[] = array($method->getName(), array()); - } elseif ($method->getNumberOfRequiredParameters() > 0) { - $methods[] = array($method->getName(), array_fill(0, $method->getNumberOfRequiredParameters(), 'req') ?: array()); - } - if ($method->getNumberOfParameters() != $method->getNumberOfRequiredParameters()) { - $methods[] = array($method->getName(), array_fill(0, $method->getNumberOfParameters(), 'all') ?: array()); - } - } - - return $methods; - } - - /** - * @dataProvider getMethodParameters - */ - public function testAllMethodCallsAreDelegatedToTheWrappedInstance($method, array $parameters) - { - $stub = $this->wrapped - ->expects($this->once()) - ->method($method) - ->will($this->returnValue('INNER VALUE FROM ' . $method)); - - call_user_func_array(array($stub, 'with'), $parameters); - - $this->assertSame('INNER VALUE FROM ' . $method, call_user_func_array(array($this->decorated, $method), $parameters)); - } -} \ No newline at end of file diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/PersistentObjectTest.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/PersistentObjectTest.php deleted file mode 100644 index 180d0f0..0000000 --- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/PersistentObjectTest.php +++ /dev/null @@ -1,247 +0,0 @@ -cm = new TestObjectMetadata; - $this->om = $this->getMock('Doctrine\Common\Persistence\ObjectManager'); - $this->om->expects($this->any())->method('getClassMetadata') - ->will($this->returnValue($this->cm)); - $this->object = new TestObject; - PersistentObject::setObjectManager($this->om); - $this->object->injectObjectManager($this->om, $this->cm); - } - - public function testGetObjectManager() - { - $this->assertSame($this->om, PersistentObject::getObjectManager()); - } - - public function testNonMatchingObjectManager() - { - $this->setExpectedException('RuntimeException'); - $om = $this->getMock('Doctrine\Common\Persistence\ObjectManager'); - $this->object->injectObjectManager($om, $this->cm); - } - - public function testGetField() - { - $this->assertEquals('beberlei', $this->object->getName()); - } - - public function testSetField() - { - $this->object->setName("test"); - $this->assertEquals("test", $this->object->getName()); - } - - public function testGetIdentifier() - { - $this->assertEquals(1, $this->object->getId()); - } - - public function testSetIdentifier() - { - $this->setExpectedException('BadMethodCallException'); - $this->object->setId(2); - } - - public function testSetUnknownField() - { - $this->setExpectedException('BadMethodCallException'); - $this->object->setUnknown("test"); - } - - public function testGetUnknownField() - { - $this->setExpectedException('BadMethodCallException'); - $this->object->getUnknown(); - } - - public function testGetToOneAssociation() - { - $this->assertNull($this->object->getParent()); - } - - public function testSetToOneAssociation() - { - $parent = new TestObject(); - $this->object->setParent($parent); - $this->assertSame($parent, $this->object->getParent($parent)); - } - - public function testSetInvalidToOneAssociation() - { - $parent = new \stdClass(); - - $this->setExpectedException('InvalidArgumentException'); - $this->object->setParent($parent); - } - - public function testSetToOneAssociationNull() - { - $parent = new TestObject(); - $this->object->setParent($parent); - $this->object->setParent(null); - $this->assertNull($this->object->getParent()); - } - - public function testAddToManyAssociation() - { - $child = new TestObject(); - $this->object->addChildren($child); - - $this->assertSame($this->object, $child->getParent()); - $this->assertEquals(1, count($this->object->getChildren())); - - $child = new TestObject(); - $this->object->addChildren($child); - - $this->assertEquals(2, count($this->object->getChildren())); - } - - public function testAddInvalidToManyAssociation() - { - $this->setExpectedException('InvalidArgumentException'); - $this->object->addChildren(new \stdClass()); - } - - public function testNoObjectManagerSet() - { - PersistentObject::setObjectManager(null); - $child = new TestObject(); - - $this->setExpectedException('RuntimeException'); - $child->setName("test"); - } - - public function testInvalidMethod() - { - $this->setExpectedException('BadMethodCallException'); - $this->object->asdf(); - } - - public function testAddInvalidCollection() - { - $this->setExpectedException('BadMethodCallException'); - $this->object->addAsdf(new \stdClass()); - } -} - -class TestObject extends PersistentObject -{ - protected $id = 1; - protected $name = 'beberlei'; - protected $parent; - protected $children; -} - -class TestObjectMetadata implements ClassMetadata -{ - - public function getAssociationMappedByTargetField($assocName) - { - $assoc = array('children' => 'parent'); - return $assoc[$assocName]; - } - - public function getAssociationNames() - { - return array('parent', 'children'); - } - - public function getAssociationTargetClass($assocName) - { - return __NAMESPACE__ . '\TestObject'; - } - - public function getFieldNames() - { - return array('id', 'name'); - } - - public function getIdentifier() - { - return array('id'); - } - - public function getName() - { - return __NAMESPACE__ . '\TestObject'; - } - - public function getReflectionClass() - { - return new \ReflectionClass($this->getName()); - } - - public function getTypeOfField($fieldName) - { - $types = array('id' => 'integer', 'name' => 'string'); - return $types[$fieldName]; - } - - public function hasAssociation($fieldName) - { - return in_array($fieldName, array('parent', 'children')); - } - - public function hasField($fieldName) - { - return in_array($fieldName, array('id', 'name')); - } - - public function isAssociationInverseSide($assocName) - { - return ($assocName === 'children'); - } - - public function isCollectionValuedAssociation($fieldName) - { - return ($fieldName === 'children'); - } - - public function isIdentifier($fieldName) - { - return $fieldName === 'id'; - } - - public function isSingleValuedAssociation($fieldName) - { - return $fieldName === 'parent'; - } - - public function getIdentifierValues($entity) - { - - } - - public function getIdentifierFieldNames() - { - - } - - public function initializeReflection(ReflectionService $reflService) - { - - } - - public function wakeupReflection(ReflectionService $reflService) - { - - } -} diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/AbstractProxyFactoryTest.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/AbstractProxyFactoryTest.php deleted file mode 100644 index 6ae9316..0000000 --- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/AbstractProxyFactoryTest.php +++ /dev/null @@ -1,146 +0,0 @@ -getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata'); - $proxyGenerator = $this->getMock('Doctrine\Common\Proxy\ProxyGenerator', array(), array(), '', false); - - $proxyGenerator - ->expects($this->once()) - ->method('getProxyFileName'); - $proxyGenerator - ->expects($this->once()) - ->method('generateProxyClass'); - - $metadataFactory = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadataFactory'); - $proxyFactory = $this->getMockForAbstractClass( - 'Doctrine\Common\Proxy\AbstractProxyFactory', - array($proxyGenerator, $metadataFactory, true) - ); - - $proxyFactory - ->expects($this->any()) - ->method('skipClass') - ->will($this->returnValue(false)); - - $generated = $proxyFactory->generateProxyClasses(array($metadata), sys_get_temp_dir()); - - $this->assertEquals(1, $generated, 'One proxy was generated'); - } - - public function testGetProxy() - { - $metadata = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata'); - $proxy = $this->getMock('Doctrine\Common\Proxy\Proxy'); - $definition = new ProxyDefinition(get_class($proxy), array(), array(), null, null); - $proxyGenerator = $this->getMock('Doctrine\Common\Proxy\ProxyGenerator', array(), array(), '', false); - $metadataFactory = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadataFactory'); - - $metadataFactory - ->expects($this->once()) - ->method('getMetadataFor') - ->will($this->returnValue($metadata)); - - $proxyFactory = $this->getMockForAbstractClass( - 'Doctrine\Common\Proxy\AbstractProxyFactory', - array($proxyGenerator, $metadataFactory, true) - ); - - $proxyFactory - ->expects($this->any()) - ->method('createProxyDefinition') - ->will($this->returnValue($definition)); - - $generatedProxy = $proxyFactory->getProxy('Class', array('id' => 1)); - - $this->assertInstanceOf(get_class($proxy), $generatedProxy); - } - - public function testResetUnitializedProxy() - { - $metadata = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata'); - $proxy = $this->getMock('Doctrine\Common\Proxy\Proxy'); - $definition = new ProxyDefinition(get_class($proxy), array(), array(), null, null); - $proxyGenerator = $this->getMock('Doctrine\Common\Proxy\ProxyGenerator', array(), array(), '', false); - $metadataFactory = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadataFactory'); - - $metadataFactory - ->expects($this->once()) - ->method('getMetadataFor') - ->will($this->returnValue($metadata)); - - $proxyFactory = $this->getMockForAbstractClass( - 'Doctrine\Common\Proxy\AbstractProxyFactory', - array($proxyGenerator, $metadataFactory, true) - ); - - $proxyFactory - ->expects($this->any()) - ->method('createProxyDefinition') - ->will($this->returnValue($definition)); - - $proxy - ->expects($this->once()) - ->method('__isInitialized') - ->will($this->returnValue(false)); - $proxy - ->expects($this->once()) - ->method('__setInitializer'); - $proxy - ->expects($this->once()) - ->method('__setCloner'); - - $proxyFactory->resetUninitializedProxy($proxy); - } - - public function testDisallowsResettingInitializedProxy() - { - $proxyFactory = $this->getMockForAbstractClass('Doctrine\Common\Proxy\AbstractProxyFactory', array(), '', false); - $proxy = $this->getMock('Doctrine\Common\Proxy\Proxy'); - - $proxy - ->expects($this->any()) - ->method('__isInitialized') - ->will($this->returnValue(true)); - - $this->setExpectedException('Doctrine\Common\Proxy\Exception\InvalidArgumentException'); - - $proxyFactory->resetUninitializedProxy($proxy); - } - - public function testMissingPrimaryKeyValue() - { - $metadata = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata'); - $proxy = $this->getMock('Doctrine\Common\Proxy\Proxy'); - $definition = new ProxyDefinition(get_class($proxy), array('missingKey'), array(), null, null); - $proxyGenerator = $this->getMock('Doctrine\Common\Proxy\ProxyGenerator', array(), array(), '', false); - $metadataFactory = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadataFactory'); - - $metadataFactory - ->expects($this->once()) - ->method('getMetadataFor') - ->will($this->returnValue($metadata)); - - $proxyFactory = $this->getMockForAbstractClass( - 'Doctrine\Common\Proxy\AbstractProxyFactory', - array($proxyGenerator, $metadataFactory, true) - ); - - $proxyFactory - ->expects($this->any()) - ->method('createProxyDefinition') - ->will($this->returnValue($definition)); - - $this->setExpectedException('\OutOfBoundsException'); - - $generatedProxy = $proxyFactory->getProxy('Class', array()); - } -} - diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/AutoloaderTest.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/AutoloaderTest.php deleted file mode 100644 index be713fc..0000000 --- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/AutoloaderTest.php +++ /dev/null @@ -1,72 +0,0 @@ -. - */ - -namespace Doctrine\Tests\Common\Proxy; - -use PHPUnit_Framework_TestCase; -use Doctrine\Common\Proxy\Autoloader; - -/** - * @group DDC-1698 - */ -class AutoloaderTest extends PHPUnit_Framework_TestCase -{ - public static function dataResolveFile() - { - return array( - array('/tmp', 'MyProxy', 'MyProxy\__CG__\RealClass', '/tmp' . DIRECTORY_SEPARATOR . '__CG__RealClass.php'), - array('/tmp', 'MyProxy\Subdir', 'MyProxy\Subdir\__CG__\RealClass', '/tmp' . DIRECTORY_SEPARATOR . '__CG__RealClass.php'), - array('/tmp', 'MyProxy', 'MyProxy\__CG__\Other\RealClass', '/tmp' . DIRECTORY_SEPARATOR . '__CG__OtherRealClass.php'), - ); - } - - /** - * @dataProvider dataResolveFile - */ - public function testResolveFile($proxyDir, $proxyNamespace, $className, $expectedProxyFile) - { - $actualProxyFile = Autoloader::resolveFile($proxyDir, $proxyNamespace, $className); - $this->assertEquals($expectedProxyFile, $actualProxyFile); - } - - public function testAutoload() - { - if (file_exists(sys_get_temp_dir() ."/AutoloaderTestClass.php")) { - unlink(sys_get_temp_dir() ."/AutoloaderTestClass.php"); - } - - $autoloader = Autoloader::register(sys_get_temp_dir(), 'ProxyAutoloaderTest', function($proxyDir, $proxyNamespace, $className) { - file_put_contents(sys_get_temp_dir() . "/AutoloaderTestClass.php", "assertTrue(class_exists('ProxyAutoloaderTest\AutoloaderTestClass', true)); - unlink(sys_get_temp_dir() ."/AutoloaderTestClass.php"); - } - - public function testRegisterWithInvalidCallback() - { - $this->setExpectedException( - 'Doctrine\Common\Proxy\Exception\InvalidArgumentException', - 'Invalid \$notFoundCallback given: must be a callable, "stdClass" given' - ); - - Autoloader::register('', '', new \stdClass()); - } -} - diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/CallableTypeHintClass.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/CallableTypeHintClass.php deleted file mode 100644 index f5fccb0..0000000 --- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/CallableTypeHintClass.php +++ /dev/null @@ -1,16 +0,0 @@ -. - */ - -namespace Doctrine\Tests\Common\Proxy; - -/** - * Test asset representing a lazy loadable object - * - * @author Marco Pivetta - * @since 2.4 - */ -class LazyLoadableObject -{ - /** - * @var string - */ - public $publicIdentifierField; - - /** - * @var string - */ - protected $protectedIdentifierField; - - /** - * @var string - */ - public $publicTransientField = 'publicTransientFieldValue'; - - /** - * @var string - */ - protected $protectedTransientField = 'protectedTransientFieldValue'; - - /** - * @var string - */ - public $publicPersistentField = 'publicPersistentFieldValue'; - - /** - * @var string - */ - protected $protectedPersistentField = 'protectedPersistentFieldValue'; - - /** - * @var string - */ - public $publicAssociation = 'publicAssociationValue'; - - /** - * @var string - */ - protected $protectedAssociation = 'protectedAssociationValue'; - - /** - * @return string - */ - public function getProtectedIdentifierField() - { - return $this->protectedIdentifierField; - } - - /** - * @return string - */ - public function testInitializationTriggeringMethod() - { - return 'testInitializationTriggeringMethod'; - } - - /** - * @return string - */ - public function getProtectedAssociation() - { - return $this->protectedAssociation; - } - - /** - * @param \stdClass $param - */ - public function publicTypeHintedMethod(\stdClass $param) - { - } - - /** - * - */ - public function &byRefMethod() - { - } - - /** - * @param mixed $thisIsNotByRef - * @param &mixed $thisIsByRef - */ - public function byRefParamMethod($thisIsNotByRef, &$thisIsByRef) - { - } -} diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/LazyLoadableObjectClassMetadata.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/LazyLoadableObjectClassMetadata.php deleted file mode 100644 index 167386e..0000000 --- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/LazyLoadableObjectClassMetadata.php +++ /dev/null @@ -1,195 +0,0 @@ -. - */ - -namespace Doctrine\Tests\Common\Proxy; - -use ReflectionClass; -use Doctrine\Common\Persistence\Mapping\ClassMetadata; - -/** - * Class metadata test asset for @see LazyLoadableObject - * - * @author Marco Pivetta - * @since 2.4 - */ -class LazyLoadableObjectClassMetadata implements ClassMetadata -{ - /** - * @var ReflectionClass - */ - protected $reflectionClass; - - /** - * @var array - */ - protected $identifier = array( - 'publicIdentifierField' => true, - 'protectedIdentifierField' => true, - ); - - /** - * @var array - */ - protected $fields = array( - 'publicIdentifierField' => true, - 'protectedIdentifierField' => true, - 'publicPersistentField' => true, - 'protectedPersistentField' => true, - ); - - /** - * @var array - */ - protected $associations = array( - 'publicAssociation' => true, - 'protectedAssociation' => true, - ); - - /** - * {@inheritDoc} - */ - public function getName() - { - return $this->getReflectionClass()->getName(); - } - - /** - * {@inheritDoc} - */ - public function getIdentifier() - { - return array_keys($this->identifier); - } - - /** - * {@inheritDoc} - */ - public function getReflectionClass() - { - if (null === $this->reflectionClass) { - $this->reflectionClass = new \ReflectionClass(__NAMESPACE__ . '\LazyLoadableObject'); - } - - return $this->reflectionClass; - } - - /** - * {@inheritDoc} - */ - public function isIdentifier($fieldName) - { - return isset($this->identifier[$fieldName]); - } - - /** - * {@inheritDoc} - */ - public function hasField($fieldName) - { - return isset($this->fields[$fieldName]); - } - - /** - * {@inheritDoc} - */ - public function hasAssociation($fieldName) - { - return isset($this->associations[$fieldName]); - } - - /** - * {@inheritDoc} - */ - public function isSingleValuedAssociation($fieldName) - { - throw new \BadMethodCallException('not implemented'); - } - - /** - * {@inheritDoc} - */ - public function isCollectionValuedAssociation($fieldName) - { - throw new \BadMethodCallException('not implemented'); - } - - /** - * {@inheritDoc} - */ - public function getFieldNames() - { - return array_keys($this->fields); - } - - /** - * {@inheritDoc} - */ - public function getIdentifierFieldNames() - { - return $this->getIdentifier(); - } - - /** - * {@inheritDoc} - */ - public function getAssociationNames() - { - return array_keys($this->associations); - } - - /** - * {@inheritDoc} - */ - public function getTypeOfField($fieldName) - { - return 'string'; - } - - /** - * {@inheritDoc} - */ - public function getAssociationTargetClass($assocName) - { - throw new \BadMethodCallException('not implemented'); - } - - /** - * {@inheritDoc} - */ - public function isAssociationInverseSide($assocName) - { - throw new \BadMethodCallException('not implemented'); - } - - /** - * {@inheritDoc} - */ - public function getAssociationMappedByTargetField($assocName) - { - throw new \BadMethodCallException('not implemented'); - } - - /** - * {@inheritDoc} - */ - public function getIdentifierValues($object) - { - throw new \BadMethodCallException('not implemented'); - } -} diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/MagicCloneClass.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/MagicCloneClass.php deleted file mode 100644 index 33b983d..0000000 --- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/MagicCloneClass.php +++ /dev/null @@ -1,37 +0,0 @@ -clonedValue = 'newClonedValue'; - } -} diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/MagicGetByRefClass.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/MagicGetByRefClass.php deleted file mode 100644 index 6adf1f5..0000000 --- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/MagicGetByRefClass.php +++ /dev/null @@ -1,51 +0,0 @@ -. - */ - -namespace Doctrine\Tests\Common\Proxy; - -use InvalidArgumentException; - -/** - * Test asset class - * - * @since 2.4 - */ -class MagicGetByRefClass -{ - /** - * @var mixed - */ - public $valueField; - - /** - * @param string $name - * - * @return mixed - * - * @throws \InvalidArgumentException - */ - public function & __get($name) - { - if ($name === 'value') { - return $this->valueField; - } - - throw new InvalidArgumentException(); - } -} diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/MagicGetClass.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/MagicGetClass.php deleted file mode 100644 index 0cab36a..0000000 --- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/MagicGetClass.php +++ /dev/null @@ -1,38 +0,0 @@ -testAttribute = $value; - } - - if ($name === 'publicField' || $name === 'id') { - throw new \BadMethodCallException('Should never be called for "publicField" or "id"'); - } - - $this->testAttribute = $value; - } -} diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/MagicSleepClass.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/MagicSleepClass.php deleted file mode 100644 index 3934a05..0000000 --- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/MagicSleepClass.php +++ /dev/null @@ -1,37 +0,0 @@ -wakeupValue = 'newWakeupValue'; - } -} diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/ProxyClassGeneratorTest.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/ProxyClassGeneratorTest.php deleted file mode 100644 index 45d45e5..0000000 --- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/ProxyClassGeneratorTest.php +++ /dev/null @@ -1,228 +0,0 @@ -. - */ - - -namespace Doctrine\Tests\Common\Proxy; - -use Doctrine\Common\Proxy\ProxyGenerator; -use ReflectionClass; -use ReflectionMethod; -use PHPUnit_Framework_TestCase; - -/** - * Test the proxy generator. Its work is generating on-the-fly subclasses of a given model, which implement the Proxy - * pattern. - * - * @author Giorgio Sironi - * @author Marco Pivetta - */ -class ProxyClassGeneratorTest extends PHPUnit_Framework_TestCase -{ - /** - * @var string - */ - protected $proxyClass = 'Doctrine\Tests\Common\ProxyProxy\__CG__\Doctrine\Tests\Common\Proxy\LazyLoadableObject'; - - /** - * @var LazyLoadableObjectClassMetadata - */ - protected $metadata; - - /** - * @var ProxyGenerator - */ - protected $proxyGenerator; - - /** - * {@inheritDoc} - */ - protected function setUp() - { - $this->metadata = new LazyLoadableObjectClassMetadata(); - $this->proxyGenerator = new ProxyGenerator(__DIR__ . '/generated', __NAMESPACE__ . 'Proxy', true); - - if (class_exists($this->proxyClass, false)) { - return; - } - - $this->generateAndRequire($this->proxyGenerator, $this->metadata); - } - - public function testReferenceProxyRespectsMethodsParametersTypeHinting() - { - $method = new ReflectionMethod($this->proxyClass, 'publicTypeHintedMethod'); - $params = $method->getParameters(); - - $this->assertEquals(1, count($params)); - $this->assertEquals('stdClass', $params[0]->getClass()->getName()); - } - - public function testProxyRespectsMethodsWhichReturnValuesByReference() - { - $method = new ReflectionMethod($this->proxyClass, 'byRefMethod'); - - $this->assertTrue($method->returnsReference()); - } - - public function testProxyRespectsByRefMethodParameters() - { - $method = new ReflectionMethod($this->proxyClass, 'byRefParamMethod'); - $parameters = $method->getParameters(); - $this->assertSame('thisIsNotByRef', $parameters[0]->getName()); - $this->assertFalse($parameters[0]->isPassedByReference()); - $this->assertSame('thisIsByRef', $parameters[1]->getName()); - $this->assertTrue($parameters[1]->isPassedByReference()); - } - - public function testCreatesAssociationProxyAsSubclassOfTheOriginalOne() - { - $this->assertTrue(is_subclass_of($this->proxyClass, $this->metadata->getName())); - } - - public function testNonNamespacedProxyGeneration() - { - $classCode = file_get_contents($this->proxyGenerator->getProxyFileName($this->metadata->getName())); - - $this->assertNotContains("class LazyLoadableObject extends \\\\" . $this->metadata->getName(), $classCode); - $this->assertContains("class LazyLoadableObject extends \\" . $this->metadata->getName(), $classCode); - } - - public function testClassWithSleepProxyGeneration() - { - if (!class_exists('Doctrine\Tests\Common\ProxyProxy\__CG__\SleepClass', false)) { - $className = 'Doctrine\Tests\Common\Proxy\SleepClass'; - $metadata = $this->createClassMetadata($className, array('id')); - $proxyGenerator = new ProxyGenerator(__DIR__ . '/generated', __NAMESPACE__ . 'Proxy', true); - - $this->generateAndRequire($proxyGenerator, $metadata); - } - - $classCode = file_get_contents(__DIR__ . '/generated/__CG__DoctrineTestsCommonProxySleepClass.php'); - $this->assertEquals(1, substr_count($classCode, 'function __sleep')); - $this->assertEquals(1, substr_count($classCode, 'parent::__sleep()')); - } - - /** - * Check that the proxy doesn't serialize static properties (in __sleep() method) - * @group DCOM-212 - */ - public function testClassWithStaticPropertyProxyGeneration() - { - if (!class_exists('Doctrine\Tests\Common\ProxyProxy\__CG__\StaticPropertyClass', false)) { - $className = 'Doctrine\Tests\Common\Proxy\StaticPropertyClass'; - $metadata = $this->createClassMetadata($className, array()); - $proxyGenerator = new ProxyGenerator(__DIR__ . '/generated', __NAMESPACE__ . 'Proxy', true); - - $this->generateAndRequire($proxyGenerator, $metadata); - } - - $classCode = file_get_contents(__DIR__ . '/generated/__CG__DoctrineTestsCommonProxyStaticPropertyClass.php'); - $this->assertEquals(1, substr_count($classCode, 'function __sleep')); - $this->assertNotContains('protectedStaticProperty', $classCode); - } - - private function generateAndRequire($proxyGenerator, $metadata) - { - $proxyGenerator->generateProxyClass($metadata, $proxyGenerator->getProxyFileName($metadata->getName())); - - require_once $proxyGenerator->getProxyFileName($metadata->getName()); - } - - public function testClassWithCallableTypeHintOnProxiedMethod() - { - if (PHP_VERSION_ID < 50400) { - $this->markTestSkipped('`callable` is only supported in PHP >=5.4.0'); - } - - if (!class_exists('Doctrine\Tests\Common\ProxyProxy\__CG__\CallableTypeHintClass', false)) { - $className = 'Doctrine\Tests\Common\Proxy\CallableTypeHintClass'; - $metadata = $this->createClassMetadata($className, array('id')); - - $proxyGenerator = new ProxyGenerator(__DIR__ . '/generated', __NAMESPACE__ . 'Proxy', true); - $this->generateAndRequire($proxyGenerator, $metadata); - } - - $classCode = file_get_contents(__DIR__ . '/generated/__CG__DoctrineTestsCommonProxyCallableTypeHintClass.php'); - - $this->assertEquals(1, substr_count($classCode, 'call(callable $foo)')); - } - - public function testClassWithInvalidTypeHintOnProxiedMethod() - { - $className = 'Doctrine\Tests\Common\Proxy\InvalidTypeHintClass'; - $metadata = $this->createClassMetadata($className, array('id')); - $proxyGenerator = new ProxyGenerator(__DIR__ . '/generated', __NAMESPACE__ . 'Proxy', true); - - $this->setExpectedException( - 'Doctrine\Common\Proxy\Exception\UnexpectedValueException', - 'The type hint of parameter "foo" in method "invalidTypeHintMethod"' - .' in class "' . $className . '" is invalid.' - ); - $proxyGenerator->generateProxyClass($metadata); - } - - public function testNoConfigDirThrowsException() - { - $this->setExpectedException('Doctrine\Common\Proxy\Exception\InvalidArgumentException'); - new ProxyGenerator(null, null); - } - - public function testNoNamespaceThrowsException() - { - $this->setExpectedException('Doctrine\Common\Proxy\Exception\InvalidArgumentException'); - new ProxyGenerator(__DIR__ . '/generated', null); - } - - public function testInvalidPlaceholderThrowsException() - { - $this->setExpectedException('Doctrine\Common\Proxy\Exception\InvalidArgumentException'); - $generator = new ProxyGenerator(__DIR__ . '/generated', 'SomeNamespace'); - $generator->setPlaceholder('', array()); - } - - public function testUseEvalIfNoFilenameIsGiven() - { - $proxyGenerator = new ProxyGenerator(__DIR__ . '/generated', __NAMESPACE__ . 'Proxy', true); - - $className = __NAMESPACE__ . '\\EvalBase'; - - $metadata = $this->createClassMetadata($className, array('id')); - - $proxyGenerator->generateProxyClass($metadata); - - $reflClass = new ReflectionClass('Doctrine\Tests\Common\ProxyProxy\__CG__\Doctrine\Tests\Common\Proxy\EvalBase'); - - $this->assertContains("eval()'d code", $reflClass->getFileName()); - } - - private function createClassMetadata($className, array $ids) - { - $metadata = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata'); - $reflClass = new ReflectionClass($className); - $metadata->expects($this->any())->method('getReflectionClass')->will($this->returnValue($reflClass)); - $metadata->expects($this->any())->method('getIdentifierFieldNames')->will($this->returnValue($ids)); - $metadata->expects($this->any())->method('getName')->will($this->returnValue($className)); - - return $metadata; - } -} - -class EvalBase -{ -} diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/ProxyLogicTest.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/ProxyLogicTest.php deleted file mode 100644 index 9a5173c..0000000 --- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/ProxyLogicTest.php +++ /dev/null @@ -1,696 +0,0 @@ -. - */ - -namespace Doctrine\Tests\Common\Proxy; - -use Doctrine\Common\Proxy\ProxyGenerator; -use Doctrine\Common\Proxy\Proxy; -use Doctrine\Common\Proxy\Exception\UnexpectedValueException; -use Doctrine\Common\Persistence\Mapping\ClassMetadata; -use PHPUnit_Framework_TestCase; - -/** - * Test the generated proxies behavior. These tests make assumptions about the structure of LazyLoadableObject - * - * @author Marco Pivetta - */ -class ProxyLogicTest extends PHPUnit_Framework_TestCase -{ - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - protected $proxyLoader; - - /** - * @var ClassMetadata - */ - protected $lazyLoadableObjectMetadata; - - /** - * @var LazyLoadableObject|Proxy - */ - protected $lazyObject; - - protected $identifier = array( - 'publicIdentifierField' => 'publicIdentifierFieldValue', - 'protectedIdentifierField' => 'protectedIdentifierFieldValue', - ); - - /** - * @var \PHPUnit_Framework_MockObject_MockObject|Callable - */ - protected $initializerCallbackMock; - - /** - * {@inheritDoc} - */ - public function setUp() - { - $this->proxyLoader = $loader = $this->getMock('stdClass', array('load'), array(), '', false); - $this->initializerCallbackMock = $this->getMock('stdClass', array('__invoke')); - $identifier = $this->identifier; - $this->lazyLoadableObjectMetadata = $metadata = new LazyLoadableObjectClassMetadata(); - - // emulating what should happen in a proxy factory - $cloner = function (LazyLoadableObject $proxy) use ($loader, $identifier, $metadata) { - /* @var $proxy LazyLoadableObject|Proxy */ - if ($proxy->__isInitialized()) { - return; - } - - $proxy->__setInitialized(true); - $proxy->__setInitializer(null); - $original = $loader->load($identifier); - - if (null === $original) { - throw new UnexpectedValueException(); - } - - foreach ($metadata->getReflectionClass()->getProperties() as $reflProperty) { - $propertyName = $reflProperty->getName(); - - if ($metadata->hasField($propertyName) || $metadata->hasAssociation($propertyName)) { - $reflProperty->setAccessible(true); - $reflProperty->setValue($proxy, $reflProperty->getValue($original)); - } - } - }; - - $proxyClassName = 'Doctrine\Tests\Common\ProxyProxy\__CG__\Doctrine\Tests\Common\Proxy\LazyLoadableObject'; - - // creating the proxy class - if (!class_exists($proxyClassName, false)) { - $proxyGenerator = new ProxyGenerator(__DIR__ . '/generated', __NAMESPACE__ . 'Proxy', true); - $proxyGenerator->generateProxyClass($metadata); - require_once $proxyGenerator->getProxyFileName($metadata->getName()); - } - - $this->lazyObject = new $proxyClassName($this->getClosure($this->initializerCallbackMock), $cloner); - - // setting identifiers in the proxy via reflection - foreach ($metadata->getIdentifierFieldNames() as $idField) { - $prop = $metadata->getReflectionClass()->getProperty($idField); - $prop->setAccessible(true); - $prop->setValue($this->lazyObject, $identifier[$idField]); - } - - $this->assertFalse($this->lazyObject->__isInitialized()); - } - - public function testFetchingPublicIdentifierDoesNotCauseLazyLoading() - { - $this->configureInitializerMock(0); - - $this->assertSame('publicIdentifierFieldValue', $this->lazyObject->publicIdentifierField); - } - - public function testFetchingIdentifiersViaPublicGetterDoesNotCauseLazyLoading() - { - $this->configureInitializerMock(0); - - $this->assertSame('protectedIdentifierFieldValue', $this->lazyObject->getProtectedIdentifierField()); - } - - public function testCallingMethodCausesLazyLoading() - { - $this->configureInitializerMock( - 1, - array($this->lazyObject, 'testInitializationTriggeringMethod', array()), - function (Proxy $proxy) { - $proxy->__setInitializer(null); - } - ); - - $this->lazyObject->testInitializationTriggeringMethod(); - $this->lazyObject->testInitializationTriggeringMethod(); - } - - public function testFetchingPublicFieldsCausesLazyLoading() - { - $test = $this; - $this->configureInitializerMock( - 1, - array($this->lazyObject, '__get', array('publicPersistentField')), - function () use ($test) { - $test->setProxyValue('publicPersistentField', 'loadedValue'); - } - ); - - $this->assertSame('loadedValue', $this->lazyObject->publicPersistentField); - $this->assertSame('loadedValue', $this->lazyObject->publicPersistentField); - } - - public function testFetchingPublicAssociationCausesLazyLoading() - { - $test = $this; - $this->configureInitializerMock( - 1, - array($this->lazyObject, '__get', array('publicAssociation')), - function () use ($test) { - $test->setProxyValue('publicAssociation', 'loadedAssociation'); - } - ); - - $this->assertSame('loadedAssociation', $this->lazyObject->publicAssociation); - $this->assertSame('loadedAssociation', $this->lazyObject->publicAssociation); - } - - public function testFetchingProtectedAssociationViaPublicGetterCausesLazyLoading() - { - $this->configureInitializerMock( - 1, - array($this->lazyObject, 'getProtectedAssociation', array()), - function (Proxy $proxy) { - $proxy->__setInitializer(null); - } - ); - - $this->assertSame('protectedAssociationValue', $this->lazyObject->getProtectedAssociation()); - $this->assertSame('protectedAssociationValue', $this->lazyObject->getProtectedAssociation()); - } - - public function testLazyLoadingTriggeredOnlyAtFirstPublicPropertyRead() - { - $test = $this; - $this->configureInitializerMock( - 1, - array($this->lazyObject, '__get', array('publicPersistentField')), - function () use ($test) { - $test->setProxyValue('publicPersistentField', 'loadedValue'); - $test->setProxyValue('publicAssociation', 'publicAssociationValue'); - } - ); - - $this->assertSame('loadedValue', $this->lazyObject->publicPersistentField); - $this->assertSame('publicAssociationValue', $this->lazyObject->publicAssociation); - } - - public function testNoticeWhenReadingNonExistentPublicProperties() - { - $this->configureInitializerMock(0); - - $class = get_class($this->lazyObject); - $this->setExpectedException( - 'PHPUnit_Framework_Error_Notice', - 'Undefined property: ' . $class . '::$non_existing_property' - ); - - $this->lazyObject->non_existing_property; - } - - public function testFalseWhenCheckingNonExistentProperty() - { - $this->configureInitializerMock(0); - - $this->assertFalse(isset($this->lazyObject->non_existing_property)); - } - - public function testNoErrorWhenSettingNonExistentProperty() - { - $this->configureInitializerMock(0); - - $this->lazyObject->non_existing_property = 'now has a value'; - $this->assertSame('now has a value', $this->lazyObject->non_existing_property); - } - - public function testCloningCallsClonerWithClonedObject() - { - $lazyObject = $this->lazyObject; - $test = $this; - $cb = $this->getMock('stdClass', array('cb')); - $cb - ->expects($this->once()) - ->method('cb') - ->will($this->returnCallback(function (LazyLoadableObject $proxy) use ($lazyObject, $test) { - /* @var $proxy LazyLoadableObject|Proxy */ - $test->assertNotSame($proxy, $lazyObject); - $proxy->__setInitializer(null); - $proxy->publicAssociation = 'clonedAssociation'; - })); - - $this->lazyObject->__setCloner($this->getClosure(array($cb, 'cb'))); - - $cloned = clone $this->lazyObject; - $this->assertSame('clonedAssociation', $cloned->publicAssociation); - $this->assertNotSame($cloned, $lazyObject, 'a clone of the lazy object is retrieved'); - } - - public function testFetchingTransientPropertiesWillNotTriggerLazyLoading() - { - $this->configureInitializerMock(0); - - $this->assertSame( - 'publicTransientFieldValue', - $this->lazyObject->publicTransientField, - 'fetching public transient field won\'t trigger lazy loading' - ); - $property = $this - ->lazyLoadableObjectMetadata - ->getReflectionClass() - ->getProperty('protectedTransientField'); - $property->setAccessible(true); - $this->assertSame( - 'protectedTransientFieldValue', - $property->getValue($this->lazyObject), - 'fetching protected transient field via reflection won\'t trigger lazy loading' - ); - } - - /** - * Provided to guarantee backwards compatibility - */ - public function testLoadProxyMethod() - { - $this->configureInitializerMock(2, array($this->lazyObject, '__load', array())); - - $this->lazyObject->__load(); - $this->lazyObject->__load(); - } - - public function testLoadingWithPersisterWillBeTriggeredOnlyOnce() - { - $this - ->proxyLoader - ->expects($this->once()) - ->method('load') - ->with( - array( - 'publicIdentifierField' => 'publicIdentifierFieldValue', - 'protectedIdentifierField' => 'protectedIdentifierFieldValue', - ), - $this->lazyObject - ) - ->will($this->returnCallback(function ($id, LazyLoadableObject $lazyObject) { - // setting a value to verify that the persister can actually set something in the object - $lazyObject->publicAssociation = $id['publicIdentifierField'] . '-test'; - return true; - })); - $this->lazyObject->__setInitializer($this->getSuggestedInitializerImplementation()); - - $this->lazyObject->__load(); - $this->lazyObject->__load(); - $this->assertSame('publicIdentifierFieldValue-test', $this->lazyObject->publicAssociation); - } - - public function testFailedLoadingWillThrowException() - { - $this->proxyLoader->expects($this->any())->method('load')->will($this->returnValue(null)); - $this->setExpectedException('UnexpectedValueException'); - $this->lazyObject->__setInitializer($this->getSuggestedInitializerImplementation()); - - $this->lazyObject->__load(); - } - - public function testCloningWithPersister() - { - $this->lazyObject->publicTransientField = 'should-not-change'; - $this - ->proxyLoader - ->expects($this->exactly(2)) - ->method('load') - ->with(array( - 'publicIdentifierField' => 'publicIdentifierFieldValue', - 'protectedIdentifierField' => 'protectedIdentifierFieldValue', - )) - ->will($this->returnCallback(function () { - $blueprint = new LazyLoadableObject(); - $blueprint->publicPersistentField = 'checked-persistent-field'; - $blueprint->publicAssociation = 'checked-association-field'; - $blueprint->publicTransientField = 'checked-transient-field'; - - return $blueprint; - })); - - $firstClone = clone $this->lazyObject; - $this->assertSame( - 'checked-persistent-field', - $firstClone->publicPersistentField, - 'Persistent fields are cloned correctly' - ); - $this->assertSame( - 'checked-association-field', - $firstClone->publicAssociation, - 'Associations are cloned correctly' - ); - $this->assertSame( - 'should-not-change', - $firstClone->publicTransientField, - 'Transient fields are not overwritten' - ); - - $secondClone = clone $this->lazyObject; - $this->assertSame( - 'checked-persistent-field', - $secondClone->publicPersistentField, - 'Persistent fields are cloned correctly' - ); - $this->assertSame( - 'checked-association-field', - $secondClone->publicAssociation, - 'Associations are cloned correctly' - ); - $this->assertSame( - 'should-not-change', - $secondClone->publicTransientField, - 'Transient fields are not overwritten' - ); - - // those should not trigger lazy loading - $firstClone->__load(); - $secondClone->__load(); - } - - public function testNotInitializedProxyUnserialization() - { - $this->configureInitializerMock(); - - $serialized = serialize($this->lazyObject); - /* @var $unserialized LazyLoadableObject|Proxy */ - $unserialized = unserialize($serialized); - $reflClass = $this->lazyLoadableObjectMetadata->getReflectionClass(); - - $this->assertFalse($unserialized->__isInitialized(), 'serialization didn\'t cause intialization'); - - // Checking identifiers - $this->assertSame('publicIdentifierFieldValue', $unserialized->publicIdentifierField, 'identifiers are kept'); - $protectedIdentifierField = $reflClass->getProperty('protectedIdentifierField'); - $protectedIdentifierField->setAccessible(true); - $this->assertSame( - 'protectedIdentifierFieldValue', - $protectedIdentifierField->getValue($unserialized), - 'identifiers are kept' - ); - - // Checking transient fields - $this->assertSame( - 'publicTransientFieldValue', - $unserialized->publicTransientField, - 'transient fields are kept' - ); - $protectedTransientField = $reflClass->getProperty('protectedTransientField'); - $protectedTransientField->setAccessible(true); - $this->assertSame( - 'protectedTransientFieldValue', - $protectedTransientField->getValue($unserialized), - 'transient fields are kept' - ); - - // Checking persistent fields - $this->assertSame( - 'publicPersistentFieldValue', - $unserialized->publicPersistentField, - 'persistent fields are kept' - ); - $protectedPersistentField = $reflClass->getProperty('protectedPersistentField'); - $protectedPersistentField->setAccessible(true); - $this->assertSame( - 'protectedPersistentFieldValue', - $protectedPersistentField->getValue($unserialized), - 'persistent fields are kept' - ); - - // Checking associations - $this->assertSame('publicAssociationValue', $unserialized->publicAssociation, 'associations are kept'); - $protectedAssociationField = $reflClass->getProperty('protectedAssociation'); - $protectedAssociationField->setAccessible(true); - $this->assertSame( - 'protectedAssociationValue', - $protectedAssociationField->getValue($unserialized), - 'associations are kept' - ); - } - - public function testInitializedProxyUnserialization() - { - // persister will retrieve the lazy object itself, so that we don't have to re-define all field values - $this->proxyLoader->expects($this->once())->method('load')->will($this->returnValue($this->lazyObject)); - $this->lazyObject->__setInitializer($this->getSuggestedInitializerImplementation()); - $this->lazyObject->__load(); - - $serialized = serialize($this->lazyObject); - $reflClass = $this->lazyLoadableObjectMetadata->getReflectionClass(); - /* @var $unserialized LazyLoadableObject|Proxy */ - $unserialized = unserialize($serialized); - - $this->assertTrue($unserialized->__isInitialized(), 'serialization didn\'t cause intialization'); - - // Checking transient fields - $this->assertSame( - 'publicTransientFieldValue', - $unserialized->publicTransientField, - 'transient fields are kept' - ); - $protectedTransientField = $reflClass->getProperty('protectedTransientField'); - $protectedTransientField->setAccessible(true); - $this->assertSame( - 'protectedTransientFieldValue', - $protectedTransientField->getValue($unserialized), - 'transient fields are kept' - ); - - // Checking persistent fields - $this->assertSame( - 'publicPersistentFieldValue', - $unserialized->publicPersistentField, - 'persistent fields are kept' - ); - $protectedPersistentField = $reflClass->getProperty('protectedPersistentField'); - $protectedPersistentField->setAccessible(true); - $this->assertSame( - 'protectedPersistentFieldValue', - $protectedPersistentField->getValue($unserialized), - 'persistent fields are kept' - ); - - // Checking identifiers - $this->assertSame( - 'publicIdentifierFieldValue', - $unserialized->publicIdentifierField, - 'identifiers are kept' - ); - $protectedIdentifierField = $reflClass->getProperty('protectedIdentifierField'); - $protectedIdentifierField->setAccessible(true); - $this->assertSame( - 'protectedIdentifierFieldValue', - $protectedIdentifierField->getValue($unserialized), - 'identifiers are kept' - ); - - // Checking associations - $this->assertSame('publicAssociationValue', $unserialized->publicAssociation, 'associations are kept'); - $protectedAssociationField = $reflClass->getProperty('protectedAssociation'); - $protectedAssociationField->setAccessible(true); - $this->assertSame( - 'protectedAssociationValue', - $protectedAssociationField->getValue($unserialized), - 'associations are kept' - ); - } - - public function testInitializationRestoresDefaultPublicLazyLoadedFieldValues() - { - // setting noop persister - $this->proxyLoader->expects($this->once())->method('load')->will($this->returnValue($this->lazyObject)); - $this->lazyObject->__setInitializer($this->getSuggestedInitializerImplementation()); - - $this->assertSame( - 'publicPersistentFieldValue', - $this->lazyObject->publicPersistentField, - 'Persistent field is restored to default value' - ); - $this->assertSame( - 'publicAssociationValue', - $this->lazyObject->publicAssociation, - 'Association is restored to default value' - ); - } - - public function testSettingPublicFieldsCausesLazyLoading() - { - $test = $this; - $this->configureInitializerMock( - 1, - array($this->lazyObject, '__set', array('publicPersistentField', 'newPublicPersistentFieldValue')), - function () use ($test) { - $test->setProxyValue('publicPersistentField', 'overrideValue'); - $test->setProxyValue('publicAssociation', 'newAssociationValue'); - } - ); - - $this->lazyObject->publicPersistentField = 'newPublicPersistentFieldValue'; - $this->assertSame('newPublicPersistentFieldValue', $this->lazyObject->publicPersistentField); - $this->assertSame('newAssociationValue', $this->lazyObject->publicAssociation); - } - - public function testSettingPublicAssociationCausesLazyLoading() - { - $test = $this; - $this->configureInitializerMock( - 1, - array($this->lazyObject, '__set', array('publicAssociation', 'newPublicAssociationValue')), - function () use ($test) { - $test->setProxyValue('publicPersistentField', 'newPublicPersistentFieldValue'); - $test->setProxyValue('publicAssociation', 'overrideValue'); - } - ); - - $this->lazyObject->publicAssociation = 'newPublicAssociationValue'; - $this->assertSame('newPublicAssociationValue', $this->lazyObject->publicAssociation); - $this->assertSame('newPublicPersistentFieldValue', $this->lazyObject->publicPersistentField); - } - - public function testCheckingPublicFieldsCausesLazyLoading() - { - $test = $this; - $this->configureInitializerMock( - 1, - array($this->lazyObject, '__isset', array('publicPersistentField')), - function () use ($test) { - $test->setProxyValue('publicPersistentField', null); - $test->setProxyValue('publicAssociation', 'setPublicAssociation'); - } - ); - - $this->assertFalse(isset($this->lazyObject->publicPersistentField)); - $this->assertNull($this->lazyObject->publicPersistentField); - $this->assertTrue(isset($this->lazyObject->publicAssociation)); - $this->assertSame('setPublicAssociation', $this->lazyObject->publicAssociation); - } - - public function testCheckingPublicAssociationCausesLazyLoading() - { - $test = $this; - $this->configureInitializerMock( - 1, - array($this->lazyObject, '__isset', array('publicAssociation')), - function () use ($test) { - $test->setProxyValue('publicPersistentField', 'newPersistentFieldValue'); - $test->setProxyValue('publicAssociation', 'setPublicAssociation'); - } - ); - - $this->assertTrue(isset($this->lazyObject->publicAssociation)); - $this->assertSame('setPublicAssociation', $this->lazyObject->publicAssociation); - $this->assertTrue(isset($this->lazyObject->publicPersistentField)); - $this->assertSame('newPersistentFieldValue', $this->lazyObject->publicPersistentField); - } - - /** - * Converts a given callable into a closure - * - * @param callable $callable - * @return \Closure - */ - public function getClosure($callable) { - return function () use ($callable) { - call_user_func_array($callable, func_get_args()); - }; - } - - /** - * Configures the current initializer callback mock with provided matcher params - * - * @param int $expectedCallCount the number of invocations to be expected. If a value< 0 is provided, `any` is used - * @param array $callParamsMatch an ordered array of parameters to be expected - * @param callable $callbackClosure a return callback closure - * - * @return \PHPUnit_Framework_MockObject_MockObject| - */ - protected function configureInitializerMock( - $expectedCallCount = 0, - array $callParamsMatch = null, - \Closure $callbackClosure = null - ) { - if (!$expectedCallCount) { - $invocationCountMatcher = $this->exactly((int) $expectedCallCount); - } else { - $invocationCountMatcher = $expectedCallCount < 0 ? $this->any() : $this->exactly($expectedCallCount); - } - - $invocationMocker = $this->initializerCallbackMock->expects($invocationCountMatcher)->method('__invoke'); - - if (null !== $callParamsMatch) { - call_user_func_array(array($invocationMocker, 'with'), $callParamsMatch); - } - - if ($callbackClosure) { - $invocationMocker->will($this->returnCallback($callbackClosure)); - } - } - - /** - * Sets a value in the current proxy object without triggering lazy loading through `__set` - * - * @link https://bugs.php.net/bug.php?id=63463 - * - * @param string $property - * @param mixed $value - */ - public function setProxyValue($property, $value) - { - $reflectionProperty = new \ReflectionProperty($this->lazyObject, $property); - $initializer = $this->lazyObject->__getInitializer(); - - // disabling initializer since setting `publicPersistentField` triggers `__set`/`__get` - $this->lazyObject->__setInitializer(null); - $reflectionProperty->setValue($this->lazyObject, $value); - $this->lazyObject->__setInitializer($initializer); - } - - /** - * Retrieves the suggested implementation of an initializer that proxy factories in O*M - * are currently following, and that should be used to initialize the current proxy object - * - * @return \Closure - */ - protected function getSuggestedInitializerImplementation() - { - $loader = $this->proxyLoader; - $identifier = $this->identifier; - - return function (LazyLoadableObject $proxy) use ($loader, $identifier) { - /* @var $proxy LazyLoadableObject|Proxy */ - $proxy->__setInitializer(null); - $proxy->__setCloner(null); - - - if ($proxy->__isInitialized()) { - return; - } - - $properties = $proxy->__getLazyProperties(); - - foreach ($properties as $propertyName => $property) { - if (!isset($proxy->$propertyName)) { - $proxy->$propertyName = $properties[$propertyName]; - } - } - - $proxy->__setInitialized(true); - - if (method_exists($proxy, '__wakeup')) { - $proxy->__wakeup(); - } - - if (null === $loader->load($identifier, $proxy)) { - throw new \UnexpectedValueException('Couldn\'t load'); - } - }; - } -} \ No newline at end of file diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/ProxyMagicMethodsTest.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/ProxyMagicMethodsTest.php deleted file mode 100644 index 1ed9d92..0000000 --- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/ProxyMagicMethodsTest.php +++ /dev/null @@ -1,327 +0,0 @@ -. - */ - -namespace Doctrine\Tests\Common\Proxy; - -use Doctrine\Common\Proxy\ProxyGenerator; -use Doctrine\Common\Proxy\Proxy; -use Doctrine\Common\Proxy\Exception\UnexpectedValueException; -use PHPUnit_Framework_TestCase; -use ReflectionClass; - -/** - * Test for behavior of proxies with inherited magic methods - * - * @author Marco Pivetta - */ -class ProxyMagicMethodsTest extends PHPUnit_Framework_TestCase -{ - /** - * @var \Doctrine\Common\Proxy\ProxyGenerator - */ - protected $proxyGenerator; - - /** - * @var LazyLoadableObject|Proxy - */ - protected $lazyObject; - - protected $identifier = array( - 'publicIdentifierField' => 'publicIdentifierFieldValue', - 'protectedIdentifierField' => 'protectedIdentifierFieldValue', - ); - - /** - * @var \PHPUnit_Framework_MockObject_MockObject|Callable - */ - protected $initializerCallbackMock; - - /** - * {@inheritDoc} - */ - public function setUp() - { - $this->proxyGenerator = new ProxyGenerator(__DIR__ . '/generated', __NAMESPACE__ . '\\MagicMethodProxy'); - } - - public static function tearDownAfterClass() - { - - } - - public function testInheritedMagicGet() - { - $proxyClassName = $this->generateProxyClass(__NAMESPACE__ . '\\MagicGetClass'); - $proxy = new $proxyClassName( - function (Proxy $proxy, $method, $params) use (&$counter) { - if ( ! in_array($params[0], array('publicField', 'test', 'notDefined'))) { - throw new \InvalidArgumentException('Unexpected access to field "' . $params[0] . '"'); - } - - $initializer = $proxy->__getInitializer(); - - $proxy->__setInitializer(null); - - $proxy->publicField = 'modifiedPublicField'; - $counter += 1; - - $proxy->__setInitializer($initializer); - - } - ); - - $this->assertSame('id', $proxy->id); - $this->assertSame('modifiedPublicField', $proxy->publicField); - $this->assertSame('test', $proxy->test); - $this->assertSame('not defined', $proxy->notDefined); - - $this->assertSame(3, $counter); - } - - /** - * @group DCOM-194 - */ - public function testInheritedMagicGetByRef() - { - $proxyClassName = $this->generateProxyClass(__NAMESPACE__ . '\\MagicGetByRefClass'); - /* @var $proxy \Doctrine\Tests\Common\Proxy\MagicGetByRefClass */ - $proxy = new $proxyClassName(); - $proxy->valueField = 123; - $value = & $proxy->__get('value'); - - $this->assertSame(123, $value); - - $value = 456; - - $this->assertSame(456, $proxy->__get('value'), 'Value was fetched by reference'); - - $this->setExpectedException('InvalidArgumentException'); - - $undefined = $proxy->nonExisting; - } - - public function testInheritedMagicSet() - { - $proxyClassName = $this->generateProxyClass(__NAMESPACE__ . '\\MagicSetClass'); - $proxy = new $proxyClassName( - function (Proxy $proxy, $method, $params) use (&$counter) { - if ( ! in_array($params[0], array('publicField', 'test', 'notDefined'))) { - throw new \InvalidArgumentException('Unexpected access to field "' . $params[0] . '"'); - } - - $counter += 1; - } - ); - - $this->assertSame('id', $proxy->id); - - $proxy->publicField = 'publicFieldValue'; - - $this->assertSame('publicFieldValue', $proxy->publicField); - - $proxy->test = 'testValue'; - - $this->assertSame('testValue', $proxy->testAttribute); - - $proxy->notDefined = 'not defined'; - - $this->assertSame('not defined', $proxy->testAttribute); - $this->assertSame(3, $counter); - } - - public function testInheritedMagicSleep() - { - $proxyClassName = $this->generateProxyClass(__NAMESPACE__ . '\\MagicSleepClass'); - $proxy = new $proxyClassName(); - - $this->assertSame('defaultValue', $proxy->serializedField); - $this->assertSame('defaultValue', $proxy->nonSerializedField); - - $proxy->serializedField = 'changedValue'; - $proxy->nonSerializedField = 'changedValue'; - - $unserialized = unserialize(serialize($proxy)); - - $this->assertSame('changedValue', $unserialized->serializedField); - $this->assertSame('defaultValue', $unserialized->nonSerializedField, 'Field was not returned by "__sleep"'); - } - - public function testInheritedMagicWakeup() - { - $proxyClassName = $this->generateProxyClass(__NAMESPACE__ . '\\MagicWakeupClass'); - $proxy = new $proxyClassName(); - - $this->assertSame('defaultValue', $proxy->wakeupValue); - - $proxy->wakeupValue = 'changedValue'; - $unserialized = unserialize(serialize($proxy)); - - $this->assertSame('newWakeupValue', $unserialized->wakeupValue, '"__wakeup" was called'); - - $unserialized->__setInitializer(function (Proxy $proxy) { - $proxy->__setInitializer(null); - - $proxy->publicField = 'newPublicFieldValue'; - }); - - $this->assertSame('newPublicFieldValue', $unserialized->publicField, 'Proxy can still be initialized'); - } - - public function testInheritedMagicIsset() - { - $proxyClassName = $this->generateProxyClass(__NAMESPACE__ . '\\MagicIssetClass'); - $proxy = new $proxyClassName(function (Proxy $proxy, $method, $params) use (&$counter) { - if (in_array($params[0], array('publicField', 'test', 'nonExisting'))) { - $initializer = $proxy->__getInitializer(); - - $proxy->__setInitializer(null); - - $proxy->publicField = 'modifiedPublicField'; - $counter += 1; - - $proxy->__setInitializer($initializer); - - return; - } - - throw new \InvalidArgumentException( - sprintf('Should not be initialized when checking isset("%s")', $params[0]) - ); - }); - - $this->assertTrue(isset($proxy->id)); - $this->assertTrue(isset($proxy->publicField)); - $this->assertTrue(isset($proxy->test)); - $this->assertFalse(isset($proxy->nonExisting)); - - $this->assertSame(3, $counter); - } - - public function testInheritedMagicClone() - { - $proxyClassName = $this->generateProxyClass(__NAMESPACE__ . '\\MagicCloneClass'); - $proxy = new $proxyClassName( - null, - function ($proxy) { - $proxy->cloned = true; - } - ); - - $cloned = clone $proxy; - - $this->assertSame('newClonedValue', $cloned->clonedValue); - $this->assertFalse($proxy->cloned); - $this->assertTrue($cloned->cloned); - } - - /** - * @group DCOM-175 - */ - public function testClonesPrivateProperties() - { - $proxyClassName = $this->generateProxyClass(__NAMESPACE__ . '\\SerializedClass'); - /* @var $proxy SerializedClass */ - $proxy = new $proxyClassName(); - - $proxy->setFoo(1); - $proxy->setBar(2); - $proxy->setBaz(3); - - $unserialized = unserialize(serialize($proxy)); - - $this->assertSame(1, $unserialized->getFoo()); - $this->assertSame(2, $unserialized->getBar()); - $this->assertSame(3, $unserialized->getBaz()); - } - - /** - * @param $className - * - * @return string - */ - private function generateProxyClass($className) - { - $proxyClassName = 'Doctrine\\Tests\\Common\\Proxy\\MagicMethodProxy\\__CG__\\' . $className; - - if (class_exists($proxyClassName, false)) { - return $proxyClassName; - } - - $metadata = $this->getMock('Doctrine\\Common\\Persistence\\Mapping\\ClassMetadata'); - - $metadata - ->expects($this->any()) - ->method('getName') - ->will($this->returnValue($className)); - - $metadata - ->expects($this->any()) - ->method('getIdentifier') - ->will($this->returnValue(array('id'))); - - $metadata - ->expects($this->any()) - ->method('getReflectionClass') - ->will($this->returnValue(new ReflectionClass($className))); - - $metadata - ->expects($this->any()) - ->method('isIdentifier') - ->will($this->returnCallback(function ($fieldName) { - return 'id' === $fieldName; - })); - - $metadata - ->expects($this->any()) - ->method('hasField') - ->will($this->returnCallback(function ($fieldName) { - return in_array($fieldName, array('id', 'publicField')); - })); - - $metadata - ->expects($this->any()) - ->method('hasAssociation') - ->will($this->returnValue(false)); - - $metadata - ->expects($this->any()) - ->method('getFieldNames') - ->will($this->returnValue(array('id', 'publicField'))); - - $metadata - ->expects($this->any()) - ->method('getIdentifierFieldNames') - ->will($this->returnValue(array('id'))); - - $metadata - ->expects($this->any()) - ->method('getAssociationNames') - ->will($this->returnValue(array())); - - $metadata - ->expects($this->any()) - ->method('getTypeOfField') - ->will($this->returnValue('string')); - - $this->proxyGenerator->generateProxyClass($metadata, $this->proxyGenerator->getProxyFileName($className)); - require_once $this->proxyGenerator->getProxyFileName($className); - - return $proxyClassName; - } -} diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/SerializedClass.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/SerializedClass.php deleted file mode 100644 index a36c3bb..0000000 --- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/SerializedClass.php +++ /dev/null @@ -1,72 +0,0 @@ -foo = $foo; - } - - /** - * @return mixed|string - */ - public function getFoo() - { - return $this->foo; - } - - /** - * @param $bar - */ - public function setBar($bar) - { - $this->bar = $bar; - } - - /** - * @return mixed|string - */ - public function getBar() - { - return $this->bar; - } - - /** - * @param $baz - */ - public function setBaz($baz) - { - $this->baz = $baz; - } - - /** - * @return mixed|string - */ - public function getBaz() - { - return $this->baz; - } -} diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/SleepClass.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/SleepClass.php deleted file mode 100644 index 3c6ffcd..0000000 --- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/SleepClass.php +++ /dev/null @@ -1,19 +0,0 @@ -getMock('stdClass', array('callGet')); - $getCheckMock->expects($this->never())->method('callGet'); - $initializer = function () use ($getCheckMock) { - call_user_func($getCheckMock); - }; - - $mockProxy = new RuntimePublicReflectionPropertyTestProxyMock(); - $mockProxy->__setInitializer($initializer); - - $reflProperty = new RuntimePublicReflectionProperty( - __NAMESPACE__ . '\RuntimePublicReflectionPropertyTestProxyMock', - 'checkedProperty' - ); - - $this->assertSame('testValue', $reflProperty->getValue($mockProxy)); - unset($mockProxy->checkedProperty); - $this->assertNull($reflProperty->getValue($mockProxy)); - } - - public function testSetValueOnProxyPublicProperty() - { - $setCheckMock = $this->getMock('stdClass', array('neverCallSet')); - $setCheckMock->expects($this->never())->method('neverCallSet'); - $initializer = function () use ($setCheckMock) { - call_user_func(array($setCheckMock, 'neverCallSet')); - }; - - $mockProxy = new RuntimePublicReflectionPropertyTestProxyMock(); - $mockProxy->__setInitializer($initializer); - - $reflProperty = new RuntimePublicReflectionProperty( - __NAMESPACE__ . '\RuntimePublicReflectionPropertyTestProxyMock', - 'checkedProperty' - ); - - $reflProperty->setValue($mockProxy, 'newValue'); - $this->assertSame('newValue', $mockProxy->checkedProperty); - - unset($mockProxy->checkedProperty); - $reflProperty->setValue($mockProxy, 'otherNewValue'); - $this->assertSame('otherNewValue', $mockProxy->checkedProperty); - - $setCheckMock = $this->getMock('stdClass', array('callSet')); - $setCheckMock->expects($this->once())->method('callSet'); - $initializer = function () use ($setCheckMock) { - call_user_func(array($setCheckMock, 'callSet')); - }; - - $mockProxy->__setInitializer($initializer); - $mockProxy->__setInitialized(true); - - unset($mockProxy->checkedProperty); - $reflProperty->setValue($mockProxy, 'againNewValue'); - $this->assertSame('againNewValue', $mockProxy->checkedProperty); - } -} - -/** - * Mock that simulates proxy public property lazy loading - */ -class RuntimePublicReflectionPropertyTestProxyMock implements Proxy -{ - /** - * @var \Closure|null - */ - private $initializer = null; - - /** - * @var \Closure|null - */ - private $initialized = false; - - /** - * @var string - */ - public $checkedProperty = 'testValue'; - - /** - * {@inheritDoc} - */ - public function __getInitializer() - { - return $this->initializer; - } - - /** - * {@inheritDoc} - */ - public function __setInitializer(\Closure $initializer = null) - { - $this->initializer = $initializer; - } - - /** - * {@inheritDoc} - */ - public function __getLazyProperties() - { - } - - /** - * {@inheritDoc} - */ - public function __load() - { - } - - /** - * {@inheritDoc} - */ - public function __isInitialized() - { - return $this->initialized; - } - - /** - * {@inheritDoc} - */ - public function __setInitialized($initialized) - { - $this->initialized = (bool) $initialized; - } - - /** - * @param string $name - */ - public function __get($name) - { - if ($this->initializer) { - $cb = $this->initializer; - $cb(); - } - - return $this->checkedProperty; - } - - /** - * @param string $name - * @param mixed $value - */ - public function __set($name, $value) - { - if ($this->initializer) { - $cb = $this->initializer; - $cb(); - } - - // triggers notices if `$name` is used: see https://bugs.php.net/bug.php?id=63463 - $this->checkedProperty = $value; - } - - /** - * @param string $name - * - * @return integer - */ - public function __isset($name) - { - if ($this->initializer) { - $cb = $this->initializer; - $cb(); - } - - return isset($this->checkedProperty); - } - - /** - * {@inheritDoc} - */ - public function __setCloner(\Closure $cloner = null) - { - } - - /** - * {@inheritDoc} - */ - public function __getCloner() - { - } -} \ No newline at end of file diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Reflection/SameNamespaceParent.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Reflection/SameNamespaceParent.php deleted file mode 100644 index 844d4a5..0000000 --- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Reflection/SameNamespaceParent.php +++ /dev/null @@ -1,7 +0,0 @@ -setExpectedException('ReflectionException'); - } - - $testsRoot = substr(__DIR__, 0, -strlen(__NAMESPACE__) - 1); - $paths = array( - 'Doctrine\\Tests' => array($testsRoot), - ); - $staticReflectionParser = new StaticReflectionParser($parsedClassName, new Psr0FindFile($paths), $classAnnotationOptimize); - $declaringClassName = $staticReflectionParser->getStaticReflectionParserForDeclaringClass('property', 'test')->getClassName(); - $this->assertEquals($expectedClassName, $declaringClassName); - - } - - /** - * @return array - */ - public function parentClassData() - { - $data = array(); - $noParentClassName = 'Doctrine\\Tests\\Common\\Reflection\\NoParent'; - $dummyParentClassName = 'Doctrine\\Tests\\Common\\Reflection\\Dummies\\NoParent'; - foreach (array(false, true) as $classAnnotationOptimize) { - $data[] = array( - $classAnnotationOptimize, $noParentClassName, $noParentClassName, - ); - $data[] = array( - $classAnnotationOptimize, 'Doctrine\\Tests\\Common\\Reflection\\FullyClassifiedParent', $noParentClassName, - ); - $data[] = array( - $classAnnotationOptimize, 'Doctrine\\Tests\\Common\\Reflection\\SameNamespaceParent', $noParentClassName, - ); - $data[] = array( - $classAnnotationOptimize, 'Doctrine\\Tests\\Common\\Reflection\\DeeperNamespaceParent', $dummyParentClassName, - ); - $data[] = array( - $classAnnotationOptimize, 'Doctrine\\Tests\\Common\\Reflection\\UseParent', $dummyParentClassName, - ); - } - return $data; - } - - /** - * @dataProvider classAnnotationOptimize - */ - public function testClassAnnotationOptimizedParsing($classAnnotationOptimize) { - $testsRoot = substr(__DIR__, 0, -strlen(__NAMESPACE__) - 1); - $paths = array( - 'Doctrine\\Tests' => array($testsRoot), - ); - $staticReflectionParser = new StaticReflectionParser('Doctrine\\Tests\\Common\\Reflection\\ExampleAnnotationClass', new Psr0FindFile($paths), $classAnnotationOptimize); - $expectedDocComment = '/** - * @Annotation( - * key = "value" - * ) - */'; - $this->assertEquals($expectedDocComment, $staticReflectionParser->getDocComment('class')); - } - - /** - * @return array - */ - public function classAnnotationOptimize() - { - return array( - array(false), - array(true) - ); - } -} diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Reflection/UseParent.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Reflection/UseParent.php deleted file mode 100644 index dd512d4..0000000 --- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Reflection/UseParent.php +++ /dev/null @@ -1,9 +0,0 @@ -assertEquals($expectedClassName, ClassUtils::getRealClass($className)); - } - - /** - * @dataProvider dataGetClass - */ - public function testGetClass( $className, $expectedClassName ) - { - $object = new $className(); - $this->assertEquals($expectedClassName, ClassUtils::getClass($object)); - } - - public function testGetParentClass() - { - $parentClass = ClassUtils::getParentClass( 'MyProject\Proxies\__CG__\OtherProject\Proxies\__CG__\Doctrine\Tests\Common\Util\ChildObject' ); - $this->assertEquals('stdClass', $parentClass); - } - - public function testGenerateProxyClassName() - { - $this->assertEquals( 'Proxies\__CG__\stdClass', ClassUtils::generateProxyClassName( 'stdClass', 'Proxies' ) ); - } - - /** - * @dataProvider dataGetClass - */ - public function testNewReflectionClass( $className, $expectedClassName ) - { - $reflClass = ClassUtils::newReflectionClass( $className ); - $this->assertEquals( $expectedClassName, $reflClass->getName() ); - } - - /** - * @dataProvider dataGetClass - */ - public function testNewReflectionObject( $className, $expectedClassName ) - { - $object = new $className; - $reflClass = ClassUtils::newReflectionObject( $object ); - $this->assertEquals( $expectedClassName, $reflClass->getName() ); - } - } - - class ChildObject extends \stdClass - { - } -} - -namespace MyProject\Proxies\__CG__ -{ - class stdClass extends \stdClass - { - } -} - -namespace MyProject\Proxies\__CG__\Doctrine\Tests\Common\Util -{ - class ChildObject extends \Doctrine\Tests\Common\Util\ChildObject - { - } -} - -namespace MyProject\Proxies\__CG__\OtherProject\Proxies\__CG__ -{ - class stdClass extends \MyProject\Proxies\__CG__\stdClass - { - } -} - -namespace MyProject\Proxies\__CG__\OtherProject\Proxies\__CG__\Doctrine\Tests\Common\Util -{ - class ChildObject extends \MyProject\Proxies\__CG__\Doctrine\Tests\Common\Util\ChildObject - { - } -} diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Util/DebugTest.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Util/DebugTest.php deleted file mode 100644 index f6fc069..0000000 --- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Util/DebugTest.php +++ /dev/null @@ -1,40 +0,0 @@ -foo = "bar"; - $obj->bar = 1234; - - $var = Debug::export($obj, 2); - $this->assertEquals( "stdClass", $var->__CLASS__ ); - } - - public function testExportDateTime() - { - $obj = new \DateTime( "2010-10-10 10:10:10" ); - - $var = Debug::export( $obj, 2 ); - $this->assertEquals( "DateTime", $var->__CLASS__ ); - } - - public function testExportArrayTraversable() - { - $obj = new \ArrayObject(array('foobar')); - - $var = Debug::export($obj, 2); - $this->assertContains('foobar', $var->__STORAGE__); - - $it = new \ArrayIterator(array('foobar')); - - $var = Debug::export($it, 5); - $this->assertContains('foobar', $var->__STORAGE__); - } -} diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/DoctrineTestCase.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/DoctrineTestCase.php deleted file mode 100644 index e8323d2..0000000 --- a/core/vendor/doctrine/common/tests/Doctrine/Tests/DoctrineTestCase.php +++ /dev/null @@ -1,10 +0,0 @@ - Doctrine/Tests/ORM/Functional/Locking/GearmanLockTest.php - -This can run considerable time, because it is using sleep() to test for the timing ranges of locks. \ No newline at end of file diff --git a/core/vendor/doctrine/inflector/README.md b/core/vendor/doctrine/inflector/README.md deleted file mode 100644 index f2d18d0..0000000 --- a/core/vendor/doctrine/inflector/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Doctrine Inflector - -Doctrine Inflector is a small library that can perform string manipulations -with regard to upper-/lowercase and singular/plural forms of words. diff --git a/core/vendor/doctrine/inflector/composer.json b/core/vendor/doctrine/inflector/composer.json deleted file mode 100644 index 3d3c3f9..0000000 --- a/core/vendor/doctrine/inflector/composer.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "doctrine/inflector", - "type": "library", - "description": "Common String Manipulations with regard to casing and singular/plural rules.", - "keywords": ["string", "inflection", "singuarlize", "pluarlize"], - "homepage": "http://www.doctrine-project.org", - "license": "MIT", - "authors": [ - {"name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com"}, - {"name": "Roman Borschel", "email": "roman@code-factory.org"}, - {"name": "Benjamin Eberlei", "email": "kontakt@beberlei.de"}, - {"name": "Jonathan Wage", "email": "jonwage@gmail.com"}, - {"name": "Johannes Schmitt", "email": "schmittjoh@gmail.com"} - ], - "require": { - "php": ">=5.3.2" - }, - "autoload": { - "psr-0": { "Doctrine\\Common\\Inflector\\": "lib/" } - } -} diff --git a/core/vendor/doctrine/inflector/lib/Doctrine/Common/Inflector/Inflector.php b/core/vendor/doctrine/inflector/lib/Doctrine/Common/Inflector/Inflector.php deleted file mode 100644 index f4e38e7..0000000 --- a/core/vendor/doctrine/inflector/lib/Doctrine/Common/Inflector/Inflector.php +++ /dev/null @@ -1,385 +0,0 @@ -. - */ - -namespace Doctrine\Common\Inflector; - -/** - * Doctrine inflector has static methods for inflecting text - * - * The methods in these classes are from several different sources collected - * across several different php projects and several different authors. The - * original author names and emails are not known. - * - * Plurialize & Singularize implementation are borrowed from CakePHP with some modifications. - * - * @link www.doctrine-project.org - * @since 1.0 - * @author Konsta Vesterinen - * @author Jonathan H. Wage - */ -class Inflector -{ - /** - * Plural inflector rules - * - * @var array - */ - private static $plural = array( - 'rules' => array( - '/(s)tatus$/i' => '\1\2tatuses', - '/(quiz)$/i' => '\1zes', - '/^(ox)$/i' => '\1\2en', - '/([m|l])ouse$/i' => '\1ice', - '/(matr|vert|ind)(ix|ex)$/i' => '\1ices', - '/(x|ch|ss|sh)$/i' => '\1es', - '/([^aeiouy]|qu)y$/i' => '\1ies', - '/(hive)$/i' => '\1s', - '/(?:([^f])fe|([lr])f)$/i' => '\1\2ves', - '/sis$/i' => 'ses', - '/([ti])um$/i' => '\1a', - '/(p)erson$/i' => '\1eople', - '/(m)an$/i' => '\1en', - '/(c)hild$/i' => '\1hildren', - '/(buffal|tomat)o$/i' => '\1\2oes', - '/(alumn|bacill|cact|foc|fung|nucle|radi|stimul|syllab|termin|vir)us$/i' => '\1i', - '/us$/i' => 'uses', - '/(alias)$/i' => '\1es', - '/(ax|cris|test)is$/i' => '\1es', - '/s$/' => 's', - '/^$/' => '', - '/$/' => 's', - ), - 'uninflected' => array( - '.*[nrlm]ese', '.*deer', '.*fish', '.*measles', '.*ois', '.*pox', '.*sheep', 'people', 'cookie' - ), - 'irregular' => array( - 'atlas' => 'atlases', - 'beef' => 'beefs', - 'brother' => 'brothers', - 'cafe' => 'cafes', - 'child' => 'children', - 'cookie' => 'cookies', - 'corpus' => 'corpuses', - 'cow' => 'cows', - 'ganglion' => 'ganglions', - 'genie' => 'genies', - 'genus' => 'genera', - 'graffito' => 'graffiti', - 'hoof' => 'hoofs', - 'loaf' => 'loaves', - 'man' => 'men', - 'money' => 'monies', - 'mongoose' => 'mongooses', - 'move' => 'moves', - 'mythos' => 'mythoi', - 'niche' => 'niches', - 'numen' => 'numina', - 'occiput' => 'occiputs', - 'octopus' => 'octopuses', - 'opus' => 'opuses', - 'ox' => 'oxen', - 'penis' => 'penises', - 'person' => 'people', - 'sex' => 'sexes', - 'soliloquy' => 'soliloquies', - 'testis' => 'testes', - 'trilby' => 'trilbys', - 'turf' => 'turfs' - ) - ); - - /** - * Singular inflector rules - * - * @var array - */ - private static $singular = array( - 'rules' => array( - '/(s)tatuses$/i' => '\1\2tatus', - '/^(.*)(menu)s$/i' => '\1\2', - '/(quiz)zes$/i' => '\\1', - '/(matr)ices$/i' => '\1ix', - '/(vert|ind)ices$/i' => '\1ex', - '/^(ox)en/i' => '\1', - '/(alias)(es)*$/i' => '\1', - '/(alumn|bacill|cact|foc|fung|nucle|radi|stimul|syllab|termin|viri?)i$/i' => '\1us', - '/([ftw]ax)es/i' => '\1', - '/(cris|ax|test)es$/i' => '\1is', - '/(shoe|slave)s$/i' => '\1', - '/(o)es$/i' => '\1', - '/ouses$/' => 'ouse', - '/([^a])uses$/' => '\1us', - '/([m|l])ice$/i' => '\1ouse', - '/(x|ch|ss|sh)es$/i' => '\1', - '/(m)ovies$/i' => '\1\2ovie', - '/(s)eries$/i' => '\1\2eries', - '/([^aeiouy]|qu)ies$/i' => '\1y', - '/([lr])ves$/i' => '\1f', - '/(tive)s$/i' => '\1', - '/(hive)s$/i' => '\1', - '/(drive)s$/i' => '\1', - '/([^fo])ves$/i' => '\1fe', - '/(^analy)ses$/i' => '\1sis', - '/(analy|diagno|^ba|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i' => '\1\2sis', - '/([ti])a$/i' => '\1um', - '/(p)eople$/i' => '\1\2erson', - '/(m)en$/i' => '\1an', - '/(c)hildren$/i' => '\1\2hild', - '/(n)ews$/i' => '\1\2ews', - '/eaus$/' => 'eau', - '/^(.*us)$/' => '\\1', - '/s$/i' => '' - ), - 'uninflected' => array( - '.*[nrlm]ese', '.*deer', '.*fish', '.*measles', '.*ois', '.*pox', '.*sheep', '.*ss' - ), - 'irregular' => array( - 'foes' => 'foe', - 'waves' => 'wave', - 'curves' => 'curve' - ) - ); - - /** - * Words that should not be inflected - * - * @var array - */ - private static $uninflected = array( - 'Amoyese', 'bison', 'Borghese', 'bream', 'breeches', 'britches', 'buffalo', 'cantus', - 'carp', 'chassis', 'clippers', 'cod', 'coitus', 'Congoese', 'contretemps', 'corps', - 'debris', 'diabetes', 'djinn', 'eland', 'elk', 'equipment', 'Faroese', 'flounder', - 'Foochowese', 'gallows', 'Genevese', 'Genoese', 'Gilbertese', 'graffiti', - 'headquarters', 'herpes', 'hijinks', 'Hottentotese', 'information', 'innings', - 'jackanapes', 'Kiplingese', 'Kongoese', 'Lucchese', 'mackerel', 'Maltese', '.*?media', - 'mews', 'moose', 'mumps', 'Nankingese', 'news', 'nexus', 'Niasese', - 'Pekingese', 'Piedmontese', 'pincers', 'Pistoiese', 'pliers', 'Portuguese', - 'proceedings', 'rabies', 'rice', 'rhinoceros', 'salmon', 'Sarawakese', 'scissors', - 'sea[- ]bass', 'series', 'Shavese', 'shears', 'siemens', 'species', 'swine', 'testes', - 'trousers', 'trout', 'tuna', 'Vermontese', 'Wenchowese', 'whiting', 'wildebeest', - 'Yengeese' - ); - - /** - * Method cache array. - * - * @var array - */ - private static $cache = array(); - - /** - * The initial state of Inflector so reset() works. - * - * @var array - */ - private static $initialState = array(); - - /** - * Convert word in to the format for a Doctrine table name. Converts 'ModelName' to 'model_name' - * - * @param string $word Word to tableize - * @return string $word Tableized word - */ - public static function tableize($word) - { - return strtolower(preg_replace('~(?<=\\w)([A-Z])~', '_$1', $word)); - } - - /** - * Convert a word in to the format for a Doctrine class name. Converts 'table_name' to 'TableName' - * - * @param string $word Word to classify - * @return string $word Classified word - */ - public static function classify($word) - { - return str_replace(" ", "", ucwords(strtr($word, "_-", " "))); - } - - /** - * Camelize a word. This uses the classify() method and turns the first character to lowercase - * - * @param string $word - * @return string $word - */ - public static function camelize($word) - { - return lcfirst(self::classify($word)); - } - - /** - * Clears Inflectors inflected value caches. And resets the inflection - * rules to the initial values. - * - * @return void - */ - public static function reset() - { - if (empty(self::$initialState)) { - self::$initialState = get_class_vars('Inflector'); - return; - } - foreach (self::$initialState as $key => $val) { - if ($key != 'initialState') { - self::${$key} = $val; - } - } - } - - /** - * Adds custom inflection $rules, of either 'plural' or 'singular' $type. - * - * ### Usage: - * - * {{{ - * Inflector::rules('plural', array('/^(inflect)or$/i' => '\1ables')); - * Inflector::rules('plural', array( - * 'rules' => array('/^(inflect)ors$/i' => '\1ables'), - * 'uninflected' => array('dontinflectme'), - * 'irregular' => array('red' => 'redlings') - * )); - * }}} - * - * @param string $type The type of inflection, either 'plural' or 'singular' - * @param array $rules Array of rules to be added. - * @param boolean $reset If true, will unset default inflections for all - * new rules that are being defined in $rules. - * @return void - */ - public static function rules($type, $rules, $reset = false) - { - foreach ($rules as $rule => $pattern) { - if (is_array($pattern)) { - if ($reset) { - self::${$type}[$rule] = $pattern; - } else { - if ($rule === 'uninflected') { - self::${$type}[$rule] = array_merge($pattern, self::${$type}[$rule]); - } else { - self::${$type}[$rule] = $pattern + self::${$type}[$rule]; - } - } - unset($rules[$rule], self::${$type}['cache' . ucfirst($rule)]); - if (isset(self::${$type}['merged'][$rule])) { - unset(self::${$type}['merged'][$rule]); - } - if ($type === 'plural') { - self::$cache['pluralize'] = self::$cache['tableize'] = array(); - } elseif ($type === 'singular') { - self::$cache['singularize'] = array(); - } - } - } - self::${$type}['rules'] = $rules + self::${$type}['rules']; - } - - /** - * Return $word in plural form. - * - * @param string $word Word in singular - * @return string Word in plural - */ - public static function pluralize($word) - { - if (isset(self::$cache['pluralize'][$word])) { - return self::$cache['pluralize'][$word]; - } - - if (!isset(self::$plural['merged']['irregular'])) { - self::$plural['merged']['irregular'] = self::$plural['irregular']; - } - - if (!isset(self::$plural['merged']['uninflected'])) { - self::$plural['merged']['uninflected'] = array_merge(self::$plural['uninflected'], self::$uninflected); - } - - if (!isset(self::$plural['cacheUninflected']) || !isset(self::$plural['cacheIrregular'])) { - self::$plural['cacheUninflected'] = '(?:' . implode('|', self::$plural['merged']['uninflected']) . ')'; - self::$plural['cacheIrregular'] = '(?:' . implode('|', array_keys(self::$plural['merged']['irregular'])) . ')'; - } - - if (preg_match('/(.*)\\b(' . self::$plural['cacheIrregular'] . ')$/i', $word, $regs)) { - self::$cache['pluralize'][$word] = $regs[1] . substr($word, 0, 1) . substr(self::$plural['merged']['irregular'][strtolower($regs[2])], 1); - return self::$cache['pluralize'][$word]; - } - - if (preg_match('/^(' . self::$plural['cacheUninflected'] . ')$/i', $word, $regs)) { - self::$cache['pluralize'][$word] = $word; - return $word; - } - - foreach (self::$plural['rules'] as $rule => $replacement) { - if (preg_match($rule, $word)) { - self::$cache['pluralize'][$word] = preg_replace($rule, $replacement, $word); - return self::$cache['pluralize'][$word]; - } - } - } - - /** - * Return $word in singular form. - * - * @param string $word Word in plural - * @return string Word in singular - */ - public static function singularize($word) - { - if (isset(self::$cache['singularize'][$word])) { - return self::$cache['singularize'][$word]; - } - - if (!isset(self::$singular['merged']['uninflected'])) { - self::$singular['merged']['uninflected'] = array_merge( - self::$singular['uninflected'], - self::$uninflected - ); - } - - if (!isset(self::$singular['merged']['irregular'])) { - self::$singular['merged']['irregular'] = array_merge( - self::$singular['irregular'], - array_flip(self::$plural['irregular']) - ); - } - - if (!isset(self::$singular['cacheUninflected']) || !isset(self::$singular['cacheIrregular'])) { - self::$singular['cacheUninflected'] = '(?:' . join('|', self::$singular['merged']['uninflected']) . ')'; - self::$singular['cacheIrregular'] = '(?:' . join('|', array_keys(self::$singular['merged']['irregular'])) . ')'; - } - - if (preg_match('/(.*)\\b(' . self::$singular['cacheIrregular'] . ')$/i', $word, $regs)) { - self::$cache['singularize'][$word] = $regs[1] . substr($word, 0, 1) . substr(self::$singular['merged']['irregular'][strtolower($regs[2])], 1); - return self::$cache['singularize'][$word]; - } - - if (preg_match('/^(' . self::$singular['cacheUninflected'] . ')$/i', $word, $regs)) { - self::$cache['singularize'][$word] = $word; - return $word; - } - - foreach (self::$singular['rules'] as $rule => $replacement) { - if (preg_match($rule, $word)) { - self::$cache['singularize'][$word] = preg_replace($rule, $replacement, $word); - return self::$cache['singularize'][$word]; - } - } - self::$cache['singularize'][$word] = $word; - return $word; - } -} diff --git a/core/vendor/doctrine/inflector/phpunit.xml.dist b/core/vendor/doctrine/inflector/phpunit.xml.dist deleted file mode 100644 index ef07faa..0000000 --- a/core/vendor/doctrine/inflector/phpunit.xml.dist +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - ./tests/Doctrine/ - - - - - - ./lib/Doctrine/ - - - - - - performance - - - diff --git a/core/vendor/doctrine/inflector/tests/Doctrine/Tests/Common/Inflector/InflectorTest.php b/core/vendor/doctrine/inflector/tests/Doctrine/Tests/Common/Inflector/InflectorTest.php deleted file mode 100644 index 487c2cd..0000000 --- a/core/vendor/doctrine/inflector/tests/Doctrine/Tests/Common/Inflector/InflectorTest.php +++ /dev/null @@ -1,185 +0,0 @@ -assertEquals($singular, Inflector::singularize($plural), "'$plural' should be singularized to '$singular'"); - } - - /** - * testInflectingPlurals method - * - * @dataProvider dataSampleWords - * @return void - */ - public function testInflectingPlurals($singular, $plural) { - $this->assertEquals($plural, Inflector::pluralize($singular), "'$singular' should be pluralized to '$plural'"); - } - - /** - * testCustomPluralRule method - * - * @return void - */ - public function testCustomPluralRule() { - Inflector::reset(); - Inflector::rules('plural', array('/^(custom)$/i' => '\1izables')); - $this->assertEquals(Inflector::pluralize('custom'), 'customizables'); - - Inflector::rules('plural', array('uninflected' => array('uninflectable'))); - $this->assertEquals(Inflector::pluralize('uninflectable'), 'uninflectable'); - - Inflector::rules('plural', array( - 'rules' => array('/^(alert)$/i' => '\1ables'), - 'uninflected' => array('noflect', 'abtuse'), - 'irregular' => array('amaze' => 'amazable', 'phone' => 'phonezes') - )); - $this->assertEquals(Inflector::pluralize('noflect'), 'noflect'); - $this->assertEquals(Inflector::pluralize('abtuse'), 'abtuse'); - $this->assertEquals(Inflector::pluralize('alert'), 'alertables'); - $this->assertEquals(Inflector::pluralize('amaze'), 'amazable'); - $this->assertEquals(Inflector::pluralize('phone'), 'phonezes'); - } - - /** - * testCustomSingularRule method - * - * @return void - */ - public function testCustomSingularRule() { - Inflector::reset(); - Inflector::rules('singular', array('/(eple)r$/i' => '\1', '/(jente)r$/i' => '\1')); - - $this->assertEquals(Inflector::singularize('epler'), 'eple'); - $this->assertEquals(Inflector::singularize('jenter'), 'jente'); - - Inflector::rules('singular', array( - 'rules' => array('/^(bil)er$/i' => '\1', '/^(inflec|contribu)tors$/i' => '\1ta'), - 'uninflected' => array('singulars'), - 'irregular' => array('spins' => 'spinor') - )); - - $this->assertEquals(Inflector::singularize('inflectors'), 'inflecta'); - $this->assertEquals(Inflector::singularize('contributors'), 'contributa'); - $this->assertEquals(Inflector::singularize('spins'), 'spinor'); - $this->assertEquals(Inflector::singularize('singulars'), 'singulars'); - } - - /** - * test that setting new rules clears the inflector caches. - * - * @return void - */ - public function testRulesClearsCaches() { - Inflector::reset(); - $this->assertEquals(Inflector::singularize('Bananas'), 'Banana'); - $this->assertEquals(Inflector::pluralize('Banana'), 'Bananas'); - - Inflector::rules('singular', array( - 'rules' => array('/(.*)nas$/i' => '\1zzz') - )); - $this->assertEquals('Banazzz', Inflector::singularize('Bananas'), 'Was inflected with old rules.'); - - Inflector::rules('plural', array( - 'rules' => array('/(.*)na$/i' => '\1zzz'), - 'irregular' => array('corpus' => 'corpora') - )); - $this->assertEquals(Inflector::pluralize('Banana'), 'Banazzz', 'Was inflected with old rules.'); - $this->assertEquals(Inflector::pluralize('corpus'), 'corpora', 'Was inflected with old irregular form.'); - } - - /** - * Test resetting inflection rules. - * - * @return void - */ - public function testCustomRuleWithReset() { - Inflector::reset(); - $uninflected = array('atlas', 'lapis', 'onibus', 'pires', 'virus', '.*x'); - $pluralIrregular = array('as' => 'ases'); - - Inflector::rules('singular', array( - 'rules' => array('/^(.*)(a|e|o|u)is$/i' => '\1\2l'), - 'uninflected' => $uninflected, - ), true); - - Inflector::rules('plural', array( - 'rules' => array( - '/^(.*)(a|e|o|u)l$/i' => '\1\2is', - ), - 'uninflected' => $uninflected, - 'irregular' => $pluralIrregular - ), true); - - $this->assertEquals(Inflector::pluralize('Alcool'), 'Alcoois'); - $this->assertEquals(Inflector::pluralize('Atlas'), 'Atlas'); - $this->assertEquals(Inflector::singularize('Alcoois'), 'Alcool'); - $this->assertEquals(Inflector::singularize('Atlas'), 'Atlas'); - } -} - diff --git a/core/vendor/doctrine/inflector/tests/Doctrine/Tests/DoctrineTestCase.php b/core/vendor/doctrine/inflector/tests/Doctrine/Tests/DoctrineTestCase.php deleted file mode 100644 index e8323d2..0000000 --- a/core/vendor/doctrine/inflector/tests/Doctrine/Tests/DoctrineTestCase.php +++ /dev/null @@ -1,10 +0,0 @@ - composer-installer.php - hhvm composer-installer.php - hhvm -v ResourceLimit.SocketDefaultTimeout=30 -v Http.SlowQueryThreshold=30000 composer.phar update --prefer-source -elif [ "$TRAVIS_PHP_VERSION" = '5.3.3' ] ; then - composer self-update - composer update --prefer-source --no-dev - composer dump-autoload -else - composer self-update - composer update --prefer-source -fi diff --git a/core/vendor/doctrine/instantiator/.travis.yml b/core/vendor/doctrine/instantiator/.travis.yml deleted file mode 100644 index 0f686a9..0000000 --- a/core/vendor/doctrine/instantiator/.travis.yml +++ /dev/null @@ -1,26 +0,0 @@ -language: php - -php: - - 5.3.3 - - 5.3 - - 5.4 - - 5.5 - - 5.6 - - hhvm - - hhvm-nightly - -before_script: - - ./.travis.install.sh - -script: - - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.3.3' ]; then phpunit; fi" - - sh -c "if [ '$TRAVIS_PHP_VERSION' != '5.3.3' ]; then ./vendor/bin/phpunit; fi" - - sh -c "if [ '$TRAVIS_PHP_VERSION' != '5.3.3' ]; then ./vendor/bin/phpcs --standard=PSR2 ./src/ ./tests/; fi" - - sh -c "if [[ '$TRAVIS_PHP_VERSION' != '5.3.3' && '$TRAVIS_PHP_VERSION' != '5.4.29' && '$TRAVIS_PHP_VERSION' != '5.5.13' ]]; then php -n ./vendor/bin/athletic -p ./tests/DoctrineTest/InstantiatorPerformance/ -f GroupedFormatter; fi" - -after_script: - - sh -c "if [ '$TRAVIS_PHP_VERSION' != '5.3.3' ]; then wget https://scrutinizer-ci.com/ocular.phar; php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi" - -matrix: - allow_failures: - - php: hhvm-nightly diff --git a/core/vendor/doctrine/instantiator/CONTRIBUTING.md b/core/vendor/doctrine/instantiator/CONTRIBUTING.md deleted file mode 100644 index 75b84b2..0000000 --- a/core/vendor/doctrine/instantiator/CONTRIBUTING.md +++ /dev/null @@ -1,35 +0,0 @@ -# Contributing - - * Coding standard for the project is [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) - * The project will follow strict [object calisthenics](http://www.slideshare.net/guilhermeblanco/object-calisthenics-applied-to-php) - * Any contribution must provide tests for additional introduced conditions - * Any un-confirmed issue needs a failing test case before being accepted - * Pull requests must be sent from a new hotfix/feature branch, not from `master`. - -## Installation - -To install the project and run the tests, you need to clone it first: - -```sh -$ git clone git://github.com/doctrine/instantiator.git -``` - -You will then need to run a composer installation: - -```sh -$ cd Instantiator -$ curl -s https://getcomposer.org/installer | php -$ php composer.phar update -``` - -## Testing - -The PHPUnit version to be used is the one installed as a dev- dependency via composer: - -```sh -$ ./vendor/bin/phpunit -``` - -Accepted coverage for new contributions is 80%. Any contribution not satisfying this requirement -won't be merged. - diff --git a/core/vendor/doctrine/instantiator/LICENSE b/core/vendor/doctrine/instantiator/LICENSE deleted file mode 100644 index 4d983d1..0000000 --- a/core/vendor/doctrine/instantiator/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2014 Doctrine Project - -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/core/vendor/doctrine/instantiator/README.md b/core/vendor/doctrine/instantiator/README.md deleted file mode 100644 index 393ec7c..0000000 --- a/core/vendor/doctrine/instantiator/README.md +++ /dev/null @@ -1,40 +0,0 @@ -# Instantiator - -This library provides a way of avoiding usage of constructors when instantiating PHP classes. - -[![Build Status](https://travis-ci.org/doctrine/instantiator.svg?branch=master)](https://travis-ci.org/doctrine/instantiator) -[![Code Coverage](https://scrutinizer-ci.com/g/doctrine/instantiator/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/doctrine/instantiator/?branch=master) -[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/doctrine/instantiator/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/doctrine/instantiator/?branch=master) -[![Dependency Status](https://www.versioneye.com/package/php--doctrine--instantiator/badge.svg)](https://www.versioneye.com/package/php--doctrine--instantiator) -[![HHVM Status](http://hhvm.h4cc.de/badge/doctrine/instantiator.png)](http://hhvm.h4cc.de/package/doctrine/instantiator) - -[![Latest Stable Version](https://poser.pugx.org/doctrine/instantiator/v/stable.png)](https://packagist.org/packages/doctrine/instantiator) -[![Latest Unstable Version](https://poser.pugx.org/doctrine/instantiator/v/unstable.png)](https://packagist.org/packages/doctrine/instantiator) - -## Installation - -The suggested installation method is via [composer](https://getcomposer.org/): - -```sh -php composer.phar require "doctrine/instantiator:~1.0.3" -``` - -## Usage - -The instantiator is able to create new instances of any class without using the constructor or any API of the class -itself: - -```php -$instantiator = new \Doctrine\Instantiator\Instantiator(); - -$instance = $instantiator->instantiate('My\\ClassName\\Here'); -``` - -## Contributing - -Please read the [CONTRIBUTING.md](CONTRIBUTING.md) contents if you wish to help out! - -## Credits - -This library was migrated from [ocramius/instantiator](https://github.com/Ocramius/Instantiator), which -has been donated to the doctrine organization, and which is now deprecated in favour of this package. diff --git a/core/vendor/doctrine/instantiator/composer.json b/core/vendor/doctrine/instantiator/composer.json deleted file mode 100644 index 89d59f6..0000000 --- a/core/vendor/doctrine/instantiator/composer.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "doctrine/instantiator", - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "type": "library", - "license": "MIT", - "homepage": "https://github.com/doctrine/instantiator", - "keywords": [ - "instantiate", - "constructor" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" - } - ], - "require": { - "php": ">=5.3,<8.0-DEV" - }, - "require-dev": { - "ext-phar": "*", - "ext-pdo": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "2.0.*@ALPHA", - "athletic/athletic": "~0.1.8" - }, - "autoload": { - "psr-0": { - "Doctrine\\Instantiator\\": "src" - } - }, - "autoload-dev": { - "psr-0": { - "DoctrineTest\\InstantiatorPerformance\\": "tests", - "DoctrineTest\\InstantiatorTest\\": "tests", - "DoctrineTest\\InstantiatorTestAsset\\": "tests" - } - }, - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - } -} diff --git a/core/vendor/doctrine/instantiator/phpmd.xml.dist b/core/vendor/doctrine/instantiator/phpmd.xml.dist deleted file mode 100644 index 8254105..0000000 --- a/core/vendor/doctrine/instantiator/phpmd.xml.dist +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/core/vendor/doctrine/instantiator/phpunit.xml.dist b/core/vendor/doctrine/instantiator/phpunit.xml.dist deleted file mode 100644 index 178ba17..0000000 --- a/core/vendor/doctrine/instantiator/phpunit.xml.dist +++ /dev/null @@ -1,25 +0,0 @@ - - - - ./tests/DoctrineTest/InstantiatorTest - - - - ./src - - - - - - diff --git a/core/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/ExceptionInterface.php b/core/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/ExceptionInterface.php deleted file mode 100644 index 3065375..0000000 --- a/core/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/ExceptionInterface.php +++ /dev/null @@ -1,29 +0,0 @@ -. - */ - -namespace Doctrine\Instantiator\Exception; - -/** - * Base exception marker interface for the instantiator component - * - * @author Marco Pivetta - */ -interface ExceptionInterface -{ -} diff --git a/core/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/InvalidArgumentException.php b/core/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/InvalidArgumentException.php deleted file mode 100644 index ea8d28c..0000000 --- a/core/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/InvalidArgumentException.php +++ /dev/null @@ -1,62 +0,0 @@ -. - */ - -namespace Doctrine\Instantiator\Exception; - -use InvalidArgumentException as BaseInvalidArgumentException; -use ReflectionClass; - -/** - * Exception for invalid arguments provided to the instantiator - * - * @author Marco Pivetta - */ -class InvalidArgumentException extends BaseInvalidArgumentException implements ExceptionInterface -{ - /** - * @param string $className - * - * @return self - */ - public static function fromNonExistingClass($className) - { - if (interface_exists($className)) { - return new self(sprintf('The provided type "%s" is an interface, and can not be instantiated', $className)); - } - - if (PHP_VERSION_ID >= 50400 && trait_exists($className)) { - return new self(sprintf('The provided type "%s" is a trait, and can not be instantiated', $className)); - } - - return new self(sprintf('The provided class "%s" does not exist', $className)); - } - - /** - * @param ReflectionClass $reflectionClass - * - * @return self - */ - public static function fromAbstractClass(ReflectionClass $reflectionClass) - { - return new self(sprintf( - 'The provided class "%s" is abstract, and can not be instantiated', - $reflectionClass->getName() - )); - } -} diff --git a/core/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/UnexpectedValueException.php b/core/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/UnexpectedValueException.php deleted file mode 100644 index 1681e56..0000000 --- a/core/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/UnexpectedValueException.php +++ /dev/null @@ -1,79 +0,0 @@ -. - */ - -namespace Doctrine\Instantiator\Exception; - -use Exception; -use ReflectionClass; -use UnexpectedValueException as BaseUnexpectedValueException; - -/** - * Exception for given parameters causing invalid/unexpected state on instantiation - * - * @author Marco Pivetta - */ -class UnexpectedValueException extends BaseUnexpectedValueException implements ExceptionInterface -{ - /** - * @param ReflectionClass $reflectionClass - * @param Exception $exception - * - * @return self - */ - public static function fromSerializationTriggeredException(ReflectionClass $reflectionClass, Exception $exception) - { - return new self( - sprintf( - 'An exception was raised while trying to instantiate an instance of "%s" via un-serialization', - $reflectionClass->getName() - ), - 0, - $exception - ); - } - - /** - * @param ReflectionClass $reflectionClass - * @param string $errorString - * @param int $errorCode - * @param string $errorFile - * @param int $errorLine - * - * @return UnexpectedValueException - */ - public static function fromUncleanUnSerialization( - ReflectionClass $reflectionClass, - $errorString, - $errorCode, - $errorFile, - $errorLine - ) { - return new self( - sprintf( - 'Could not produce an instance of "%s" via un-serialization, since an error was triggered ' - . 'in file "%s" at line "%d"', - $reflectionClass->getName(), - $errorFile, - $errorLine - ), - 0, - new Exception($errorString, $errorCode) - ); - } -} diff --git a/core/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Instantiator.php b/core/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Instantiator.php deleted file mode 100644 index 98868cf..0000000 --- a/core/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Instantiator.php +++ /dev/null @@ -1,254 +0,0 @@ -. - */ - -namespace Doctrine\Instantiator; - -use Closure; -use Doctrine\Instantiator\Exception\InvalidArgumentException; -use Doctrine\Instantiator\Exception\UnexpectedValueException; -use Exception; -use ReflectionClass; - -/** - * {@inheritDoc} - * - * @author Marco Pivetta - */ -final class Instantiator implements InstantiatorInterface -{ - /** - * Markers used internally by PHP to define whether {@see \unserialize} should invoke - * the method {@see \Serializable::unserialize()} when dealing with classes implementing - * the {@see \Serializable} interface. - */ - const SERIALIZATION_FORMAT_USE_UNSERIALIZER = 'C'; - const SERIALIZATION_FORMAT_AVOID_UNSERIALIZER = 'O'; - - /** - * @var \Closure[] of {@see \Closure} instances used to instantiate specific classes - */ - private static $cachedInstantiators = array(); - - /** - * @var object[] of objects that can directly be cloned - */ - private static $cachedCloneables = array(); - - /** - * {@inheritDoc} - */ - public function instantiate($className) - { - if (isset(self::$cachedCloneables[$className])) { - return clone self::$cachedCloneables[$className]; - } - - if (isset(self::$cachedInstantiators[$className])) { - $factory = self::$cachedInstantiators[$className]; - - return $factory(); - } - - $factory = self::$cachedInstantiators[$className] = $this->buildFactory($className); - $instance = $factory(); - $reflection = new ReflectionClass($instance); - - if ($this->isSafeToClone($reflection)) { - self::$cachedCloneables[$className] = clone $instance; - } - - return $instance; - } - - /** - * @internal - * @private - * - * Builds a {@see \Closure} capable of instantiating the given $className without - * invoking its constructor. - * This method is only exposed as public because of PHP 5.3 compatibility. Do not - * use this method in your own code - * - * @param string $className - * - * @return Closure - */ - public function buildFactory($className) - { - $reflectionClass = $this->getReflectionClass($className); - - if ($this->isInstantiableViaReflection($reflectionClass)) { - return function () use ($reflectionClass) { - return $reflectionClass->newInstanceWithoutConstructor(); - }; - } - - $serializedString = sprintf( - '%s:%d:"%s":0:{}', - $this->getSerializationFormat($reflectionClass), - strlen($className), - $className - ); - - $this->attemptInstantiationViaUnSerialization($reflectionClass, $serializedString); - - return function () use ($serializedString) { - return unserialize($serializedString); - }; - } - - /** - * @param string $className - * - * @return ReflectionClass - * - * @throws InvalidArgumentException - */ - private function getReflectionClass($className) - { - if (! class_exists($className)) { - throw InvalidArgumentException::fromNonExistingClass($className); - } - - $reflection = new ReflectionClass($className); - - if ($reflection->isAbstract()) { - throw InvalidArgumentException::fromAbstractClass($reflection); - } - - return $reflection; - } - - /** - * @param ReflectionClass $reflectionClass - * @param string $serializedString - * - * @throws UnexpectedValueException - * - * @return void - */ - private function attemptInstantiationViaUnSerialization(ReflectionClass $reflectionClass, $serializedString) - { - set_error_handler(function ($code, $message, $file, $line) use ($reflectionClass, & $error) { - $error = UnexpectedValueException::fromUncleanUnSerialization( - $reflectionClass, - $message, - $code, - $file, - $line - ); - }); - - try { - unserialize($serializedString); - } catch (Exception $exception) { - restore_error_handler(); - - throw UnexpectedValueException::fromSerializationTriggeredException($reflectionClass, $exception); - } - - restore_error_handler(); - - if ($error) { - throw $error; - } - } - - /** - * @param ReflectionClass $reflectionClass - * - * @return bool - */ - private function isInstantiableViaReflection(ReflectionClass $reflectionClass) - { - if (\PHP_VERSION_ID >= 50600) { - return ! ($reflectionClass->isInternal() && $reflectionClass->isFinal()); - } - - return \PHP_VERSION_ID >= 50400 && ! $this->hasInternalAncestors($reflectionClass); - } - - /** - * Verifies whether the given class is to be considered internal - * - * @param ReflectionClass $reflectionClass - * - * @return bool - */ - private function hasInternalAncestors(ReflectionClass $reflectionClass) - { - do { - if ($reflectionClass->isInternal()) { - return true; - } - } while ($reflectionClass = $reflectionClass->getParentClass()); - - return false; - } - - /** - * Verifies if the given PHP version implements the `Serializable` interface serialization - * with an incompatible serialization format. If that's the case, use serialization marker - * "C" instead of "O". - * - * @link http://news.php.net/php.internals/74654 - * - * @param ReflectionClass $reflectionClass - * - * @return string the serialization format marker, either self::SERIALIZATION_FORMAT_USE_UNSERIALIZER - * or self::SERIALIZATION_FORMAT_AVOID_UNSERIALIZER - */ - private function getSerializationFormat(ReflectionClass $reflectionClass) - { - if ($this->isPhpVersionWithBrokenSerializationFormat() - && $reflectionClass->implementsInterface('Serializable') - ) { - return self::SERIALIZATION_FORMAT_USE_UNSERIALIZER; - } - - return self::SERIALIZATION_FORMAT_AVOID_UNSERIALIZER; - } - - /** - * Checks whether the current PHP runtime uses an incompatible serialization format - * - * @return bool - */ - private function isPhpVersionWithBrokenSerializationFormat() - { - return PHP_VERSION_ID === 50429 || PHP_VERSION_ID === 50513; - } - - /** - * Checks if a class is cloneable - * - * @param ReflectionClass $reflection - * - * @return bool - */ - private function isSafeToClone(ReflectionClass $reflection) - { - if (method_exists($reflection, 'isCloneable') && ! $reflection->isCloneable()) { - return false; - } - - // not cloneable if it implements `__clone`, as we want to avoid calling it - return ! $reflection->hasMethod('__clone'); - } -} diff --git a/core/vendor/doctrine/instantiator/src/Doctrine/Instantiator/InstantiatorInterface.php b/core/vendor/doctrine/instantiator/src/Doctrine/Instantiator/InstantiatorInterface.php deleted file mode 100644 index b665bea..0000000 --- a/core/vendor/doctrine/instantiator/src/Doctrine/Instantiator/InstantiatorInterface.php +++ /dev/null @@ -1,37 +0,0 @@ -. - */ - -namespace Doctrine\Instantiator; - -/** - * Instantiator provides utility methods to build objects without invoking their constructors - * - * @author Marco Pivetta - */ -interface InstantiatorInterface -{ - /** - * @param string $className - * - * @return object - * - * @throws \Doctrine\Instantiator\Exception\ExceptionInterface - */ - public function instantiate($className); -} diff --git a/core/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorPerformance/InstantiatorPerformanceEvent.php b/core/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorPerformance/InstantiatorPerformanceEvent.php deleted file mode 100644 index 3e8fc6f..0000000 --- a/core/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorPerformance/InstantiatorPerformanceEvent.php +++ /dev/null @@ -1,96 +0,0 @@ -. - */ - -namespace DoctrineTest\InstantiatorPerformance; - -use Athletic\AthleticEvent; -use Doctrine\Instantiator\Instantiator; - -/** - * Performance tests for {@see \Doctrine\Instantiator\Instantiator} - * - * @author Marco Pivetta - */ -class InstantiatorPerformanceEvent extends AthleticEvent -{ - /** - * @var \Doctrine\Instantiator\Instantiator - */ - private $instantiator; - - /** - * {@inheritDoc} - */ - protected function setUp() - { - $this->instantiator = new Instantiator(); - - $this->instantiator->instantiate(__CLASS__); - $this->instantiator->instantiate('ArrayObject'); - $this->instantiator->instantiate('DoctrineTest\\InstantiatorTestAsset\\SimpleSerializableAsset'); - $this->instantiator->instantiate('DoctrineTest\\InstantiatorTestAsset\\SerializableArrayObjectAsset'); - $this->instantiator->instantiate('DoctrineTest\\InstantiatorTestAsset\\UnCloneableAsset'); - } - - /** - * @iterations 20000 - * @baseline - * @group instantiation - */ - public function testInstantiateSelf() - { - $this->instantiator->instantiate(__CLASS__); - } - - /** - * @iterations 20000 - * @group instantiation - */ - public function testInstantiateInternalClass() - { - $this->instantiator->instantiate('ArrayObject'); - } - - /** - * @iterations 20000 - * @group instantiation - */ - public function testInstantiateSimpleSerializableAssetClass() - { - $this->instantiator->instantiate('DoctrineTest\\InstantiatorTestAsset\\SimpleSerializableAsset'); - } - - /** - * @iterations 20000 - * @group instantiation - */ - public function testInstantiateSerializableArrayObjectAsset() - { - $this->instantiator->instantiate('DoctrineTest\\InstantiatorTestAsset\\SerializableArrayObjectAsset'); - } - - /** - * @iterations 20000 - * @group instantiation - */ - public function testInstantiateUnCloneableAsset() - { - $this->instantiator->instantiate('DoctrineTest\\InstantiatorTestAsset\\UnCloneableAsset'); - } -} diff --git a/core/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTest/Exception/InvalidArgumentExceptionTest.php b/core/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTest/Exception/InvalidArgumentExceptionTest.php deleted file mode 100644 index 39d9b94..0000000 --- a/core/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTest/Exception/InvalidArgumentExceptionTest.php +++ /dev/null @@ -1,83 +0,0 @@ -. - */ - -namespace DoctrineTest\InstantiatorTest\Exception; - -use Doctrine\Instantiator\Exception\InvalidArgumentException; -use PHPUnit_Framework_TestCase; -use ReflectionClass; - -/** - * Tests for {@see \Doctrine\Instantiator\Exception\InvalidArgumentException} - * - * @author Marco Pivetta - * - * @covers \Doctrine\Instantiator\Exception\InvalidArgumentException - */ -class InvalidArgumentExceptionTest extends PHPUnit_Framework_TestCase -{ - public function testFromNonExistingTypeWithNonExistingClass() - { - $className = __CLASS__ . uniqid(); - $exception = InvalidArgumentException::fromNonExistingClass($className); - - $this->assertInstanceOf('Doctrine\\Instantiator\\Exception\\InvalidArgumentException', $exception); - $this->assertSame('The provided class "' . $className . '" does not exist', $exception->getMessage()); - } - - public function testFromNonExistingTypeWithTrait() - { - if (PHP_VERSION_ID < 50400) { - $this->markTestSkipped('Need at least PHP 5.4.0, as this test requires traits support to run'); - } - - $exception = InvalidArgumentException::fromNonExistingClass( - 'DoctrineTest\\InstantiatorTestAsset\\SimpleTraitAsset' - ); - - $this->assertSame( - 'The provided type "DoctrineTest\\InstantiatorTestAsset\\SimpleTraitAsset" is a trait, ' - . 'and can not be instantiated', - $exception->getMessage() - ); - } - - public function testFromNonExistingTypeWithInterface() - { - $exception = InvalidArgumentException::fromNonExistingClass('Doctrine\\Instantiator\\InstantiatorInterface'); - - $this->assertSame( - 'The provided type "Doctrine\\Instantiator\\InstantiatorInterface" is an interface, ' - . 'and can not be instantiated', - $exception->getMessage() - ); - } - - public function testFromAbstractClass() - { - $reflection = new ReflectionClass('DoctrineTest\\InstantiatorTestAsset\\AbstractClassAsset'); - $exception = InvalidArgumentException::fromAbstractClass($reflection); - - $this->assertSame( - 'The provided class "DoctrineTest\\InstantiatorTestAsset\\AbstractClassAsset" is abstract, ' - . 'and can not be instantiated', - $exception->getMessage() - ); - } -} diff --git a/core/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTest/Exception/UnexpectedValueExceptionTest.php b/core/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTest/Exception/UnexpectedValueExceptionTest.php deleted file mode 100644 index 84154e7..0000000 --- a/core/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTest/Exception/UnexpectedValueExceptionTest.php +++ /dev/null @@ -1,69 +0,0 @@ -. - */ - -namespace DoctrineTest\InstantiatorTest\Exception; - -use Doctrine\Instantiator\Exception\UnexpectedValueException; -use Exception; -use PHPUnit_Framework_TestCase; -use ReflectionClass; - -/** - * Tests for {@see \Doctrine\Instantiator\Exception\UnexpectedValueException} - * - * @author Marco Pivetta - * - * @covers \Doctrine\Instantiator\Exception\UnexpectedValueException - */ -class UnexpectedValueExceptionTest extends PHPUnit_Framework_TestCase -{ - public function testFromSerializationTriggeredException() - { - $reflectionClass = new ReflectionClass($this); - $previous = new Exception(); - $exception = UnexpectedValueException::fromSerializationTriggeredException($reflectionClass, $previous); - - $this->assertInstanceOf('Doctrine\\Instantiator\\Exception\\UnexpectedValueException', $exception); - $this->assertSame($previous, $exception->getPrevious()); - $this->assertSame( - 'An exception was raised while trying to instantiate an instance of "' - . __CLASS__ . '" via un-serialization', - $exception->getMessage() - ); - } - - public function testFromUncleanUnSerialization() - { - $reflection = new ReflectionClass('DoctrineTest\\InstantiatorTestAsset\\AbstractClassAsset'); - $exception = UnexpectedValueException::fromUncleanUnSerialization($reflection, 'foo', 123, 'bar', 456); - - $this->assertInstanceOf('Doctrine\\Instantiator\\Exception\\UnexpectedValueException', $exception); - $this->assertSame( - 'Could not produce an instance of "DoctrineTest\\InstantiatorTestAsset\\AbstractClassAsset" ' - . 'via un-serialization, since an error was triggered in file "bar" at line "456"', - $exception->getMessage() - ); - - $previous = $exception->getPrevious(); - - $this->assertInstanceOf('Exception', $previous); - $this->assertSame('foo', $previous->getMessage()); - $this->assertSame(123, $previous->getCode()); - } -} diff --git a/core/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTest/InstantiatorTest.php b/core/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTest/InstantiatorTest.php deleted file mode 100644 index e7f6e94..0000000 --- a/core/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTest/InstantiatorTest.php +++ /dev/null @@ -1,216 +0,0 @@ -. - */ - -namespace DoctrineTest\InstantiatorTest; - -use Doctrine\Instantiator\Exception\UnexpectedValueException; -use Doctrine\Instantiator\Instantiator; -use PHPUnit_Framework_TestCase; -use ReflectionClass; - -/** - * Tests for {@see \Doctrine\Instantiator\Instantiator} - * - * @author Marco Pivetta - * - * @covers \Doctrine\Instantiator\Instantiator - */ -class InstantiatorTest extends PHPUnit_Framework_TestCase -{ - /** - * @var Instantiator - */ - private $instantiator; - - /** - * {@inheritDoc} - */ - protected function setUp() - { - $this->instantiator = new Instantiator(); - } - - /** - * @param string $className - * - * @dataProvider getInstantiableClasses - */ - public function testCanInstantiate($className) - { - $this->assertInstanceOf($className, $this->instantiator->instantiate($className)); - } - - /** - * @param string $className - * - * @dataProvider getInstantiableClasses - */ - public function testInstantiatesSeparateInstances($className) - { - $instance1 = $this->instantiator->instantiate($className); - $instance2 = $this->instantiator->instantiate($className); - - $this->assertEquals($instance1, $instance2); - $this->assertNotSame($instance1, $instance2); - } - - public function testExceptionOnUnSerializationException() - { - if (defined('HHVM_VERSION')) { - $this->markTestSkipped( - 'As of facebook/hhvm#3432, HHVM has no PDORow, and therefore ' - . ' no internal final classes that cannot be instantiated' - ); - } - - $className = 'DoctrineTest\\InstantiatorTestAsset\\UnserializeExceptionArrayObjectAsset'; - - if (\PHP_VERSION_ID >= 50600) { - $className = 'PDORow'; - } - - if (\PHP_VERSION_ID === 50429 || \PHP_VERSION_ID === 50513) { - $className = 'DoctrineTest\\InstantiatorTestAsset\\SerializableArrayObjectAsset'; - } - - $this->setExpectedException('Doctrine\\Instantiator\\Exception\\UnexpectedValueException'); - - $this->instantiator->instantiate($className); - } - - public function testNoticeOnUnSerializationException() - { - if (\PHP_VERSION_ID >= 50600) { - $this->markTestSkipped( - 'PHP 5.6 supports `ReflectionClass#newInstanceWithoutConstructor()` for some internal classes' - ); - } - - try { - $this->instantiator->instantiate('DoctrineTest\\InstantiatorTestAsset\\WakeUpNoticesAsset'); - - $this->fail('No exception was raised'); - } catch (UnexpectedValueException $exception) { - $wakeUpNoticesReflection = new ReflectionClass('DoctrineTest\\InstantiatorTestAsset\\WakeUpNoticesAsset'); - $previous = $exception->getPrevious(); - - $this->assertInstanceOf('Exception', $previous); - - // in PHP 5.4.29 and PHP 5.5.13, this case is not a notice, but an exception being thrown - if (! (\PHP_VERSION_ID === 50429 || \PHP_VERSION_ID === 50513)) { - $this->assertSame( - 'Could not produce an instance of "DoctrineTest\\InstantiatorTestAsset\WakeUpNoticesAsset" ' - . 'via un-serialization, since an error was triggered in file "' - . $wakeUpNoticesReflection->getFileName() . '" at line "36"', - $exception->getMessage() - ); - - $this->assertSame('Something went bananas while un-serializing this instance', $previous->getMessage()); - $this->assertSame(\E_USER_NOTICE, $previous->getCode()); - } - } - } - - /** - * @param string $invalidClassName - * - * @dataProvider getInvalidClassNames - */ - public function testInstantiationFromNonExistingClass($invalidClassName) - { - $this->setExpectedException('Doctrine\\Instantiator\\Exception\\InvalidArgumentException'); - - $this->instantiator->instantiate($invalidClassName); - } - - public function testInstancesAreNotCloned() - { - $className = 'TemporaryClass' . uniqid(); - - eval('namespace ' . __NAMESPACE__ . '; class ' . $className . '{}'); - - $instance = $this->instantiator->instantiate(__NAMESPACE__ . '\\' . $className); - - $instance->foo = 'bar'; - - $instance2 = $this->instantiator->instantiate(__NAMESPACE__ . '\\' . $className); - - $this->assertObjectNotHasAttribute('foo', $instance2); - } - - /** - * Provides a list of instantiable classes (existing) - * - * @return string[][] - */ - public function getInstantiableClasses() - { - $classes = array( - array('stdClass'), - array(__CLASS__), - array('Doctrine\\Instantiator\\Instantiator'), - array('PharException'), - array('DoctrineTest\\InstantiatorTestAsset\\SimpleSerializableAsset'), - array('DoctrineTest\\InstantiatorTestAsset\\PharExceptionAsset'), - array('DoctrineTest\\InstantiatorTestAsset\\UnCloneableAsset'), - array('DoctrineTest\\InstantiatorTestAsset\\XMLReaderAsset'), - ); - - if (\PHP_VERSION_ID === 50429 || \PHP_VERSION_ID === 50513) { - return $classes; - } - - $classes = array_merge( - $classes, - array( - array('PharException'), - array('ArrayObject'), - array('DoctrineTest\\InstantiatorTestAsset\\ArrayObjectAsset'), - array('DoctrineTest\\InstantiatorTestAsset\\SerializableArrayObjectAsset'), - ) - ); - - if (\PHP_VERSION_ID >= 50600) { - $classes[] = array('DoctrineTest\\InstantiatorTestAsset\\WakeUpNoticesAsset'); - $classes[] = array('DoctrineTest\\InstantiatorTestAsset\\UnserializeExceptionArrayObjectAsset'); - } - - return $classes; - } - - /** - * Provides a list of instantiable classes (existing) - * - * @return string[][] - */ - public function getInvalidClassNames() - { - $classNames = array( - array(__CLASS__ . uniqid()), - array('Doctrine\\Instantiator\\InstantiatorInterface'), - array('DoctrineTest\\InstantiatorTestAsset\\AbstractClassAsset'), - ); - - if (\PHP_VERSION_ID >= 50400) { - $classNames[] = array('DoctrineTest\\InstantiatorTestAsset\\SimpleTraitAsset'); - } - - return $classNames; - } -} diff --git a/core/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/AbstractClassAsset.php b/core/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/AbstractClassAsset.php deleted file mode 100644 index fbe28dd..0000000 --- a/core/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/AbstractClassAsset.php +++ /dev/null @@ -1,29 +0,0 @@ -. - */ - -namespace DoctrineTest\InstantiatorTestAsset; - -/** - * A simple asset for an abstract class - * - * @author Marco Pivetta - */ -abstract class AbstractClassAsset -{ -} diff --git a/core/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/ArrayObjectAsset.php b/core/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/ArrayObjectAsset.php deleted file mode 100644 index 56146d7..0000000 --- a/core/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/ArrayObjectAsset.php +++ /dev/null @@ -1,41 +0,0 @@ -. - */ - -namespace DoctrineTest\InstantiatorTestAsset; - -use ArrayObject; -use BadMethodCallException; - -/** - * Test asset that extends an internal PHP class - * - * @author Marco Pivetta - */ -class ArrayObjectAsset extends ArrayObject -{ - /** - * Constructor - should not be called - * - * @throws BadMethodCallException - */ - public function __construct() - { - throw new BadMethodCallException('Not supposed to be called!'); - } -} diff --git a/core/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/PharAsset.php b/core/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/PharAsset.php deleted file mode 100644 index 553fd56..0000000 --- a/core/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/PharAsset.php +++ /dev/null @@ -1,41 +0,0 @@ -. - */ - -namespace DoctrineTest\InstantiatorTestAsset; - -use BadMethodCallException; -use Phar; - -/** - * Test asset that extends an internal PHP class - * - * @author Marco Pivetta - */ -class PharAsset extends Phar -{ - /** - * Constructor - should not be called - * - * @throws BadMethodCallException - */ - public function __construct() - { - throw new BadMethodCallException('Not supposed to be called!'); - } -} diff --git a/core/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/PharExceptionAsset.php b/core/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/PharExceptionAsset.php deleted file mode 100644 index 42bf73e..0000000 --- a/core/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/PharExceptionAsset.php +++ /dev/null @@ -1,44 +0,0 @@ -. - */ - -namespace DoctrineTest\InstantiatorTestAsset; - -use BadMethodCallException; -use PharException; - -/** - * Test asset that extends an internal PHP class - * This class should be serializable without problems - * and without getting the "Erroneous data format for unserializing" - * error - * - * @author Marco Pivetta - */ -class PharExceptionAsset extends PharException -{ - /** - * Constructor - should not be called - * - * @throws BadMethodCallException - */ - public function __construct() - { - throw new BadMethodCallException('Not supposed to be called!'); - } -} diff --git a/core/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/SerializableArrayObjectAsset.php b/core/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/SerializableArrayObjectAsset.php deleted file mode 100644 index ba19aaf..0000000 --- a/core/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/SerializableArrayObjectAsset.php +++ /dev/null @@ -1,62 +0,0 @@ -. - */ - -namespace DoctrineTest\InstantiatorTestAsset; - -use ArrayObject; -use BadMethodCallException; -use Serializable; - -/** - * Serializable test asset that also extends an internal class - * - * @author Marco Pivetta - */ -class SerializableArrayObjectAsset extends ArrayObject implements Serializable -{ - /** - * Constructor - should not be called - * - * @throws BadMethodCallException - */ - public function __construct() - { - throw new BadMethodCallException('Not supposed to be called!'); - } - - /** - * {@inheritDoc} - */ - public function serialize() - { - return ''; - } - - /** - * {@inheritDoc} - * - * Should not be called - * - * @throws BadMethodCallException - */ - public function unserialize($serialized) - { - throw new BadMethodCallException('Not supposed to be called!'); - } -} diff --git a/core/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/SimpleSerializableAsset.php b/core/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/SimpleSerializableAsset.php deleted file mode 100644 index 39f84a6..0000000 --- a/core/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/SimpleSerializableAsset.php +++ /dev/null @@ -1,61 +0,0 @@ -. - */ - -namespace DoctrineTest\InstantiatorTestAsset; - -use BadMethodCallException; -use Serializable; - -/** - * Base serializable test asset - * - * @author Marco Pivetta - */ -class SimpleSerializableAsset implements Serializable -{ - /** - * Constructor - should not be called - * - * @throws BadMethodCallException - */ - public function __construct() - { - throw new BadMethodCallException('Not supposed to be called!'); - } - - /** - * {@inheritDoc} - */ - public function serialize() - { - return ''; - } - - /** - * {@inheritDoc} - * - * Should not be called - * - * @throws BadMethodCallException - */ - public function unserialize($serialized) - { - throw new BadMethodCallException('Not supposed to be called!'); - } -} diff --git a/core/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/SimpleTraitAsset.php b/core/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/SimpleTraitAsset.php deleted file mode 100644 index 04e7806..0000000 --- a/core/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/SimpleTraitAsset.php +++ /dev/null @@ -1,29 +0,0 @@ -. - */ - -namespace DoctrineTest\InstantiatorTestAsset; - -/** - * A simple trait with no attached logic - * - * @author Marco Pivetta - */ -trait SimpleTraitAsset -{ -} diff --git a/core/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/UnCloneableAsset.php b/core/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/UnCloneableAsset.php deleted file mode 100644 index 7d03bda..0000000 --- a/core/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/UnCloneableAsset.php +++ /dev/null @@ -1,50 +0,0 @@ -. - */ - -namespace DoctrineTest\InstantiatorTestAsset; - -use BadMethodCallException; - -/** - * Base un-cloneable asset - * - * @author Marco Pivetta - */ -class UnCloneableAsset -{ - /** - * Constructor - should not be called - * - * @throws BadMethodCallException - */ - public function __construct() - { - throw new BadMethodCallException('Not supposed to be called!'); - } - - /** - * Magic `__clone` - should not be invoked - * - * @throws BadMethodCallException - */ - public function __clone() - { - throw new BadMethodCallException('Not supposed to be called!'); - } -} diff --git a/core/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/UnserializeExceptionArrayObjectAsset.php b/core/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/UnserializeExceptionArrayObjectAsset.php deleted file mode 100644 index b348a40..0000000 --- a/core/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/UnserializeExceptionArrayObjectAsset.php +++ /dev/null @@ -1,39 +0,0 @@ -. - */ - -namespace DoctrineTest\InstantiatorTestAsset; - -use ArrayObject; -use BadMethodCallException; - -/** - * A simple asset for an abstract class - * - * @author Marco Pivetta - */ -class UnserializeExceptionArrayObjectAsset extends ArrayObject -{ - /** - * {@inheritDoc} - */ - public function __wakeup() - { - throw new BadMethodCallException(); - } -} diff --git a/core/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/WakeUpNoticesAsset.php b/core/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/WakeUpNoticesAsset.php deleted file mode 100644 index 18dc671..0000000 --- a/core/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/WakeUpNoticesAsset.php +++ /dev/null @@ -1,38 +0,0 @@ -. - */ - -namespace DoctrineTest\InstantiatorTestAsset; - -use ArrayObject; - -/** - * A simple asset for an abstract class - * - * @author Marco Pivetta - */ -class WakeUpNoticesAsset extends ArrayObject -{ - /** - * Wakeup method called after un-serialization - */ - public function __wakeup() - { - trigger_error('Something went bananas while un-serializing this instance'); - } -} diff --git a/core/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/XMLReaderAsset.php b/core/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/XMLReaderAsset.php deleted file mode 100644 index 39ee699..0000000 --- a/core/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/XMLReaderAsset.php +++ /dev/null @@ -1,41 +0,0 @@ -. - */ - -namespace DoctrineTest\InstantiatorTestAsset; - -use BadMethodCallException; -use XMLReader; - -/** - * Test asset that extends an internal PHP class - * - * @author Dave Marshall - */ -class XMLReaderAsset extends XMLReader -{ - /** - * Constructor - should not be called - * - * @throws BadMethodCallException - */ - public function __construct() - { - throw new BadMethodCallException('Not supposed to be called!'); - } -} diff --git a/core/vendor/doctrine/lexer/README.md b/core/vendor/doctrine/lexer/README.md deleted file mode 100644 index 66f4430..0000000 --- a/core/vendor/doctrine/lexer/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Doctrine Lexer - -Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers. - -This lexer is used in Doctrine Annotations and in Doctrine ORM (DQL). diff --git a/core/vendor/doctrine/lexer/composer.json b/core/vendor/doctrine/lexer/composer.json deleted file mode 100644 index 5e6e83a..0000000 --- a/core/vendor/doctrine/lexer/composer.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "doctrine/lexer", - "type": "library", - "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.", - "keywords": ["lexer", "parser"], - "homepage": "http://www.doctrine-project.org", - "license": "MIT", - "authors": [ - {"name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com"}, - {"name": "Roman Borschel", "email": "roman@code-factory.org"}, - {"name": "Johannes Schmitt", "email": "schmittjoh@gmail.com"} - ], - "require": { - "php": ">=5.3.2" - }, - "autoload": { - "psr-0": { "Doctrine\\Common\\Lexer\\": "lib/" } - } -} diff --git a/core/vendor/doctrine/lexer/lib/Doctrine/Common/Lexer/AbstractLexer.php b/core/vendor/doctrine/lexer/lib/Doctrine/Common/Lexer/AbstractLexer.php deleted file mode 100644 index eb6cf7c..0000000 --- a/core/vendor/doctrine/lexer/lib/Doctrine/Common/Lexer/AbstractLexer.php +++ /dev/null @@ -1,265 +0,0 @@ -. - */ - -namespace Doctrine\Common\Lexer; - -/** - * Base class for writing simple lexers, i.e. for creating small DSLs. - * - * @since 2.0 - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - */ -abstract class AbstractLexer -{ - /** - * @var array Array of scanned tokens - */ - private $tokens = array(); - - /** - * @var integer Current lexer position in input string - */ - private $position = 0; - - /** - * @var integer Current peek of current lexer position - */ - private $peek = 0; - - /** - * @var array The next token in the input. - */ - public $lookahead; - - /** - * @var array The last matched/seen token. - */ - public $token; - - /** - * Sets the input data to be tokenized. - * - * The Lexer is immediately reset and the new input tokenized. - * Any unprocessed tokens from any previous input are lost. - * - * @param string $input The input to be tokenized. - */ - public function setInput($input) - { - $this->tokens = array(); - $this->reset(); - $this->scan($input); - } - - /** - * Resets the lexer. - */ - public function reset() - { - $this->lookahead = null; - $this->token = null; - $this->peek = 0; - $this->position = 0; - } - - /** - * Resets the peek pointer to 0. - */ - public function resetPeek() - { - $this->peek = 0; - } - - /** - * Resets the lexer position on the input to the given position. - * - * @param integer $position Position to place the lexical scanner - */ - public function resetPosition($position = 0) - { - $this->position = $position; - } - - /** - * Checks whether a given token matches the current lookahead. - * - * @param integer|string $token - * @return boolean - */ - public function isNextToken($token) - { - return null !== $this->lookahead && $this->lookahead['type'] === $token; - } - - /** - * Checks whether any of the given tokens matches the current lookahead - * - * @param array $tokens - * @return boolean - */ - public function isNextTokenAny(array $tokens) - { - return null !== $this->lookahead && in_array($this->lookahead['type'], $tokens, true); - } - - /** - * Moves to the next token in the input string. - * - * A token is an associative array containing three items: - * - 'value' : the string value of the token in the input string - * - 'type' : the type of the token (identifier, numeric, string, input - * parameter, none) - * - 'position' : the position of the token in the input string - * - * @return array|null the next token; null if there is no more tokens left - */ - public function moveNext() - { - $this->peek = 0; - $this->token = $this->lookahead; - $this->lookahead = (isset($this->tokens[$this->position])) - ? $this->tokens[$this->position++] : null; - - return $this->lookahead !== null; - } - - /** - * Tells the lexer to skip input tokens until it sees a token with the given value. - * - * @param string $type The token type to skip until. - */ - public function skipUntil($type) - { - while ($this->lookahead !== null && $this->lookahead['type'] !== $type) { - $this->moveNext(); - } - } - - /** - * Checks if given value is identical to the given token - * - * @param mixed $value - * @param integer $token - * @return boolean - */ - public function isA($value, $token) - { - return $this->getType($value) === $token; - } - - /** - * Moves the lookahead token forward. - * - * @return array | null The next token or NULL if there are no more tokens ahead. - */ - public function peek() - { - if (isset($this->tokens[$this->position + $this->peek])) { - return $this->tokens[$this->position + $this->peek++]; - } else { - return null; - } - } - - /** - * Peeks at the next token, returns it and immediately resets the peek. - * - * @return array|null The next token or NULL if there are no more tokens ahead. - */ - public function glimpse() - { - $peek = $this->peek(); - $this->peek = 0; - return $peek; - } - - /** - * Scans the input string for tokens. - * - * @param string $input a query string - */ - protected function scan($input) - { - static $regex; - - if ( ! isset($regex)) { - $regex = '/(' . implode(')|(', $this->getCatchablePatterns()) . ')|' - . implode('|', $this->getNonCatchablePatterns()) . '/i'; - } - - $flags = PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_OFFSET_CAPTURE; - $matches = preg_split($regex, $input, -1, $flags); - - foreach ($matches as $match) { - // Must remain before 'value' assignment since it can change content - $type = $this->getType($match[0]); - - $this->tokens[] = array( - 'value' => $match[0], - 'type' => $type, - 'position' => $match[1], - ); - } - } - - /** - * Gets the literal for a given token. - * - * @param integer $token - * @return string - */ - public function getLiteral($token) - { - $className = get_class($this); - $reflClass = new \ReflectionClass($className); - $constants = $reflClass->getConstants(); - - foreach ($constants as $name => $value) { - if ($value === $token) { - return $className . '::' . $name; - } - } - - return $token; - } - - /** - * Lexical catchable patterns. - * - * @return array - */ - abstract protected function getCatchablePatterns(); - - /** - * Lexical non-catchable patterns. - * - * @return array - */ - abstract protected function getNonCatchablePatterns(); - - /** - * Retrieve token type. Also processes the token value if necessary. - * - * @param string $value - * @return integer - */ - abstract protected function getType(&$value); -} diff --git a/core/vendor/easyrdf/easyrdf/CHANGELOG.md b/core/vendor/easyrdf/easyrdf/CHANGELOG.md deleted file mode 100644 index 6ac65fb..0000000 --- a/core/vendor/easyrdf/easyrdf/CHANGELOG.md +++ /dev/null @@ -1,340 +0,0 @@ -EasyRdf 0.9.0 -============= - -* code-style fix - -EasyRdf 0.9.0-rc.4 -================== - -* fixed compatibility with php < 5.4.8 (see issue #212) -* tweaked unit-tests - -EasyRdf 0.9.0-rc.3 -================== - -* fixed documentation generation - -EasyRdf 0.9.0-rc.2 -================== - -* tweaked unit-tests - -EasyRdf 0.9.0-rc.1 -================== - -Major new features ------------------- -* Framing support in `EasyRdf_Serialiser_JsonLd` -* JSON-LD Parser - -API changes ------------ -* `EasyRdf_Literal_Decimal` returns strings, instead of floats to avoid losing precision (see issue #178) -* `EasyRdf_Literal_Decimal` requires input-strings which conform to `xs:decimal` format -* `EasyRdf_GraphStore` supports operations over default graph now -* `EasyRdf_Literal` typed as `xs:double` is used for PHP-floats instead of `EasyRdf_Literal_Decimal` -* Exceptions thrown from `EasyRdf_Graph::resource()` use different message-texts now (see issue #159) - -Enhancements ------------- -* Synced list of default namespaces against [RDFa Core Initial Context](http://www.w3.org/2011/rdfa-context/rdfa-1.1) rev.2014-01-17 -* Added support for empty prefixes (see issue #183) -* `EasyRdf_Graph::newAndLoad` throws `EasyRdf_Http_Exception` in case of failure, which gives access to status and response-body. (see issue #149) -* `EasyRdf_Graph` and `EasyRdf_Resource` have 'typesAsResources()' methods now - -Bug Fixes ---------- -* Fix for Turtle serialisation of FALSE (see issue #179) -* Fix for edge-case in RDF/XML serialisation (see issue #186) -* SPARQL-queries against endpoints which have query-params in their URL (see issue #184) -* Float values are properly handled if locale with "other" separator is active -* Fixed parsing of Turtle-documents with higher utf-8 characters (see issue #195) -* Namespace-prefixes are compliant with RDFXML QName spec (see issue #185) -* `EasyRdf_Namespace` won't generate "short" names with "/" in them anymore (see issue #115) -* `EasyRdf_Parser_RdfXml` respects "base" specified for the document (see issue #157) -* HTML documents are correctly detected now, not as "n-triples" (see issue #206) -* Accept-headers are formatted in locale-independent fashion now (see issue #208) - - -EasyRdf 0.8.0 -============= - -Major new features ------------------- -* Now PSR-2 compliant -* Added RDFa parser -* Added SPARQL Update support to `EasyRdf_Sparql_Client` - -API changes ------------ -* `is_a()` has been renamed to `isA()` -* `isBnode()` has been renamed to `isBNode()` -* `getNodeId()` has been renamed to `getBNodeId()` -* Added a `$value` property to `hasProperty()` -* Renamed `toArray()` to `toRdfPhp()` -* Renamed `count()` to `countValues()` in `EasyRdf_Graph` and `EasyRdf_Resource` -* Made passing a URI to `delete()` behave more like `all()` and `get()` - you must enclose in `<>` -* `dump(true)` has changed to `dump('html')` -* `getUri()` in `EasyRdf_Sparql_Client` has been renamed to `getQueryUri()` - -Enhancements ------------- -* Added `EasyRdf_Container` class to help iterate through `rdf:Alt`, `rdf:Bag` and `rdf:Seq` -* Added `EasyRdf_Collection` class to help iterate through `rdf:List` -* Added `EasyRdf_Literal_HTML` and `EasyRdf_Literal_XML` -* Changed formatting of `xsd:dateTime` from `DateTime::ISO8601` to `DateTime::ATOM` -* Added `rss:title` to the list of properties that `label()` will check for -* Added support for serialising containers to the RDF/XML serialiser -* Added getGraph method to `EasyRdf_Resource` -* Turtle parser improvements -* Added the `application/n-triples` MIME type for the N-Triples format -* Added support to `EasyRdf_Namespace` for expanding `a` to `rdf:type` -* Added `listNamedGraphs()` function to `EasyRdf_Sparql_Client` -* Added line and column number to exceptions in the built-in parsers - -Bug Fixes ---------- -* Fixed bug in `EasyRdf_Namespace::expand()` (see issue #114) -* Fix for dumping SPARQL SELECT query with unbound result (see issue #112) -* Sesame compatibility : avoid duplicate Content-Length header -* Fix for for passing objects of type DateTime to $graph->add() (see issue #119) -* Fix for SPARQL queries longer than 2KB (see issue #85) -* Fix for dumping literal with unshortenable datatype uri (see issue #120) -* Fix for getting default mime type or extension when there isn't one -* Fix for missing trailing slash the HTTP client - - -EasyRdf 0.7.2 -============= - -Enhancements ------------- -* Removed automatic registration of ARC2 and librdf parsers and serialisers -** You must now specifically choose the parser or serialiser -* Refactored `EasyRdf_Literal` with datatypes so that it preserves exact value -* Changed Turtle serialiser to not escape Unicode characters unnecessarily -* Fix for escaping literals objects in Turtle serialiser -* Added a new static function `newAndLoad()` to `EasyRdf_Graph` -* Added setters for each of the components of the URI to the class `EasyRdf_ParsedUri` -* Added option to the converter example, to allow raw output, without any HTML - -Bug Fixes ---------- -* Fixed broken Redland parser (thanks to Jon Phipps) -* Fix for serialising two bnodes that reference each other in Turtle -* Added support for parsing literals with single quotes in Turtle -* Removed require for EasyRdf/Exception.php -* Fix for serialising `EasyRdf_Literal_DateTime` to Turtle -* Fix for serialising Turtle literals with a shorthand syntax -* Several typo fixes and minor corrections - - -EasyRdf 0.7.1 -============= - -Enhancements ------------- -* Changed minimum version of PHPUnit to 3.5.15 -* Added RDFa namespace -* Added Open Graph Protocol namespace -* Made improvements to formatting of the Turtle serialiser -* Added new splitUri() function to EasyRdf_Namespace -* Made improvements to format guessing - -Bug Fixes ---------- -* Fix for RDF/XML parser not returning the number of triples -* Added re-mapping of b-nodes to N-Triples and Redland parsers - - -EasyRdf 0.7.0 -============= - -API Changes ------------ -* You must now wrap full property URIs in angle brackets - -Major new features ------------------- -* Added a new pure-PHP Turtle parser -* Added basic property-path support for traversing graphs -* Added support for serialising to the GraphViz dot format (and generating images) -* Added a new class `EasyRdf_ParsedUri` - a RFC3986 compliant URI parser - -Enhancements ------------- -* The load() function in `EasyRdf_Graph` no-longer takes a $data argument -* The parse() and load() methods, now return the number of triples parsed -* Added count() method to `EasyRdf_Resource` and `EasyRdf_Graph` -* Added localName() method to `EasyRdf_Resource` -* Added htmlLink() method to `EasyRdf_Resource` -* Added methods deleteResource() and deleteLiteral() to `EasyRdf_Graph` -* Added support for guessing the file format based on the file extension -* Performance improvements to built-in serialisers - -Environment changes -------------------- -* Added PHP Composer description to the project -* Now properly PSR-0 autoloader compatible -* New minimum version of PHP is 5.2.8 -* Changed test suite to require PHPUnit 3.6 -* Changed from Phing to GNU Make based build system -* Added automated testing of the examples - -Bug Fixes ---------- -* Fix for loading https:// URLs -* Fix for storing the value 0 in a `EasyRdf_Graph` -* Fix for HTTP servers that return relative URIs in the Location header -* Fix for Literals with languages in the SPARQL Query Results XML Format -* Fix for SPARQL servers that put extra whitespace into the XML result -* Fix for the httpget.php example in PHP 5.4+ - - -EasyRdf 0.6.3 -============= -* Added $graph->parseFile() method. -* Added support for SSL (https) to the built-in HTTP client -* Fixes for HTTP responses with a charset parameter in the Content Type. -* Improved error handling and empty documents in JSON and rapper parsers. -* Added connivence class for xsd:hexBinary literals: - - `EasyRdf_Literal_HexBinary` -* Made EasyRdf more tolerant of 'badly serialised bnodes' -* Fix for SPARQL servers that return charset in the MIME Type. -* Fix for using xml:lang in SPARQL 1.1 Query Results JSON Format -* Changed datetime ISO formatting to use 'Z' instead of +0000 for UTC dateTimes -* Added the namespace for 'The Cert Ontology' to EasyRdf. - - -EasyRdf 0.6.2 -============= -* Bug fix for missing triples in the RDF/XML serialiser. -* Added countTriples() method to `EasyRdf_Graph`. -* Re-factored the mechanism for mapping RDF datatypes to PHP classes. -* Added subclasses of `EasyRdf_Literal` for various XSD datatypes: - - `EasyRdf_Literal_Boolean` - - `EasyRdf_Literal_Date` - - `EasyRdf_Literal_DateTime` - - `EasyRdf_Literal_Decimal` - - `EasyRdf_Literal_Integer` -* Made the Redland based parser write triples directly to `EasyRdf_Graph` -* Added support for datatypes and languages in the `EasyRdf_Parser_Ntriples` parser. -* Fix for parsing XML Literals in RDF/XML - - -EasyRdf 0.6.1 -============= -* Updated API documentation for new classes and methods added in 0.6.0 -* Added a description to the top of the source code for each example. -* Changed the generated bnode identifier names from eidXXX to genidXXX. -* Implemented inlining of resources in the RDF/XML serialiser. -* Added new reversePropertyUris() method to `EasyRdf_Graph` and `EasyRdf_Resource`. -* Added addType() and setType() to `EasyRdf_Resource`. -* Added a textarea to the converter example. -* Added support for parsing the json-triples format. -* Renamed `EasyRdf_SparqlClient` to `EasyRdf_Sparql_Client` -* Renamed `EasyRdf_SparqlResult` to `EasyRdf_Sparql_Result` -* Fix for $graph->isEmpty() failing after adding and deleting some triples -* Added new `EasyRdf_DatatypeMapper` class that allows you to map RDF datatypes to PHP classes. -* Renamed guessDatatype() to getDatatypeForValue() in `EasyRdf_Literal`. -* Added getResource() and allResources() to `EasyRdf_Graph` and `EasyRdf_Resource` -* Implemented value casting in literals based on the datatype. - - -EasyRdf 0.6.0 -============= -* Major re-factor of the way data is stored internally in `EasyRdf_Graph`. -* Parsing and serialising is now much faster and will enable further optimisations. -* API is mostly backwards-compatible apart from: - - Changed inverse property operator from - to ^ to match Sparql 1.1 property paths. - - New `EasyRdf_Graphs` will not automatically be loaded on creation - You must now call $graph->load(); - - Setting the default HTTP client is now part of a new `EasyRdf_Http` class - - It is no-longer possible to add multiple properties at once using an associative array. -* Added methods to `EasyRdf_Graph` for direct manipulation of triples. -* Added new `EasyRdf_GraphStore` - class for fetching, saving and deleting graphs to a Graph Store over HTTP. -* Added new `EasyRdf_SparqlClient` and `EasyRdf_SparqlResult` - class for querying a SPARQL endpoint over HTTP. -* Added q values for each Mime-Type associated with an `EasyRdf_Format`. -* New example demonstrating integration with the Zend Framework. -* New `EasyRdf_HTTP_MockClient` class makes testing easier. - - -EasyRdf 0.5.2 -============= -* Added a built-in RDF/XML parser -* Made the RDF/XML serialiser use the rdf:type to open tags -* Added support for comments in the N-Triples parser -* Added new resolveUriReference() function to `EasyRdf_Utils` -* Added the application/rdf+json and text/rdf+n3 mime types - - -EasyRdf 0.5.1 -============= -* Bug fixes for PHP 5.2 - - -EasyRdf 0.5.0 -============= -* Added support for inverse properties. -* Updated RDF/XML and Turtle serialisers to create new namespaces if possible. -* Added new is_a($type) method to `EasyRdf_Resource`. -* Added support for passing an array of properties to the get() method. -* Added primaryTopic() method to `EasyRdf_Resource`. -* The function label() in `EasyRdf_Resource` will no longer attempted to shorten the URI, - if there is no label available. -* Resource types are now stored as resources, instead of shortened URIs. -* Added support for deleting a specific value for property to `EasyRdf_Resource`. -* Properties and datatypes are now stored as full URIs and not - converted to qnames during import. -* Change the TypeMapper to store full URIs internally. -* Added bibo and geo to the set of default namespaces. -* Improved bnode links in dump format -* Fix for converting non-string `EasyRdf_Literal` to string. -* Created an example that resolves UK postcodes using uk-postcodes.com. - - -EasyRdf 0.4.0 -============= -* Moved source code to Github -* Added an `EasyRdf_Literal` class -* Added proper support for Datatypes and Languages -* Added built-in RDF/XML serialiser -* Added built-in Turtle serialiser -* Added a new `EasyRdf_Format` class to deal with mime types etc. -* finished a major refactoring of the Parser/Serialiser registration -* removed all parsing related code from `EasyRdf_Graph` -* Added a basic serialisation example -* Added additional common namespaces -* Test fixes - - -EasyRdf 0.3.0 -============= -* Generated Wiki pages from phpdoc -* Filtering of literals by language -* Moved parsers into `EasyRdf_Parser_XXX` namespace -* Added support for serialisation -* Wrote RDF generation example (foafmaker.php) -* Added built-in ntriples parser/generator -* Added built-in RDF/PHP serialiser -* Added built-in RDF/JSON serialiser -* Added SKOS and RSS to the set of default namespaces. - - -EasyRdf 0.2.0 -============= -* Added support for Redland PHP bindings -* Added support for n-triples document type. -* Improved blank node handing and added newBNode() method to `EasyRdf_Graph`. -* Add option to `EasyRdf_RapperParser` to choose location of rapper command -* Added Rails style HTML tag helpers to examples to make them simpler - - -EasyRdf 0.1.0 -============= -* First public release -* Support for ARC2 and Rapper -* Built-in HTTP Client -* API Documentation -* PHP Unit tests for every class. -* Several usage examples diff --git a/core/vendor/easyrdf/easyrdf/DEVELOPER.md b/core/vendor/easyrdf/easyrdf/DEVELOPER.md deleted file mode 100644 index f9c6dac..0000000 --- a/core/vendor/easyrdf/easyrdf/DEVELOPER.md +++ /dev/null @@ -1,31 +0,0 @@ -Contributing to EasyRdf -======================= - -Contributions to the EasyRdf codebase are welcome using the usual Github pull request workflow. - -To run the code style checker: - -``` -make cs -``` - -You can run the PHP unit test suite with: - -``` -make test-lib -``` - -Unit tests are automatically run after being received by Github: -http://ci.aelius.com/job/easyrdf/ - -The tests for the examples are run separately: -http://ci.aelius.com/job/easyrdf-examples/ - - -Notes ------ - -* Please ask on the [mailing list] before starting work on any significant changes -* Please write tests for any new features or bug fixes. The tests should be checked in the same commit as the code. - -[mailing list]:http://groups.google.com/group/easyrdf diff --git a/core/vendor/easyrdf/easyrdf/LICENSE.md b/core/vendor/easyrdf/easyrdf/LICENSE.md deleted file mode 100644 index c5e2f5d..0000000 --- a/core/vendor/easyrdf/easyrdf/LICENSE.md +++ /dev/null @@ -1,420 +0,0 @@ -LICENSE -======= - -Copyright (c) 2009-2011 Nicholas J Humfrey. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * The name of the author 'Nicholas J Humfrey" may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - - -OTHER LICENSES -============== - -Parts of this program or documentation is available under different -licensing terms. These are as following. - -The appendix in the documentation about RDF formats (APPENDIX A) is a -derivative work under CC-BY-SA-3.0. It consists of two documents: - -1. The RDF/PHP Specification was written/edited 2008 by Ian Davis and Keith - Alexander -2. The RDF/JSON Specification was written/edited 2007, 2008 by Keith - Alexander, Danny Ayers, Sam Tunnicliffe, Fellahst, Ian Davis and Robman - -These two documents have been translated 2014 into markdown by hakre. - - -Creative Commons Attribution-ShareAlike 3.0 Unported -==================================================== - -CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE -LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN -ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION -ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE -INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM -ITS USE. - -License - -THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE -COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY -COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS -AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. - -BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE -TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY -BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS -CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND -CONDITIONS. - -1. Definitions - -a. "Adaptation" means a work based upon the Work, or upon the Work and -other pre-existing works, such as a translation, adaptation, derivative -work, arrangement of music or other alterations of a literary or -artistic work, or phonogram or performance and includes cinematographic -adaptations or any other form in which the Work may be recast, -transformed, or adapted including in any form recognizably derived from -the original, except that a work that constitutes a Collection will not -be considered an Adaptation for the purpose of this License. For the -avoidance of doubt, where the Work is a musical work, performance or -phonogram, the synchronization of the Work in timed-relation with a -moving image ("synching") will be considered an Adaptation for the -purpose of this License. - -b. "Collection" means a collection of literary or artistic works, such -as encyclopedias and anthologies, or performances, phonograms or -broadcasts, or other works or subject matter other than works listed in -Section 1(f) below, which, by reason of the selection and arrangement of -their contents, constitute intellectual creations, in which the Work is -included in its entirety in unmodified form along with one or more other -contributions, each constituting separate and independent works in -themselves, which together are assembled into a collective whole. A work -that constitutes a Collection will not be considered an Adaptation (as -defined below) for the purposes of this License. - -c. "Creative Commons Compatible License" means a license that is listed -at http://creativecommons.org/compatiblelicenses that has been approved -by Creative Commons as being essentially equivalent to this License, -including, at a minimum, because that license: (i) contains terms that -have the same purpose, meaning and effect as the License Elements of -this License; and, (ii) explicitly permits the relicensing of -adaptations of works made available under that license under this -License or a Creative Commons jurisdiction license with the same License -Elements as this License. - -d. "Distribute" means to make available to the public the original and -copies of the Work or Adaptation, as appropriate, through sale or other -transfer of ownership. - -e. "License Elements" means the following high-level license attributes -as selected by Licensor and indicated in the title of this License: -Attribution, ShareAlike. - -f. "Licensor" means the individual, individuals, entity or entities that -offer(s) the Work under the terms of this License. - -g. "Original Author" means, in the case of a literary or artistic work, -the individual, individuals, entity or entities who created the Work or -if no individual or entity can be identified, the publisher; and in -addition (i) in the case of a performance the actors, singers, -musicians, dancers, and other persons who act, sing, deliver, declaim, -play in, interpret or otherwise perform literary or artistic works or -expressions of folklore; (ii) in the case of a phonogram the producer -being the person or legal entity who first fixes the sounds of a -performance or other sounds; and, (iii) in the case of broadcasts, the -organization that transmits the broadcast. - -h. "Work" means the literary and/or artistic work offered under the -terms of this License including without limitation any production in the -literary, scientific and artistic domain, whatever may be the mode or -form of its expression including digital form, such as a book, pamphlet -and other writing; a lecture, address, sermon or other work of the same -nature; a dramatic or dramatico-musical work; a choreographic work or -entertainment in dumb show; a musical composition with or without words; -a cinematographic work to which are assimilated works expressed by a -process analogous to cinematography; a work of drawing, painting, -architecture, sculpture, engraving or lithography; a photographic work -to which are assimilated works expressed by a process analogous to -photography; a work of applied art; an illustration, map, plan, sketch -or three-dimensional work relative to geography, topography, -architecture or science; a performance; a broadcast; a phonogram; a -compilation of data to the extent it is protected as a copyrightable -work; or a work performed by a variety or circus performer to the extent -it is not otherwise considered a literary or artistic work. - -i. "You" means an individual or entity exercising rights under this -License who has not previously violated the terms of this License with -respect to the Work, or who has received express permission from the -Licensor to exercise rights under this License despite a previous -violation. - -j. "Publicly Perform" means to perform public recitations of the Work -and to communicate to the public those public recitations, by any means -or process, including by wire or wireless means or public digital -performances; to make available to the public Works in such a way that -members of the public may access these Works from a place and at a place -individually chosen by them; to perform the Work to the public by any -means or process and the communication to the public of the performances -of the Work, including by public digital performance; to broadcast and -rebroadcast the Work by any means including signs, sounds or images. - -k. "Reproduce" means to make copies of the Work by any means including -without limitation by sound or visual recordings and the right of -fixation and reproducing fixations of the Work, including storage of a -protected performance or phonogram in digital form or other electronic -medium. - -2. Fair Dealing Rights. Nothing in this License is intended to reduce, -limit, or restrict any uses free from copyright or rights arising from -limitations or exceptions that are provided for in connection with the -copyright protection under copyright law or other applicable laws. - -3. License Grant. Subject to the terms and conditions of this License, -Licensor hereby grants You a worldwide, royalty-free, non-exclusive, -perpetual (for the duration of the applicable copyright) license to -exercise the rights in the Work as stated below: - -a. to Reproduce the Work, to incorporate the Work into one or more -Collections, and to Reproduce the Work as incorporated in the -Collections; - -b. to create and Reproduce Adaptations provided that any such -Adaptation, including any translation in any medium, takes reasonable -steps to clearly label, demarcate or otherwise identify that changes -were made to the original Work. For example, a translation could be -marked "The original work was translated from English to Spanish," or a -modification could indicate "The original work has been modified."; - -c. to Distribute and Publicly Perform the Work including as incorporated -in Collections; and, - -d. to Distribute and Publicly Perform Adaptations. - -e. For the avoidance of doubt: - -i. Non-waivable Compulsory License Schemes. In those jurisdictions in -which the right to collect royalties through any statutory or compulsory -licensing scheme cannot be waived, the Licensor reserves the exclusive -right to collect such royalties for any exercise by You of the rights -granted under this License; - -ii. Waivable Compulsory License Schemes. In those jurisdictions in which -the right to collect royalties through any statutory or compulsory -licensing scheme can be waived, the Licensor waives the exclusive right -to collect such royalties for any exercise by You of the rights granted -under this License; and, - -iii. Voluntary License Schemes. The Licensor waives the right to collect -royalties, whether individually or, in the event that the Licensor is a -member of a collecting society that administers voluntary licensing -schemes, via that society, from any exercise by You of the rights -granted under this License. - -The above rights may be exercised in all media and formats whether now -known or hereafter devised. The above rights include the right to make -such modifications as are technically necessary to exercise the rights -in other media and formats. Subject to Section 8(f), all rights not -expressly granted by Licensor are hereby reserved. - -4. Restrictions. The license granted in Section 3 above is expressly -made subject to and limited by the following restrictions: - -a. You may Distribute or Publicly Perform the Work only under the terms -of this License. You must include a copy of, or the Uniform Resource -Identifier (URI) for, this License with every copy of the Work You -Distribute or Publicly Perform. You may not offer or impose any terms on -the Work that restrict the terms of this License or the ability of the -recipient of the Work to exercise the rights granted to that recipient -under the terms of the License. You may not sublicense the Work. You -must keep intact all notices that refer to this License and to the -disclaimer of warranties with every copy of the Work You Distribute or -Publicly Perform. When You Distribute or Publicly Perform the Work, You -may not impose any effective technological measures on the Work that -restrict the ability of a recipient of the Work from You to exercise the -rights granted to that recipient under the terms of the License. This -Section 4(a) applies to the Work as incorporated in a Collection, but -this does not require the Collection apart from the Work itself to be -made subject to the terms of this License. If You create a Collection, -upon notice from any Licensor You must, to the extent practicable, -remove from the Collection any credit as required by Section 4(c), as -requested. If You create an Adaptation, upon notice from any Licensor -You must, to the extent practicable, remove from the Adaptation any -credit as required by Section 4(c), as requested. - -b. You may Distribute or Publicly Perform an Adaptation only under the -terms of: (i) this License; (ii) a later version of this License with -the same License Elements as this License; (iii) a Creative Commons -jurisdiction license (either this or a later license version) that -contains the same License Elements as this License (e.g., -Attribution-ShareAlike 3.0 US)); (iv) a Creative Commons Compatible -License. If you license the Adaptation under one of the licenses -mentioned in (iv), you must comply with the terms of that license. If -you license the Adaptation under the terms of any of the licenses -mentioned in (i), (ii) or (iii) (the "Applicable License"), you must -comply with the terms of the Applicable License generally and the -following provisions: (I) You must include a copy of, or the URI for, -the Applicable License with every copy of each Adaptation You Distribute -or Publicly Perform; (II) You may not offer or impose any terms on the -Adaptation that restrict the terms of the Applicable License or the -ability of the recipient of the Adaptation to exercise the rights -granted to that recipient under the terms of the Applicable License; -(III) You must keep intact all notices that refer to the Applicable -License and to the disclaimer of warranties with every copy of the Work -as included in the Adaptation You Distribute or Publicly Perform; (IV) -when You Distribute or Publicly Perform the Adaptation, You may not -impose any effective technological measures on the Adaptation that -restrict the ability of a recipient of the Adaptation from You to -exercise the rights granted to that recipient under the terms of the -Applicable License. This Section 4(b) applies to the Adaptation as -incorporated in a Collection, but this does not require the Collection -apart from the Adaptation itself to be made subject to the terms of the -Applicable License. - -c. If You Distribute, or Publicly Perform the Work or any Adaptations or -Collections, You must, unless a request has been made pursuant to -Section 4(a), keep intact all copyright notices for the Work and -provide, reasonable to the medium or means You are utilizing: (i) the -name of the Original Author (or pseudonym, if applicable) if supplied, -and/or if the Original Author and/or Licensor designate another party or -parties (e.g., a sponsor institute, publishing entity, journal) for -attribution ("Attribution Parties") in Licensor's copyright notice, -terms of service or by other reasonable means, the name of such party or -parties; (ii) the title of the Work if supplied; (iii) to the extent -reasonably practicable, the URI, if any, that Licensor specifies to be -associated with the Work, unless such URI does not refer to the -copyright notice or licensing information for the Work; and (iv) , -consistent with Ssection 3(b), in the case of an Adaptation, a credit -identifying the use of the Work in the Adaptation (e.g., "French -translation of the Work by Original Author," or "Screenplay based on -original Work by Original Author"). The credit required by this Section -4(c) may be implemented in any reasonable manner; provided, however, -that in the case of a Adaptation or Collection, at a minimum such credit -will appear, if a credit for all contributing authors of the Adaptation -or Collection appears, then as part of these credits and in a manner at -least as prominent as the credits for the other contributing authors. -For the avoidance of doubt, You may only use the credit required by this -Section for the purpose of attribution in the manner set out above and, -by exercising Your rights under this License, You may not implicitly or -explicitly assert or imply any connection with, sponsorship or -endorsement by the Original Author, Licensor and/or Attribution Parties, -as appropriate, of You or Your use of the Work, without the separate, -express prior written permission of the Original Author, Licensor and/or -Attribution Parties. - -d. Except as otherwise agreed in writing by the Licensor or as may be -otherwise permitted by applicable law, if You Reproduce, Distribute or -Publicly Perform the Work either by itself or as part of any Adaptations -or Collections, You must not distort, mutilate, modify or take other -derogatory action in relation to the Work which would be prejudicial to -the Original Author's honor or reputation. Licensor agrees that in those -jurisdictions (e.g. Japan), in which any exercise of the right granted -in Section 3(b) of this License (the right to make Adaptations) would be -deemed to be a distortion, mutilation, modification or other derogatory -action prejudicial to the Original Author's honor and reputation, the -Licensor will waive or not assert, as appropriate, this Section, to the -fullest extent permitted by the applicable national law, to enable You -to reasonably exercise Your right under Section 3(b) of this License -(right to make Adaptations) but not otherwise. - -5. Representations, Warranties and Disclaimer - -UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR -OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY -KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, -INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, -FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF -LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, -WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE -EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU. - -6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE -LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR -ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES -ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS -BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -7. Termination - -a. This License and the rights granted hereunder will terminate -automatically upon any breach by You of the terms of this License. -Individuals or entities who have received Adaptations or Collections -from You under this License, however, will not have their licenses -terminated provided such individuals or entities remain in full -compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will -survive any termination of this License. - -b. Subject to the above terms and conditions, the license granted here -is perpetual (for the duration of the applicable copyright in the Work). -Notwithstanding the above, Licensor reserves the right to release the -Work under different license terms or to stop distributing the Work at -any time; provided, however that any such election will not serve to -withdraw this License (or any other license that has been, or is -required to be, granted under the terms of this License), and this -License will continue in full force and effect unless terminated as -stated above. - -8. Miscellaneous - -a. Each time You Distribute or Publicly Perform the Work or a -Collection, the Licensor offers to the recipient a license to the Work -on the same terms and conditions as the license granted to You under -this License. - -b. Each time You Distribute or Publicly Perform an Adaptation, Licensor -offers to the recipient a license to the original Work on the same terms -and conditions as the license granted to You under this License. - -c. If any provision of this License is invalid or unenforceable under -applicable law, it shall not affect the validity or enforceability of -the remainder of the terms of this License, and without further action -by the parties to this agreement, such provision shall be reformed to -the minimum extent necessary to make such provision valid and -enforceable. - -d. No term or provision of this License shall be deemed waived and no -breach consented to unless such waiver or consent shall be in writing -and signed by the party to be charged with such waiver or consent. - -e. This License constitutes the entire agreement between the parties -with respect to the Work licensed here. There are no understandings, -agreements or representations with respect to the Work not specified -here. Licensor shall not be bound by any additional provisions that may -appear in any communication from You. This License may not be modified -without the mutual written agreement of the Licensor and You. - -f. The rights granted under, and the subject matter referenced, in this -License were drafted utilizing the terminology of the Berne Convention -for the Protection of Literary and Artistic Works (as amended on -September 28, 1979), the Rome Convention of 1961, the WIPO Copyright -Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and -the Universal Copyright Convention (as revised on July 24, 1971). These -rights and subject matter take effect in the relevant jurisdiction in -which the License terms are sought to be enforced according to the -corresponding provisions of the implementation of those treaty -provisions in the applicable national law. If the standard suite of -rights granted under applicable copyright law includes additional rights -not granted under this License, such additional rights are deemed to be -included in the License; this License is not intended to restrict the -license of any rights under applicable law. - - - -Creative Commons Notice - -Creative Commons is not a party to this License, and makes no warranty -whatsoever in connection with the Work. Creative Commons will not be -liable to You or any party on any legal theory for any damages -whatsoever, including without limitation any general, special, -incidental or consequential damages arising in connection to this -license. Notwithstanding the foregoing two (2) sentences, if Creative -Commons has expressly identified itself as the Licensor hereunder, it -shall have all rights and obligations of Licensor. - -Except for the limited purpose of indicating to the public that the Work -is licensed under the CCPL, Creative Commons does not authorize the use -by either party of the trademark "Creative Commons" or any related -trademark or logo of Creative Commons without the prior written consent -of Creative Commons. Any permitted use will be in compliance with -Creative Commons' then-current trademark usage guidelines, as may be -published on its website or otherwise made available upon request from -time to time. For the avoidance of doubt, this trademark restriction -does not form part of the License. - -Creative Commons may be contacted at http://creativecommons.org/. diff --git a/core/vendor/easyrdf/easyrdf/README.md b/core/vendor/easyrdf/easyrdf/README.md deleted file mode 100644 index d5b9956..0000000 --- a/core/vendor/easyrdf/easyrdf/README.md +++ /dev/null @@ -1,112 +0,0 @@ -EasyRdf -======= -EasyRdf is a PHP library designed to make it easy to consume and produce [RDF]. -It was designed for use in mixed teams of experienced and inexperienced RDF -developers. It is written in Object Oriented PHP and has been tested -extensively using PHPUnit. - -After parsing EasyRdf builds up a graph of PHP objects that can then be walked -around to get the data to be placed on the page. Dump methods are available to -inspect what data is available during development. - -Data is typically loaded into a [EasyRdf_Graph] object from source RDF -documents, loaded from the web via HTTP. The [EasyRdf_GraphStore] class -simplifies loading and saving data to a SPARQL 1.1 Graph Store. - -SPARQL queries can be made over HTTP to a Triplestore using the -[EasyRdf_Sparql_Client] class. SELECT and ASK queries will return an -[EasyRdf_Sparql_Result] object and CONSTRUCT and DESCRIBE queries will return -an [EasyRdf_Graph] object. - -### Example ### - - $foaf = new EasyRdf_Graph("http://njh.me/foaf.rdf"); - $foaf->load(); - $me = $foaf->primaryTopic(); - echo "My name is: ".$me->get('foaf:name')."\n"; - - -Downloads ---------- - -The latest _stable_ version of EasyRdf can be [downloaded from the EasyRdf website]. - - -Links ------ - -* [EasyRdf Homepage](http://www.easyrdf.org/) -* [API documentation](http://www.easyrdf.org/docs/api) -* [Change Log](http://github.com/njh/easyrdf/blob/master/CHANGELOG.md) -* Source Code: -* Issue Tracker: - - -Requirements ------------- - -* PHP 5.2.8 or higher - - -Features --------- - -* API documentation written in phpdoc -* Extensive unit tests written using phpunit - * Automated testing against PHP 5.2, 5.3 and 5.4 -* Built-in parsers and serialisers: RDF/JSON, N-Triples, RDF/XML, Turtle -* Optional parsing support for: [ARC2], [Redland Bindings], [rapper] -* Optional support for [Zend_Http_Client] -* No required external dependancies upon other libraries (PEAR, Zend, etc...) -* Complies with Zend Framework coding style. -* Type mapper - resources of type foaf:Person can be mapped into PHP object of class Foaf_Person -* Support for visualisation of graphs using [GraphViz] -* Comes with a number of examples - - -More Examples -------------- - -* [artistinfo.php](https://github.com/njh/easyrdf/blob/master/examples/artistinfo.php#slider) - Example of mapping an RDF class type to a PHP Class -* [basic.php](https://github.com/njh/easyrdf/blob/master/examples/basic.php#slider) - Basic "Hello World" type example -* [basic_sparql.php](https://github.com/njh/easyrdf/blob/master/examples/basic_sparql.php#slider) - Example of making a SPARQL SELECT query -* [converter.php](https://github.com/njh/easyrdf/blob/master/examples/converter.php#slider) - Convert RDF from one format to another -* [dump.php](https://github.com/njh/easyrdf/blob/master/examples/dump.php#slider) - Display the contents of a graph -* [foafinfo.php](https://github.com/njh/easyrdf/blob/master/examples/foafinfo.php#slider) - Display the basic information in a FOAF document -* [foafmaker.php](https://github.com/njh/easyrdf/blob/master/examples/foafmaker.php#slider) - Construct a FOAF document with a choice of serialisations -* [graph_direct.php](https://github.com/njh/easyrdf/blob/master/examples/graph_direct.php#slider) - Example of using EasyRdf_Graph directly without EasyRdf_Resource -* [graphstore.php](https://github.com/njh/easyrdf/blob/master/examples/graphstore.php#slider) - Store and retrieve data from a SPARQL 1.1 Graph Store -* [graphviz.php](https://github.com/njh/easyrdf/blob/master/examples/graphviz.php#slider) - GraphViz rendering example -* [html_tag_helpers.php](https://github.com/njh/easyrdf/blob/master/examples/html_tag_helpers.php#slider) - Rails Style html tag helpers to make the EasyRdf examples simplier -* [httpget.php](https://github.com/njh/easyrdf/blob/master/examples/httpget.php#slider) - No RDF, just test EasyRdf_Http_Client -* [serialise.php](https://github.com/njh/easyrdf/blob/master/examples/serialise.php#slider) - Basic serialisation example -* [sparql_queryform.php](https://github.com/njh/easyrdf/blob/master/examples/sparql_queryform.php#slider) - Form to submit SPARQL queries and display the result -* [uk_postcode.php](https://github.com/njh/easyrdf/blob/master/examples/uk_postcode.php#slider) - Example of resolving UK postcodes using uk-postcodes.com -* [villages.php](https://github.com/njh/easyrdf/blob/master/examples/villages.php#slider) - Fetch and information about villages in Fife from dbpedialite.org -* [zend_framework.php](https://github.com/njh/easyrdf/blob/master/examples/zend_framework.php#slider) - Example of using Zend_Http_Client and Zend_Loader_Autoloader with EasyRdf - - - -Licensing ---------- - -The EasyRdf library and tests are licensed under the [BSD-3-Clause] license. -The examples are in the public domain, for more information see [UNLICENSE]. - - - -[EasyRdf_Graph]:http://www.easyrdf.org/docs/api/EasyRdf_Graph.html -[EasyRdf_GraphStore]:http://www.easyrdf.org/docs/api/EasyRdf_GraphStore.html -[EasyRdf_Sparql_Client]:http://www.easyrdf.org/docs/api/EasyRdf_Sparql_Client.html -[EasyRdf_Sparql_Result]:http://www.easyrdf.org/docs/api/EasyRdf_Sparql_Result.html - -[ARC2]:http://github.com/semsol/arc2/ -[BSD-3-Clause]:http://www.opensource.org/licenses/BSD-3-Clause -[downloaded from the EasyRdf website]:http://www.easyrdf.org/downloads -[GraphViz]:http://www.graphviz.org/ -[rapper]:http://librdf.org/raptor/rapper.html -[RDF]:http://en.wikipedia.org/wiki/Resource_Description_Framework -[Redland Bindings]:http://librdf.org/bindings/ -[SPARQL 1.1 query language]:http://www.w3.org/TR/sparql11-query/ -[UNLICENSE]:http://unlicense.org/ -[Zend_Http_Client]:http://framework.zend.com/manual/en/zend.http.client.html diff --git a/core/vendor/easyrdf/easyrdf/composer.json b/core/vendor/easyrdf/easyrdf/composer.json deleted file mode 100644 index 030e087..0000000 --- a/core/vendor/easyrdf/easyrdf/composer.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name": "easyrdf/easyrdf", - "description": "EasyRdf is a PHP library designed to make it easy to consume and produce RDF.", - "version": "0.9.0", - "type": "library", - "keywords": ["RDF", "Semantic Web", "Linked Data", "Turtle", "RDFa", "SPARQL"], - "homepage": "http://www.easyrdf.org/", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Nicholas Humfrey", - "email": "njh@aelius.com", - "homepage": "http://www.aelius.com/njh/", - "role": "Developer" - }, - { - "name": "Alexey Zakhlestin", - "email": "indeyets@gmail.com", - "role": "Developer" - } - ], - "support": { - "forum": "http://groups.google.com/group/easyrdf/", - "issues": "http://github.com/njh/easyrdf/issues", - "irc": "irc://chat.freenode.net/easyrdf" - }, - "require": { - "php": ">=5.2.8", - "ext-mbstring": "*", - "ext-pcre": "*" - }, - "suggest": { - "ml/json-ld": "~1.0" - }, - "require-dev": { - "phpunit/PHPUnit": "~3.5", - "squizlabs/php_codesniffer": "~1.4.3", - "sami/sami": "~1.4" - }, - "autoload": { - "psr-0": { "EasyRdf_": "lib/" } - } -} diff --git a/core/vendor/easyrdf/easyrdf/doap.php b/core/vendor/easyrdf/easyrdf/doap.php deleted file mode 100644 index 4393fe0..0000000 --- a/core/vendor/easyrdf/easyrdf/doap.php +++ /dev/null @@ -1,45 +0,0 @@ -homepage.'doap.rdf'); - $easyrdf = $doap->resource('#easyrdf', 'doap:Project', 'foaf:Project'); - $easyrdf->addLiteral('doap:name', 'EasyRDF'); - $easyrdf->addLiteral('doap:shortname', 'easyrdf'); - $easyrdf->addLiteral('doap:revision', $composer->version); - $easyrdf->addLiteral('doap:shortdesc', $composer->description, 'en'); - $easyrdf->addResource('doap:homepage', $composer->homepage); - - $easyrdf->addLiteral('doap:programming-language', 'PHP'); - $easyrdf->addLiteral( - 'doap:description', 'EasyRdf is a PHP library designed to make it easy to consume and produce RDF. '. - 'It was designed for use in mixed teams of experienced and inexperienced RDF developers. '. - 'It is written in Object Oriented PHP and has been tested extensively using PHPUnit.', 'en' - ); - $easyrdf->addResource('doap:license', 'http://usefulinc.com/doap/licenses/bsd'); - $easyrdf->addResource('doap:download-page', 'http://github.com/njh/easyrdf/downloads'); - $easyrdf->addResource('doap:download-page', 'http://github.com/njh/easyrdf/downloads'); - $easyrdf->addResource('doap:bug-database', 'http://github.com/njh/easyrdf/issues'); - $easyrdf->addResource('doap:mailing-list', 'http://groups.google.com/group/easyrdf'); - - $easyrdf->addResource('doap:category', 'http://dbpedia.org/resource/Resource_Description_Framework'); - $easyrdf->addResource('doap:category', 'http://dbpedia.org/resource/PHP'); - $easyrdf->addResource('doap:category', 'http://www.dbpedialite.org/things/24131#id'); - $easyrdf->addResource('doap:category', 'http://www.dbpedialite.org/things/53847#id'); - - $repository = $doap->newBNode('doap:GitRepository'); - $repository->addResource('doap:browse', 'http://github.com/njh/easyrdf'); - $repository->addResource('doap:location', 'git://github.com/njh/easyrdf.git'); - $easyrdf->addResource('doap:repository', $repository); - - $njh = $doap->resource('http://njh.me/', 'foaf:Person'); - $njh->addLiteral('foaf:name', 'Nicholas J Humfrey'); - $njh->addResource('foaf:homepage', 'http://www.aelius.com/njh/'); - $easyrdf->add('doap:maintainer', $njh); - $easyrdf->add('doap:developer', $njh); - $easyrdf->add('foaf:maker', $njh); - - print $doap->serialise('rdfxml'); diff --git a/core/vendor/easyrdf/easyrdf/lib/EasyRdf.php b/core/vendor/easyrdf/easyrdf/lib/EasyRdf.php deleted file mode 100644 index 8c7248b..0000000 --- a/core/vendor/easyrdf/easyrdf/lib/EasyRdf.php +++ /dev/null @@ -1,244 +0,0 @@ -position = 1; - $this->current = null; - parent::__construct($uri, $graph); - } - - /** Seek to a specific position in the container - * - * The first item is postion 1 - * - * @param integer $position The position in the container to seek to - * @throws OutOfBoundsException - */ - public function seek($position) - { - if (is_int($position) and $position > 0) { - list($node, $actual) = $this->getCollectionNode($position); - if ($actual === $position) { - $this->position = $actual; - $this->current = $node; - } else { - throw new OutOfBoundsException( - "Unable to seek to position $position in the collection" - ); - } - } else { - throw new InvalidArgumentException( - "Collection position must be a positive integer" - ); - } - } - - /** Rewind the iterator back to the start of the collection - * - */ - public function rewind() - { - $this->position = 1; - $this->current = null; - } - - /** Return the current item in the collection - * - * @return mixed The current item - */ - public function current() - { - if ($this->position === 1) { - return $this->get('rdf:first'); - } elseif ($this->current) { - return $this->current->get('rdf:first'); - } - } - - /** Return the key / current position in the collection - * - * Note: the first item is number 1 - * - * @return int The current position - */ - public function key() - { - return $this->position; - } - - /** Move forward to next item in the collection - * - */ - public function next() - { - if ($this->position === 1) { - $this->current = $this->get('rdf:rest'); - } elseif ($this->current) { - $this->current = $this->current->get('rdf:rest'); - } - $this->position++; - } - - /** Checks if current position is valid - * - * @return bool True if the current position is valid - */ - public function valid() - { - if ($this->position === 1 and $this->hasProperty('rdf:first')) { - return true; - } elseif ($this->current !== null and $this->current->hasProperty('rdf:first')) { - return true; - } else { - return false; - } - } - - /** Get a node for a particular offset into the collection - * - * This function may not return the item you requested, if - * it does not exist. Please check the $postion parameter - * returned. - * - * If the offset is null, then the last node in the - * collection (before rdf:nil) will be returned. - * - * @param integer $offset The offset into the collection (or null) - * @return array $node, $postion The node object and postion of the node - */ - public function getCollectionNode($offset) - { - $position = 1; - $node = $this; - $nil = $this->graph->resource('rdf:nil'); - while (($rest = $node->get('rdf:rest')) and $rest !== $nil and (is_null($offset) or ($position < $offset))) { - $node = $rest; - $position++; - } - return array($node, $position); - } - - /** Counts the number of items in the collection - * - * Note that this is an slow method - it is more efficient to use - * the iterator interface, if you can. - * - * @return integer The number of items in the collection - */ - public function count() - { - // Find the end of the collection - list($node, $position) = $this->getCollectionNode(null); - if (!$node->hasProperty('rdf:first')) { - return 0; - } else { - return $position; - } - } - - /** Append an item to the end of the collection - * - * @param mixed $value The value to append - * @return integer The number of values appended (1 or 0) - */ - public function append($value) - { - // Find the end of the collection - list($node, $position) = $this->getCollectionNode(null); - $rest = $node->get('rdf:rest'); - - if ($node === $this and is_null($rest)) { - $node->set('rdf:first', $value); - $node->addResource('rdf:rest', 'rdf:nil'); - } else { - $new = $this->graph->newBnode(); - $node->set('rdf:rest', $new); - $new->add('rdf:first', $value); - $new->addResource('rdf:rest', 'rdf:nil'); - } - - return 1; - } - - /** Array Access: check if a position exists in collection using array syntax - * - * Example: isset($list[2]) - */ - public function offsetExists($offset) - { - if (is_int($offset) and $offset > 0) { - list($node, $position) = $this->getCollectionNode($offset); - return ($node and $position === $offset and $node->hasProperty('rdf:first')); - } else { - throw new InvalidArgumentException( - "Collection offset must be a positive integer" - ); - } - } - - /** Array Access: get an item at a specified position in collection using array syntax - * - * Example: $item = $list[2]; - */ - public function offsetGet($offset) - { - if (is_int($offset) and $offset > 0) { - list($node, $position) = $this->getCollectionNode($offset); - if ($node and $position === $offset) { - return $node->get('rdf:first'); - } - } else { - throw new InvalidArgumentException( - "Collection offset must be a positive integer" - ); - } - } - - /** - * Array Access: set an item at a positon in collection using array syntax - * - * Example: $list[2] = $item; - */ - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - // No offset - append to end of collection - $this->append($value); - } elseif (is_int($offset) and $offset > 0) { - list($node, $position) = $this->getCollectionNode($offset); - - // Create nodes, if they are missing - while ($position < $offset) { - $new = $this->graph->newBnode(); - $node->set('rdf:rest', $new); - $new->addResource('rdf:rest', 'rdf:nil'); - $node = $new; - $position++; - } - - // Terminate the list - if (!$node->hasProperty('rdf:rest')) { - $node->addResource('rdf:rest', 'rdf:nil'); - } - - return $node->set('rdf:first', $value); - } else { - throw new InvalidArgumentException( - "Collection offset must be a positive integer" - ); - } - } - - /** - * Array Access: delete an item at a specific postion using array syntax - * - * Example: unset($seq[2]); - */ - public function offsetUnset($offset) - { - if (is_int($offset) and $offset > 0) { - list($node, $position) = $this->getCollectionNode($offset); - } else { - throw new InvalidArgumentException( - "Collection offset must be a positive integer" - ); - } - - // Does the item exist? - if ($node and $position === $offset) { - $nil = $this->graph->resource('rdf:nil'); - if ($position === 1) { - $rest = $node->get('rdf:rest'); - if ($rest and $rest !== $nil) { - // Move second value, so we can keep the head of list - $node->set('rdf:first', $rest->get('rdf:first')); - $node->set('rdf:rest', $rest->get('rdf:rest')); - $rest->delete('rdf:first'); - $rest->delete('rdf:rest'); - } else { - // Just remove the value - $node->delete('rdf:first'); - $node->delete('rdf:rest'); - } - } else { - // Remove the value and re-link the list - $node->delete('rdf:first'); - $rest = $node->get('rdf:rest'); - $previous = $node->get('^rdf:rest'); - if (is_null($rest)) { - $rest = $nil; - } - if ($previous) { - $previous->set('rdf:rest', $rest); - } - } - } - } -} diff --git a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Container.php b/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Container.php deleted file mode 100644 index 2207956..0000000 --- a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Container.php +++ /dev/null @@ -1,230 +0,0 @@ -position = 1; - parent::__construct($uri, $graph); - } - - /** Seek to a specific position in the container - * - * The first item is postion 1 - * - * @param integer $position The position in the container to seek to - * @throws OutOfBoundsException - */ - public function seek($position) - { - if (is_int($position) and $position > 0) { - if ($this->hasProperty('rdf:_'.$position)) { - $this->position = $position; - } else { - throw new OutOfBoundsException( - "Unable to seek to position $position in the container" - ); - } - } else { - throw new InvalidArgumentException( - "Container position must be a positive integer" - ); - } - } - - /** Rewind the iterator back to the start of the container (item 1) - * - */ - public function rewind() - { - $this->position = 1; - } - - /** Return the current item in the container - * - * @return mixed The current item - */ - public function current() - { - return $this->get('rdf:_'.$this->position); - } - - /** Return the key / current position in the container - * - * @return int The current position - */ - public function key() - { - return $this->position; - } - - /** Move forward to next item in the container - * - */ - public function next() - { - $this->position++; - } - - /** Checks if current position is valid - * - * @return bool True if the current position is valid - */ - public function valid() - { - return $this->hasProperty('rdf:_'.$this->position); - } - - /** Counts the number of items in the container - * - * Note that this is an slow method - it is more efficient to use - * the iterator interface, if you can. - * - * @return integer The number of items in the container - */ - public function count() - { - $pos = 1; - while ($this->hasProperty('rdf:_'.$pos)) { - $pos++; - } - return $pos - 1; - } - - /** Append an item to the end of the container - * - * @param mixed $value The value to append - * @return integer The number of values appended (1 or 0) - */ - public function append($value) - { - // Find the end of the list - $pos = 1; - while ($this->hasProperty('rdf:_'.$pos)) { - $pos++; - } - - // Add the item - return $this->add('rdf:_'.$pos, $value); - } - - /** Array Access: check if a position exists in container using array syntax - * - * Example: isset($seq[2]) - */ - public function offsetExists($offset) - { - if (is_int($offset) and $offset > 0) { - return $this->hasProperty('rdf:_'.$offset); - } else { - throw new InvalidArgumentException( - "Container position must be a positive integer" - ); - } - } - - /** Array Access: get an item at a specified position in container using array syntax - * - * Example: $item = $seq[2]; - */ - public function offsetGet($offset) - { - if (is_int($offset) and $offset > 0) { - return $this->get('rdf:_'.$offset); - } else { - throw new InvalidArgumentException( - "Container position must be a positive integer" - ); - } - } - - /** - * Array Access: set an item at a positon in container using array syntax - * - * Example: $seq[2] = $item; - * - * Warning: creating gaps in the sequence will result in unexpected behavior - */ - public function offsetSet($offset, $value) - { - if (is_int($offset) and $offset > 0) { - return $this->set('rdf:_'.$offset, $value); - } elseif (is_null($offset)) { - return $this->append($value); - } else { - throw new InvalidArgumentException( - "Container position must be a positive integer" - ); - } - } - - /** - * Array Access: delete an item at a specific postion using array syntax - * - * Example: unset($seq[2]); - * - * Warning: creating gaps in the sequence will result in unexpected behavior - */ - public function offsetUnset($offset) - { - if (is_int($offset) and $offset > 0) { - return $this->delete('rdf:_'.$offset); - } else { - throw new InvalidArgumentException( - "Container position must be a positive integer" - ); - } - } -} diff --git a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Exception.php b/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Exception.php deleted file mode 100644 index 25090a5..0000000 --- a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Exception.php +++ /dev/null @@ -1,50 +0,0 @@ - 0.5) where 0.5 is the - * q value for that type. The types are sorted by q value - * before constructing the string. - * - * @param array $extraTypes extra MIME types to add - * @return string list of supported MIME types - */ - public static function getHttpAcceptHeader($extraTypes = array()) - { - $accept = $extraTypes; - foreach (self::$formats as $format) { - if ($format->parserClass and count($format->mimeTypes) > 0) { - $accept = array_merge($accept, $format->mimeTypes); - } - } - arsort($accept, SORT_NUMERIC); - - $acceptStr=''; - foreach ($accept as $type => $q) { - if ($acceptStr) { - $acceptStr .= ','; - } - if ($q == 1.0) { - $acceptStr .= $type; - } else { - $acceptStr .= sprintf("%s;q=%1.1F", $type, $q); - } - } - return $acceptStr; - } - - /** Check if a named graph exists - * - * @param string $name the name of the format - * @return boolean true if the format exists - */ - public static function formatExists($name) - { - return array_key_exists($name, self::$formats); - } - - /** Get a EasyRdf_Format from a name, uri or mime type - * - * @param string $query a query string to search for - * @return object the first EasyRdf_Format that matches the query - * @throws EasyRdf_Exception if no format is found - */ - public static function getFormat($query) - { - if (!is_string($query) or $query == null or $query == '') { - throw new InvalidArgumentException( - "\$query should be a string and cannot be null or empty" - ); - } - - foreach (self::$formats as $format) { - if ($query == $format->name or - $query == $format->uri or - array_key_exists($query, $format->mimeTypes) or - in_array($query, $format->extensions)) { - return $format; - } - } - - # No match - throw new EasyRdf_Exception( - "Format is not recognised: $query" - ); - } - - /** Register a new format - * - * @param string $name The name of the format (e.g. ntriples) - * @param string $label The label for the format (e.g. N-Triples) - * @param string $uri The URI for the format - * @param string $mimeTypes One or more mime types for the format - * @param string $extensions One or more extensions (file suffix) - * @return object The new EasyRdf_Format object - */ - public static function register( - $name, - $label = null, - $uri = null, - $mimeTypes = array(), - $extensions = array() - ) { - if (!is_string($name) or $name == null or $name == '') { - throw new InvalidArgumentException( - "\$name should be a string and cannot be null or empty" - ); - } - - if (!array_key_exists($name, self::$formats)) { - self::$formats[$name] = new EasyRdf_Format($name); - } - - self::$formats[$name]->setLabel($label); - self::$formats[$name]->setUri($uri); - self::$formats[$name]->setMimeTypes($mimeTypes); - self::$formats[$name]->setExtensions($extensions); - return self::$formats[$name]; - } - - /** Remove a format from the registry - * - * @param string $name The name of the format (e.g. ntriples) - */ - public static function unregister($name) - { - unset(self::$formats[$name]); - } - - /** Class method to register a parser class to a format name - * - * @param string $name The name of the format (e.g. ntriples) - * @param string $class The name of the class (e.g. EasyRdf_Parser_Ntriples) - */ - public static function registerParser($name, $class) - { - if (!self::formatExists($name)) { - self::register($name); - } - self::getFormat($name)->setParserClass($class); - } - - /** Class method to register a serialiser class to a format name - * - * @param string $name The name of the format (e.g. ntriples) - * @param string $class The name of the class (e.g. EasyRdf_Serialiser_Ntriples) - */ - public static function registerSerialiser($name, $class) - { - if (!self::formatExists($name)) { - self::register($name); - } - self::getFormat($name)->setSerialiserClass($class); - } - - /** Attempt to guess the document format from some content. - * - * If $filename is given, then the suffix is first used to guess the format. - * - * If the document format is not recognised, null is returned. - * - * @param string $data The document data - * @param string $filename Optional filename - * @return object EasyRdf_Format The format object - */ - public static function guessFormat($data, $filename = null) - { - if (is_array($data)) { - # Data has already been parsed into RDF/PHP - return self::getFormat('php'); - } - - // First try and identify by the filename - if ($filename and preg_match('/\.(\w+)$/', $filename, $matches)) { - foreach (self::$formats as $format) { - if (in_array($matches[1], $format->extensions)) { - return $format; - } - } - } - - // Then try and guess by the first 1024 bytes of content - $short = substr($data, 0, 1024); - if (preg_match('/^\s*\{/', $short)) { - return self::getFormat('json'); - } elseif (preg_match('/ <.+>/m', $short)) { - return self::getFormat('ntriples'); - } else { - return null; - } - } - - /** - * This constructor is for internal use only. - * To create a new format, use the register method. - * - * @param string $name The name of the format - * @see EasyRdf_Format::register() - * @ignore - */ - public function __construct($name) - { - $this->name = $name; - $this->label = $name; # Only a default - } - - /** Get the name of a format object - * - * @return string The name of the format (e.g. rdfxml) - */ - public function getName() - { - return $this->name; - } - - /** Get the label for a format object - * - * @return string The format label (e.g. RDF/XML) - */ - public function getLabel() - { - return $this->label; - } - - /** Set the label for a format object - * - * @param string $label The new label for the format - */ - public function setLabel($label) - { - if ($label) { - if (!is_string($label)) { - throw new InvalidArgumentException( - "\$label should be a string" - ); - } - return $this->label = $label; - } else { - return $this->label = null; - } - } - - /** Get the URI for a format object - * - * @return string The format URI - */ - public function getUri() - { - return $this->uri; - } - - /** Set the URI for a format object - * - * @param string $uri The new URI for the format - */ - public function setUri($uri) - { - if ($uri) { - if (!is_string($uri)) { - throw new InvalidArgumentException( - "\$uri should be a string" - ); - } - return $this->uri = $uri; - } else { - return $this->uri = null; - } - } - - /** Get the default registered mime type for a format object - * - * @return string The default mime type as a string. - */ - public function getDefaultMimeType() - { - $types = array_keys($this->mimeTypes); - if (isset($types[0])) { - return $types[0]; - } - } - - /** Get all the registered mime types for a format object - * - * @return array One or more MIME types in an array with - * the mime type as the key and q value as the value - */ - public function getMimeTypes() - { - return $this->mimeTypes; - } - - /** Set the MIME Types for a format object - * - * @param array $mimeTypes One or more mime types - */ - public function setMimeTypes($mimeTypes) - { - if ($mimeTypes) { - if (!is_array($mimeTypes)) { - $mimeTypes = array($mimeTypes); - } - $this->mimeTypes = $mimeTypes; - } else { - $this->mimeTypes = array(); - } - } - - /** Get the default registered file extension (filename suffix) for a format object - * - * @return string The default extension as a string. - */ - public function getDefaultExtension() - { - if (isset($this->extensions[0])) { - return $this->extensions[0]; - } - } - - /** Get all the registered file extensions (filename suffix) for a format object - * - * @return array One or more extensions as an array - */ - public function getExtensions() - { - return $this->extensions; - } - - /** Set the file format extensions (filename suffix) for a format object - * - * @param mixed $extensions One or more file extensions - */ - public function setExtensions($extensions) - { - if ($extensions) { - if (!is_array($extensions)) { - $extensions = array($extensions); - } - $this->extensions = $extensions; - } else { - $this->extensions = array(); - } - } - - /** Set the parser to use for a format - * - * @param string $class The name of the class - */ - public function setParserClass($class) - { - if ($class) { - if (!is_string($class)) { - throw new InvalidArgumentException( - "\$class should be a string" - ); - } - $this->parserClass = $class; - } else { - $this->parserClass = null; - } - } - - /** Get the name of the class to use to parse the format - * - * @return string The name of the class - */ - public function getParserClass() - { - return $this->parserClass; - } - - /** Create a new parser to parse this format - * - * @return object The new parser object - */ - public function newParser() - { - $parserClass = $this->parserClass; - if (!$parserClass) { - throw new EasyRdf_Exception( - "No parser class available for format: ".$this->getName() - ); - } - return (new $parserClass()); - } - - /** Set the serialiser to use for a format - * - * @param string $class The name of the class - */ - public function setSerialiserClass($class) - { - if ($class) { - if (!is_string($class)) { - throw new InvalidArgumentException( - "\$class should be a string" - ); - } - $this->serialiserClass = $class; - } else { - $this->serialiserClass = null; - } - } - - /** Get the name of the class to use to serialise the format - * - * @return string The name of the class - */ - public function getSerialiserClass() - { - return $this->serialiserClass; - } - - /** Create a new serialiser to parse this format - * - * @return object The new serialiser object - */ - public function newSerialiser() - { - $serialiserClass = $this->serialiserClass; - if (!$serialiserClass) { - throw new EasyRdf_Exception( - "No serialiser class available for format: ".$this->getName() - ); - } - return (new $serialiserClass()); - } - - /** Magic method to return the name of the format when casted to string - * - * @return string The name of the format - */ - public function __toString() - { - return $this->name; - } -} - - -/* - Register default set of supported formats - NOTE: they are ordered by preference -*/ - -EasyRdf_Format::register( - 'php', - 'RDF/PHP', - 'http://n2.talis.com/wiki/RDF_PHP_Specification', - array( - 'application/x-httpd-php-source' => 1.0 - ), - array('phps') -); - -EasyRdf_Format::register( - 'json', - 'RDF/JSON Resource-Centric', - 'http://n2.talis.com/wiki/RDF_JSON_Specification', - array( - 'application/json' => 1.0, - 'text/json' => 0.9, - 'application/rdf+json' => 0.9 - ), - array('json') -); - -EasyRdf_Format::register( - 'jsonld', - 'JSON-LD', - 'http://www.w3.org/TR/json-ld/', - array( - 'application/ld+json' => 1.0 - ), - array('jsonld') -); - -EasyRdf_Format::register( - 'ntriples', - 'N-Triples', - 'http://www.w3.org/TR/n-triples/', - array( - 'application/n-triples' => 1.0, - 'text/plain' => 0.9, - 'text/ntriples' => 0.9, - 'application/ntriples' => 0.9, - 'application/x-ntriples' => 0.9 - ), - array('nt') -); - -EasyRdf_Format::register( - 'turtle', - 'Turtle Terse RDF Triple Language', - 'http://www.dajobe.org/2004/01/turtle', - array( - 'text/turtle' => 0.8, - 'application/turtle' => 0.7, - 'application/x-turtle' => 0.7 - ), - array('ttl') -); - -EasyRdf_Format::register( - 'rdfxml', - 'RDF/XML', - 'http://www.w3.org/TR/rdf-syntax-grammar', - array( - 'application/rdf+xml' => 0.8 - ), - array('rdf', 'xrdf') -); - -EasyRdf_Format::register( - 'dot', - 'Graphviz', - 'http://www.graphviz.org/doc/info/lang.html', - array( - 'text/vnd.graphviz' => 0.8 - ), - array('gv', 'dot') -); - -EasyRdf_Format::register( - 'json-triples', - 'RDF/JSON Triples' -); - -EasyRdf_Format::register( - 'n3', - 'Notation3', - 'http://www.w3.org/2000/10/swap/grammar/n3#', - array( - 'text/n3' => 0.5, - 'text/rdf+n3' => 0.5 - ), - array('n3') -); - -EasyRdf_Format::register( - 'rdfa', - 'RDFa', - 'http://www.w3.org/TR/rdfa-core/', - array( - 'text/html' => 0.4, - 'application/xhtml+xml' => 0.4 - ), - array('html') -); - -EasyRdf_Format::register( - 'sparql-xml', - 'SPARQL XML Query Results', - 'http://www.w3.org/TR/rdf-sparql-XMLres/', - array( - 'application/sparql-results+xml' => 1.0 - ) -); - -EasyRdf_Format::register( - 'sparql-json', - 'SPARQL JSON Query Results', - 'http://www.w3.org/TR/rdf-sparql-json-res/', - array( - 'application/sparql-results+json' => 1.0 - ) -); - -EasyRdf_Format::register( - 'png', - 'Portable Network Graphics (PNG)', - 'http://www.w3.org/TR/PNG/', - array( - 'image/png' => 0.3 - ), - array('png') -); - -EasyRdf_Format::register( - 'gif', - 'Graphics Interchange Format (GIF)', - 'http://www.w3.org/Graphics/GIF/spec-gif89a.txt', - array( - 'image/gif' => 0.2 - ), - array('gif') -); - -EasyRdf_Format::register( - 'svg', - 'Scalable Vector Graphics (SVG)', - 'http://www.w3.org/TR/SVG/', - array( - 'image/svg+xml' => 0.3 - ), - array('svg') -); - - -/* - Register default set of parsers and serialisers -*/ - -EasyRdf_Format::registerParser('json', 'EasyRdf_Parser_Json'); -EasyRdf_Format::registerParser('jsonld', 'EasyRdf_Parser_JsonLd'); -EasyRdf_Format::registerParser('ntriples', 'EasyRdf_Parser_Ntriples'); -EasyRdf_Format::registerParser('php', 'EasyRdf_Parser_RdfPhp'); -EasyRdf_Format::registerParser('rdfxml', 'EasyRdf_Parser_RdfXml'); -EasyRdf_Format::registerParser('turtle', 'EasyRdf_Parser_Turtle'); -EasyRdf_Format::registerParser('rdfa', 'EasyRdf_Parser_Rdfa'); - -EasyRdf_Format::registerSerialiser('json', 'EasyRdf_Serialiser_Json'); -EasyRdf_Format::registerSerialiser('jsonld', 'EasyRdf_Serialiser_JsonLd'); -EasyRdf_Format::registerSerialiser('n3', 'EasyRdf_Serialiser_Turtle'); -EasyRdf_Format::registerSerialiser('ntriples', 'EasyRdf_Serialiser_Ntriples'); -EasyRdf_Format::registerSerialiser('php', 'EasyRdf_Serialiser_RdfPhp'); -EasyRdf_Format::registerSerialiser('rdfxml', 'EasyRdf_Serialiser_RdfXml'); -EasyRdf_Format::registerSerialiser('turtle', 'EasyRdf_Serialiser_Turtle'); - -EasyRdf_Format::registerSerialiser('dot', 'EasyRdf_Serialiser_GraphViz'); -EasyRdf_Format::registerSerialiser('gif', 'EasyRdf_Serialiser_GraphViz'); -EasyRdf_Format::registerSerialiser('png', 'EasyRdf_Serialiser_GraphViz'); -EasyRdf_Format::registerSerialiser('svg', 'EasyRdf_Serialiser_GraphViz'); diff --git a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Graph.php b/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Graph.php deleted file mode 100644 index 46ccc17..0000000 --- a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Graph.php +++ /dev/null @@ -1,1663 +0,0 @@ -checkResourceParam($uri, true); - - if ($uri) { - $this->uri = $uri; - $this->parsedUri = new EasyRdf_ParsedUri($uri); - if ($data) { - $this->parse($data, $format, $this->uri); - } - } - } - - /** - * Create a new graph and load RDF data from a URI into it - * - * This static function is shorthand for: - * $graph = new EasyRdf_Graph($uri); - * $graph->load($uri, $format); - * - * The document type is optional but should be specified if it - * can't be guessed or got from the HTTP headers. - * - * @param string $uri The URI of the data to load - * @param string $format Optional format of the data (eg. rdfxml) - * @return object EasyRdf_Graph The new the graph object - */ - public static function newAndLoad($uri, $format = null) - { - $graph = new self($uri); - $graph->load($uri, $format); - return $graph; - } - - /** Get or create a resource stored in a graph - * - * If the resource did not previously exist, then a new resource will - * be created. If you provide an RDF type and that type is registered - * with the EasyRdf_TypeMapper, then the resource will be an instance - * of the class registered. - * - * If URI is null, then the URI of the graph is used. - * - * @param string $uri The URI of the resource - * @param mixed $types RDF type of a new resource (e.g. foaf:Person) - * @return object EasyRdf_Resource - */ - public function resource($uri = null, $types = array()) - { - $this->checkResourceParam($uri, true); - if (!$uri) { - throw new InvalidArgumentException( - '$uri is null and EasyRdf_Graph object has no URI either.' - ); - } - - // Resolve relative URIs - if ($this->parsedUri) { - $uri = $this->parsedUri->resolve($uri)->toString(); - } - - // Add the types - $this->addType($uri, $types); - - // Create resource object if it doesn't already exist - if (!isset($this->resources[$uri])) { - $resClass = $this->classForResource($uri); - $this->resources[$uri] = new $resClass($uri, $this); - } - - return $this->resources[$uri]; - } - - /** Work out the class to instantiate a resource as - * @ignore - */ - protected function classForResource($uri) - { - $rdfType = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'; - if (isset($this->index[$uri][$rdfType])) { - foreach ($this->index[$uri][$rdfType] as $type) { - if ($type['type'] == 'uri' or $type['type'] == 'bnode') { - $class = EasyRdf_TypeMapper::get($type['value']); - if ($class != null) { - return $class; - } - } - } - } - - // Parsers don't typically add a rdf:type to rdf:List, so we have to - // do a bit of 'inference' here using properties. - if ($uri == 'http://www.w3.org/1999/02/22-rdf-syntax-ns#nil' or - isset($this->index[$uri]['http://www.w3.org/1999/02/22-rdf-syntax-ns#first']) or - isset($this->index[$uri]['http://www.w3.org/1999/02/22-rdf-syntax-ns#rest']) - ) { - return 'EasyRdf_Collection'; - } - return 'EasyRdf_Resource'; - } - - /** - * Create a new blank node in the graph and return it. - * - * If you provide an RDF type and that type is registered - * with the EasyRdf_TypeMapper, then the resource will be an instance - * of the class registered. - * - * @param mixed $types RDF type of a new blank node (e.g. foaf:Person) - * @return object EasyRdf_Resource The new blank node - */ - public function newBNode($types = array()) - { - return $this->resource($this->newBNodeId(), $types); - } - - /** - * Create a new unique blank node identifier and return it. - * - * @return string The new blank node identifier (e.g. _:genid1) - */ - public function newBNodeId() - { - return "_:genid".(++$this->bNodeCount); - } - - /** - * Parse some RDF data into the graph object. - * - * @param string $data Data to parse for the graph - * @param string $format Optional format of the data - * @param string $uri The URI of the data to load - * @return integer The number of triples added to the graph - */ - public function parse($data, $format = null, $uri = null) - { - $this->checkResourceParam($uri, true); - - if (empty($format) or $format == 'guess') { - // Guess the format if it is Unknown - $format = EasyRdf_Format::guessFormat($data, $uri); - } else { - $format = EasyRdf_Format::getFormat($format); - } - - if (!$format) { - throw new EasyRdf_Exception( - "Unable to parse data of an unknown format." - ); - } - - $parser = $format->newParser(); - return $parser->parse($this, $data, $format, $uri); - } - - /** - * Parse a file containing RDF data into the graph object. - * - * @param string $filename The path of the file to load - * @param string $format Optional format of the file - * @param string $uri The URI of the file to load - * @return integer The number of triples added to the graph - */ - public function parseFile($filename, $format = null, $uri = null) - { - if ($uri === null) { - $uri = "file://$filename"; - } - - return $this->parse( - file_get_contents($filename), - $format, - $uri - ); - } - - /** - * Load RDF data into the graph from a URI. - * - * If no URI is given, then the URI of the graph will be used. - * - * The document type is optional but should be specified if it - * can't be guessed or got from the HTTP headers. - * - * @param string $uri The URI of the data to load - * @param string $format Optional format of the data (eg. rdfxml) - * @return integer The number of triples added to the graph - */ - public function load($uri = null, $format = null) - { - $this->checkResourceParam($uri, true); - - if (!$uri) { - throw new EasyRdf_Exception( - "No URI given to load() and the graph does not have a URI." - ); - } - - // Setup the HTTP client - $client = EasyRdf_Http::getDefaultHttpClient(); - $client->resetParameters(true); - $client->setConfig(array('maxredirects' => 0)); - $client->setMethod('GET'); - $client->setHeaders('Accept', EasyRdf_Format::getHttpAcceptHeader()); - - $requestUrl = $uri; - $response = null; - $redirectCounter = 0; - do { - // Have we already loaded it into the graph? - $requestUrl = EasyRdf_Utils::removeFragmentFromUri($requestUrl); - if (in_array($requestUrl, $this->loaded)) { - return 0; - } - - // Make the HTTP request - $client->setHeaders('host', null); - $client->setUri($requestUrl); - $response = $client->request(); - - // Add the URL to the list of URLs loaded - $this->loaded[] = $requestUrl; - - if ($response->isRedirect() and $location = $response->getHeader('location')) { - // Avoid problems with buggy servers that add whitespace - $location = trim($location); - - // Some servers return relative URLs in the location header - // resolve it in relation to previous request - $baseUri = new EasyRdf_ParsedUri($requestUrl); - $requestUrl = $baseUri->resolve($location)->toString(); - $requestUrl = EasyRdf_Utils::removeFragmentFromUri($requestUrl); - - // If it is a 303 then drop the parameters - if ($response->getStatus() == 303) { - $client->resetParameters(); - } - - ++$redirectCounter; - } elseif ($response->isSuccessful()) { - // If we didn't get any location, stop redirecting - break; - } else { - throw new EasyRdf_Http_Exception( - "HTTP request for {$requestUrl} failed: ".$response->getMessage(), - $response->getStatus(), - null, - $response->getBody() - ); - } - } while ($redirectCounter < $this->maxRedirects); - - if (!$format or $format == 'guess') { - list($format, $params) = EasyRdf_Utils::parseMimeType( - $response->getHeader('Content-Type') - ); - } - - // Parse the data - return $this->parse($response->getBody(), $format, $uri); - } - - /** Get an associative array of all the resources stored in the graph. - * The keys of the array is the URI of the EasyRdf_Resource. - * - * @return array Array of EasyRdf_Resource - */ - public function resources() - { - foreach ($this->index as $subject => $properties) { - if (!isset($this->resources[$subject])) { - $this->resource($subject); - } - } - - foreach ($this->revIndex as $object => $properties) { - if (!isset($this->resources[$object])) { - $this->resource($object); - } - } - - return $this->resources; - } - - /** Get an arry of resources matching a certain property and optional value. - * - * For example this routine could be used as a way of getting - * everyone who has name: - * $people = $graph->resourcesMatching('foaf:name') - * - * Or everyone who is male: - * $people = $graph->resourcesMatching('foaf:gender', 'male'); - * - * Or all homepages: - * $people = $graph->resourcesMatching('^foaf:homepage'); - * - * @param string $property The property to check. - * @param mixed $value Optional, the value of the propery to check for. - * @return array Array of EasyRdf_Resource - */ - public function resourcesMatching($property, $value = null) - { - $this->checkSinglePropertyParam($property, $inverse); - $this->checkValueParam($value); - - // Use the reverse index if it is an inverse property - if ($inverse) { - $index = &$this->revIndex; - } else { - $index = &$this->index; - } - - $matched = array(); - foreach ($index as $subject => $props) { - if (isset($index[$subject][$property])) { - if (isset($value)) { - foreach ($this->index[$subject][$property] as $v) { - if ($v['type'] == $value['type'] and - $v['value'] == $value['value']) { - $matched[] = $this->resource($subject); - break; - } - } - } else { - $matched[] = $this->resource($subject); - } - } - } - return $matched; - } - - /** Get the URI of the graph - * - * @return string The URI of the graph - */ - public function getUri() - { - return $this->uri; - } - - /** Check that a URI/resource parameter is valid, and convert it to a string - * @ignore - */ - protected function checkResourceParam(&$resource, $allowNull = false) - { - if ($allowNull == true) { - if ($resource === null) { - if ($this->uri) { - $resource = $this->uri; - } else { - return; - } - } - } elseif ($resource === null) { - throw new InvalidArgumentException( - "\$resource should be either IRI, blank-node identifier or EasyRdf_Resource. got null" - ); - } - - if (is_object($resource) and $resource instanceof EasyRdf_Resource) { - $resource = $resource->getUri(); - } elseif (is_object($resource) and $resource instanceof EasyRdf_ParsedUri) { - $resource = strval($resource); - } elseif (is_string($resource)) { - if ($resource == '') { - throw new InvalidArgumentException( - "\$resource should be either IRI, blank-node identifier or EasyRdf_Resource. got empty string" - ); - } elseif (preg_match("|^<(.+)>$|", $resource, $matches)) { - $resource = $matches[1]; - } else { - $resource = EasyRdf_Namespace::expand($resource); - } - } else { - throw new InvalidArgumentException( - "\$resource should be either IRI, blank-node identifier or EasyRdf_Resource" - ); - } - } - - /** Check that a single URI/property parameter (not a property path) - * is valid, and expand it if required - * @ignore - */ - protected function checkSinglePropertyParam(&$property, &$inverse) - { - if (is_object($property) and $property instanceof EasyRdf_Resource) { - $property = $property->getUri(); - } elseif (is_object($property) and $property instanceof EasyRdf_ParsedUri) { - $property = strval($property); - } elseif (is_string($property)) { - if ($property == '') { - throw new InvalidArgumentException( - "\$property cannot be an empty string" - ); - } elseif (substr($property, 0, 1) == '^') { - $inverse = true; - $property = EasyRdf_Namespace::expand(substr($property, 1)); - } elseif (substr($property, 0, 2) == '_:') { - throw new InvalidArgumentException( - "\$property cannot be a blank node" - ); - } else { - $inverse = false; - $property = EasyRdf_Namespace::expand($property); - } - } - - if ($property === null or !is_string($property)) { - throw new InvalidArgumentException( - "\$property should be a string or EasyRdf_Resource and cannot be null" - ); - } - } - - /** Check that a value parameter is valid, and convert it to an associative array if needed - * @ignore - */ - protected function checkValueParam(&$value) - { - if (isset($value)) { - if (is_object($value)) { - if (!method_exists($value, 'toRdfPhp')) { - // Convert to a literal object - $value = EasyRdf_Literal::create($value); - } - $value = $value->toRdfPhp(); - } elseif (is_array($value)) { - if (!isset($value['type'])) { - throw new InvalidArgumentException( - "\$value is missing a 'type' key" - ); - } - - if (!isset($value['value'])) { - throw new InvalidArgumentException( - "\$value is missing a 'value' key" - ); - } - - // Fix ordering and remove unknown keys - $value = array( - 'type' => strval($value['type']), - 'value' => strval($value['value']), - 'lang' => isset($value['lang']) ? strval($value['lang']) : null, - 'datatype' => isset($value['datatype']) ? strval($value['datatype']) : null - ); - } else { - $value = array( - 'type' => 'literal', - 'value' => strval($value), - 'datatype' => EasyRdf_Literal::getDatatypeForValue($value) - ); - } - if (!in_array($value['type'], array('uri', 'bnode', 'literal'), true)) { - throw new InvalidArgumentException( - "\$value does not have a valid type (".$value['type'].")" - ); - } - if (empty($value['datatype'])) { - unset($value['datatype']); - } - if (empty($value['lang'])) { - unset($value['lang']); - } - if (isset($value['lang']) and isset($value['datatype'])) { - throw new InvalidArgumentException( - "\$value cannot have both and language and a datatype" - ); - } - } - } - - /** Get a single value for a property of a resource - * - * If multiple values are set for a property then the value returned - * may be arbitrary. - * - * If $property is an array, then the first item in the array that matches - * a property that exists is returned. - * - * This method will return null if the property does not exist. - * - * @param string $resource The URI of the resource (e.g. http://example.com/joe#me) - * @param string $propertyPath A valid property path - * @param string $type The type of value to filter by (e.g. literal or resource) - * @param string $lang The language to filter by (e.g. en) - * @return mixed A value associated with the property - */ - public function get($resource, $propertyPath, $type = null, $lang = null) - { - $this->checkResourceParam($resource); - - if (is_object($propertyPath) and $propertyPath instanceof EasyRdf_Resource) { - return $this->getSingleProperty($resource, $propertyPath->getUri(), $type, $lang); - } elseif (is_string($propertyPath) and preg_match('|^(\^?)<(.+)>|', $propertyPath, $matches)) { - return $this->getSingleProperty($resource, "$matches[1]$matches[2]", $type, $lang); - } elseif ($propertyPath === null or !is_string($propertyPath)) { - throw new InvalidArgumentException( - "\$propertyPath should be a string or EasyRdf_Resource and cannot be null" - ); - } elseif ($propertyPath === '') { - throw new InvalidArgumentException( - "\$propertyPath cannot be an empty string" - ); - } - - // Loop through each component in the path - foreach (explode('/', $propertyPath) as $part) { - // Stop if we come to a literal - if ($resource instanceof EasyRdf_Literal) { - return null; - } - - // Try each of the alternative paths - foreach (explode('|', $part) as $p) { - $res = $this->getSingleProperty($resource, $p, $type, $lang); - if ($res) { - break; - } - } - - // Stop if nothing was found - $resource = $res; - if (!$resource) { - break; - } - } - - return $resource; - } - - /** Get a single value for a property of a resource - * - * @param string $resource The URI of the resource (e.g. http://example.com/joe#me) - * @param string $property The name of the property (e.g. foaf:name) - * @param string $type The type of value to filter by (e.g. literal or resource) - * @param string $lang The language to filter by (e.g. en) - * @return mixed A value associated with the property - * - * @ignore - */ - protected function getSingleProperty($resource, $property, $type = null, $lang = null) - { - $this->checkResourceParam($resource); - $this->checkSinglePropertyParam($property, $inverse); - - // Get an array of values for the property - $values = $this->propertyValuesArray($resource, $property, $inverse); - if (!isset($values)) { - return null; - } - - // Filter the results - $result = null; - if ($type) { - foreach ($values as $value) { - if ($type == 'literal' and $value['type'] == 'literal') { - if ($lang == null or (isset($value['lang']) and $value['lang'] == $lang)) { - $result = $value; - break; - } - } elseif ($type == 'resource') { - if ($value['type'] == 'uri' or $value['type'] == 'bnode') { - $result = $value; - break; - } - } - } - } else { - $result = $values[0]; - } - - // Convert the internal data structure into a PHP object - return $this->arrayToObject($result); - } - - /** Get a single literal value for a property of a resource - * - * If multiple values are set for a property then the value returned - * may be arbitrary. - * - * This method will return null if there is not literal value for the - * property. - * - * @param string $resource The URI of the resource (e.g. http://example.com/joe#me) - * @param string|array $property The name of the property (e.g. foaf:name) - * @param string $lang The language to filter by (e.g. en) - * @return object EasyRdf_Literal Literal value associated with the property - */ - public function getLiteral($resource, $property, $lang = null) - { - return $this->get($resource, $property, 'literal', $lang); - } - - /** Get a single resource value for a property of a resource - * - * If multiple values are set for a property then the value returned - * may be arbitrary. - * - * This method will return null if there is not resource for the - * property. - * - * @param string $resource The URI of the resource (e.g. http://example.com/joe#me) - * @param string|array $property The name of the property (e.g. foaf:name) - * @return object EasyRdf_Resource Resource associated with the property - */ - public function getResource($resource, $property) - { - return $this->get($resource, $property, 'resource'); - } - - /** Return all the values for a particular property of a resource - * @ignore - */ - protected function propertyValuesArray($resource, $property, $inverse = false) - { - // Is an inverse property being requested? - if ($inverse) { - if (isset($this->revIndex[$resource])) { - $properties = &$this->revIndex[$resource]; - } - } else { - if (isset($this->index[$resource])) { - $properties = &$this->index[$resource]; - } - } - - if (isset($properties[$property])) { - return $properties[$property]; - } else { - return null; - } - } - - /** Get an EasyRdf_Resource or EasyRdf_Literal object from an associative array. - * @ignore - */ - protected function arrayToObject($data) - { - if ($data) { - if ($data['type'] == 'uri' or $data['type'] == 'bnode') { - return $this->resource($data['value']); - } else { - return EasyRdf_Literal::create($data); - } - } else { - return null; - } - } - - /** Get all values for a property path - * - * This method will return an empty array if the property does not exist. - * - * @param string $resource The URI of the resource (e.g. http://example.com/joe#me) - * @param string $propertyPath A valid property path - * @param string $type The type of value to filter by (e.g. literal) - * @param string $lang The language to filter by (e.g. en) - * @return array An array of values associated with the property - */ - public function all($resource, $propertyPath, $type = null, $lang = null) - { - $this->checkResourceParam($resource); - - if (is_object($propertyPath) and $propertyPath instanceof EasyRdf_Resource) { - return $this->allForSingleProperty($resource, $propertyPath->getUri(), $type, $lang); - } elseif (is_string($propertyPath) and preg_match('|^(\^?)<(.+)>|', $propertyPath, $matches)) { - return $this->allForSingleProperty($resource, "$matches[1]$matches[2]", $type, $lang); - } elseif ($propertyPath === null or !is_string($propertyPath)) { - throw new InvalidArgumentException( - "\$propertyPath should be a string or EasyRdf_Resource and cannot be null" - ); - } elseif ($propertyPath === '') { - throw new InvalidArgumentException( - "\$propertyPath cannot be an empty string" - ); - } - - $objects = array($resource); - - // Loop through each component in the path - foreach (explode('/', $propertyPath) as $part) { - - $results = array(); - foreach (explode('|', $part) as $p) { - foreach ($objects as $o) { - // Ignore literals found earlier in path - if ($o instanceof EasyRdf_Literal) { - continue; - } - - $results = array_merge( - $results, - $this->allForSingleProperty($o, $p, $type, $lang) - ); - } - } - - // Stop if we don't have anything - if (empty($objects)) { - break; - } - - // Use the results as the input to the next iteration - $objects = $results; - } - - return $results; - } - - /** Get all values for a single property of a resource - * - * @param string $resource The URI of the resource (e.g. http://example.com/joe#me) - * @param string $property The name of the property (e.g. foaf:name) - * @param string $type The type of value to filter by (e.g. literal) - * @param string $lang The language to filter by (e.g. en) - * @return array An array of values associated with the property - * - * @ignore - */ - protected function allForSingleProperty($resource, $property, $type = null, $lang = null) - { - $this->checkResourceParam($resource); - $this->checkSinglePropertyParam($property, $inverse); - - // Get an array of values for the property - $values = $this->propertyValuesArray($resource, $property, $inverse); - if (!isset($values)) { - return array(); - } - - $objects = array(); - if ($type) { - foreach ($values as $value) { - if ($type == 'literal' and $value['type'] == 'literal') { - if ($lang == null or (isset($value['lang']) and $value['lang'] == $lang)) { - $objects[] = $this->arrayToObject($value); - } - } elseif ($type == 'resource') { - if ($value['type'] == 'uri' or $value['type'] == 'bnode') { - $objects[] = $this->arrayToObject($value); - } - } - } - } else { - foreach ($values as $value) { - $objects[] = $this->arrayToObject($value); - } - } - return $objects; - } - - /** Get all literal values for a property of a resource - * - * This method will return an empty array if the resource does not - * has any literal values for that property. - * - * @param string $resource The URI of the resource (e.g. http://example.com/joe#me) - * @param string $property The name of the property (e.g. foaf:name) - * @param string $lang The language to filter by (e.g. en) - * @return array An array of values associated with the property - */ - public function allLiterals($resource, $property, $lang = null) - { - return $this->all($resource, $property, 'literal', $lang); - } - - /** Get all resources for a property of a resource - * - * This method will return an empty array if the resource does not - * has any resources for that property. - * - * @param string $resource The URI of the resource (e.g. http://example.com/joe#me) - * @param string $property The name of the property (e.g. foaf:name) - * @return array An array of values associated with the property - */ - public function allResources($resource, $property) - { - return $this->all($resource, $property, 'resource'); - } - - /** Get all the resources in the graph of a certain type - * - * If no resources of the type are available and empty - * array is returned. - * - * @param string $type The type of the resource (e.g. foaf:Person) - * @return array The array of resources - */ - public function allOfType($type) - { - return $this->all($type, '^rdf:type'); - } - - /** Count the number of values for a property of a resource - * - * @param string $resource The URI of the resource (e.g. http://example.com/joe#me) - * @param string $property The name of the property (e.g. foaf:name) - * @param string $type The type of value to filter by (e.g. literal) - * @param string $lang The language to filter by (e.g. en) - * @return integer The number of values for this property - */ - public function countValues($resource, $property, $type = null, $lang = null) - { - return count($this->all($resource, $property, $type, $lang)); - } - - /** Concatenate all values for a property of a resource into a string. - * - * The default is to join the values together with a space character. - * This method will return an empty string if the property does not exist. - * - * @param mixed $resource The resource to get the property on - * @param string $property The name of the property (e.g. foaf:name) - * @param string $glue The string to glue the values together with. - * @param string $lang The language to filter by (e.g. en) - * @return string Concatenation of all the values. - */ - public function join($resource, $property, $glue = ' ', $lang = null) - { - return join($glue, $this->all($resource, $property, 'literal', $lang)); - } - - /** Add data to the graph - * - * The resource can either be a resource or the URI of a resource. - * - * Example: - * $graph->add("http://www.example.com", 'dc:title', 'Title of Page'); - * - * @param mixed $resource The resource to add data to - * @param mixed $property The property name - * @param mixed $value The new value for the property - * @return integer The number of values added (1 or 0) - */ - public function add($resource, $property, $value) - { - $this->checkResourceParam($resource); - $this->checkSinglePropertyParam($property, $inverse); - $this->checkValueParam($value); - - // No value given? - if ($value === null) { - return 0; - } - - // Check that the value doesn't already exist - if (isset($this->index[$resource][$property])) { - foreach ($this->index[$resource][$property] as $v) { - if ($v == $value) { - return 0; - } - } - } - $this->index[$resource][$property][] = $value; - - // Add to the reverse index if it is a resource - if ($value['type'] == 'uri' or $value['type'] == 'bnode') { - $uri = $value['value']; - $this->revIndex[$uri][$property][] = array( - 'type' => substr($resource, 0, 2) == '_:' ? 'bnode' : 'uri', - 'value' => $resource - ); - } - - // Success - return 1; - } - - /** Add a literal value as a property of a resource - * - * The resource can either be a resource or the URI of a resource. - * The value can either be a single value or an array of values. - * - * Example: - * $graph->add("http://www.example.com", 'dc:title', 'Title of Page'); - * - * @param mixed $resource The resource to add data to - * @param mixed $property The property name - * @param mixed $value The value or values for the property - * @param string $lang The language of the literal - * @return integer The number of values added - */ - public function addLiteral($resource, $property, $value, $lang = null) - { - $this->checkResourceParam($resource); - $this->checkSinglePropertyParam($property, $inverse); - - if (is_array($value)) { - $added = 0; - foreach ($value as $v) { - $added += $this->addLiteral($resource, $property, $v, $lang); - } - return $added; - } elseif (!is_object($value) or !$value instanceof EasyRdf_Literal) { - $value = EasyRdf_Literal::create($value, $lang); - } - return $this->add($resource, $property, $value); - } - - /** Add a resource as a property of another resource - * - * The resource can either be a resource or the URI of a resource. - * - * Example: - * $graph->add("http://example.com/bob", 'foaf:knows', 'http://example.com/alice'); - * - * @param mixed $resource The resource to add data to - * @param mixed $property The property name - * @param mixed $resource2 The resource to be value of the property - * @return integer The number of values added - */ - public function addResource($resource, $property, $resource2) - { - $this->checkResourceParam($resource); - $this->checkSinglePropertyParam($property, $inverse); - $this->checkResourceParam($resource2); - - return $this->add( - $resource, - $property, - array( - 'type' => substr($resource2, 0, 2) == '_:' ? 'bnode' : 'uri', - 'value' => $resource2 - ) - ); - } - - /** Set a value for a property - * - * The new value will replace the existing values for the property. - * - * @param string $resource The resource to set the property on - * @param string $property The name of the property (e.g. foaf:name) - * @param mixed $value The value for the property - * @return integer The number of values added (1 or 0) - */ - public function set($resource, $property, $value) - { - $this->checkResourceParam($resource); - $this->checkSinglePropertyParam($property, $inverse); - $this->checkValueParam($value); - - // Delete the old values - $this->delete($resource, $property); - - // Add the new values - return $this->add($resource, $property, $value); - } - - /** Delete a property (or optionally just a specific value) - * - * @param mixed $resource The resource to delete the property from - * @param string $property The name of the property (e.g. foaf:name) - * @param mixed $value The value to delete (null to delete all values) - * @return integer The number of values deleted - */ - public function delete($resource, $property, $value = null) - { - $this->checkResourceParam($resource); - - if (is_object($property) and $property instanceof EasyRdf_Resource) { - return $this->deleteSingleProperty($resource, $property->getUri(), $value); - } elseif (is_string($property) and preg_match('|^(\^?)<(.+)>|', $property, $matches)) { - return $this->deleteSingleProperty($resource, "$matches[1]$matches[2]", $value); - } elseif ($property === null or !is_string($property)) { - throw new InvalidArgumentException( - "\$property should be a string or EasyRdf_Resource and cannot be null" - ); - } elseif ($property === '') { - throw new InvalidArgumentException( - "\$property cannot be an empty string" - ); - } - - // FIXME: finish implementing property paths for delete - return $this->deleteSingleProperty($resource, $property, $value); - } - - - /** Delete a property (or optionally just a specific value) - * - * @param mixed $resource The resource to delete the property from - * @param string $property The name of the property (e.g. foaf:name) - * @param mixed $value The value to delete (null to delete all values) - * @return integer The number of values deleted - * - * @ignore - */ - public function deleteSingleProperty($resource, $property, $value = null) - { - $this->checkResourceParam($resource); - $this->checkSinglePropertyParam($property, $inverse); - $this->checkValueParam($value); - - $count = 0; - if (isset($this->index[$resource][$property])) { - foreach ($this->index[$resource][$property] as $k => $v) { - if (!$value or $v == $value) { - unset($this->index[$resource][$property][$k]); - $count++; - if ($v['type'] == 'uri' or $v['type'] == 'bnode') { - $this->deleteInverse($v['value'], $property, $resource); - } - } - } - - // Clean up the indexes - remove empty properties and resources - if ($count) { - if (count($this->index[$resource][$property]) == 0) { - unset($this->index[$resource][$property]); - } - if (count($this->index[$resource]) == 0) { - unset($this->index[$resource]); - } - } - } - - return $count; - } - - /** Delete a resource from a property of another resource - * - * The resource can either be a resource or the URI of a resource. - * - * Example: - * $graph->delete("http://example.com/bob", 'foaf:knows', 'http://example.com/alice'); - * - * @param mixed $resource The resource to delete data from - * @param mixed $property The property name - * @param mixed $resource2 The resource value of the property to be deleted - */ - public function deleteResource($resource, $property, $resource2) - { - $this->checkResourceParam($resource); - $this->checkSinglePropertyParam($property, $inverse); - $this->checkResourceParam($resource2); - - return $this->delete( - $resource, - $property, - array( - 'type' => substr($resource2, 0, 2) == '_:' ? 'bnode' : 'uri', - 'value' => $resource2 - ) - ); - } - - /** Delete a literal value from a property of a resource - * - * Example: - * $graph->delete("http://www.example.com", 'dc:title', 'Title of Page'); - * - * @param mixed $resource The resource to add data to - * @param mixed $property The property name - * @param mixed $value The value of the property - * @param string $lang The language of the literal - */ - public function deleteLiteral($resource, $property, $value, $lang = null) - { - $this->checkResourceParam($resource); - $this->checkSinglePropertyParam($property, $inverse); - $this->checkValueParam($value); - - if ($lang) { - $value['lang'] = $lang; - } - - return $this->delete($resource, $property, $value); - } - - /** This function is for internal use only. - * - * Deletes an inverse property from a resource. - * - * @ignore - */ - protected function deleteInverse($resource, $property, $value) - { - if (isset($this->revIndex[$resource])) { - foreach ($this->revIndex[$resource][$property] as $k => $v) { - if ($v['value'] === $value) { - unset($this->revIndex[$resource][$property][$k]); - } - } - if (count($this->revIndex[$resource][$property]) == 0) { - unset($this->revIndex[$resource][$property]); - } - if (count($this->revIndex[$resource]) == 0) { - unset($this->revIndex[$resource]); - } - } - } - - /** Check if the graph contains any statements - * - * @return boolean True if the graph contains no statements - */ - public function isEmpty() - { - return count($this->index) == 0; - } - - /** Get a list of all the shortened property names (qnames) for a resource. - * - * This method will return an empty array if the resource has no properties. - * - * @return array Array of shortened URIs - */ - public function properties($resource) - { - $this->checkResourceParam($resource); - - $properties = array(); - if (isset($this->index[$resource])) { - foreach ($this->index[$resource] as $property => $value) { - $short = EasyRdf_Namespace::shorten($property); - if ($short) { - $properties[] = $short; - } - } - } - return $properties; - } - - /** Get a list of the full URIs for the properties of a resource. - * - * This method will return an empty array if the resource has no properties. - * - * @return array Array of full URIs - */ - public function propertyUris($resource) - { - $this->checkResourceParam($resource); - - if (isset($this->index[$resource])) { - return array_keys($this->index[$resource]); - } else { - return array(); - } - } - - /** Get a list of the full URIs for the properties that point to a resource. - * - * @return array Array of full property URIs - */ - public function reversePropertyUris($resource) - { - $this->checkResourceParam($resource); - - if (isset($this->revIndex[$resource])) { - return array_keys($this->revIndex[$resource]); - } else { - return array(); - } - } - - /** Check to see if a property exists for a resource. - * - * This method will return true if the property exists. - * If the value parameter is given, then it will only return true - * if the value also exists for that property. - * - * By providing a value parameter you can use this function to check - * to see if a triple exists in the graph. - * - * @param mixed $resource The resource to check - * @param string $property The name of the property (e.g. foaf:name) - * @param mixed $value An optional value of the property - * @return boolean True if value the property exists. - */ - public function hasProperty($resource, $property, $value = null) - { - $this->checkResourceParam($resource); - $this->checkSinglePropertyParam($property, $inverse); - $this->checkValueParam($value); - - // Use the reverse index if it is an inverse property - if ($inverse) { - $index = &$this->revIndex; - } else { - $index = &$this->index; - } - - if (isset($index[$resource][$property])) { - if (is_null($value)) { - return true; - } else { - foreach ($index[$resource][$property] as $v) { - if ($v == $value) { - return true; - } - } - } - } - - return false; - } - - /** Serialise the graph into RDF - * - * The $format parameter can be an EasyRdf_Format object, a - * format name, a mime type or a file extension. - * - * Example: - * $turtle = $graph->serialise('turtle'); - * - * @param mixed $format The format to serialise to - * @param array $options Serialiser-specific options, for fine-tuning the output - * @return mixed The serialised graph - */ - public function serialise($format, array $options = array()) - { - if (!$format instanceof EasyRdf_Format) { - $format = EasyRdf_Format::getFormat($format); - } - $serialiser = $format->newSerialiser(); - return $serialiser->serialise($this, $format->getName(), $options); - } - - /** Return a human readable view of all the resources in the graph - * - * This method is intended to be a debugging aid and will - * return a pretty-print view of all the resources and their - * properties. - * - * @param string $format Either 'html' or 'text' - * @return string - */ - public function dump($format = 'html') - { - $result = ''; - if ($format == 'html') { - $result .= "
". - "Graph: ". $this->uri . "
\n"; - } else { - $result .= "Graph: ". $this->uri . "\n"; - } - - foreach ($this->index as $resource => $properties) { - $result .= $this->dumpResource($resource, $format); - } - return $result; - } - - /** Return a human readable view of a resource and its properties - * - * This method is intended to be a debugging aid and will - * print a resource and its properties. - * - * @param mixed $resource The resource to dump - * @param string $format Either 'html' or 'text' - * @return string - */ - public function dumpResource($resource, $format = 'html') - { - $this->checkResourceParam($resource, true); - - if (isset($this->index[$resource])) { - $properties = $this->index[$resource]; - } else { - return ''; - } - - $plist = array(); - foreach ($properties as $property => $values) { - $olist = array(); - foreach ($values as $value) { - if ($value['type'] == 'literal') { - $olist []= EasyRdf_Utils::dumpLiteralValue($value, $format, 'black'); - } else { - $olist []= EasyRdf_Utils::dumpResourceValue($value['value'], $format, 'blue'); - } - } - - $pstr = EasyRdf_Namespace::shorten($property); - if ($pstr == null) { - $pstr = $property; - } - if ($format == 'html') { - $plist []= " ". - "". - htmlentities($pstr) . " ". - " ". - join(", ", $olist); - } else { - $plist []= " -> $pstr -> " . join(", ", $olist); - } - } - - if ($format == 'html') { - return "
\n". - "
".EasyRdf_Utils::dumpResourceValue($resource, $format, 'blue')." ". - "(". - $this->classForResource($resource).")
\n". - "
\n". - "
".join("
\n
", $plist)."
". - "
\n"; - } else { - return $resource." (".$this->classForResource($resource).")\n" . - join("\n", $plist) . "\n\n"; - } - } - - /** Get the resource type of the graph - * - * The type will be a shortened URI as a string. - * If the graph has multiple types then the type returned - * may be arbitrary. - * This method will return null if the resource has no type. - * - * @return string A type assocated with the resource (e.g. foaf:Document) - */ - public function type($resource = null) - { - $type = $this->typeAsResource($resource); - - if ($type) { - return EasyRdf_Namespace::shorten($type); - } - - return null; - } - - /** Get the resource type of the graph as a EasyRdf_Resource - * - * If the graph has multiple types then the type returned - * may be arbitrary. - * This method will return null if the resource has no type. - * - * @return object EasyRdf_Resource A type assocated with the resource - */ - public function typeAsResource($resource = null) - { - $this->checkResourceParam($resource, true); - - if ($resource) { - return $this->get($resource, 'rdf:type', 'resource'); - } - - return null; - } - - /** Get a list of types for a resource - * - * The types will each be a shortened URI as a string. - * This method will return an empty array if the resource has no types. - * - * If $resource is null, then it will get the types for the URI of the graph. - * - * @return array All types assocated with the resource (e.g. foaf:Person) - */ - public function types($resource = null) - { - $resources = $this->typesAsResources($resource); - - $types = array(); - foreach ($resources as $type) { - $types[] = EasyRdf_Namespace::shorten($type); - } - - return $types; - } - - /** - * Get the resource types of the graph as a EasyRdf_Resource - * - * @return EasyRdf_Resource[] - */ - public function typesAsResources($resource = null) - { - $this->checkResourceParam($resource, true); - - if ($resource) { - return $this->all($resource, 'rdf:type', 'resource'); - } - - return array(); - } - - /** Check if a resource is of the specified type - * - * @param string $resource The resource to check the type of - * @param string $type The type to check (e.g. foaf:Person) - * @return boolean True if resource is of specified type - */ - public function isA($resource, $type) - { - $this->checkResourceParam($resource, true); - - $type = EasyRdf_Namespace::expand($type); - foreach ($this->all($resource, 'rdf:type', 'resource') as $t) { - if ($t->getUri() == $type) { - return true; - } - } - return false; - } - - /** Add one or more rdf:type properties to a resource - * - * @param string $resource The resource to add the type to - * @param string $types One or more types to add (e.g. foaf:Person) - * @return integer The number of types added - */ - public function addType($resource, $types) - { - $this->checkResourceParam($resource, true); - - if (!is_array($types)) { - $types = array($types); - } - - $count = 0; - foreach ($types as $type) { - $type = EasyRdf_Namespace::expand($type); - $count += $this->add($resource, 'rdf:type', array('type' => 'uri', 'value' => $type)); - } - - return $count; - } - - /** Change the rdf:type property for a resource - * - * Note that if the resource object has already previously - * been created, then the PHP class of the resource will not change. - * - * @param string $resource The resource to change the type of - * @param string $type The new type (e.g. foaf:Person) - * @return integer The number of types added - */ - public function setType($resource, $type) - { - $this->checkResourceParam($resource, true); - - $this->delete($resource, 'rdf:type'); - return $this->addType($resource, $type); - } - - /** Get a human readable label for a resource - * - * This method will check a number of properties for a resource - * (in the order: skos:prefLabel, rdfs:label, foaf:name, dc:title) - * and return an approriate first that is available. If no label - * is available then it will return null. - * - * @return string A label for the resource. - */ - public function label($resource = null, $lang = null) - { - $this->checkResourceParam($resource, true); - - if ($resource) { - return $this->get( - $resource, - 'skos:prefLabel|rdfs:label|foaf:name|rss:title|dc:title|dc11:title', - 'literal', - $lang - ); - } else { - return null; - } - } - - /** Get the primary topic of the graph - * - * @return EasyRdf_Resource The primary topic of the document. - */ - public function primaryTopic($resource = null) - { - $this->checkResourceParam($resource, true); - - if ($resource) { - return $this->get( - $resource, - 'foaf:primaryTopic|^foaf:isPrimaryTopicOf', - 'resource' - ); - } else { - return null; - } - } - - /** Returns the graph as a RDF/PHP associative array - * - * @return array The contents of the graph as an array. - */ - public function toRdfPhp() - { - return $this->index; - } - - /** Calculates the number of triples in the graph - * - * @return integer The number of triples in the graph. - */ - public function countTriples() - { - $count = 0; - foreach ($this->index as $resource) { - foreach ($resource as $property => $values) { - $count += count($values); - } - } - return $count; - } - - /** Magic method to return URI of resource when casted to string - * - * @return string The URI of the resource - */ - public function __toString() - { - return $this->uri == null ? '' : $this->uri; - } - - /** Magic method to get a property of the graph - * - * Note that only properties in the default namespace can be accessed in this way. - * - * Example: - * $value = $graph->title; - * - * @see EasyRdf_Namespace::setDefault() - * @param string $name The name of the property - * @return string A single value for the named property - */ - public function __get($name) - { - return $this->get($this->uri, $name); - } - - /** Magic method to set the value for a property of the graph - * - * Note that only properties in the default namespace can be accessed in this way. - * - * Example: - * $graph->title = 'Title'; - * - * @see EasyRdf_Namespace::setDefault() - * @param string $name The name of the property - * @param string $value The value for the property - */ - public function __set($name, $value) - { - return $this->set($this->uri, $name, $value); - } - - /** Magic method to check if a property exists - * - * Note that only properties in the default namespace can be accessed in this way. - * - * Example: - * if (isset($graph->title)) { blah(); } - * - * @see EasyRdf_Namespace::setDefault() - * @param string $name The name of the property - */ - public function __isset($name) - { - return $this->hasProperty($this->uri, $name); - } - - /** Magic method to delete a property of the graph - * - * Note that only properties in the default namespace can be accessed in this way. - * - * Example: - * unset($graph->title); - * - * @see EasyRdf_Namespace::setDefault() - * @param string $name The name of the property - */ - public function __unset($name) - { - return $this->delete($this->uri, $name); - } -} diff --git a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/GraphStore.php b/core/vendor/easyrdf/easyrdf/lib/EasyRdf/GraphStore.php deleted file mode 100644 index 40cbf63..0000000 --- a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/GraphStore.php +++ /dev/null @@ -1,306 +0,0 @@ -uri = $uri; - $this->parsedUri = new EasyRdf_ParsedUri($uri); - } - - /** Get the URI of the graph store - * - * @return string The URI of the graph store - */ - public function getUri() - { - return $this->uri; - } - - /** Fetch a named graph from the graph store - * - * The URI can either be a full absolute URI or - * a URI relative to the URI of the graph store. - * - * @param string $uriRef The URI of graph desired - * @return EasyRdf_Graph The graph requested - */ - public function get($uriRef) - { - if ($uriRef === self::DEFAULT_GRAPH) { - $dataUrl = $this->urlForGraph(self::DEFAULT_GRAPH); - $graph = new EasyRdf_Graph(); - } else { - $graphUri = $this->parsedUri->resolve($uriRef)->toString(); - $dataUrl = $this->urlForGraph($graphUri); - - $graph = new EasyRdf_Graph($graphUri); - } - - $graph->load($dataUrl); - - return $graph; - } - - /** - * Fetch default graph from the graph store - * @return EasyRdf_Graph - */ - public function getDefault() - { - return $this->get(self::DEFAULT_GRAPH); - } - - /** Send some graph data to the graph store - * - * This method is used by insert() and replace() - * - * @ignore - */ - protected function sendGraph($method, $graph, $uriRef, $format) - { - if (is_object($graph) and $graph instanceof EasyRdf_Graph) { - if ($uriRef === null) { - $uriRef = $graph->getUri(); - } - $data = $graph->serialise($format); - } else { - $data = $graph; - } - - if ($uriRef === null) { - throw new InvalidArgumentException('Graph IRI is not specified'); - } - - $formatObj = EasyRdf_Format::getFormat($format); - $mimeType = $formatObj->getDefaultMimeType(); - - if ($uriRef === self::DEFAULT_GRAPH) { - $dataUrl = $this->urlForGraph(self::DEFAULT_GRAPH); - } else { - $graphUri = $this->parsedUri->resolve($uriRef)->toString(); - $dataUrl = $this->urlForGraph($graphUri); - } - - $client = EasyRdf_Http::getDefaultHttpClient(); - $client->resetParameters(true); - $client->setUri($dataUrl); - $client->setMethod($method); - $client->setRawData($data); - $client->setHeaders('Content-Type', $mimeType); - - $response = $client->request(); - - if (!$response->isSuccessful()) { - throw new EasyRdf_Exception( - "HTTP request for {$dataUrl} failed: ".$response->getMessage() - ); - } - - return $response; - } - - /** Replace the contents of a graph in the graph store with new data - * - * The $graph parameter is the EasyRdf_Graph object to be sent to the - * graph store. Alternatively it can be a string, already serialised. - * - * The URI can either be a full absolute URI or - * a URI relative to the URI of the graph store. - * - * The $format parameter can be given to specify the serialisation - * used to send the graph data to the graph store. - * - * @param EasyRdf_Graph|string $graph Data - * @param string $uriRef The URI of graph to be replaced - * @param string $format The format of the data to send to the graph store - * @return EasyRdf_Http_Response The response from the graph store - */ - public function replace($graph, $uriRef = null, $format = 'ntriples') - { - return $this->sendGraph('PUT', $graph, $uriRef, $format); - } - - /** - * Replace the contents of default graph in the graph store with new data - * - * The $graph parameter is the EasyRdf_Graph object to be sent to the - * graph store. Alternatively it can be a string, already serialised. - * - * The $format parameter can be given to specify the serialisation - * used to send the graph data to the graph store. - * - * @param EasyRdf_Graph|string $graph Data - * @param string $format The format of the data to send to the graph store - * @return EasyRdf_Http_Response The response from the graph store - */ - public function replaceDefault($graph, $format = 'ntriples') - { - return self::replace($graph, self::DEFAULT_GRAPH, $format); - } - - /** Add data to a graph in the graph store - * - * The $graph parameter is the EasyRdf_Graph object to be sent to the - * graph store. Alternatively it can be a string, already serialised. - * - * The URI can either be a full absolute URI or - * a URI relative to the URI of the graph store. - * - * The $format parameter can be given to specify the serialisation - * used to send the graph data to the graph store. - * - * @param EasyRdf_Graph|string $graph Data - * @param string $uriRef The URI of graph to be added to - * @param string $format The format of the data to send to the graph store - * @return object EasyRdf_Http_Response The response from the graph store - */ - public function insert($graph, $uriRef = null, $format = 'ntriples') - { - return $this->sendGraph('POST', $graph, $uriRef, $format); - } - - /** - * Add data to default graph of the graph store - * - * The $graph parameter is the EasyRdf_Graph object to be sent to the - * graph store. Alternatively it can be a string, already serialised. - * - * The $format parameter can be given to specify the serialisation - * used to send the graph data to the graph store. - * - * @param EasyRdf_Graph|string $graph Data - * @param string $format The format of the data to send to the graph store - * @return object EasyRdf_Http_Response The response from the graph store - */ - public function insertIntoDefault($graph, $format = 'ntriples') - { - return $this->insert($graph, self::DEFAULT_GRAPH, $format); - } - - /** Delete named graph content from the graph store - * - * The URI can either be a full absolute URI or - * a URI relative to the URI of the graph store. - * - * @param string $uriRef The URI of graph to be added to - * - * @throws EasyRdf_Exception - * @return EasyRdf_Http_Response The response from the graph store - */ - public function delete($uriRef) - { - if ($uriRef === self::DEFAULT_GRAPH) { - $dataUrl = $this->urlForGraph(self::DEFAULT_GRAPH); - } else { - $graphUri = $this->parsedUri->resolve($uriRef)->toString(); - $dataUrl = $this->urlForGraph($graphUri); - } - - $client = EasyRdf_Http::getDefaultHttpClient(); - $client->resetParameters(true); - $client->setUri($dataUrl); - $client->setMethod('DELETE'); - $response = $client->request(); - - if (!$response->isSuccessful()) { - throw new EasyRdf_Exception( - "HTTP request to delete {$dataUrl} failed: ".$response->getMessage() - ); - } - - return $response; - } - - /** - * Delete default graph content from the graph store - * - * @return EasyRdf_Http_Response - * @throws EasyRdf_Exception - */ - public function deleteDefault() - { - return $this->delete(self::DEFAULT_GRAPH); - } - - /** Work out the full URL for a graph store request. - * by checking if if it is a direct or indirect request. - * @ignore - */ - protected function urlForGraph($url) - { - if ($url === self::DEFAULT_GRAPH) { - $url = $this->uri.'?default'; - } elseif (strpos($url, $this->uri) === false) { - $url = $this->uri."?graph=".urlencode($url); - } - - return $url; - } - - /** Magic method to return URI of the graph store when casted to string - * - * @return string The URI of the graph store - */ - public function __toString() - { - return empty($this->uri) ? '' : $this->uri; - } -} diff --git a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Http.php b/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Http.php deleted file mode 100644 index c978463..0000000 --- a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Http.php +++ /dev/null @@ -1,82 +0,0 @@ - 5, - 'useragent' => 'EasyRdf_Http_Client', - 'timeout' => 10 - ); - - /** - * Request URI - * - * @var string - */ - private $uri = null; - - /** - * Associative array of request headers - * - * @var array - */ - private $headers = array(); - - /** - * HTTP request method - * - * @var string - */ - private $method = 'GET'; - - /** - * Associative array of GET parameters - * - * @var array - */ - private $paramsGet = array(); - - /** - * The raw post data to send. Could be set by setRawData($data). - * - * @var string - */ - private $rawPostData = null; - - /** - * Redirection counter - * - * @var int - */ - private $redirectCounter = 0; - - /** - * Constructor method. Will create a new HTTP client. Accepts the target - * URL and optionally configuration array. - * - * @param string $uri - * @param array $config Configuration key-value pairs. - */ - public function __construct($uri = null, $config = null) - { - if ($uri !== null) { - $this->setUri($uri); - } - if ($config !== null) { - $this->setConfig($config); - } - } - - /** - * Set the URI for the next request - * - * @param string $uri - * @return EasyRdf_Http_Client - */ - public function setUri($uri) - { - if (!is_string($uri)) { - $uri = strval($uri); - } - - if (!preg_match('/^http(s?):/', $uri)) { - throw new InvalidArgumentException( - "EasyRdf_Http_Client only supports the 'http' and 'https' schemes." - ); - } - - $this->uri = $uri; - - return $this; - } - - /** - * Get the URI for the next request - * - * @return string - */ - public function getUri($asString = true) - { - return $this->uri; - } - - /** - * Set configuration parameters for this HTTP client - * - * @param array $config - * @return EasyRdf_Http_Client - * @throws InvalidArgumentException - */ - public function setConfig($config = array()) - { - if ($config == null or !is_array($config)) { - throw new InvalidArgumentException( - "\$config should be an array and cannot be null" - ); - } - - foreach ($config as $k => $v) { - $this->config[strtolower($k)] = $v; - } - - return $this; - } - - /** - * Set a request header - * - * @param string $name Header name (e.g. 'Accept') - * @param string $value Header value or null - * @return EasyRdf_Http_Client - */ - public function setHeaders($name, $value = null) - { - $normalizedName = strtolower($name); - - // If $value is null or false, unset the header - if ($value === null || $value === false) { - unset($this->headers[$normalizedName]); - } else { - // Else, set the header - $this->headers[$normalizedName] = array($name, $value); - } - - return $this; - } - - /** - * Set the next request's method - * - * Validated the passed method and sets it. - * - * @param string $method - * @return EasyRdf_Http_Client - * @throws InvalidArgumentException - */ - public function setMethod($method) - { - if (!is_string($method) or !preg_match('/^[A-Z]+$/', $method)) { - throw new InvalidArgumentException("Invalid HTTP request method."); - } - - $this->method = $method; - - return $this; - } - - /** - * Get the method for the next request - * - * @return string - */ - public function getMethod() - { - return $this->method; - } - - /** - * Get the value of a specific header - * - * Note that if the header has more than one value, an array - * will be returned. - * - * @param string $key - * @return string|array|null The header value or null if it is not set - */ - public function getHeader($key) - { - $key = strtolower($key); - if (isset($this->headers[$key])) { - return $this->headers[$key][1]; - } else { - return null; - } - } - - /** - * Set a GET parameter for the request. - * - * @param string $name - * @param string $value - * @return EasyRdf_Http_Client - */ - public function setParameterGet($name, $value = null) - { - if ($value === null) { - if (isset($this->paramsGet[$name])) { - unset($this->paramsGet[$name]); - } - } else { - $this->paramsGet[$name] = $value; - } - - return $this; - } - - /** - * Get a GET parameter for the request. - * - * @param string $name - * @return string value - */ - public function getParameterGet($name) - { - if (isset($this->paramsGet[$name])) { - return $this->paramsGet[$name]; - } else { - return null; - } - } - - /** - * Get all the GET parameters - * - * @return array - */ - public function getParametersGet() - { - return $this->paramsGet; - } - - /** - * Get the number of redirections done on the last request - * - * @return int - */ - public function getRedirectionsCount() - { - return $this->redirectCounter; - } - - /** - * Set the raw (already encoded) POST data. - * - * This function is here for two reasons: - * 1. For advanced user who would like to set their own data, already encoded - * 2. For backwards compatibilty: If someone uses the old post($data) method. - * this method will be used to set the encoded data. - * - * $data can also be stream (such as file) from which the data will be read. - * - * @param string|resource $data - * @return Zend_Http_Client - */ - public function setRawData($data) - { - $this->rawPostData = $data; - return $this; - } - - /** - * Get the raw (already encoded) POST data. - * - * @return string - */ - public function getRawData() - { - return $this->rawPostData; - } - - /** - * Clear all GET and POST parameters - * - * Should be used to reset the request parameters if the client is - * used for several concurrent requests. - * - * clearAll parameter controls if we clean just parameters or also - * headers - * - * @param bool $clearAll Should all data be cleared? - * @return EasyRdf_Http_Client - */ - public function resetParameters($clearAll = false) - { - // Reset parameter data - $this->paramsGet = array(); - $this->rawPostData = null; - $this->method = 'GET'; - - if ($clearAll) { - $this->headers = array(); - } else { - // Clear outdated headers - if (isset($this->headers['content-type'])) { - unset($this->headers['content-type']); - } - if (isset($this->headers['content-length'])) { - unset($this->headers['content-length']); - } - } - - return $this; - } - - /** - * Send the HTTP request and return an HTTP response object - * - * @return EasyRdf_Http_Response - * @throws EasyRdf_Exception - */ - public function request($method = null) - { - if (!$this->uri) { - throw new EasyRdf_Exception( - "Set URI before calling EasyRdf_Http_Client->request()" - ); - } - - if ($method) { - $this->setMethod($method); - } - $this->redirectCounter = 0; - $response = null; - - // Send the first request. If redirected, continue. - do { - // Clone the URI and add the additional GET parameters to it - $uri = parse_url($this->uri); - if ($uri['scheme'] === 'http') { - $host = $uri['host']; - } elseif ($uri['scheme'] === 'https') { - $host = 'ssl://'.$uri['host']; - } else { - throw new EasyRdf_Exception( - "Unsupported URI scheme: ".$uri['scheme'] - ); - } - - if (isset($uri['port'])) { - $port = $uri['port']; - } else { - if ($uri['scheme'] === 'https') { - $port = 443; - } else { - $port = 80; - } - } - - if (!empty($this->paramsGet)) { - if (!empty($uri['query'])) { - $uri['query'] .= '&'; - } else { - $uri['query'] = ''; - } - $uri['query'] .= http_build_query($this->paramsGet, null, '&'); - } - - $headers = $this->prepareHeaders($uri['host'], $port); - - // Open socket to remote server - $socket = @fsockopen($host, $port, $errno, $errstr, $this->config['timeout']); - if (!$socket) { - throw new EasyRdf_Exception("Unable to connect to $host:$port ($errstr)"); - } - - // Write the request - $path = $uri['path']; - if (empty($path)) { - $path = '/'; - } - if (isset($uri['query'])) { - $path .= '?' . $uri['query']; - } - fwrite($socket, "{$this->method} {$path} HTTP/1.1\r\n"); - foreach ($headers as $k => $v) { - if (is_string($k)) { - $v = ucfirst($k) . ": $v"; - } - fwrite($socket, "$v\r\n"); - } - fwrite($socket, "\r\n"); - - // Send the request body, if there is one set - if (isset($this->rawPostData)) { - fwrite($socket, $this->rawPostData); - } - - // Read in the response - $content = ''; - while (!feof($socket)) { - $content .= fgets($socket); - } - - // FIXME: support HTTP/1.1 100 Continue - - // Close the socket - @fclose($socket); - - // Parse the response string - $response = EasyRdf_Http_Response::fromString($content); - - // If we got redirected, look for the Location header - if ($response->isRedirect() && - ($location = $response->getHeader('location')) - ) { - - // Avoid problems with buggy servers that add whitespace at the - // end of some headers (See ZF-11283) - $location = trim($location); - - // Some servers return relative URLs in the location header - // resolve it in relation to previous request - $baseUri = new EasyRdf_ParsedUri($this->uri); - $location = $baseUri->resolve($location)->toString(); - - // If it is a 303 then drop the parameters and send a GET request - if ($response->getStatus() == 303) { - $this->resetParameters(); - $this->setMethod('GET'); - } - - // If we got a well formed absolute URI - if (parse_url($location)) { - $this->setHeaders('host', null); - $this->setUri($location); - } else { - throw new EasyRdf_Exception( - "Failed to parse Location header returned by ". - $this->uri - ); - } - ++$this->redirectCounter; - - } else { - // If we didn't get any location, stop redirecting - break; - } - - - } while ($this->redirectCounter < $this->config['maxredirects']); - - return $response; - } - - /** - * Prepare the request headers - * - * @ignore - * @return array - */ - protected function prepareHeaders($host, $port) - { - $headers = array(); - - // Set the host header - if (! isset($this->headers['host'])) { - // If the port is not default, add it - if ($port !== 80 and $port !== 443) { - $host .= ':' . $port; - } - $headers[] = "Host: {$host}"; - } - - // Set the connection header - if (! isset($this->headers['connection'])) { - $headers[] = "Connection: close"; - } - - // Set the user agent header - if (! isset($this->headers['user-agent'])) { - $headers[] = "User-Agent: {$this->config['useragent']}"; - } - - // If we have rawPostData set, set the content-length header - if (isset($this->rawPostData)) { - $headers[] = "Content-Length: ".strlen($this->rawPostData); - } - - // Add all other user defined headers - foreach ($this->headers as $header) { - list($name, $value) = $header; - if (is_array($value)) { - $value = implode(', ', $value); - } - - $headers[] = "$name: $value"; - } - - return $headers; - } -} diff --git a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Http/Exception.php b/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Http/Exception.php deleted file mode 100644 index 4e4c073..0000000 --- a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Http/Exception.php +++ /dev/null @@ -1,18 +0,0 @@ -body = $body; - } - - public function getBody() - { - return $this->body; - } -} diff --git a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Http/Response.php b/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Http/Response.php deleted file mode 100644 index 21f986a..0000000 --- a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Http/Response.php +++ /dev/null @@ -1,360 +0,0 @@ -status = intval($status); - $this->body = $body; - $this->version = $version; - $this->message = $message; - - foreach ($headers as $k => $v) { - $k = ucwords(strtolower($k)); - $this->headers[$k] = $v; - } - } - - /** - * Check whether the response in successful - * - * @return boolean - */ - public function isSuccessful() - { - return ($this->status >= 200 && $this->status < 300); - } - - /** - * Check whether the response is an error - * - * @return boolean - */ - public function isError() - { - return ($this->status >= 400 && $this->status < 600); - } - - /** - * Check whether the response is a redirection - * - * @return boolean - */ - public function isRedirect() - { - return ($this->status >= 300 && $this->status < 400); - } - - /** - * Get the HTTP response status code - * - * @return int - */ - public function getStatus() - { - return $this->status; - } - - /** - * Return a message describing the HTTP response code - * (Eg. "OK", "Not Found", "Moved Permanently") - * - * @return string - */ - public function getMessage() - { - return $this->message; - } - - /** - * Get the response body as string - * - * @return string - */ - public function getBody() - { - // Decode the body if it was transfer-encoded - switch (strtolower($this->getHeader('transfer-encoding'))) { - // Handle chunked body - case 'chunked': - return self::decodeChunkedBody($this->body); - break; - - // No transfer encoding, or unknown encoding extension: - // return body as is - default: - return $this->body; - break; - } - } - - /** - * Get the raw response body (as transfered "on wire") as string - * - * If the body is encoded (with Transfer-Encoding, not content-encoding - - * IE "chunked" body), gzip compressed, etc. it will not be decoded. - * - * @return string - */ - public function getRawBody() - { - return $this->body; - } - - /** - * Get the HTTP version of the response - * - * @return string - */ - public function getVersion() - { - return $this->version; - } - - /** - * Get the response headers - * - * @return array - */ - public function getHeaders() - { - return $this->headers; - } - - /** - * Get a specific header as string, or null if it is not set - * - * @param string$header - * @return string|array|null - */ - public function getHeader($header) - { - $header = ucwords(strtolower($header)); - if (array_key_exists($header, $this->headers)) { - return $this->headers[$header]; - } else { - return null; - } - } - - /** - * Get all headers as string - * - * @param boolean $statusLine Whether to return the first status line (ie "HTTP 200 OK") - * @param string $br Line breaks (eg. "\n", "\r\n", "
") - * @return string - */ - public function getHeadersAsString($statusLine = true, $br = "\n") - { - $str = ''; - - if ($statusLine) { - $str = "HTTP/{$this->version} {$this->status} {$this->message}{$br}"; - } - - // Iterate over the headers and stringify them - foreach ($this->headers as $name => $value) { - if (is_string($value)) { - $str .= "{$name}: {$value}{$br}"; - } elseif (is_array($value)) { - foreach ($value as $subval) { - $str .= "{$name}: {$subval}{$br}"; - } - } - } - - return $str; - } - - /** - * Create an EasyRdf_Http_Response object from a HTTP response string - * - * @param string $responseStr - * @return EasyRdf_Http_Response - */ - public static function fromString($responseStr) - { - // First, split body and headers - $matches = preg_split('|(?:\r?\n){2}|m', $responseStr, 2); - if ($matches and sizeof($matches) == 2) { - list ($headerLines, $body) = $matches; - } else { - throw new EasyRdf_Exception( - "Failed to parse HTTP response." - ); - } - - // Split headers part to lines - $headerLines = preg_split('|[\r\n]+|m', $headerLines); - $status = array_shift($headerLines); - if (preg_match("|^HTTP/([\d\.x]+) (\d+) ([^\r\n]+)|", $status, $m)) { - $version = $m[1]; - $status = $m[2]; - $message = $m[3]; - } else { - throw new EasyRdf_Exception( - "Failed to parse HTTP response status line." - ); - } - - // Process the rest of the header lines - $headers = array(); - foreach ($headerLines as $line) { - if (preg_match("|^([\w-]+):\s+(.+)$|", $line, $m)) { - $hName = ucwords(strtolower($m[1])); - $hValue = $m[2]; - - if (isset($headers[$hName])) { - if (! is_array($headers[$hName])) { - $headers[$hName] = array($headers[$hName]); - } - $headers[$hName][] = $hValue; - } else { - $headers[$hName] = $hValue; - } - } - } - - return new EasyRdf_Http_Response($status, $headers, $body, $version, $message); - } - - - /** - * Decode a "chunked" transfer-encoded body and return the decoded text - * - * @param string $body - * @return string - */ - public static function decodeChunkedBody($body) - { - $decBody = ''; - - while (trim($body)) { - if (preg_match('/^([\da-fA-F]+)[^\r\n]*\r\n/sm', $body, $m)) { - $length = hexdec(trim($m[1])); - $cut = strlen($m[0]); - $decBody .= substr($body, $cut, $length); - $body = substr($body, $cut + $length + 2); - } else { - throw new EasyRdf_Exception( - "Failed to decode chunked body in HTTP response." - ); - } - } - - return $decBody; - } - - - /** - * Get the entire response as string - * - * @param string $br Line breaks (eg. "\n", "\r\n", "
") - * @return string - */ - public function asString($br = "\n") - { - return $this->getHeadersAsString(true, $br) . $br . $this->getRawBody(); - } - - /** - * Implements magic __toString() - * - * @return string - */ - public function __toString() - { - return $this->asString(); - } -} diff --git a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Isomorphic.php b/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Isomorphic.php deleted file mode 100644 index 5b46125..0000000 --- a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Isomorphic.php +++ /dev/null @@ -1,436 +0,0 @@ - 0 or count($bnodesB > 0)) { - // There are blank nodes - build a bi-jection - return self::buildBijectionTo($statementsA, $bnodesA, $statementsB, $bnodesB); - } else { - // No bnodes and the grounded statements match - return array(); - } - } - - /** - * Count the number of subjects in a graph - * @ignore - */ - private static function countSubjects($graph) - { - return count($graph->toRdfPhp()); - } - - /** - * Check if all the statements in $graphA also appear in $graphB - * @ignore - */ - private static function groundedStatementsMatch($graphA, $graphB, &$bnodes, &$anonStatements) - { - $groundedStatementsMatch = true; - - foreach ($graphA->toRdfPhp() as $subject => $properties) { - if (substr($subject, 0, 2) == '_:') { - array_push($bnodes, $subject); - $subjectIsBnode = true; - } else { - $subjectIsBnode = false; - } - - foreach ($properties as $property => $values) { - foreach ($values as $value) { - if ($value['type'] == 'uri' and substr($value['value'], 0, 2) == '_:') { - array_push($bnodes, $value['value']); - $objectIsBnode = true; - } else { - $objectIsBnode = false; - } - - if ($groundedStatementsMatch and - $subjectIsBnode === false and - $objectIsBnode === false and - $graphB->hasProperty($subject, $property, $value) === false - ) { - $groundedStatementsMatch = false; - } - - if ($subjectIsBnode or $objectIsBnode) { - array_push( - $anonStatements, - array( - array('type' => $subjectIsBnode ? 'bnode' : 'uri', 'value' => $subject), - array('type' => 'uri', 'value' => $property), - $value - ) - ); - } - } - } - } - - return $groundedStatementsMatch; - } - - /** - * The main recursive bijection algorithm. - * - * This algorithm is very similar to the one explained by Jeremy Carroll in - * http://www.hpl.hp.com/techreports/2001/HPL-2001-293.pdf. Page 12 has the - * relevant pseudocode. - * - * @ignore - */ - private static function buildBijectionTo - ( - $statementsA, - $nodesA, - $statementsB, - $nodesB, - $groundedHashesA = array(), - $groundedHashesB = array() - ) { - - // Create a hash signature of every node, based on the signature of - // statements it exists in. - // We also save hashes of nodes that cannot be reliably known; we will use - // that information to eliminate possible recursion combinations. - // - // Any mappings given in the method parameters are considered grounded. - list($hashesA, $ungroundedHashesA) = self::hashNodes($statementsA, $nodesA, $groundedHashesA); - list($hashesB, $ungroundedHashesB) = self::hashNodes($statementsB, $nodesB, $groundedHashesB); - - // Grounded hashes are built at the same rate between the two graphs (if - // they are isomorphic). If there exists a grounded node in one that is - // not in the other, we can just return. Ungrounded nodes might still - // conflict, so we don't check them. This is a little bit messy in the - // middle of the method, and probably slows down isomorphic checks, but - // prevents almost-isomorphic cases from getting nutty. - foreach ($hashesA as $nodeA => $hashA) { - if (!in_array($hashA, $hashesB)) { - return null; - } - } - foreach ($hashesB as $nodeB => $hashB) { - if (!in_array($hashB, $hashesA)) { - return null; - } - } - - // Using the created hashes, map nodes to other_nodes - // Ungrounded hashes will also be equal, but we keep the distinction - // around for when we recurse later (we only recurse on ungrounded nodes) - $bijection = array(); - foreach ($nodesA as $nodeA) { - $foundNode = null; - foreach ($ungroundedHashesB as $nodeB => $hashB) { - if ($ungroundedHashesA[$nodeA] == $hashB) { - $foundNode = $nodeB; - } - } - - if ($foundNode) { - $bijection[$nodeA] = $foundNode; - - // Deletion is required to keep counts even; two nodes with identical - // signatures can biject to each other at random. - unset($ungroundedHashesB[$foundNode]); - } - } - - // bijection is now a mapping of nodes to other_nodes. If all are - // accounted for on both sides, we have a bijection. - // - // If not, we will speculatively mark pairs with matching ungrounded - // hashes as bijected and recurse. - $bijectionA = array_keys($bijection); - $bijectionB = array_values($bijection); - sort($bijectionA); - sort($nodesA); - sort($bijectionB); - sort($nodesB); - if ($bijectionA != $nodesA or $bijectionB != $nodesB) { - $bijection = null; - - foreach ($nodesA as $nodeA) { - - // We don't replace grounded nodes' hashes - if (isset($hashesA[$nodeA])) { - continue; - } - - foreach ($nodesB as $nodeB) { - // We don't replace grounded nodesB's hashes - if (isset($hashesB[$nodeB])) { - continue; - } - - // The ungrounded signature must match for this to potentially work - if ($ungroundedHashesA[$nodeA] != $ungroundedHashesB[$nodeB]) { - continue; - } - - $hash = sha1($nodeA); - $hashesA[$nodeA] = $hash; - $hashesB[$nodeB] = $hash; - $bijection = self::buildBijectionTo( - $statementsA, - $nodesA, - $statementsB, - $nodesA, - $hashesA, - $hashesB - ); - } - } - } - - return $bijection; - } - - /** - * Given a set of statements, create a mapping of node => SHA1 for a given - * set of blank nodes. grounded_hashes is a mapping of node => SHA1 pairs - * that we will take as a given, and use those to make more specific - * signatures of other nodes. - * - * Returns a tuple of associative arrats: one of grounded hashes, and one of all - * hashes. grounded hashes are based on non-blank nodes and grounded blank - * nodes, and can be used to determine if a node's signature matches - * another. - * - * @ignore - */ - private static function hashNodes($statements, $nodes, $groundedHahes) - { - $hashes = $groundedHahes; - $ungroundedHashes = array(); - $hashNeeded = true; - - // We may have to go over the list multiple times. If a node is marked as - // grounded, other nodes can then use it to decide their own state of - // grounded. - while ($hashNeeded) { - $startingGroundedNodes = count($hashes); - foreach ($nodes as $node) { - if (!isset($hashes[$node])) { - $hash = self::nodeHashFor($node, $statements, $hashes); - if (self::nodeIsGrounded($node, $statements, $hashes)) { - $hashes[$node] = $hash; - } - } - $ungroundedHashes[$node] = $hash; - } - - // after going over the list, any nodes with a unique hash can be marked - // as grounded, even if we have not tied them back to a root yet. - $uniques = array(); - foreach ($ungroundedHashes as $node => $hash) { - $uniques[$hash] = isset($uniques[$hash]) ? false : $node; - } - foreach ($uniques as $hash => $node) { - if ($node) { - $hashes[$node] = $hash; - } - } - $hashNeeded = ($startingGroundedNodes != count($hashes)); - } - - return array($hashes, $ungroundedHashes); - } - - /** - * Generate a hash for a node based on the signature of the statements it - * appears in. Signatures consist of grounded elements in statements - * associated with a node, that is, anything but an ungrounded anonymous - * node. Creating the hash is simply hashing a sorted list of each - * statement's signature, which is itself a concatenation of the string form - * of all grounded elements. - * - * Nodes other than the given node are considered grounded if they are a - * member in the given hash. - * - * Returns a tuple consisting of grounded being true or false and the string - * for the hash - * - * @ignore - */ - private static function nodeHashFor($node, $statements, $hashes) - { - $statement_signatures = array(); - foreach ($statements as $statement) { - foreach ($statement as $n) { - if ($n['type'] != 'literal' and $n['value'] == $node) { - array_push( - $statement_signatures, - self::hashStringFor($statement, $hashes, $node) - ); - } - } - } - - // Note that we sort the signatures--without a canonical ordering, - // we might get different hashes for equivalent nodes - sort($statement_signatures); - - // Convert statements into one long string and hash it - return sha1(implode('', $statement_signatures)); - } - - /** - * Returns true if a given node is grounded - * A node is groundd if it is not a blank node or it is included - * in the given mapping of grounded nodes. - * - * @ignore - */ - private static function nodeIsGrounded($node, $statements, $hashes) - { - $grounded = true; - foreach ($statements as $statement) { - if (in_array($node, $statement)) { - foreach ($statement as $resource) { - if ($node['type'] != 'bnode' or - isset($hashes[$node['value']]) or - $resource == $node - ) { - $grounded = false; - } - } - } - } - return $grounded; - } - - /** - * Provide a string signature for the given statement, collecting - * string signatures for grounded node elements. - * - * @ignore - */ - private static function hashStringFor($statement, $hashes, $node) - { - $str = ""; - foreach ($statement as $r) { - $str .= self::stringForNode($r, $hashes, $node); - } - return $str; - } - - /** - * Provides a string for the given node for use in a string signature - * Non-anonymous nodes will return their string form. Grounded anonymous - * nodes will return their hashed form. - * - * @ignore - */ - private static function stringForNode($node, $hashes, $target) - { - if (is_null($node)) { - return ""; - } elseif ($node['type'] == 'bnode') { - if ($node['value'] == $target) { - return "itself"; - } elseif (isset($hashes[$node['value']])) { - return $hashes[$node['value']]; - } else { - return "a blank node"; - } - } else { - $s = new EasyRdf_Serialiser_Ntriples(); - return $s->serialiseValue($node); - } - } -} diff --git a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Literal.php b/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Literal.php deleted file mode 100644 index b6e5a71..0000000 --- a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Literal.php +++ /dev/null @@ -1,332 +0,0 @@ -value = $value; - $this->lang = $lang ? $lang : null; - $this->datatype = $datatype ? $datatype : null; - - if ($this->datatype) { - if (is_object($this->datatype)) { - // Convert objects to strings - $this->datatype = strval($this->datatype); - } else { - // Expand shortened URIs (CURIEs) - $this->datatype = EasyRdf_Namespace::expand($this->datatype); - } - - // Literals can not have both a language and a datatype - $this->lang = null; - } else { - // Set the datatype based on the subclass - $class = get_class($this); - if (isset(self::$classMap[$class])) { - $this->datatype = self::$classMap[$class]; - $this->lang = null; - } - } - - if (is_float($this->value)) { - // special handling of floats, as they suffer from locale [mis]configuration - $this->value = rtrim(sprintf('%F', $this->value), '0'); - } else { - // Cast value to string - settype($this->value, 'string'); - } - } - - /** Returns the value of the literal. - * - * @return string Value of this literal. - */ - public function getValue() - { - return $this->value; - } - - /** Returns the full datatype URI of the literal. - * - * @return string Datatype URI of this literal. - */ - public function getDatatypeUri() - { - return $this->datatype; - } - - /** Returns the shortened datatype URI of the literal. - * - * @return string Datatype of this literal (e.g. xsd:integer). - */ - public function getDatatype() - { - if ($this->datatype) { - return EasyRdf_Namespace::shorten($this->datatype); - } else { - return null; - } - } - - /** Returns the language of the literal. - * - * @return string Language of this literal. - */ - public function getLang() - { - return $this->lang; - } - - /** Returns the properties of the literal as an associative array - * - * For example: - * array('type' => 'literal', 'value' => 'string value') - * - * @return array The properties of the literal - */ - public function toRdfPhp() - { - $array = array( - 'type' => 'literal', - 'value' => $this->value - ); - - if ($this->datatype) { - $array['datatype'] = $this->datatype; - } - - if ($this->lang) { - $array['lang'] = $this->lang; - } - - return $array; - } - - /** Magic method to return the value of a literal as a string - * - * @return string The value of the literal - */ - public function __toString() - { - return isset($this->value) ? $this->value : ''; - } - - /** Return pretty-print view of the literal - * - * @param string $format Either 'html' or 'text' - * @param string $color The colour of the text - * @return string - */ - public function dumpValue($format = 'html', $color = 'black') - { - return EasyRdf_Utils::dumpLiteralValue($this, $format, $color); - } -} - -/* - Register default set of datatype classes -*/ - -EasyRdf_Literal::setDatatypeMapping('xsd:boolean', 'EasyRdf_Literal_Boolean'); -EasyRdf_Literal::setDatatypeMapping('xsd:date', 'EasyRdf_Literal_Date'); -EasyRdf_Literal::setDatatypeMapping('xsd:dateTime', 'EasyRdf_Literal_DateTime'); -EasyRdf_Literal::setDatatypeMapping('xsd:decimal', 'EasyRdf_Literal_Decimal'); -EasyRdf_Literal::setDatatypeMapping('xsd:hexBinary', 'EasyRdf_Literal_HexBinary'); -EasyRdf_Literal::setDatatypeMapping('rdf:HTML', 'EasyRdf_Literal_HTML'); -EasyRdf_Literal::setDatatypeMapping('xsd:integer', 'EasyRdf_Literal_Integer'); -EasyRdf_Literal::setDatatypeMapping('rdf:XMLLiteral', 'EasyRdf_Literal_XML'); diff --git a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Literal/Boolean.php b/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Literal/Boolean.php deleted file mode 100644 index d8ca2ed..0000000 --- a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Literal/Boolean.php +++ /dev/null @@ -1,93 +0,0 @@ -value) === 'true' or $this->value === '1'; - } - - /** Return true if the value of the literal is 'true' or '1' - * - * @return bool - */ - public function isTrue() - { - return strtolower($this->value) === 'true' or $this->value === '1'; - } - - /** Return true if the value of the literal is 'false' or '0' - * - * @return bool - */ - public function isFalse() - { - return strtolower($this->value) === 'false' or $this->value === '0'; - } -} diff --git a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Literal/Date.php b/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Literal/Date.php deleted file mode 100644 index 0e05acf..0000000 --- a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Literal/Date.php +++ /dev/null @@ -1,137 +0,0 @@ -format('Y-m-d'); - } - - parent::__construct($value, null, $datatype); - } - - /** Parses a string using DateTime and creates a new literal - * - * Example: - * $date = EasyRdf_Literal_Date::parse('1 January 2011'); - * - * @see DateTime - * @param string $value The date to parse - * @return object EasyRdf_Literal_Date - */ - public static function parse($value) - { - $value = new DateTime($value); - return new EasyRdf_Literal_Date($value); - } - - /** Returns the date as a PHP DateTime object - * - * @see DateTime::format - * @return string - */ - public function getValue() - { - return new DateTime($this->value); - } - - /** Returns date formatted according to given format - * - * @see DateTime::format - * @param string $format - * @return string - */ - public function format($format) - { - return $this->getValue()->format($format); - } - - /** A full integer representation of the year, 4 digits - * - * @return integer - */ - public function year() - { - return (int)$this->format('Y'); - } - - /** Integer representation of the month - * - * @return integer - */ - public function month() - { - return (int)$this->format('m'); - } - - /** Integer representation of the day of the month - * - * @return integer - */ - public function day() - { - return (int)$this->format('d'); - } -} diff --git a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Literal/DateTime.php b/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Literal/DateTime.php deleted file mode 100644 index c1c602d..0000000 --- a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Literal/DateTime.php +++ /dev/null @@ -1,117 +0,0 @@ -format(DateTime::ATOM); - $value = preg_replace('/[\+\-]00(\:?)00$/', 'Z', $atom); - } - - EasyRdf_Literal::__construct($value, null, $datatype); - } - - /** Parses a string using DateTime and creates a new literal - * - * Example: - * $dt = EasyRdf_Literal_DateTime::parse('Mon 18 Jul 2011 18:45:43 BST'); - * - * @see DateTime - * @param string $value The date and time to parse - * @return object EasyRdf_Literal_DateTime - */ - public static function parse($value) - { - $value = new DateTime($value); - return new EasyRdf_Literal_DateTime($value); - } - - /** 24-hour format of the hour as an integer - * - * @return integer - */ - public function hour() - { - return (int)$this->format('H'); - } - - /** The minutes pasts the hour as an integer - * - * @return integer - */ - public function min() - { - return (int)$this->format('i'); - } - - /** The seconds pasts the minute as an integer - * - * @return integer - */ - public function sec() - { - return (int)$this->format('s'); - } -} diff --git a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Literal/Decimal.php b/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Literal/Decimal.php deleted file mode 100644 index 51c59c8..0000000 --- a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Literal/Decimal.php +++ /dev/null @@ -1,126 +0,0 @@ -value); - } - - /** - * @param string $value - * - * @throws UnexpectedValueException - */ - public static function validate($value) - { - if (!mb_ereg_match(self::DECIMAL_REGEX, $value)) { - throw new UnexpectedValueException("'{$value}' doesn't look like a valid decimal"); - } - } - - /** - * Converts valid xsd:decimal literal to Canonical representation - * see http://www.w3.org/TR/xmlschema-2/#decimal - * - * @param string $value Valid xsd:decimal literal - * - * @return string - */ - public static function canonicalise($value) - { - $pieces = array(); - mb_ereg(self::DECIMAL_REGEX, $value, $pieces); - - $sign = $pieces[1] === '-' ? '-' : ''; // '+' is not allowed - $integer = ltrim(($pieces[4] !== false) ? $pieces[4] : $pieces[7], '0'); - $fractional = rtrim($pieces[5], '0'); - - if (empty($integer)) { - $integer = '0'; - } - - if (empty($fractional)) { - $fractional = '0'; - } - - return "{$sign}{$integer}.{$fractional}"; - } -} diff --git a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Literal/HTML.php b/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Literal/HTML.php deleted file mode 100644 index a4915b7..0000000 --- a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Literal/HTML.php +++ /dev/null @@ -1,70 +0,0 @@ -value, $allowableTags); - } -} diff --git a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Literal/HexBinary.php b/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Literal/HexBinary.php deleted file mode 100644 index 7301a10..0000000 --- a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Literal/HexBinary.php +++ /dev/null @@ -1,89 +0,0 @@ -value); - } -} diff --git a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Literal/Integer.php b/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Literal/Integer.php deleted file mode 100644 index 47de413..0000000 --- a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Literal/Integer.php +++ /dev/null @@ -1,68 +0,0 @@ -value; - } -} diff --git a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Literal/XML.php b/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Literal/XML.php deleted file mode 100644 index 3f8dd79..0000000 --- a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Literal/XML.php +++ /dev/null @@ -1,71 +0,0 @@ -loadXML($this->value); - return $dom; - } -} diff --git a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Namespace.php b/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Namespace.php deleted file mode 100644 index 8990e82..0000000 --- a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Namespace.php +++ /dev/null @@ -1,416 +0,0 @@ - 'http://purl.org/ontology/bibo/', - 'cc' => 'http://creativecommons.org/ns#', - 'cert' => 'http://www.w3.org/ns/auth/cert#', - 'ctag' => 'http://commontag.org/ns#', - 'dc' => 'http://purl.org/dc/terms/', - 'dc11' => 'http://purl.org/dc/elements/1.1/', - 'dcat' => 'http://www.w3.org/ns/dcat#', - 'dcterms' => 'http://purl.org/dc/terms/', - 'doap' => 'http://usefulinc.com/ns/doap#', - 'exif' => 'http://www.w3.org/2003/12/exif/ns#', - 'foaf' => 'http://xmlns.com/foaf/0.1/', - 'geo' => 'http://www.w3.org/2003/01/geo/wgs84_pos#', - 'gr' => 'http://purl.org/goodrelations/v1#', - 'grddl' => 'http://www.w3.org/2003/g/data-view#', - 'ical' => 'http://www.w3.org/2002/12/cal/icaltzd#', - 'ma' => 'http://www.w3.org/ns/ma-ont#', - 'og' => 'http://ogp.me/ns#', - 'org' => 'http://www.w3.org/ns/org#', - 'owl' => 'http://www.w3.org/2002/07/owl#', - 'prov' => 'http://www.w3.org/ns/prov#', - 'qb' => 'http://purl.org/linked-data/cube#', - 'rdf' => 'http://www.w3.org/1999/02/22-rdf-syntax-ns#', - 'rdfa' => 'http://www.w3.org/ns/rdfa#', - 'rdfs' => 'http://www.w3.org/2000/01/rdf-schema#', - 'rev' => 'http://purl.org/stuff/rev#', - 'rif' => 'http://www.w3.org/2007/rif#', - 'rr' => 'http://www.w3.org/ns/r2rml#', - 'rss' => 'http://purl.org/rss/1.0/', - 'schema' => 'http://schema.org/', - 'sd' => 'http://www.w3.org/ns/sparql-service-description#', - 'sioc' => 'http://rdfs.org/sioc/ns#', - 'skos' => 'http://www.w3.org/2004/02/skos/core#', - 'skosxl' => 'http://www.w3.org/2008/05/skos-xl#', - 'synd' => 'http://purl.org/rss/1.0/modules/syndication/', - 'v' => 'http://rdf.data-vocabulary.org/#', - 'vcard' => 'http://www.w3.org/2006/vcard/ns#', - 'void' => 'http://rdfs.org/ns/void#', - 'wdr' => 'http://www.w3.org/2007/05/powder#', - 'wdrs' => 'http://www.w3.org/2007/05/powder-s#', - 'wot' => 'http://xmlns.com/wot/0.1/', - 'xhv' => 'http://www.w3.org/1999/xhtml/vocab#', - 'xml' => 'http://www.w3.org/XML/1998/namespace', - 'xsd' => 'http://www.w3.org/2001/XMLSchema#', - ); - - private static $namespaces = null; - - private static $default = null; - - /** Counter for numbering anonymous namespaces */ - private static $anonymousNamespaceCount = 0; - - /** - * Return all the namespaces registered - * - * @return array Associative array of all the namespaces. - */ - public static function namespaces() - { - if (self::$namespaces === null) { - self::resetNamespaces(); - } - - return self::$namespaces; - } - - /** - * Resets list of namespaces to the one, which is provided by EasyRDF - * useful for tests, among other things - */ - public static function resetNamespaces() - { - self::$namespaces = self::$initial_namespaces; - } - - /** - * Return a namespace given its prefix. - * - * @param string $prefix The namespace prefix (eg 'foaf') - * @return string The namespace URI (eg 'http://xmlns.com/foaf/0.1/') - */ - public static function get($prefix) - { - if (!is_string($prefix) or $prefix === null) { - throw new InvalidArgumentException( - "\$prefix should be a string and cannot be null or empty" - ); - } - - if (preg_match('/\W/', $prefix)) { - throw new InvalidArgumentException( - "\$prefix should only contain alpha-numeric characters" - ); - } - - $prefix = strtolower($prefix); - $namespaces = self::namespaces(); - - if (array_key_exists($prefix, $namespaces)) { - return $namespaces[$prefix]; - } else { - return null; - } - } - - /** - * Register a new namespace. - * - * @param string $prefix The namespace prefix (eg 'foaf') - * @param string $long The namespace URI (eg 'http://xmlns.com/foaf/0.1/') - */ - public static function set($prefix, $long) - { - if (!is_string($prefix) or $prefix === null) { - throw new InvalidArgumentException( - "\$prefix should be a string and cannot be null or empty" - ); - } - - if ($prefix !== '') { - // prefix ::= Name minus ":" // see: http://www.w3.org/TR/REC-xml-names/#NT-NCName - // Name ::= NameStartChar (NameChar)* // see: http://www.w3.org/TR/REC-xml/#NT-Name - // NameStartChar ::= ":" | [A-Z] | "_" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | - // [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | - // [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF] - // NameChar ::= NameStartChar | "-" | "." | [0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040] - - $_name_start_char = - 'A-Z_a-z\xc0-\xD6\xd8-\xf6\xf8-\xff\x{0100}-\x{02ff}\x{0370}-\x{037d}' . - '\x{037F}-\x{1FFF}\x{200C}-\x{200D}\x{2070}-\x{218F}\x{2C00}-\x{2FEF}\x{3001}-\x{D7FF}' . - '\x{F900}-\x{FDCF}\x{FDF0}-\x{FFFD}\x{10000}-\x{EFFFF}'; - - $_name_char = - $_name_start_char . - '\-.0-9\xb7\x{0300}-\x{036f}\x{203f}-\x{2040}'; - - $regex = "#^[{$_name_start_char}]{1}[{$_name_char}]{0,}$#u"; - - $match_result = preg_match($regex, $prefix); - - if ($match_result === false) { - throw new LogicException('regexp error'); - } - - if ($match_result === 0) { - throw new InvalidArgumentException( - "\$prefix should match RDFXML-QName specification. got: {$prefix}" - ); - } - } - - if (!is_string($long) or $long === null or $long === '') { - throw new InvalidArgumentException( - "\$long should be a string and cannot be null or empty" - ); - } - - $prefix = strtolower($prefix); - - $namespaces = self::namespaces(); - $namespaces[$prefix] = $long; - - self::$namespaces = $namespaces; - } - - /** - * Get the default namespace - * - * Returns the URI of the default namespace or null - * if no default namespace is defined. - * - * @return string The URI of the default namespace - */ - public static function getDefault() - { - return self::$default; - } - - /** - * Set the default namespace - * - * Set the default namespace to either a URI or the prefix of - * an already defined namespace. - * - * Example: - * EasyRdf_Namespace::setDefault('http://schema.org/'); - * - * @param string $namespace The URI or prefix of a namespace (eg 'og') - */ - public static function setDefault($namespace) - { - if (is_null($namespace) or $namespace === '') { - self::$default = null; - } elseif (preg_match('/^\w+$/', $namespace)) { - $namespaces = self::namespaces(); - - if (!isset($namespaces[$namespace])) { - throw new InvalidArgumentException( - "Unable to set default namespace to unknown prefix: $namespace" - ); - } - - self::$default = $namespaces[$namespace]; - } else { - self::$default = $namespace; - } - } - - /** - * Delete an existing namespace. - * - * @param string $prefix The namespace prefix (eg 'foaf') - */ - public static function delete($prefix) - { - if (!is_string($prefix) or $prefix === null or $prefix === '') { - throw new InvalidArgumentException( - "\$prefix should be a string and cannot be null or empty" - ); - } - - $prefix = strtolower($prefix); - self::namespaces(); // make sure, that self::$namespaces is initialized - if (isset(self::$namespaces[$prefix])) { - unset(self::$namespaces[$prefix]); - } - } - - /** - * Delete the anonymous namespaces and reset the counter to 0 - */ - public static function reset() - { - while (self::$anonymousNamespaceCount > 0) { - self::delete('ns'.(self::$anonymousNamespaceCount-1)); - self::$anonymousNamespaceCount--; - } - } - - /** - * Try and breakup a URI into a prefix and local part - * - * If $createNamespace is true, and the URI isn't part of an existing - * namespace, then EasyRdf will attempt to create a new namespace and - * return the name of the new prefix (for example 'ns0', 'term'). - * - * If it isn't possible to split the URI, then null will be returned. - * - * @param string $uri The full URI (eg 'http://xmlns.com/foaf/0.1/name') - * @param bool $createNamespace If true, a new namespace will be created - * @return array The split URI (eg 'foaf', 'name') or null - */ - public static function splitUri($uri, $createNamespace = false) - { - if ($uri === null or $uri === '') { - throw new InvalidArgumentException( - "\$uri cannot be null or empty" - ); - } - - if (is_object($uri) and ($uri instanceof EasyRdf_Resource)) { - $uri = $uri->getUri(); - } elseif (!is_string($uri)) { - throw new InvalidArgumentException( - "\$uri should be a string or EasyRdf_Resource" - ); - } - - foreach (self::namespaces() as $prefix => $long) { - if (substr($uri, 0, strlen($long)) !== $long) { - continue; - } - - $local_part = substr($uri, strlen($long)); - - if (strpos($local_part, '/') !== false) { - // we can't have '/' in local part - continue; - } - - return array($prefix, $local_part); - } - - if ($createNamespace) { - // Try and create a new namespace - # FIXME: check the valid characters for an XML element name - if (preg_match('/^(.+?)([\w\-]+)$/', $uri, $matches)) { - $prefix = "ns".(self::$anonymousNamespaceCount++); - self::set($prefix, $matches[1]); - return array($prefix, $matches[2]); - } - } - - return null; - } - - /** - * Return the prefix namespace that a URI belongs to. - * - * @param string $uri A full URI (eg 'http://xmlns.com/foaf/0.1/name') - * @return string The prefix namespace that it is a part of(eg 'foaf') - */ - public static function prefixOfUri($uri) - { - if ($parts = self::splitUri($uri)) { - return $parts[0]; - } - } - - /** - * Shorten a URI by substituting in the namespace prefix. - * - * If $createNamespace is true, and the URI isn't part of an existing - * namespace, then EasyRdf will attempt to create a new namespace and - * use that namespace to shorten the URI (for example ns0:term). - * - * If it isn't possible to shorten the URI, then null will be returned. - * - * @param string $uri The full URI (eg 'http://xmlns.com/foaf/0.1/name') - * @param bool $createNamespace If true, a new namespace will be created - * @return string The shortened URI (eg 'foaf:name') or null - */ - public static function shorten($uri, $createNamespace = false) - { - if ($parts = self::splitUri($uri, $createNamespace)) { - return implode(':', $parts); - } - } - - /** - * Expand a shortened URI (qname) back into a full URI. - * - * If it isn't possible to expand the qname, for example if the namespace - * isn't registered, then the original string will be returned. - * - * @param string $shortUri The short URI (eg 'foaf:name') - * @return string The full URI (eg 'http://xmlns.com/foaf/0.1/name') - */ - public static function expand($shortUri) - { - if (!is_string($shortUri) or $shortUri === '') { - throw new InvalidArgumentException( - "\$shortUri should be a string and cannot be null or empty" - ); - } - - if ($shortUri === 'a') { - $namespaces = self::namespaces(); - return $namespaces['rdf'] . 'type'; - } elseif (preg_match('/^(\w+?):([\w\-]+)$/', $shortUri, $matches)) { - $long = self::get($matches[1]); - if ($long) { - return $long . $matches[2]; - } - } elseif (preg_match('/^(\w+)$/', $shortUri) and isset(self::$default)) { - return self::$default . $shortUri; - } - - return $shortUri; - } -} diff --git a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/ParsedUri.php b/core/vendor/easyrdf/easyrdf/lib/EasyRdf/ParsedUri.php deleted file mode 100644 index 0b8dd47..0000000 --- a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/ParsedUri.php +++ /dev/null @@ -1,340 +0,0 @@ -scheme = isset($matches[2]) ? $matches[2] : ''; - } - if (!empty($matches[3])) { - $this->authority = isset($matches[4]) ? $matches[4] : ''; - } - $this->path = isset($matches[5]) ? $matches[5] : ''; - if (!empty($matches[6])) { - $this->query = isset($matches[7]) ? $matches[7] : ''; - } - if (!empty($matches[8])) { - $this->fragment = isset($matches[9]) ? $matches[9] : ''; - } - } - } elseif (is_array($uri)) { - $this->scheme = isset($uri['scheme']) ? $uri['scheme'] : null; - $this->authority = isset($uri['authority']) ? $uri['authority'] : null; - $this->path = isset($uri['path']) ? $uri['path'] : null; - $this->query = isset($uri['query']) ? $uri['query'] : null; - $this->fragment = isset($uri['fragment']) ? $uri['fragment'] : null; - } - } - - - /** Returns true if this is an absolute (complete) URI - * @return boolean - */ - public function isAbsolute() - { - return $this->scheme !== null; - } - - /** Returns true if this is an relative (partial) URI - * @return boolean - */ - public function isRelative() - { - return $this->scheme === null; - } - - /** Returns the scheme of the URI (e.g. http) - * @return string - */ - public function getScheme() - { - return $this->scheme; - } - - /** Sets the scheme of the URI (e.g. http) - * @param string $scheme The new value for the scheme of the URI - */ - public function setScheme($scheme) - { - $this->scheme = $scheme; - } - - /** Returns the authority of the URI (e.g. www.example.com:8080) - * @return string - */ - public function getAuthority() - { - return $this->authority; - } - - /** Sets the authority of the URI (e.g. www.example.com:8080) - * @param string $authority The new value for the authority component of the URI - */ - public function setAuthority($authority) - { - $this->authority = $authority; - } - - /** Returns the path of the URI (e.g. /foo/bar) - * @return string - */ - public function getPath() - { - return $this->path; - } - - /** Set the path of the URI (e.g. /foo/bar) - * @param string $path The new value for the path component of the URI - */ - public function setPath($path) - { - $this->path = $path; - } - - /** Returns the query string part of the URI (e.g. foo=bar) - * @return string - */ - public function getQuery() - { - return $this->query; - } - - /** Set the query string of the URI (e.g. foo=bar) - * @param string $query The new value for the query string component of the URI - */ - public function setQuery($query) - { - $this->query = $query; - } - - /** Returns the fragment part of the URI (i.e. after the #) - * @return string - */ - public function getFragment() - { - return $this->fragment; - } - - /** Set the fragment of the URI (i.e. after the #) - * @param string $fragment The new value for the fragment component of the URI - */ - public function setFragment($fragment) - { - $this->fragment = $fragment; - } - - - /** - * Normalises the path of this URI if it has one. Normalising a path means - * that any unnecessary '.' and '..' segments are removed. For example, the - * URI http://example.com/a/b/../c/./d would be normalised to - * http://example.com/a/c/d - * - * @return object EasyRdf_ParsedUri - */ - public function normalise() - { - if (empty($this->path)) { - return $this; - } - - // Remove ./ from the start - if (substr($this->path, 0, 2) == './') { - // Remove both characters - $this->path = substr($this->path, 2); - } - - // Remove /. from the end - if (substr($this->path, -2) == '/.') { - // Remove only the last dot, not the slash! - $this->path = substr($this->path, 0, -1); - } - - if (substr($this->path, -3) == '/..') { - $this->path .= '/'; - } - - // Split the path into its segments - $segments = explode('/', $this->path); - $newSegments = array(); - - // Remove all unnecessary '.' and '..' segments - foreach ($segments as $segment) { - if ($segment == '..') { - // Remove the previous part of the path - $count = count($newSegments); - if ($count > 0 && $newSegments[$count-1]) { - array_pop($newSegments); - } - } elseif ($segment == '.') { - // Ignore - continue; - } else { - array_push($newSegments, $segment); - } - } - - // Construct the new normalised path - $this->path = implode($newSegments, '/'); - - // Allow easy chaining of methods - return $this; - } - - /** - * Resolves a relative URI using this URI as the base URI. - */ - public function resolve($relUri) - { - // If it is a string, then convert it to a parsed object - if (is_string($relUri)) { - $relUri = new EasyRdf_ParsedUri($relUri); - } - - // This code is based on the pseudocode in section 5.2.2 of RFC3986 - $target = new EasyRdf_ParsedUri(); - if ($relUri->scheme) { - $target->scheme = $relUri->scheme; - $target->authority = $relUri->authority; - $target->path = $relUri->path; - $target->query = $relUri->query; - } else { - if ($relUri->authority) { - $target->authority = $relUri->authority; - $target->path = $relUri->path; - $target->query = $relUri->query; - } else { - if (empty($relUri->path)) { - $target->path = $this->path; - if ($relUri->query) { - $target->query = $relUri->query; - } else { - $target->query = $this->query; - } - } else { - if (substr($relUri->path, 0, 1) == '/') { - $target->path = $relUri->path; - } else { - $path = $this->path; - $lastSlash = strrpos($path, '/'); - if ($lastSlash !== false) { - $path = substr($path, 0, $lastSlash + 1); - } else { - $path = '/'; - } - - $target->path .= $path . $relUri->path; - } - $target->query = $relUri->query; - } - $target->authority = $this->authority; - } - $target->scheme = $this->scheme; - } - - $target->fragment = $relUri->fragment; - - $target->normalise(); - - return $target; - } - - /** Convert the parsed URI back into a string - * - * @return string The URI as a string - */ - public function toString() - { - $str = ''; - if ($this->scheme !== null) { - $str .= $this->scheme . ':'; - } - if ($this->authority !== null) { - $str .= '//' . $this->authority; - } - $str .= $this->path; - if ($this->query !== null) { - $str .= '?' . $this->query; - } - if ($this->fragment !== null) { - $str .= '#' . $this->fragment; - } - return $str; - } - - /** Magic method to convert the URI, when casted, back to a string - * - * @return string The URI as a string - */ - public function __toString() - { - return $this->toString(); - } -} diff --git a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser.php b/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser.php deleted file mode 100644 index 196388d..0000000 --- a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser.php +++ /dev/null @@ -1,152 +0,0 @@ -bnodeMap[$name])) { - $this->bnodeMap[$name] = $this->graph->newBNodeId(); - } - return $this->bnodeMap[$name]; - } - - /** - * Delete the bnode mapping - to be called at the start of a new parse - * @ignore - */ - protected function resetBnodeMap() - { - $this->bnodeMap = array(); - } - - /** - * Check, cleanup parameters and prepare for parsing - * @ignore - */ - protected function checkParseParams($graph, $data, $format, $baseUri) - { - if ($graph == null or !is_object($graph) or - !($graph instanceof EasyRdf_Graph)) { - throw new InvalidArgumentException( - "\$graph should be an EasyRdf_Graph object and cannot be null" - ); - } else { - $this->graph = $graph; - } - - if ($format == null or $format == '') { - throw new InvalidArgumentException( - "\$format cannot be null or empty" - ); - } elseif (is_object($format) and $format instanceof EasyRdf_Format) { - $this->format = $format = $format->getName(); - } elseif (!is_string($format)) { - throw new InvalidArgumentException( - "\$format should be a string or an EasyRdf_Format object" - ); - } else { - $this->format = $format; - } - - if ($baseUri) { - if (!is_string($baseUri)) { - throw new InvalidArgumentException( - "\$baseUri should be a string" - ); - } else { - $this->baseUri = new EasyRdf_ParsedUri($baseUri); - } - } else { - $this->baseUri = null; - } - - // Prepare for parsing - $this->resetBnodeMap(); - $this->tripleCount = 0; - } - - /** - * Sub-classes must follow this protocol - * @ignore - */ - public function parse($graph, $data, $format, $baseUri) - { - throw new EasyRdf_Exception( - "This method should be overridden by sub-classes." - ); - } - - /** - * Add a triple to the current graph, and keep count of the number of triples - * @ignore - */ - protected function addTriple($resource, $property, $value) - { - $count = $this->graph->add($resource, $property, $value); - $this->tripleCount += $count; - return $count; - } -} diff --git a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/Arc.php b/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/Arc.php deleted file mode 100644 index b4e5e1e..0000000 --- a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/Arc.php +++ /dev/null @@ -1,96 +0,0 @@ - 'RDFXML', - 'turtle' => 'Turtle', - 'ntriples' => 'Turtle', - 'rdfa' => 'SemHTML', - ); - - /** - * Constructor - * - * @return object EasyRdf_Parser_Arc - */ - public function __construct() - { - require_once 'arc/ARC2.php'; - } - - /** - * Parse an RDF document into an EasyRdf_Graph - * - * @param object EasyRdf_Graph $graph the graph to load the data into - * @param string $data the RDF document data - * @param string $format the format of the input data - * @param string $baseUri the base URI of the data being parsed - * @return integer The number of triples added to the graph - */ - public function parse($graph, $data, $format, $baseUri) - { - parent::checkParseParams($graph, $data, $format, $baseUri); - - if (array_key_exists($format, self::$supportedTypes)) { - $className = self::$supportedTypes[$format]; - } else { - throw new EasyRdf_Exception( - "EasyRdf_Parser_Arc does not support: $format" - ); - } - - $parser = ARC2::getParser($className); - if ($parser) { - $parser->parse($baseUri, $data); - $rdfphp = $parser->getSimpleIndex(false); - return parent::parse($graph, $rdfphp, 'php', $baseUri); - } else { - throw new EasyRdf_Exception( - "ARC2 failed to get a $className parser." - ); - } - } -} diff --git a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/Exception.php b/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/Exception.php deleted file mode 100644 index d03b5bd..0000000 --- a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/Exception.php +++ /dev/null @@ -1,76 +0,0 @@ -parserLine = $line; - $this->parserColumn = $column; - - if (!is_null($line)) { - $message .= " on line $line"; - if (!is_null($column)) { - $message .= ", column $column"; - } - } - - parent::__construct($message); - } - - public function getParserLine() - { - return $this->parserLine; - } - - public function getParserColumn() - { - return $this->parserColumn; - } -} diff --git a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/Json.php b/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/Json.php deleted file mode 100644 index 924abdc..0000000 --- a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/Json.php +++ /dev/null @@ -1,156 +0,0 @@ -jsonLastErrorExists = function_exists('json_last_error'); - } - - /** Return the last JSON parser error as a string - * - * If json_last_error() is not available a generic message will be returned. - * - * @ignore - */ - protected function jsonLastErrorString() - { - if ($this->jsonLastErrorExists) { - switch (json_last_error()) { - case JSON_ERROR_NONE: - return null; - case JSON_ERROR_DEPTH: - return "JSON Parse error: the maximum stack depth has been exceeded"; - case JSON_ERROR_STATE_MISMATCH: - return "JSON Parse error: invalid or malformed JSON"; - case JSON_ERROR_CTRL_CHAR: - return "JSON Parse error: control character error, possibly incorrectly encoded"; - case JSON_ERROR_SYNTAX: - return "JSON Parse syntax error"; - case JSON_ERROR_UTF8: - return "JSON Parse error: malformed UTF-8 characters, possibly incorrectly encoded"; - default: - return "JSON Parse error: unknown"; - } - } else { - return "JSON Parse error"; - } - } - - /** Parse the triple-centric JSON format, as output by libraptor - * - * http://librdf.org/raptor/api/serializer-json.html - * - * @ignore - */ - protected function parseJsonTriples($data, $baseUri) - { - foreach ($data['triples'] as $triple) { - if ($triple['subject']['type'] == 'bnode') { - $subject = $this->remapBnode($triple['subject']['value']); - } else { - $subject = $triple['subject']['value']; - } - - $predicate = $triple['predicate']['value']; - - if ($triple['object']['type'] == 'bnode') { - $object = array( - 'type' => 'bnode', - 'value' => $this->remapBnode($triple['object']['value']) - ); - } else { - $object = $triple['object']; - } - - $this->addTriple($subject, $predicate, $object); - } - - return $this->tripleCount; - } - - /** - * Parse RDF/JSON into an EasyRdf_Graph - * - * @param object EasyRdf_Graph $graph the graph to load the data into - * @param string $data the RDF document data - * @param string $format the format of the input data - * @param string $baseUri the base URI of the data being parsed - * @return integer The number of triples added to the graph - */ - public function parse($graph, $data, $format, $baseUri) - { - $this->checkParseParams($graph, $data, $format, $baseUri); - - if ($format != 'json') { - throw new EasyRdf_Exception( - "EasyRdf_Parser_Json does not support: $format" - ); - } - - $decoded = @json_decode(strval($data), true); - if ($decoded === null) { - throw new EasyRdf_Parser_Exception( - $this->jsonLastErrorString() - ); - } - - if (array_key_exists('triples', $decoded)) { - return $this->parseJsonTriples($decoded, $baseUri); - } else { - return parent::parse($graph, $decoded, 'php', $baseUri); - } - } -} diff --git a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/JsonLd.php b/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/JsonLd.php deleted file mode 100644 index d0efc12..0000000 --- a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/JsonLd.php +++ /dev/null @@ -1,42 +0,0 @@ - 5 or (PHP_MAJOR_VERSION == 5 and PHP_MINOR_VERSION >= 3)) { - require dirname(__FILE__).'/JsonLdImplementation.php'; -} else { - throw new LogicException("JSON-LD support requires PHP 5.3+"); -} diff --git a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/JsonLdImplementation.php b/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/JsonLdImplementation.php deleted file mode 100644 index d2e22c4..0000000 --- a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/JsonLdImplementation.php +++ /dev/null @@ -1,120 +0,0 @@ - - * @license http://www.opensource.org/licenses/bsd-license.php - */ -class EasyRdf_Parser_JsonLd extends EasyRdf_Parser -{ - /** - * Parse a JSON-LD document into an EasyRdf_Graph - * - * Attention: Since JSON-LD supports datasets, a document may contain - * multiple graphs and not just one. This parser returns only the - * default graph. An alternative would be to merge all graphs. - * - * @param object EasyRdf_Graph $graph the graph to load the data into - * @param string $data the RDF document data - * @param string $format the format of the input data - * @param string $baseUri the base URI of the data being parsed - * @return integer The number of triples added to the graph - */ - public function parse($graph, $data, $format, $baseUri) - { - parent::checkParseParams($graph, $data, $format, $baseUri); - - if ($format != 'jsonld') { - throw new EasyRdf_Exception( - "EasyRdf_Parser_JsonLd does not support $format" - ); - } - - try { - $quads = \ML\JsonLD\JsonLD::toRdf($data, array('base' => $baseUri)); - } catch (\ML\JsonLD\Exception\JsonLdException $e) { - throw new EasyRdf_Parser_Exception($e->getMessage()); - } - - foreach ($quads as $quad) { - // Ignore named graphs - if (null !== $quad->getGraph()) { - continue; - } - - $subject = (string) $quad->getSubject(); - if ('_:' === substr($subject, 0, 2)) { - $subject = $this->remapBnode($subject); - } - - $predicate = (string) $quad->getProperty(); - - if ($quad->getObject() instanceof \ML\IRI\IRI) { - $object = array( - 'type' => 'uri', - 'value' => (string) $quad->getObject() - ); - - if ('_:' === substr($object['value'], 0, 2)) { - $object = array( - 'type' => 'bnode', - 'value' => $this->remapBnode($object['value']) - ); - } - } else { - $object = array( - 'type' => 'literal', - 'value' => $quad->getObject()->getValue() - ); - - if ($quad->getObject() instanceof \ML\JsonLD\LanguageTaggedString) { - $object['lang'] = $quad->getObject()->getLanguage(); - } else { - $object['datatype'] = $quad->getObject()->getType(); - } - } - - $this->addTriple($subject, $predicate, $object); - } - - return $this->tripleCount; - } -} diff --git a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/Ntriples.php b/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/Ntriples.php deleted file mode 100644 index 01ebf9d..0000000 --- a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/Ntriples.php +++ /dev/null @@ -1,211 +0,0 @@ - chr(0x09), - 'b' => chr(0x08), - 'n' => chr(0x0A), - 'r' => chr(0x0D), - 'f' => chr(0x0C), - '\"' => chr(0x22), - '\'' => chr(0x27) - ); - foreach ($mappings as $in => $out) { - $str = preg_replace('/\x5c([' . $in . '])/', $out, $str); - } - - if (stripos($str, '\u') === false) { - return $str; - } - - while (preg_match('/\\\(U)([0-9A-F]{8})/', $str, $matches) || - preg_match('/\\\(u)([0-9A-F]{4})/', $str, $matches)) { - $no = hexdec($matches[2]); - if ($no < 128) { // 0x80 - $char = chr($no); - } elseif ($no < 2048) { // 0x800 - $char = chr(($no >> 6) + 192) . - chr(($no & 63) + 128); - } elseif ($no < 65536) { // 0x10000 - $char = chr(($no >> 12) + 224) . - chr((($no >> 6) & 63) + 128) . - chr(($no & 63) + 128); - } elseif ($no < 2097152) { // 0x200000 - $char = chr(($no >> 18) + 240) . - chr((($no >> 12) & 63) + 128) . - chr((($no >> 6) & 63) + 128) . - chr(($no & 63) + 128); - } else { - # FIXME: throw an exception instead? - $char = ''; - } - $str = str_replace('\\' . $matches[1] . $matches[2], $char, $str); - } - return $str; - } - - /** - * @ignore - */ - protected function parseNtriplesSubject($sub, $lineNum) - { - if (preg_match('/<([^<>]+)>/', $sub, $matches)) { - return $this->unescapeString($matches[1]); - } elseif (preg_match('/_:([A-Za-z0-9]*)/', $sub, $matches)) { - if (empty($matches[1])) { - return $this->graph->newBNodeId(); - } else { - $nodeid = $this->unescapeString($matches[1]); - return $this->remapBnode($nodeid); - } - } else { - throw new EasyRdf_Parser_Exception( - "Failed to parse subject: $sub", - $lineNum - ); - } - } - - /** - * @ignore - */ - protected function parseNtriplesObject($obj, $lineNum) - { - if (preg_match('/"(.+)"\^\^<([^<>]+)>/', $obj, $matches)) { - return array( - 'type' => 'literal', - 'value' => $this->unescapeString($matches[1]), - 'datatype' => $this->unescapeString($matches[2]) - ); - } elseif (preg_match('/"(.+)"@([\w\-]+)/', $obj, $matches)) { - return array( - 'type' => 'literal', - 'value' => $this->unescapeString($matches[1]), - 'lang' => $this->unescapeString($matches[2]) - ); - } elseif (preg_match('/"(.*)"/', $obj, $matches)) { - return array('type' => 'literal', 'value' => $this->unescapeString($matches[1])); - } elseif (preg_match('/<([^<>]+)>/', $obj, $matches)) { - return array('type' => 'uri', 'value' => $matches[1]); - } elseif (preg_match('/_:([A-Za-z0-9]*)/', $obj, $matches)) { - if (empty($matches[1])) { - return array( - 'type' => 'bnode', - 'value' => $this->graph->newBNodeId() - ); - } else { - $nodeid = $this->unescapeString($matches[1]); - return array( - 'type' => 'bnode', - 'value' => $this->remapBnode($nodeid) - ); - } - } else { - throw new EasyRdf_Parser_Exception( - "Failed to parse object: $obj", - $lineNum - ); - } - } - - /** - * Parse an N-Triples document into an EasyRdf_Graph - * - * @param object EasyRdf_Graph $graph the graph to load the data into - * @param string $data the RDF document data - * @param string $format the format of the input data - * @param string $baseUri the base URI of the data being parsed - * @return integer The number of triples added to the graph - */ - public function parse($graph, $data, $format, $baseUri) - { - parent::checkParseParams($graph, $data, $format, $baseUri); - - if ($format != 'ntriples') { - throw new EasyRdf_Exception( - "EasyRdf_Parser_Ntriples does not support: $format" - ); - } - - $lines = preg_split('/\x0D?\x0A/', strval($data)); - foreach ($lines as $index => $line) { - $lineNum = $index + 1; - if (preg_match('/^\s*#/', $line)) { - # Comment - continue; - } elseif (preg_match('/^\s*(.+?)\s+<([^<>]+?)>\s+(.+?)\s*\.\s*$/', $line, $matches)) { - $this->addTriple( - $this->parseNtriplesSubject($matches[1], $lineNum), - $this->unescapeString($matches[2]), - $this->parseNtriplesObject($matches[3], $lineNum) - ); - } elseif (preg_match('/^\s*$/', $line)) { - # Blank line - continue; - } else { - throw new EasyRdf_Parser_Exception( - "Failed to parse statement", - $lineNum - ); - } - } - - return $this->tripleCount; - } -} diff --git a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/Rapper.php b/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/Rapper.php deleted file mode 100644 index ed12198..0000000 --- a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/Rapper.php +++ /dev/null @@ -1,102 +0,0 @@ -/dev/null", $output, $status); - if ($status != 0) { - throw new EasyRdf_Exception( - "Failed to execute the command '$rapperCmd': $result" - ); - } elseif (version_compare($result, self::MINIMUM_RAPPER_VERSION) < 0) { - throw new EasyRdf_Exception( - "Version ".self::MINIMUM_RAPPER_VERSION." or higher of rapper is required." - ); - } else { - $this->rapperCmd = $rapperCmd; - } - } - - /** - * Parse an RDF document into an EasyRdf_Graph - * - * @param object EasyRdf_Graph $graph the graph to load the data into - * @param string $data the RDF document data - * @param string $format the format of the input data - * @param string $baseUri the base URI of the data being parsed - * @return integer The number of triples added to the graph - */ - public function parse($graph, $data, $format, $baseUri) - { - parent::checkParseParams($graph, $data, $format, $baseUri); - - $json = EasyRdf_Utils::execCommandPipe( - $this->rapperCmd, - array( - '--quiet', - '--input', $format, - '--output', 'json', - '--ignore-errors', - '--input-uri', $baseUri, - '--output-uri', '-', '-' - ), - $data - ); - - // Parse in the JSON - return parent::parse($graph, $json, 'json', $baseUri); - } -} diff --git a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/RdfPhp.php b/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/RdfPhp.php deleted file mode 100644 index cd0ec82..0000000 --- a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/RdfPhp.php +++ /dev/null @@ -1,100 +0,0 @@ -checkParseParams($graph, $data, $format, $baseUri); - - if ($format != 'php') { - throw new EasyRdf_Exception( - "EasyRdf_Parser_RdfPhp does not support: $format" - ); - } - - foreach ($data as $subject => $properties) { - if (substr($subject, 0, 2) === '_:') { - $subject = $this->remapBnode($subject); - } elseif (preg_match('/^\w+$/', $subject)) { - # Cope with invalid RDF/JSON serialisations that - # put the node name in, without the _: prefix - # (such as net.fortytwo.sesametools.rdfjson) - $subject = $this->remapBnode($subject); - } - - foreach ($properties as $property => $objects) { - foreach ($objects as $object) { - if ($object['type'] === 'bnode') { - $object['value'] = $this->remapBnode($object['value']); - } - $this->addTriple($subject, $property, $object); - } - } - } - - return $this->tripleCount; - } -} diff --git a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/RdfXml.php b/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/RdfXml.php deleted file mode 100644 index bfbbd30..0000000 --- a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/RdfXml.php +++ /dev/null @@ -1,812 +0,0 @@ -graph = $graph; - $this->state = 0; - $this->xLang = null; - $this->xBase = new EasyRdf_ParsedUri($base); - $this->xml = 'http://www.w3.org/XML/1998/namespace'; - $this->rdf = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'; - $this->nsp = array($this->xml => 'xml', $this->rdf => 'rdf'); - $this->sStack = array(); - $this->sCount = 0; - } - - /** @ignore */ - protected function initXMLParser() - { - if (!isset($this->xmlParser)) { - $parser = xml_parser_create_ns('UTF-8', ''); - xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 0); - xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); - xml_set_element_handler($parser, 'startElementHandler', 'endElementHandler'); - xml_set_character_data_handler($parser, 'cdataHandler'); - xml_set_start_namespace_decl_handler($parser, 'newNamespaceHandler'); - xml_set_object($parser, $this); - $this->xmlParser = $parser; - } - } - - /** @ignore */ - protected function pushS(&$s) - { - $s['pos'] = $this->sCount; - $this->sStack[$this->sCount] = $s; - $this->sCount++; - } - - /** @ignore */ - protected function popS() - { - $r = array(); - $this->sCount--; - for ($i = 0, $iMax = $this->sCount; $i < $iMax; $i++) { - $r[$i] = $this->sStack[$i]; - } - $this->sStack = $r; - } - - /** @ignore */ - protected function updateS($s) - { - $this->sStack[$s['pos']] = $s; - } - - /** @ignore */ - protected function getParentS() - { - if ($this->sCount && isset($this->sStack[$this->sCount - 1])) { - return $this->sStack[$this->sCount - 1]; - } else { - return false; - } - } - - /** @ignore */ - protected function getParentXBase() - { - if ($p = $this->getParentS()) { - if (isset($p['p_x_base']) && $p['p_x_base']) { - return $p['p_x_base']; - } elseif (isset($p['x_base'])) { - return $p['x_base']; - } else { - return ''; - } - } else { - return $this->xBase; - } - } - - /** @ignore */ - protected function getParentXLang() - { - if ($p = $this->getParentS()) { - if (isset($p['p_x_lang']) && $p['p_x_lang']) { - return $p['p_x_lang']; - } elseif (isset($p['x_lang'])) { - return $p['x_lang']; - } else { - return null; - } - } else { - return $this->xLang; - } - } - - /** @ignore */ - protected function splitURI($v) - { - /* auto-splitting on / or # */ - if (preg_match('/^(.*[\/\#])([^\/\#]+)$/', $v, $m)) { - return array($m[1], $m[2]); - } - /* auto-splitting on last special char, e.g. urn:foo:bar */ - if (preg_match('/^(.*[\:\/])([^\:\/]+)$/', $v, $m)) { - return array($m[1], $m[2]); - } - return array($v, ''); - } - - /** @ignore */ - protected function add($s, $p, $o, $sType, $oType, $oDatatype = null, $oLang = null) - { - $this->addTriple( - $s, - $p, - array( - 'type' => $oType, - 'value' => $o, - 'lang' => $oLang, - 'datatype' => $oDatatype - ) - ); - } - - /** @ignore */ - protected function reify($t, $s, $p, $o, $sType, $oType, $oDatatype = null, $oLang = null) - { - $this->add($t, $this->rdf.'type', $this->rdf.'Statement', 'uri', 'uri'); - $this->add($t, $this->rdf.'subject', $s, 'uri', $sType); - $this->add($t, $this->rdf.'predicate', $p, 'uri', 'uri'); - $this->add($t, $this->rdf.'object', $o, 'uri', $oType, $oDatatype, $oLang); - } - - /** @ignore */ - protected function startElementHandler($p, $t, $a) - { - switch($this->state) { - case 0: - return $this->startState0($t, $a); - case 1: - return $this->startState1($t, $a); - case 2: - return $this->startState2($t, $a); - case 4: - return $this->startState4($t, $a); - case 5: - return $this->startState5($t, $a); - case 6: - return $this->startState6($t, $a); - default: - throw new EasyRdf_Parser_Exception( - 'startElementHandler() called at state ' . $this->state . ' in '.$t - ); - } - } - - /** @ignore */ - protected function endElementHandler($p, $t) - { - switch($this->state){ - case 1: - return $this->endState1($t); - case 2: - return $this->endState2($t); - case 3: - return $this->endState3($t); - case 4: - return $this->endState4($t); - case 5: - return $this->endState5($t); - case 6: - return $this->endState6($t); - default: - throw new EasyRdf_Parser_Exception( - 'endElementHandler() called at state ' . $this->state . ' in '.$t - ); - } - } - - /** @ignore */ - protected function cdataHandler($p, $d) - { - switch($this->state){ - case 4: - return $this->cdataState4($d); - case 6: - return $this->cdataState6($d); - default: - return false; - } - } - - /** @ignore */ - protected function newNamespaceHandler($p, $prf, $uri) - { - $this->nsp[$uri] = isset($this->nsp[$uri]) ? $this->nsp[$uri] : $prf; - } - - /** @ignore */ - protected function startState0($t, $a) - { - $this->state = 1; - if ($t !== $this->rdf.'RDF') { - $this->startState1($t, $a); - } else { - if (isset($a[$this->xml.'base'])) { - $this->xBase = $this->xBase->resolve($a[$this->xml.'base']); - } - } - } - - /** @ignore */ - protected function startState1($t, $a) - { - $s = array( - 'x_base' => $this->getParentXBase(), - 'x_lang' => $this->getParentXLang(), - 'li_count' => 0, - ); - - if (isset($a[$this->xml.'base'])) { - $s['x_base'] = $this->xBase->resolve($a[$this->xml.'base']); - } - - if (isset($a[$this->xml.'lang'])) { - $s['x_lang'] = $a[$this->xml.'lang']; - } - - /* ID */ - if (isset($a[$this->rdf.'ID'])) { - $s['type'] = 'uri'; - $s['value'] = $s['x_base']->resolve('#'.$a[$this->rdf.'ID']); - /* about */ - } elseif (isset($a[$this->rdf.'about'])) { - $s['type'] = 'uri'; - $s['value'] = $s['x_base']->resolve($a[$this->rdf.'about']); - /* bnode */ - } else { - $s['type'] = 'bnode'; - if (isset($a[$this->rdf.'nodeID'])) { - $s['value'] = $this->remapBnode($a[$this->rdf.'nodeID']); - } else { - $s['value'] = $this->graph->newBNodeId(); - } - } - - /* sub-node */ - if ($this->state === 4) { - $supS = $this->getParentS(); - /* new collection */ - if (isset($supS['o_is_coll']) && $supS['o_is_coll']) { - $coll = array( - 'type' => 'bnode', - 'value' => $this->graph->newBNodeId(), - 'is_coll' => true, - 'x_base' => $s['x_base'], - 'x_lang' => $s['x_lang'] - ); - $this->add($supS['value'], $supS['p'], $coll['value'], $supS['type'], $coll['type']); - $this->add($coll['value'], $this->rdf.'first', $s['value'], $coll['type'], $s['type']); - $this->pushS($coll); - - } elseif (isset($supS['is_coll']) && $supS['is_coll']) { - /* new entry in existing coll */ - $coll = array( - 'type' => 'bnode', - 'value' => $this->graph->newBNodeId(), - 'is_coll' => true, - 'x_base' => $s['x_base'], - 'x_lang' => $s['x_lang'] - ); - $this->add($supS['value'], $this->rdf.'rest', $coll['value'], $supS['type'], $coll['type']); - $this->add($coll['value'], $this->rdf.'first', $s['value'], $coll['type'], $s['type']); - $this->pushS($coll); - /* normal sub-node */ - } elseif (isset($supS['p']) && $supS['p']) { - $this->add($supS['value'], $supS['p'], $s['value'], $supS['type'], $s['type']); - } - } - /* typed node */ - if ($t !== $this->rdf.'Description') { - $this->add($s['value'], $this->rdf.'type', $t, $s['type'], 'uri'); - } - /* (additional) typing attr */ - if (isset($a[$this->rdf.'type'])) { - $this->add($s['value'], $this->rdf.'type', $a[$this->rdf.'type'], $s['type'], 'uri'); - } - - /* Seq|Bag|Alt */ - // if (in_array($t, array($this->rdf.'Seq', $this->rdf.'Bag', $this->rdf.'Alt'))) { - // # FIXME: what is this? - // $s['is_con'] = true; - // } - - /* any other attrs (skip rdf and xml, except rdf:_, rdf:value, rdf:Seq) */ - foreach ($a as $k => $v) { - if (((strpos($k, $this->xml) === false) && (strpos($k, $this->rdf) === false)) || - preg_match('/(\_[0-9]+|value|Seq|Bag|Alt|Statement|Property|List)$/', $k)) { - if (strpos($k, ':')) { - $this->add($s['value'], $k, $v, $s['type'], 'literal', null, $s['x_lang']); - } - } - } - $this->pushS($s); - $this->state = 2; - } - - /** @ignore */ - protected function startState2($t, $a) - { - $s = $this->getParentS(); - foreach (array('p_x_base', 'p_x_lang', 'p_id', 'o_is_coll') as $k) { - unset($s[$k]); - } - /* base */ - if (isset($a[$this->xml.'base'])) { - $s['p_x_base'] = $s['x_base']->resolve($a[$this->xml.'base']); - } - $b = isset($s['p_x_base']) && $s['p_x_base'] ? $s['p_x_base'] : $s['x_base']; - /* lang */ - if (isset($a[$this->xml.'lang'])) { - $s['p_x_lang'] = $a[$this->xml.'lang']; - } - $l = isset($s['p_x_lang']) && $s['p_x_lang'] ? $s['p_x_lang'] : $s['x_lang']; - /* adjust li */ - if ($t === $this->rdf.'li') { - $s['li_count']++; - $t = $this->rdf.'_'.$s['li_count']; - } - /* set p */ - $s['p'] = $t; - /* reification */ - if (isset($a[$this->rdf.'ID'])) { - $s['p_id'] = $a[$this->rdf.'ID']; - } - $o = array('value' => null, 'type' => null, 'x_base' => $b, 'x_lang' => $l); - /* resource/rdf:resource */ - if (isset($a['resource'])) { - $a[$this->rdf.'resource'] = $a['resource']; - unset($a['resource']); - } - if (isset($a[$this->rdf.'resource'])) { - $o['type'] = 'uri'; - $o['value'] = $b->resolve($a[$this->rdf.'resource']); - $this->add($s['value'], $s['p'], $o['value'], $s['type'], $o['type']); - /* type */ - if (isset($a[$this->rdf.'type'])) { - $this->add( - $o['value'], - $this->rdf.'type', - $a[$this->rdf.'type'], - 'uri', - 'uri' - ); - } - /* reification */ - if (isset($s['p_id'])) { - $this->reify( - $b->resolve('#'.$s['p_id']), - $s['value'], - $s['p'], - $o['value'], - $s['type'], - $o['type'] - ); - unset($s['p_id']); - } - $this->state = 3; - } elseif (isset($a[$this->rdf.'nodeID'])) { - /* named bnode */ - $o['value'] = $this->remapBnode($a[$this->rdf.'nodeID']); - $o['type'] = 'bnode'; - $this->add($s['value'], $s['p'], $o['value'], $s['type'], $o['type']); - $this->state = 3; - /* reification */ - if (isset($s['p_id'])) { - $this->reify( - $b->resolve('#'.$s['p_id']), - $s['value'], - $s['p'], - $o['value'], - $s['type'], - $o['type'] - ); - } - /* parseType */ - } elseif (isset($a[$this->rdf.'parseType'])) { - if ($a[$this->rdf.'parseType'] === 'Literal') { - $s['o_xml_level'] = 0; - $s['o_xml_data'] = ''; - $s['p_xml_literal_level'] = 0; - $s['ns'] = array(); - $this->state = 6; - } elseif ($a[$this->rdf.'parseType'] === 'Resource') { - $o['value'] = $this->graph->newBNodeId(); - $o['type'] = 'bnode'; - $o['hasClosingTag'] = 0; - $this->add($s['value'], $s['p'], $o['value'], $s['type'], $o['type']); - $this->pushS($o); - /* reification */ - if (isset($s['p_id'])) { - $this->reify( - $b->resolve('#'.$s['p_id']), - $s['value'], - $s['p'], - $o['value'], - $s['type'], - $o['type'] - ); - unset($s['p_id']); - } - $this->state = 2; - } elseif ($a[$this->rdf.'parseType'] === 'Collection') { - $s['o_is_coll'] = true; - $this->state = 4; - } - } else { - /* sub-node or literal */ - $s['o_cdata'] = ''; - if (isset($a[$this->rdf.'datatype'])) { - $s['o_datatype'] = $a[$this->rdf.'datatype']; - } - $this->state = 4; - } - /* any other attrs (skip rdf and xml) */ - foreach ($a as $k => $v) { - if (((strpos($k, $this->xml) === false) && - (strpos($k, $this->rdf) === false)) || - preg_match('/(\_[0-9]+|value)$/', $k)) { - if (strpos($k, ':')) { - if (!$o['value']) { - $o['value'] = $this->graph->newBNodeId(); - $o['type'] = 'bnode'; - $this->add($s['value'], $s['p'], $o['value'], $s['type'], $o['type']); - } - /* reification */ - if (isset($s['p_id'])) { - $this->reify( - $b->resolve('#'.$s['p_id']), - $s['value'], - $s['p'], - $o['value'], - $s['type'], - $o['type'] - ); - unset($s['p_id']); - } - $this->add($o['value'], $k, $v, $o['type'], 'literal'); - $this->state = 3; - } - } - } - $this->updateS($s); - } - - /** @ignore */ - protected function startState4($t, $a) - { - return $this->startState1($t, $a); - } - - /** @ignore */ - protected function startState5($t, $a) - { - $this->state = 4; - return $this->startState4($t, $a); - } - - /** @ignore */ - protected function startState6($t, $a) - { - $s = $this->getParentS(); - $data = isset($s['o_xml_data']) ? $s['o_xml_data'] : ''; - $ns = isset($s['ns']) ? $s['ns'] : array(); - $parts = $this->splitURI($t); - if (count($parts) === 1) { - $data .= '<'.$t; - } else { - $nsUri = $parts[0]; - $name = $parts[1]; - if (!isset($this->nsp[$nsUri])) { - foreach ($this->nsp as $tmp1 => $tmp2) { - if (strpos($t, $tmp1) === 0) { - $nsUri = $tmp1; - $name = substr($t, strlen($tmp1)); - break; - } - } - } - - $nsp = isset($this->nsp[$nsUri]) ? $this->nsp[$nsUri] : ''; - $data .= $nsp ? '<' . $nsp . ':' . $name : '<' . $name; - /* ns */ - if (!isset($ns[$nsp.'='.$nsUri]) || !$ns[$nsp.'='.$nsUri]) { - $data .= $nsp ? ' xmlns:'.$nsp.'="'.$nsUri.'"' : ' xmlns="'.$nsUri.'"'; - $ns[$nsp.'='.$nsUri] = true; - $s['ns'] = $ns; - } - } - foreach ($a as $k => $v) { - $parts = $this->splitURI($k); - if (count($parts) === 1) { - $data .= ' '.$k.'="'.$v.'"'; - } else { - $nsUri = $parts[0]; - $name = $parts[1]; - $nsp = isset($this->nsp[$nsUri]) ? $this->nsp[$nsUri] : ''; - $data .= $nsp ? ' '.$nsp.':'.$name.'="'.$v.'"' : ' '.$name.'="'.$v.'"' ; - } - } - $data .= '>'; - $s['o_xml_data'] = $data; - $s['o_xml_level'] = isset($s['o_xml_level']) ? $s['o_xml_level'] + 1 : 1; - if ($t == $s['p']) {/* xml container prop */ - $s['p_xml_literal_level'] = isset($s['p_xml_literal_level']) ? $s['p_xml_literal_level'] + 1 : 1; - } - $this->updateS($s); - } - - /** @ignore */ - protected function endState1($t) - { - /* end of doc */ - $this->state = 0; - } - - /** @ignore */ - protected function endState2($t) - { - /* expecting a prop, getting a close */ - if ($s = $this->getParentS()) { - $hasClosingTag = (isset($s['hasClosingTag']) && !$s['hasClosingTag']) ? 0 : 1; - $this->popS(); - $this->state = 5; - if ($s = $this->getParentS()) { - /* new s */ - if (!isset($s['p']) || !$s['p']) { - /* p close after collection|parseType=Resource|node close after p close */ - $this->state = $this->sCount ? 4 : 1; - if (!$hasClosingTag) { - $this->state = 2; - } - } elseif (!$hasClosingTag) { - $this->state = 2; - } - } - } - } - - /** @ignore */ - protected function endState3($t) - { - /* p close */ - $this->state = 2; - } - - /** @ignore */ - protected function endState4($t) - { - /* empty p | pClose after cdata | pClose after collection */ - if ($s = $this->getParentS()) { - $b = isset($s['p_x_base']) && $s['p_x_base'] ? - $s['p_x_base'] : (isset($s['x_base']) ? $s['x_base'] : ''); - if (isset($s['is_coll']) && $s['is_coll']) { - $this->add($s['value'], $this->rdf.'rest', $this->rdf.'nil', $s['type'], 'uri'); - /* back to collection start */ - while ((!isset($s['p']) || ($s['p'] != $t))) { - $subS = $s; - $this->popS(); - $s = $this->getParentS(); - } - /* reification */ - if (isset($s['p_id']) && $s['p_id']) { - $this->reify( - $b->resolve('#'.$s['p_id']), - $s['value'], - $s['p'], - $subS['value'], - $s['type'], - $subS['type'] - ); - } - unset($s['p']); - $this->updateS($s); - } else { - $dt = isset($s['o_datatype']) ? $s['o_datatype'] : null; - $l = isset($s['p_x_lang']) && $s['p_x_lang'] ? - $s['p_x_lang'] : (isset($s['x_lang']) ? $s['x_lang'] : null); - $o = array('type' => 'literal', 'value' => $s['o_cdata']); - $this->add( - $s['value'], - $s['p'], - $o['value'], - $s['type'], - $o['type'], - $dt, - $l - ); - /* reification */ - if (isset($s['p_id']) && $s['p_id']) { - $this->reify( - $b->resolve('#'.$s['p_id']), - $s['value'], - $s['p'], - $o['value'], - $s['type'], - $o['type'], - $dt, - $l - ); - } - unset($s['o_cdata']); - unset($s['o_datatype']); - unset($s['p']); - $this->updateS($s); - } - $this->state = 2; - } - } - - /** @ignore */ - protected function endState5($t) - { - /* p close */ - if ($s = $this->getParentS()) { - unset($s['p']); - $this->updateS($s); - $this->state = 2; - } - } - - /** @ignore */ - protected function endState6($t) - { - if ($s = $this->getParentS()) { - $l = isset($s['p_x_lang']) && $s['p_x_lang'] ? - $s['p_x_lang'] : - (isset($s['x_lang']) ? $s['x_lang'] : null); - $data = $s['o_xml_data']; - $level = $s['o_xml_level']; - if ($level === 0) { - /* pClose */ - $this->add( - $s['value'], - $s['p'], - trim($data, ' '), - $s['type'], - 'literal', - $this->rdf.'XMLLiteral', - $l - ); - unset($s['o_xml_data']); - $this->state = 2; - } else { - $parts = $this->splitURI($t); - if (count($parts) == 1) { - $data .= ''; - } else { - $nsUri = $parts[0]; - $name = $parts[1]; - if (!isset($this->nsp[$nsUri])) { - foreach ($this->nsp as $tmp1 => $tmp2) { - if (strpos($t, $tmp1) === 0) { - $nsUri = $tmp1; - $name = substr($t, strlen($tmp1)); - break; - } - } - } - $nsp = isset($this->nsp[$nsUri]) ? $this->nsp[$nsUri] : ''; - $data .= $nsp ? '' : ''; - } - $s['o_xml_data'] = $data; - $s['o_xml_level'] = $level - 1; - if ($t == $s['p']) { - /* xml container prop */ - $s['p_xml_literal_level']--; - } - } - $this->updateS($s); - } - } - - /** @ignore */ - protected function cdataState4($d) - { - if ($s = $this->getParentS()) { - $s['o_cdata'] = isset($s['o_cdata']) ? $s['o_cdata'] . $d : $d; - $this->updateS($s); - } - } - - /** @ignore */ - protected function cdataState6($d) - { - if ($s = $this->getParentS()) { - if (isset($s['o_xml_data']) || preg_match('/[\n\r]/', $d) || trim($d)) { - $d = htmlspecialchars($d, ENT_NOQUOTES); - $s['o_xml_data'] = isset($s['o_xml_data']) ? $s['o_xml_data'] . $d : $d; - } - $this->updateS($s); - } - } - - /** - * Parse an RDF/XML document into an EasyRdf_Graph - * - * @param object EasyRdf_Graph $graph the graph to load the data into - * @param string $data the RDF document data - * @param string $format the format of the input data - * @param string $baseUri the base URI of the data being parsed - * @return integer The number of triples added to the graph - */ - public function parse($graph, $data, $format, $baseUri) - { - parent::checkParseParams($graph, $data, $format, $baseUri); - - if ($format != 'rdfxml') { - throw new EasyRdf_Exception( - "EasyRdf_Parser_RdfXml does not support: $format" - ); - } - - $this->init($graph, $baseUri); - $this->resetBnodeMap(); - - /* xml parser */ - $this->initXMLParser(); - - /* parse */ - if (!xml_parse($this->xmlParser, $data, false)) { - $message = xml_error_string(xml_get_error_code($this->xmlParser)); - throw new EasyRdf_Parser_Exception( - 'XML error: "' . $message . '"', - xml_get_current_line_number($this->xmlParser), - xml_get_current_column_number($this->xmlParser) - ); - } - - xml_parser_free($this->xmlParser); - - return $this->tripleCount; - } -} diff --git a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/Rdfa.php b/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/Rdfa.php deleted file mode 100644 index 58eebe6..0000000 --- a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/Rdfa.php +++ /dev/null @@ -1,727 +0,0 @@ -debug) { - print "Adding triple: $resource -> $property -> ".$value['type'].':'.$value['value']."\n"; - } - $count = $this->graph->add($resource, $property, $value); - $this->tripleCount += $count; - return $count; - } - - protected function generateList($subject, $property, $list) - { - $current = $subject; - $prop = $property; - - // Output a blank node for each item in the list - foreach ($list as $item) { - $newNode = $this->graph->newBNodeId(); - $this->addTriple($current, $prop, array('type' => 'bnode', 'value' => $newNode)); - $this->addTriple($newNode, 'rdf:first', $item); - - $current = $newNode; - $prop = 'rdf:rest'; - } - - // Finally, terminate the list - $this->addTriple( - $current, - $prop, - array('type' => 'uri', 'value' => EasyRdf_Namespace::expand('rdf:nil')) - ); - } - - protected function addToList($listMapping, $property, $value) - { - if ($this->debug) { - print "Adding to list: $property -> ".$value['type'].':'.$value['value']."\n"; - } - - // Create property in the list mapping if it doesn't already exist - if (!isset($listMapping->$property)) { - $listMapping->$property = array(); - } - array_push($listMapping->$property, $value); - } - - protected function printNode($node, $depth) - { - $indent = str_repeat(' ', $depth); - print $indent; - switch($node->nodeType) { - case XML_ELEMENT_NODE: - print 'node'; - break; - case XML_ATTRIBUTE_NODE: - print 'attr'; - break; - case XML_TEXT_NODE: - print 'text'; - break; - case XML_CDATA_SECTION_NODE: - print 'cdata'; - break; - case XML_ENTITY_REF_NODE: - print 'entref'; - break; - case XML_ENTITY_NODE: - print 'entity'; - break; - case XML_PI_NODE: - print 'pi'; - break; - case XML_COMMENT_NODE: - print 'comment'; - break; - case XML_DOCUMENT_NODE: - print 'doc'; - break; - case XML_DOCUMENT_TYPE_NODE: - print 'doctype'; - break; - case XML_HTML_DOCUMENT_NODE: - print 'html'; - break; - default: - throw new EasyRdf_Exception("unknown node type: ".$node->nodeType); - break; - } - print ' '.$node->nodeName."\n"; - - if ($node->hasAttributes()) { - foreach ($node->attributes as $attr) { - print $indent.' '.$attr->nodeName." => ".$attr->nodeValue."\n"; - } - } - } - - protected function guessTimeDatatype($value) - { - if (preg_match('/^-?\d{4}-\d{2}-\d{2}(Z|[\-\+]\d{2}:\d{2})?$/', $value)) { - return 'http://www.w3.org/2001/XMLSchema#date'; - } elseif (preg_match('/^\d{2}:\d{2}:\d{2}(Z|[\-\+]\d{2}:\d{2})?$/', $value)) { - return 'http://www.w3.org/2001/XMLSchema#time'; - } elseif (preg_match('/^-?\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(Z|[\-\+]\d{2}:\d{2})?$/', $value)) { - return 'http://www.w3.org/2001/XMLSchema#dateTime'; - } elseif (preg_match('/^P(\d+Y)?(\d+M)?(\d+D)?T?(\d+H)?(\d+M)?(\d+S)?$/', $value)) { - return 'http://www.w3.org/2001/XMLSchema#duration'; - } elseif (preg_match('/^\d{4}$/', $value)) { - return 'http://www.w3.org/2001/XMLSchema#gYear'; - } elseif (preg_match('/^\d{4}-\d{2}$/', $value)) { - return 'http://www.w3.org/2001/XMLSchema#gYearMonth'; - } else { - return null; - } - } - - protected function initialContext() - { - $context = array( - 'prefixes' => array(), - 'vocab' => null, - 'subject' => $this->baseUri, - 'property' => null, - 'object' => null, - 'terms' => array(), - 'incompleteRels' => array(), - 'incompleteRevs' => array(), - 'listMapping' => null, - 'lang' => null, - 'path' => '', - 'xmlns' => array(), - ); - - // Set the default prefix - $context['prefixes'][''] = 'http://www.w3.org/1999/xhtml/vocab#'; - - // RDFa 1.1 default term mapping - $context['terms']['describedby'] = 'http://www.w3.org/2007/05/powder-s#describedby'; - $context['terms']['license'] = 'http://www.w3.org/1999/xhtml/vocab#license'; - $context['terms']['role'] = 'http://www.w3.org/1999/xhtml/vocab#role'; - - return $context; - } - - protected function expandCurie($node, &$context, $value) - { - if (preg_match('/^(\w*?):(.*)$/', $value, $matches)) { - list (, $prefix, $local) = $matches; - $prefix = strtolower($prefix); - if ($prefix === '_') { - // It is a bnode - return $this->remapBnode(substr($value, 2)); - } elseif (empty($prefix) and $context['vocab']) { - // Empty prefix - return $context['vocab'] . $local; - } elseif (isset($context['prefixes'][$prefix])) { - return $context['prefixes'][$prefix] . $local; - } elseif ($uri = $node->lookupNamespaceURI($prefix)) { - return $uri . $local; - } elseif (!empty($prefix) and $uri = EasyRdf_Namespace::get($prefix)) { - // Expand using well-known prefixes - return $uri . $local; - } - } - } - - protected function processUri($node, &$context, $value, $isProp = false) - { - if (preg_match('/^\[(.*)\]$/', $value, $matches)) { - // Safe CURIE - return $this->expandCurie($node, $context, $matches[1]); - } elseif (preg_match(self::TERM_REGEXP, $value) and $isProp) { - $term = strtolower($value); - if ($context['vocab']) { - return $context['vocab'] . $value; - } elseif (isset($context['terms'][$term])) { - return $context['terms'][$term]; - } - } elseif (substr($value, 0, 2) === '_:' and $isProp) { - return null; - } else { - $uri = $this->expandCurie($node, $context, $value); - if ($uri) { - return $uri; - } else { - $parsed = new EasyRdf_ParsedUri($value); - if ($parsed->isAbsolute()) { - return $value; - } elseif ($isProp) { - // Properties can't be relative URIs - return null; - } elseif ($this->baseUri) { - return $this->baseUri->resolve($parsed); - } - } - } - } - - protected function processUriList($node, $context, $values) - { - if (!$values) { - return array(); - } - - $uris = array(); - foreach (preg_split('/\s+/', $values) as $value) { - $uri = $this->processUri($node, $context, $value, true); - if ($uri) { - array_push($uris, $uri); - } - } - return $uris; - } - - protected function getUriAttribute($node, &$context, $attributes) - { - if (!is_array($attributes)) { - $attributes = array($attributes); - } - - // Find the first attribute that returns a valid URI - foreach ($attributes as $attribute) { - if ($node->hasAttribute($attribute)) { - $value = $node->getAttribute($attribute); - $uri = $this->processUri($node, $context, $value); - if ($uri) { - return $uri; - } - } - } - } - - protected function processNode($node, &$context, $depth = 1) - { - if ($this->debug) { - $this->printNode($node, $depth); - } - - // Step 1: establish local variables - $skip = false; - $subject = null; - $typedResource = null; - $object = null; - $rels = array(); - $revs = array(); - $lang = $context['lang']; - $incompleteRels = array(); - $incompleteRevs = array(); - - if ($node->nodeType === XML_ELEMENT_NODE) { - $context['path'] .= '/' . $node->nodeName; - - $content = $node->hasAttribute('content') ? $node->getAttribute('content') : null; - $datatype = $node->hasAttribute('datatype') ? $node->getAttribute('datatype') : null; - $property = $node->getAttribute('property') ? $node->getAttribute('property') : null; - $typeof = $node->getAttribute('typeof') ? $node->getAttribute('typeof') : null; - - // Step 2: Default vocabulary - if ($node->hasAttribute('vocab')) { - $context['vocab'] = $node->getAttribute('vocab'); - if ($context['vocab']) { - $this->addTriple( - $this->baseUri, - 'rdfa:usesVocabulary', - array('type' => 'uri', 'value' => $context['vocab']) - ); - } - } - - // Step 3: Set prefix mappings - // Support for deprecated xmlns if present in document - foreach ($context['xmlns'] as $prefix => $uri) { - if ($node->hasAttribute('xmlns:' . $prefix)) { - $context['prefixes'][$prefix] = $node->getAttribute('xmlns:' . $prefix); - if ($this->debug) { - print "Prefix (xmlns): $prefix => $uri\n"; - } - } - } - if ($node->hasAttribute('prefix')) { - $mappings = preg_split('/\s+/', $node->getAttribute('prefix')); - while (count($mappings)) { - $prefix = strtolower(array_shift($mappings)); - $uri = array_shift($mappings); - - if (substr($prefix, -1) === ':') { - $prefix = substr($prefix, 0, -1); - } else { - continue; - } - - if ($prefix === '_') { - continue; - } elseif (!empty($prefix)) { - $context['prefixes'][$prefix] = $uri; - if ($this->debug) { - print "Prefix: $prefix => $uri\n"; - } - } - } - } - - // Step 4 - if ($node->hasAttributeNS(self::XML_NS, 'lang')) { - $lang = $node->getAttributeNS(self::XML_NS, 'lang'); - } elseif ($node->hasAttribute('lang')) { - $lang = $node->getAttribute('lang'); - } - - // HTML+RDFa 1.1: ignore rel and rev unless they contain CURIEs. - foreach (array('rel', 'rev') as $attr) { - if ($node->hasAttribute('property') and $node->hasAttribute($attr)) { - // Quick check in case there are no CURIEs to deal with. - if (strpos($node->getAttribute($attr), ':') === false) { - $node->removeAttribute($attr); - } else { - // Only keep CURIEs. - $curies = array(); - foreach (preg_split('/\s+/', $node->getAttribute($attr)) as $token) { - if (strpos($token, ':')) { - $curies[] = $token; - } - } - $node->setAttribute($attr, implode(' ', $curies)); - } - } - } - - $rels = $this->processUriList($node, $context, $node->getAttribute('rel')); - $revs = $this->processUriList($node, $context, $node->getAttribute('rev')); - - if (!$node->hasAttribute('rel') and !$node->hasAttribute('rev')) { - // Step 5: Establish a new subject if no rel/rev - if ($property and is_null($content) and is_null($datatype)) { - $subject = $this->getUriAttribute($node, $context, 'about'); - if ($typeof and !$subject) { - $typedResource = $this->getUriAttribute( - $node, - $context, - array('resource', 'href', 'src') - ); - if (!$typedResource) { - $typedResource = $this->graph->newBNodeId(); - } - $object = $typedResource; - } - } else { - $subject = $this->getUriAttribute( - $node, - $context, - array('about', 'resource', 'href', 'src') - ); - } - - // Establish a subject if there isn't one - # FIXME: refactor this - if (is_null($subject)) { - if ($context['path'] === '/html/head') { - $subject = $context['object']; - } elseif ($depth <= 2) { - $subject = $this->baseUri; - } elseif ($typeof and !$property) { - $subject = $this->graph->newBNodeId(); - } else { - if (!$property) { - $skip = true; - } - $subject = $context['object']; - } - } - - } else { - // Step 6 - // If the current element does contain a @rel or @rev attribute, then the next step is to - // establish both a value for new subject and a value for current object resource: - - $subject = $this->getUriAttribute($node, $context, 'about'); - - $object = $this->getUriAttribute( - $node, - $context, - array('resource', 'href', 'src') - ); - - if ($typeof) { - if (!$object and !$subject) { - $object = $this->graph->newBNodeId(); - } - $typedResource = $subject ? $subject : $object; - } - - # FIXME: if the element is the root element of the document - # then act as if there is an empty @about present - if (!$subject) { - $subject = $context['object']; - } - - } - - # FIXME: better place for this? - if ($typeof and $subject and !$typedResource) { - $typedResource = $subject; - } - - // Step 7: Process @typeof if there is a subject - if ($typedResource) { - foreach ($this->processUriList($node, $context, $typeof) as $type) { - $this->addTriple( - $typedResource, - 'rdf:type', - array('type' => 'uri', 'value' => $type) - ); - } - } - - // Step 8: Create new List mapping if the subject has changed - if ($subject and $subject !== $context['subject']) { - $listMapping = new StdClass(); - } else { - $listMapping = $context['listMapping']; - } - - // Step 9: Generate triples with given object - if ($subject and $object) { - foreach ($rels as $prop) { - $obj = array('type' => 'uri', 'value' => $object); - if ($node->hasAttribute('inlist')) { - $this->addToList($listMapping, $prop, $obj); - } else { - $this->addTriple($subject, $prop, $obj); - } - } - - foreach ($revs as $prop) { - $this->addTriple( - $object, - $prop, - array('type' => 'uri', 'value' => $subject) - ); - } - } elseif ($rels or $revs) { - // Step 10: Incomplete triples and bnode creation - $object = $this->graph->newBNodeId(); - if ($rels) { - if ($node->hasAttribute('inlist')) { - foreach ($rels as $prop) { - # FIXME: add support for incomplete lists - if (!isset($listMapping->$prop)) { - $listMapping->$prop = array(); - } - } - } else { - $incompleteRels = $rels; - if ($this->debug) { - print "Incomplete rels: ".implode(',', $rels)."\n"; - } - } - } - - if ($revs) { - $incompleteRevs = $revs; - if ($this->debug) { - print "Incomplete revs: ".implode(',', $revs)."\n"; - } - } - } - - // Step 11: establish current property value - if ($subject and $property) { - $value = array(); - - if ($datatype) { - $datatype = $this->processUri($node, $context, $datatype, true); - } - - if ($content !== null) { - $value['value'] = $content; - } elseif ($node->hasAttribute('datetime')) { - $value['value'] = $node->getAttribute('datetime'); - $datetime = true; - } elseif ($datatype === '') { - $value['value'] = $node->textContent; - } elseif ($datatype === self::RDF_XML_LITERAL) { - $value['value'] = ''; - foreach ($node->childNodes as $child) { - $value['value'] .= $child->C14N(); - } - } elseif (is_null($datatype) and empty($rels) and empty($revs)) { - $value['value'] = $this->getUriAttribute( - $node, - $context, - array('resource', 'href', 'src') - ); - - if ($value['value']) { - $value['type'] = 'uri'; - } - } - - if (empty($value['value']) and $typedResource and !$node->hasAttribute('about')) { - $value['type'] = 'uri'; - $value['value'] = $typedResource; - } - - if (empty($value['value'])) { - $value['value'] = $node->textContent; - } - - if (empty($value['type'])) { - $value['type'] = 'literal'; - if ($datatype) { - $value['datatype'] = $datatype; - } elseif (isset($datetime) or $node->nodeName === 'time') { - $value['datatype'] = $this->guessTimeDatatype($value['value']); - } - - if (empty($value['datatype']) and $lang) { - $value['lang'] = $lang; - } - } - - // Add each of the properties - foreach ($this->processUriList($node, $context, $property) as $prop) { - if ($node->hasAttribute('inlist')) { - $this->addToList($listMapping, $prop, $value); - } elseif ($subject) { - $this->addTriple($subject, $prop, $value); - } - } - } - - // Step 12: Complete the incomplete triples from the evaluation context - if (!$skip and $subject and ($context['incompleteRels'] or $context['incompleteRevs'])) { - foreach ($context['incompleteRels'] as $prop) { - $this->addTriple( - $context['subject'], - $prop, - array('type' => 'uri', 'value' => $subject) - ); - } - - foreach ($context['incompleteRevs'] as $prop) { - $this->addTriple( - $subject, - $prop, - array('type' => 'uri', 'value' => $context['subject']) - ); - } - } - } - - // Step 13: create a new evaluation context and proceed recursively - if ($node->hasChildNodes()) { - if ($skip) { - $newContext = $context; - } else { - // Prepare a new evaluation context - $newContext = $context; - if ($object) { - $newContext['object'] = $object; - } elseif ($subject) { - $newContext['object'] = $subject; - } else { - $newContext['object'] = $context['subject']; - } - if ($subject) { - $newContext['subject'] = $subject; - } - $newContext['incompleteRels'] = $incompleteRels; - $newContext['incompleteRevs'] = $incompleteRevs; - if (isset($listMapping)) { - $newContext['listMapping'] = $listMapping; - } - } - - // The language is always updated, even if skip is set - $newContext['lang'] = $lang; - - foreach ($node->childNodes as $child) { - if ($child->nodeType === XML_ELEMENT_NODE) { - $this->processNode($child, $newContext, $depth+1); - } - } - } - - // Step 14: create triples for lists - if (!empty($listMapping)) { - foreach ($listMapping as $prop => $list) { - if ($context['listMapping'] !== $listMapping) { - if ($this->debug) { - print "Need to create triples for $prop => ".count($list)." items\n"; - } - $this->generateList($subject, $prop, $list); - } - } - } - } - - /** - * Parse RDFa 1.1 into an EasyRdf_Graph - * - * @param object EasyRdf_Graph $graph the graph to load the data into - * @param string $data the RDF document data - * @param string $format the format of the input data - * @param string $baseUri the base URI of the data being parsed - * @return integer The number of triples added to the graph - */ - public function parse($graph, $data, $format, $baseUri) - { - parent::checkParseParams($graph, $data, $format, $baseUri); - - if ($format != 'rdfa') { - throw new EasyRdf_Exception( - "EasyRdf_Parser_Rdfa does not support: $format" - ); - } - - // Initialise evaluation context. - $context = $this->initialContext(); - - libxml_use_internal_errors(true); - - // Parse the document into DOM - $doc = new DOMDocument(); - // Attempt to parse the document as strict XML, and fall back to HTML - // if XML parsing fails. - if ($doc->loadXML($data, LIBXML_NONET)) { - if ($this->debug) { - print "Document was parsed as XML."; - } - // Collect all xmlns namespaces defined throughout the document. - $sxe = simplexml_import_dom($doc); - $context['xmlns'] = $sxe->getDocNamespaces(true); - unset($context['xmlns']['']); - } else { - $doc->loadHTML($data); - if ($this->debug) { - print "Document was parsed as HTML."; - } - } - - // Establish the base for both XHTML and HTML documents. - $xpath = new DOMXPath($doc); - $xpath->registerNamespace('xh', "http://www.w3.org/1999/xhtml"); - $nodeList = $xpath->query('/xh:html/xh:head/xh:base'); - if ($node = $nodeList->item(0) and $href = $node->getAttribute('href')) { - $this->baseUri = new EasyRdf_ParsedUri($href); - } - $nodeList = $xpath->query('/html/head/base'); - if ($node = $nodeList->item(0) and $href = $node->getAttribute('href')) { - $this->baseUri = new EasyRdf_ParsedUri($href); - } - - // Remove the fragment from the base URI - $this->baseUri->setFragment(null); - - // Recursively process XML nodes - $this->processNode($doc, $context); - - return $this->tripleCount; - } -} diff --git a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/Redland.php b/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/Redland.php deleted file mode 100644 index bdeb5a2..0000000 --- a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/Redland.php +++ /dev/null @@ -1,246 +0,0 @@ -remapBnode( - librdf_node_get_blank_identifier($node) - ); - } else { - throw new EasyRdf_Exception("Unsupported type: ".$type); - } - } - - /** - * Convert a node into an associate array - * @ignore - */ - protected function nodeToRdfPhp($node) - { - $object = array(); - $object['type'] = EasyRdf_Parser_Redland::nodeTypeString($node); - if ($object['type'] == 'uri') { - $object['value'] = EasyRdf_Parser_Redland::nodeUriString($node); - } elseif ($object['type'] == 'bnode') { - $object['value'] = '_:'.librdf_node_get_blank_identifier($node); - } elseif ($object['type'] == 'literal') { - $object['value'] = librdf_node_get_literal_value($node); - $lang = librdf_node_get_literal_value_language($node); - if ($lang) { - $object['lang'] = $lang; - } - $datatype = librdf_node_get_literal_value_datatype_uri($node); - if ($datatype) { - $object['datatype'] = librdf_uri_to_string($datatype); - } - } else { - throw new EasyRdf_Exception("Unsupported type: ".$object['type']); - } - return $object; - } - - /** - * Return the number of errors during parsing - * @ignore - */ - protected function parserErrorCount($parser) - { - $errorUri = librdf_new_uri( - $this->world, - self::LIBRDF_PARSER_FEATURE_ERROR_COUNT - ); - $errorNode = librdf_parser_get_feature($parser, $errorUri); - $errorCount = librdf_node_get_literal_value($errorNode); - librdf_free_uri($errorUri); - return $errorCount; - } - - /** - * Constructor - * - * @return object EasyRdf_Parser_Redland - */ - public function __construct() - { - if (extension_loaded('redland')) { - $this->world = librdf_php_get_world(); - if (!$this->world) { - throw new EasyRdf_Exception( - "Failed to initialise librdf world." - ); - } - } else { - throw new EasyRdf_Exception( - "Redland PHP extension is not available." - ); - } - } - - /** - * Parse an RDF document into an EasyRdf_Graph - * - * @param object EasyRdf_Graph $graph the graph to load the data into - * @param string $data the RDF document data - * @param string $format the format of the input data - * @param string $baseUri the base URI of the data being parsed - * @return integer The number of triples added to the graph - */ - public function parse($graph, $data, $format, $baseUri) - { - parent::checkParseParams($graph, $data, $format, $baseUri); - - $parser = librdf_new_parser($this->world, $format, null, null); - if (!$parser) { - throw new EasyRdf_Exception( - "Failed to create librdf_parser of type: $format" - ); - } - - $rdfUri = librdf_new_uri($this->world, $baseUri); - if (!$rdfUri) { - throw new EasyRdf_Exception( - "Failed to create librdf_uri from: $baseUri" - ); - } - - $stream = librdf_parser_parse_string_as_stream($parser, $data, $rdfUri); - if (!$stream) { - throw new EasyRdf_Parser_Exception( - "Failed to parse RDF stream" - ); - } - - do { - $statement = librdf_stream_get_object($stream); - if ($statement) { - $subject = EasyRdf_Parser_Redland::nodeUriString( - librdf_statement_get_subject($statement) - ); - $predicate = EasyRdf_Parser_Redland::nodeUriString( - librdf_statement_get_predicate($statement) - ); - $object = EasyRdf_Parser_Redland::nodeToRdfPhp( - librdf_statement_get_object($statement) - ); - - $this->addTriple($subject, $predicate, $object); - } - } while (!librdf_stream_next($stream)); - - $errorCount = $this->parserErrorCount($parser); - if ($errorCount) { - throw new EasyRdf_Parser_Exception("$errorCount errors while parsing."); - } - - librdf_free_uri($rdfUri); - librdf_free_stream($stream); - librdf_free_parser($parser); - - return $this->tripleCount; - } -} diff --git a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/Turtle.php b/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/Turtle.php deleted file mode 100644 index 760cf7b..0000000 --- a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/Turtle.php +++ /dev/null @@ -1,1317 +0,0 @@ -data = $data; - $this->namespaces = array(); - $this->subject = null; - $this->predicate = null; - $this->object = null; - - $this->line = 1; - $this->column = 1; - - $this->resetBnodeMap(); - - $c = $this->skipWSC(); - while ($c != -1) { - $this->parseStatement(); - $c = $this->skipWSC(); - } - - return $this->tripleCount; - } - - - /** - * Parse a statement [2] - * @ignore - */ - protected function parseStatement() - { - $directive = ''; - while (true) { - $c = $this->read(); - if ($c == -1 || self::isWhitespace($c)) { - $this->unread($c); - break; - } else { - $directive .= $c; - } - } - - if (preg_match('/^(@|prefix$|base$)/i', $directive)) { - $this->parseDirective($directive); - $this->skipWSC(); - // SPARQL BASE and PREFIX lines do not end in . - if ($directive[0] == "@") { - $this->verifyCharacterOrFail($this->read(), "."); - } - } else { - $this->unread($directive); - $this->parseTriples(); - $this->skipWSC(); - $this->verifyCharacterOrFail($this->read(), "."); - } - } - - /** - * Parse a directive [3] - * @ignore - */ - protected function parseDirective($directive) - { - $directive = strtolower($directive); - if ($directive == "prefix" || $directive == '@prefix') { - $this->parsePrefixID(); - } elseif ($directive == "base" || $directive == '@base') { - $this->parseBase(); - } elseif (mb_strlen($directive, "UTF-8") == 0) { - throw new EasyRdf_Parser_Exception( - "Turtle Parse Error: directive name is missing, expected @prefix or @base", - $this->line, - $this->column - ); - } else { - throw new EasyRdf_Parser_Exception( - "Turtle Parse Error: unknown directive \"$directive\"", - $this->line, - $this->column - ); - } - } - - /** - * Parse a prefixID [4] - * @ignore - */ - protected function parsePrefixID() - { - $this->skipWSC(); - - // Read prefix ID (e.g. "rdf:" or ":") - $prefixID = ''; - - while (true) { - $c = $this->read(); - if ($c == ':') { - $this->unread($c); - break; - } elseif (self::isWhitespace($c)) { - break; - } elseif ($c == -1) { - throw new EasyRdf_Parser_Exception( - "Turtle Parse Error: unexpected end of file while reading prefix id", - $this->line, - $this->column - ); - } - - $prefixID .= $c; - } - - $this->skipWSC(); - $this->verifyCharacterOrFail($this->read(), ":"); - $this->skipWSC(); - - // Read the namespace URI - $namespace = $this->parseURI(); - - // Store local namespace mapping - $this->namespaces[$prefixID] = $namespace['value']; - } - - /** - * Parse base [5] - * @ignore - */ - protected function parseBase() - { - $this->skipWSC(); - - $baseUri = $this->parseURI(); - $this->baseUri = new EasyRdf_ParsedUri($baseUri['value']); - } - - /** - * Parse triples [6] - * @ignore - */ - protected function parseTriples() - { - $c = $this->peek(); - - // If the first character is an open bracket we need to decide which of - // the two parsing methods for blank nodes to use - if ($c == '[') { - $c = $this->read(); - $this->skipWSC(); - $c = $this->peek(); - if ($c == ']') { - $c = $this->read(); - $this->subject = $this->createBNode(); - $this->skipWSC(); - $this->parsePredicateObjectList(); - } else { - $this->unread('['); - $this->subject = $this->parseImplicitBlank(); - } - $this->skipWSC(); - $c = $this->peek(); - - // if this is not the end of the statement, recurse into the list of - // predicate and objects, using the subject parsed above as the subject - // of the statement. - if ($c != '.') { - $this->parsePredicateObjectList(); - } - } else { - $this->parseSubject(); - $this->skipWSC(); - $this->parsePredicateObjectList(); - } - - $this->subject = null; - $this->predicate = null; - $this->object = null; - } - - /** - * Parse a predicateObjectList [7] - * @ignore - */ - protected function parsePredicateObjectList() - { - $this->predicate = $this->parsePredicate(); - - $this->skipWSC(); - $this->parseObjectList(); - - while ($this->skipWSC() == ';') { - $this->read(); - - $c = $this->skipWSC(); - - if ($c == '.' || $c == ']') { - break; - } elseif ($c == ';') { - // empty predicateObjectList, skip to next - continue; - } - - $this->predicate = $this->parsePredicate(); - - $this->skipWSC(); - - $this->parseObjectList(); - } - } - - /** - * Parse a objectList [8] - * @ignore - */ - protected function parseObjectList() - { - $this->parseObject(); - - while ($this->skipWSC() == ',') { - $this->read(); - $this->skipWSC(); - $this->parseObject(); - } - } - - /** - * Parse a subject [10] - * @ignore - */ - protected function parseSubject() - { - $c = $this->peek(); - if ($c == '(') { - $this->subject = $this->parseCollection(); - } elseif ($c == '[') { - $this->subject = $this->parseImplicitBlank(); - } else { - $value = $this->parseValue(); - - if ($value['type'] == 'uri' or $value['type'] == 'bnode') { - $this->subject = $value; - } else { - throw new EasyRdf_Parser_Exception( - "Turtle Parse Error: illegal subject type: ".$value['type'], - $this->line, - $this->column - ); - } - } - } - - /** - * Parse a predicate [11] - * @ignore - */ - protected function parsePredicate() - { - // Check if the short-cut 'a' is used - $c1 = $this->read(); - - if ($c1 == 'a') { - $c2 = $this->read(); - - if (self::isWhitespace($c2)) { - // Short-cut is used, return the rdf:type URI - return array( - 'type' => 'uri', - 'value' => EasyRdf_Namespace::get('rdf') . 'type' - ); - } - - // Short-cut is not used, unread all characters - $this->unread($c2); - } - $this->unread($c1); - - // Predicate is a normal resource - $predicate = $this->parseValue(); - if ($predicate['type'] == 'uri') { - return $predicate; - } else { - throw new EasyRdf_Parser_Exception( - "Turtle Parse Error: Illegal predicate type: " . $predicate['type'], - $this->line, - $this->column - ); - } - } - - /** - * Parse a object [12] - * @ignore - */ - protected function parseObject() - { - $c = $this->peek(); - - if ($c == '(') { - $this->object = $this->parseCollection(); - } elseif ($c == '[') { - $this->object = $this->parseImplicitBlank(); - } else { - $this->object = $this->parseValue(); - } - - $this->addTriple( - $this->subject['value'], - $this->predicate['value'], - $this->object - ); - } - - /** - * Parses a blankNodePropertyList [15] - * - * This method parses the token [] - * and predicateObjectLists that are surrounded by square brackets. - * - * @ignore - */ - protected function parseImplicitBlank() - { - $this->verifyCharacterOrFail($this->read(), "["); - - $bnode = $this->createBNode(); - - $c = $this->read(); - if ($c != ']') { - $this->unread($c); - - // Remember current subject and predicate - $oldSubject = $this->subject; - $oldPredicate = $this->predicate; - - // generated bNode becomes subject - $this->subject = $bnode; - - // Enter recursion with nested predicate-object list - $this->skipWSC(); - - $this->parsePredicateObjectList(); - - $this->skipWSC(); - - // Read closing bracket - $this->verifyCharacterOrFail($this->read(), "]"); - - // Restore previous subject and predicate - $this->subject = $oldSubject; - $this->predicate = $oldPredicate; - } - - return $bnode; - } - - /** - * Parses a collection [16], e.g: ( item1 item2 item3 ) - * @ignore - */ - protected function parseCollection() - { - $this->verifyCharacterOrFail($this->read(), "("); - - $c = $this->skipWSC(); - if ($c == ')') { - // Empty list - $this->read(); - return array( - 'type' => 'uri', - 'value' => EasyRdf_Namespace::get('rdf') . 'nil' - ); - } else { - $listRoot = $this->createBNode(); - - // Remember current subject and predicate - $oldSubject = $this->subject; - $oldPredicate = $this->predicate; - - // generated bNode becomes subject, predicate becomes rdf:first - $this->subject = $listRoot; - $this->predicate = array( - 'type' => 'uri', - 'value' => EasyRdf_Namespace::get('rdf') . 'first' - ); - - $this->parseObject(); - $bNode = $listRoot; - - while ($this->skipWSC() != ')') { - // Create another list node and link it to the previous - $newNode = $this->createBNode(); - - $this->addTriple( - $bNode['value'], - EasyRdf_Namespace::get('rdf') . 'rest', - $newNode - ); - - // New node becomes the current - $this->subject = $bNode = $newNode; - - $this->parseObject(); - } - - // Skip ')' - $this->read(); - - // Close the list - $this->addTriple( - $bNode['value'], - EasyRdf_Namespace::get('rdf') . 'rest', - array( - 'type' => 'uri', - 'value' => EasyRdf_Namespace::get('rdf') . 'nil' - ) - ); - - // Restore previous subject and predicate - $this->subject = $oldSubject; - $this->predicate = $oldPredicate; - - return $listRoot; - } - } - - /** - * Parses an RDF value. This method parses uriref, qname, node ID, quoted - * literal, integer, double and boolean. - * @ignore - */ - protected function parseValue() - { - $c = $this->peek(); - - if ($c == '<') { - // uriref, e.g. - return $this->parseURI(); - } elseif ($c == ':' || self::isPrefixStartChar($c)) { - // qname or boolean - return $this->parseQNameOrBoolean(); - } elseif ($c == '_') { - // node ID, e.g. _:n1 - return $this->parseNodeID(); - } elseif ($c == '"' || $c == "'") { - // quoted literal, e.g. "foo" or """foo""" or 'foo' or '''foo''' - return $this->parseQuotedLiteral(); - } elseif (ctype_digit($c) || $c == '.' || $c == '+' || $c == '-') { - // integer or double, e.g. 123 or 1.2e3 - return $this->parseNumber(); - } elseif ($c == -1) { - throw new EasyRdf_Parser_Exception( - "Turtle Parse Error: unexpected end of file while reading value", - $this->line, - $this->column - ); - } else { - throw new EasyRdf_Parser_Exception( - "Turtle Parse Error: expected an RDF value here, found '$c'", - $this->line, - $this->column - ); - } - } - - /** - * Parses a quoted string, optionally followed by a language tag or datatype. - * @ignore - */ - protected function parseQuotedLiteral() - { - $label = $this->parseQuotedString(); - - // Check for presence of a language tag or datatype - $c = $this->peek(); - - if ($c == '@') { - $this->read(); - - // Read language - $lang = ''; - $c = $this->read(); - if ($c == -1) { - throw new EasyRdf_Parser_Exception( - "Turtle Parse Error: unexpected end of file while reading language", - $this->line, - $this->column - ); - } elseif (!self::isLanguageStartChar($c)) { - throw new EasyRdf_Parser_Exception( - "Turtle Parse Error: expected a letter, found '$c'", - $this->line, - $this->column - ); - } - - $lang .= $c; - - $c = $this->read(); - while (!self::isWhitespace($c)) { - if ($c == '.' || $c == ';' || $c == ',' || $c == ')' || $c == ']' || $c == -1) { - break; - } - if (self::isLanguageChar($c)) { - $lang .= $c; - } else { - throw new EasyRdf_Parser_Exception( - "Turtle Parse Error: illegal language tag char: '$c'", - $this->line, - $this->column - ); - } - $c = $this->read(); - } - - $this->unread($c); - - return array( - 'type' => 'literal', - 'value' => $label, - 'lang' => $lang - ); - } elseif ($c == '^') { - $this->read(); - - // next character should be another '^' - $this->verifyCharacterOrFail($this->read(), "^"); - - // Read datatype - $datatype = $this->parseValue(); - if ($datatype['type'] == 'uri') { - return array( - 'type' => 'literal', - 'value' => $label, - 'datatype' => $datatype['value'] - ); - } else { - throw new EasyRdf_Parser_Exception( - "Turtle Parse Error: illegal datatype type: " . $datatype['type'], - $this->line, - $this->column - ); - } - } else { - return array( - 'type' => 'literal', - 'value' => $label - ); - } - } - - /** - * Parses a quoted string, which is either a "normal string" or a """long string""". - * @ignore - */ - protected function parseQuotedString() - { - $result = null; - - $c1 = $this->read(); - - // First character should be ' or " - $this->verifyCharacterOrFail($c1, "\"\'"); - - // Check for long-string, which starts and ends with three double quotes - $c2 = $this->read(); - $c3 = $this->read(); - - if ($c2 == $c1 && $c3 == $c1) { - // Long string - $result = $this->parseLongString($c2); - } else { - // Normal string - $this->unread($c3); - $this->unread($c2); - - $result = $this->parseString($c1); - } - - // Unescape any escape sequences - return $this->unescapeString($result); - } - - /** - * Parses a "normal string". This method requires that the opening character - * has already been parsed. - * @param string $closingCharacter The type of quote to use (either ' or ") - * @ignore - */ - protected function parseString($closingCharacter) - { - $str = ''; - - while (true) { - $c = $this->read(); - - if ($c == $closingCharacter) { - break; - } elseif ($c == -1) { - throw new EasyRdf_Parser_Exception( - "Turtle Parse Error: unexpected end of file while reading string", - $this->line, - $this->column - ); - } - - $str .= $c; - - if ($c == '\\') { - // This escapes the next character, which might be a ' or a " - $c = $this->read(); - if ($c == -1) { - throw new EasyRdf_Parser_Exception( - "Turtle Parse Error: unexpected end of file while reading string", - $this->line, - $this->column - ); - } - $str .= $c; - } - } - - return $str; - } - - /** - * Parses a """long string""". This method requires that the first three - * characters have already been parsed. - * @param string $closingCharacter The type of quote to use (either ' or ") - * @ignore - */ - protected function parseLongString($closingCharacter) - { - $str = ''; - $doubleQuoteCount = 0; - - while ($doubleQuoteCount < 3) { - $c = $this->read(); - - if ($c == -1) { - throw new EasyRdf_Parser_Exception( - "Turtle Parse Error: unexpected end of file while reading long string", - $this->line, - $this->column - ); - } elseif ($c == $closingCharacter) { - $doubleQuoteCount++; - } else { - $doubleQuoteCount = 0; - } - - $str .= $c; - - if ($c == '\\') { - // This escapes the next character, which might be a ' or " - $c = $this->read(); - if ($c == -1) { - throw new EasyRdf_Parser_Exception( - "Turtle Parse Error: unexpected end of file while reading long string", - $this->line, - $this->column - ); - } - $str .= $c; - } - } - - return mb_substr($str, 0, -3, "UTF-8"); - } - - /** - * Parses a numeric value, either of type integer, decimal or double - * @ignore - */ - protected function parseNumber() - { - $value = ''; - $datatype = EasyRdf_Namespace::get('xsd').'integer'; - - $c = $this->read(); - - // read optional sign character - if ($c == '+' || $c == '-') { - $value .= $c; - $c = $this->read(); - } - - while (ctype_digit($c)) { - $value .= $c; - $c = $this->read(); - } - - if ($c == '.' || $c == 'e' || $c == 'E') { - // read optional fractional digits - if ($c == '.') { - - if (self::isWhitespace($this->peek())) { - // We're parsing an integer that did not have a space before the - // period to end the statement - } else { - $value .= $c; - $c = $this->read(); - while (ctype_digit($c)) { - $value .= $c; - $c = $this->read(); - } - - if (mb_strlen($value, "UTF-8") == 1) { - // We've only parsed a '.' - throw new EasyRdf_Parser_Exception( - "Turtle Parse Error: object for statement missing", - $this->line, - $this->column - ); - } - - // We're parsing a decimal or a double - $datatype = EasyRdf_Namespace::get('xsd').'decimal'; - } - } else { - if (mb_strlen($value, "UTF-8") == 0) { - // We've only parsed an 'e' or 'E' - throw new EasyRdf_Parser_Exception( - "Turtle Parse Error: object for statement missing", - $this->line, - $this->column - ); - } - } - - // read optional exponent - if ($c == 'e' || $c == 'E') { - $datatype = EasyRdf_Namespace::get('xsd').'double'; - $value .= $c; - - $c = $this->read(); - if ($c == '+' || $c == '-') { - $value .= $c; - $c = $this->read(); - } - - if (!ctype_digit($c)) { - throw new EasyRdf_Parser_Exception( - "Turtle Parse Error: exponent value missing", - $this->line, - $this->column - ); - } - - $value .= $c; - - $c = $this->read(); - while (ctype_digit($c)) { - $value .= $c; - $c = $this->read(); - } - } - } - - // Unread last character, it isn't part of the number - $this->unread($c); - - // Return result as a typed literal - return array( - 'type' => 'literal', - 'value' => $value, - 'datatype' => $datatype - ); - } - - /** - * Parses a URI / IRI - * @ignore - */ - protected function parseURI() - { - $uri = ''; - - // First character should be '<' - $this->verifyCharacterOrFail($this->read(), "<"); - - // Read up to the next '>' character - while (true) { - $c = $this->read(); - - if ($c == '>') { - break; - } elseif ($c == -1) { - throw new EasyRdf_Parser_Exception( - "Turtle Parse Error: unexpected end of file while reading URI", - $this->line, - $this->column - ); - } - - $uri .= $c; - - if ($c == '\\') { - // This escapes the next character, which might be a '>' - $c = $this->read(); - if ($c == -1) { - throw new EasyRdf_Parser_Exception( - "Turtle Parse Error: unexpected end of file while reading URI", - $this->line, - $this->column - ); - } - $uri .= $c; - } - } - - // Unescape any escape sequences - $uri = $this->unescapeString($uri); - - return array( - 'type' => 'uri', - 'value' => $this->resolve($uri) - ); - } - - /** - * Parses qnames and boolean values, which have equivalent starting - * characters. - * @ignore - */ - protected function parseQNameOrBoolean() - { - // First character should be a ':' or a letter - $c = $this->read(); - if ($c == -1) { - throw new EasyRdf_Parser_Exception( - "Turtle Parse Error: unexpected end of file while readying value", - $this->line, - $this->column - ); - } - if ($c != ':' && !self::isPrefixStartChar($c)) { - throw new EasyRdf_Parser_Exception( - "Turtle Parse Error: expected a ':' or a letter, found '$c'", - $this->line, - $this->column - ); - } - - $namespace = null; - - if ($c == ':') { - // qname using default namespace - if (isset($this->namespaces[''])) { - $namespace = $this->namespaces['']; - } else { - throw new EasyRdf_Parser_Exception( - "Turtle Parse Error: default namespace used but not defined", - $this->line, - $this->column - ); - } - } else { - // $c is the first letter of the prefix - $prefix = $c; - - $c = $this->read(); - while (self::isPrefixChar($c)) { - $prefix .= $c; - $c = $this->read(); - } - - if ($c != ':') { - // prefix may actually be a boolean value - $value = $prefix; - - if ($value == "true" || $value == "false") { - return array( - 'type' => 'literal', - 'value' => $value, - 'datatype' => EasyRdf_Namespace::get('xsd') . 'boolean' - ); - } - } - - $this->verifyCharacterOrFail($c, ":"); - - if (isset($this->namespaces[$prefix])) { - $namespace = $this->namespaces[$prefix]; - } else { - throw new EasyRdf_Parser_Exception( - "Turtle Parse Error: namespace prefix '$prefix' used but not defined", - $this->line, - $this->column - ); - } - } - - // $c == ':', read optional local name - $localName = ''; - $c = $this->read(); - if (self::isNameStartChar($c)) { - if ($c == '\\') { - $localName .= $this->readLocalEscapedChar(); - } else { - $localName .= $c; - } - - $c = $this->read(); - while (self::isNameChar($c)) { - if ($c == '\\') { - $localName .= $this->readLocalEscapedChar(); - } else { - $localName .= $c; - } - $c = $this->read(); - } - } - - // Unread last character - $this->unread($c); - - // Note: namespace has already been resolved - return array( - 'type' => 'uri', - 'value' => $namespace . $localName - ); - } - - protected function readLocalEscapedChar() - { - $c = $this->read(); - - if (self::isLocalEscapedChar($c)) { - return $c; - } else { - throw new EasyRdf_Parser_Exception( - "found '" . $c . "', expected one of: " . implode(', ', self::$localEscapedChars), - $this->line, - $this->column - ); - } - } - - /** - * Parses a blank node ID, e.g: _:node1 - * @ignore - */ - protected function parseNodeID() - { - // Node ID should start with "_:" - $this->verifyCharacterOrFail($this->read(), "_"); - $this->verifyCharacterOrFail($this->read(), ":"); - - // Read the node ID - $c = $this->read(); - if ($c == -1) { - throw new EasyRdf_Parser_Exception( - "Turtle Parse Error: unexpected end of file while reading node id", - $this->line, - $this->column - ); - } elseif (!self::isNameStartChar($c)) { - throw new EasyRdf_Parser_Exception( - "Turtle Parse Error: expected a letter, found '$c'", - $this->line, - $this->column - ); - } - - // Read all following letter and numbers, they are part of the name - $name = $c; - $c = $this->read(); - while (self::isNameChar($c)) { - $name .= $c; - $c = $this->read(); - } - - $this->unread($c); - - return array( - 'type' => 'bnode', - 'value' => $this->remapBnode($name) - ); - } - - protected function resolve($uri) - { - if ($this->baseUri) { - return $this->baseUri->resolve($uri)->toString(); - } else { - return $uri; - } - } - - /** - * Verifies that the supplied character $c is one of the expected - * characters specified in $expected. This method will throw a - * exception if this is not the case. - * @ignore - */ - protected function verifyCharacterOrFail($c, $expected) - { - if ($c == -1) { - throw new EasyRdf_Parser_Exception( - "Turtle Parse Error: unexpected end of file", - $this->line, - $this->column - ); - } elseif (strpbrk($c, $expected) === false) { - $msg = 'expected '; - for ($i = 0; $i < strlen($expected); $i++) { - if ($i > 0) { - $msg .= " or "; - } - $msg .= '\''.$expected[$i].'\''; - } - $msg .= ", found '$c'"; - - throw new EasyRdf_Parser_Exception( - "Turtle Parse Error: $msg", - $this->line, - $this->column - ); - } - } - - /** - * Skip through whitespace and comments - * @ignore - */ - protected function skipWSC() - { - $c = $this->read(); - while (self::isWhitespace($c) || $c == '#') { - if ($c == '#') { - $this->processComment(); - } - - $c = $this->read(); - } - - $this->unread($c); - return $c; - } - - /** - * Consumes characters from reader until the first EOL has been read. - * @ignore - */ - protected function processComment() - { - $comment = ''; - $c = $this->read(); - while ($c != -1 && $c != "\r" && $c != "\n") { - $comment .= $c; - $c = $this->read(); - } - - // c is equal to -1, \r or \n. - // In case c is equal to \r, we should also read a following \n. - if ($c == "\r") { - $c = $this->read(); - if ($c != "\n") { - $this->unread($c); - } - } - } - - /** - * Read a single character from the input buffer. - * Returns -1 when the end of the file is reached. - * @ignore - */ - protected function read() - { - if (!empty($this->data)) { - $c = mb_substr($this->data, 0, 1, "UTF-8"); - // Keep tracks of which line we are on (0A = Line Feed) - if ($c == "\x0A") { - $this->line += 1; - $this->column = 1; - } else { - $this->column += 1; - } - - if (version_compare(PHP_VERSION, '5.4.8', '<')) { - // versions of PHP prior to 5.4.8 treat "NULL" length parameter as 0 - $this->data = mb_substr($this->data, 1, mb_strlen($this->data), "UTF-8"); - } else { - $this->data = mb_substr($this->data, 1, null, "UTF-8"); - } - return $c; - } else { - return -1; - } - } - - /** - * Gets the next character to be returned by read() - * without removing it from the input buffer. - * @ignore - */ - protected function peek() - { - if (!empty($this->data)) { - return mb_substr($this->data, 0, 1, "UTF-8"); - } else { - return -1; - } - } - - - /** - * Steps back, restoring the previous character read() to the input buffer - * @ignore - */ - protected function unread($c) - { - # FIXME: deal with unreading new lines - $this->column -= mb_strlen($c, "UTF-8"); - $this->data = $c . $this->data; - } - - /** @ignore */ - protected function createBNode() - { - return array( - 'type' => 'bnode', - 'value' => $this->graph->newBNodeId() - ); - } - - /** - * Returns true if $c is a whitespace character - * @ignore - */ - public static function isWhitespace($c) - { - // Whitespace character are space, tab, newline and carriage return: - return $c == "\x20" || $c == "\x09" || $c == "\x0A" || $c == "\x0D"; - } - - /** @ignore */ - public static function isPrefixStartChar($c) - { - $o = ord($c); - return - $o >= 0x41 && $o <= 0x5a || # A-Z - $o >= 0x61 && $o <= 0x7a || # a-z - $o >= 0x00C0 && $o <= 0x00D6 || - $o >= 0x00D8 && $o <= 0x00F6 || - $o >= 0x00F8 && $o <= 0x02FF || - $o >= 0x0370 && $o <= 0x037D || - $o >= 0x037F && $o <= 0x1FFF || - $o >= 0x200C && $o <= 0x200D || - $o >= 0x2070 && $o <= 0x218F || - $o >= 0x2C00 && $o <= 0x2FEF || - $o >= 0x3001 && $o <= 0xD7FF || - $o >= 0xF900 && $o <= 0xFDCF || - $o >= 0xFDF0 && $o <= 0xFFFD || - $o >= 0x10000 && $o <= 0xEFFFF; - } - - /** @ignore */ - public static function isNameStartChar($c) - { - return - $c == '\\' || - $c == '_' || - $c == ':' || - $c == '%' || - ctype_digit($c) || - self::isPrefixStartChar($c); - } - - /** @ignore */ - public static function isNameChar($c) - { - $o = ord($c); - return - self::isNameStartChar($c) || - $o >= 0x30 && $o <= 0x39 || # 0-9 - $c == '-' || - $o == 0x00B7 || - $o >= 0x0300 && $o <= 0x036F || - $o >= 0x203F && $o <= 0x2040; - } - - /** @ignore */ - private static $localEscapedChars = array( - '_', '~', '.', '-', '!', '$', '&', '\'', '(', ')', - '*', '+', ',', ';', '=', '/', '?', '#', '@', '%' - ); - - /** @ignore */ - public static function isLocalEscapedChar($c) - { - return in_array($c, self::$localEscapedChars); - } - - /** @ignore */ - public static function isPrefixChar($c) - { - $o = ord($c); - return - $c == '_' || - $o >= 0x30 && $o <= 0x39 || # 0-9 - self::isPrefixStartChar($c) || - $c == '-' || - $o == 0x00B7 || - $c >= 0x0300 && $c <= 0x036F || - $c >= 0x203F && $c <= 0x2040; - } - - /** @ignore */ - public static function isLanguageStartChar($c) - { - $o = ord($c); - return - $o >= 0x41 && $o <= 0x5a || # A-Z - $o >= 0x61 && $o <= 0x7a; # a-z - } - - /** @ignore */ - public static function isLanguageChar($c) - { - $o = ord($c); - return - $o >= 0x41 && $o <= 0x5a || # A-Z - $o >= 0x61 && $o <= 0x7a || # a-z - $o >= 0x30 && $o <= 0x39 || # 0-9 - $c == '-'; - } -} diff --git a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Resource.php b/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Resource.php deleted file mode 100644 index 3cb2805..0000000 --- a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Resource.php +++ /dev/null @@ -1,720 +0,0 @@ -resource('http://www.example.com/'); - * - */ - public function __construct($uri, $graph = null) - { - if (!is_string($uri) or $uri == null or $uri == '') { - throw new InvalidArgumentException( - "\$uri should be a string and cannot be null or empty" - ); - } - - $this->uri = $uri; - - # Check that $graph is an EasyRdf_Graph object - if (is_object($graph) and $graph instanceof EasyRdf_Graph) { - $this->graph = $graph; - } elseif (!is_null($graph)) { - throw new InvalidArgumentException( - "\$graph should be an EasyRdf_Graph object" - ); - } - } - - /** - * Return the graph that this resource belongs to - * - * @return EasyRdf_Graph - */ - public function getGraph() - { - return $this->graph; - } - - /** Returns the URI for the resource. - * - * @return string URI of this resource. - */ - public function getUri() - { - return $this->uri; - } - - /** Check to see if a resource is a blank node. - * - * @return bool True if this resource is a blank node. - */ - public function isBNode() - { - if (substr($this->uri, 0, 2) == '_:') { - return true; - } else { - return false; - } - } - - /** Get the identifier for a blank node - * - * Returns null if the resource is not a blank node. - * - * @return string The identifer for the bnode - */ - public function getBNodeId() - { - if (substr($this->uri, 0, 2) == '_:') { - return substr($this->uri, 2); - } else { - return null; - } - } - - /** Get a the prefix of the namespace that this resource is part of - * - * This method will return null the resource isn't part of any - * registered namespace. - * - * @return string The namespace prefix of the resource (e.g. foaf) - */ - public function prefix() - { - return EasyRdf_Namespace::prefixOfUri($this->uri); - } - - /** Get a shortened version of the resources URI. - * - * This method will return the full URI if the resource isn't part of any - * registered namespace. - * - * @return string The shortened URI of this resource (e.g. foaf:name) - */ - public function shorten() - { - return EasyRdf_Namespace::shorten($this->uri); - } - - /** Gets the local name of the URI of this resource - * - * The local name is defined as the part of the URI string - * after the last occurrence of the '#', ':' or '/' character. - * - * @return string The local name - */ - public function localName() - { - if (preg_match("|([^#:/]+)$|", $this->uri, $matches)) { - return $matches[1]; - } - } - - /** Parse the URI of the resource and return as a ParsedUri object - * - * @return EasyRdf_ParsedUri - */ - public function parseUri() - { - return new EasyRdf_ParsedUri($this->uri); - } - - /** Generates an HTML anchor tag, linking to this resource. - * - * If no text is given, then the URI also uses as the link text. - * - * @param string $text Text for the link. - * @param array $options Associative array of attributes for the anchor tag - * @return string The HTML link string - */ - public function htmlLink($text = null, $options = array()) - { - $options = array_merge(array('href' => $this->uri), $options); - if ($text === null) { - $text = $this->uri; - } - - $html = " $value) { - if (!preg_match('/^[-\w]+$/', $key)) { - throw new InvalidArgumentException( - "\$options should use valid attribute names as keys" - ); - } - - $html .= " ".htmlspecialchars($key)."=\"". - htmlspecialchars($value)."\""; - } - $html .= ">".htmlspecialchars($text).""; - - return $html; - } - - /** Returns the properties of the resource as an RDF/PHP associative array - * - * For example: - * array('type' => 'uri', 'value' => 'http://www.example.com/') - * - * @return array The properties of the resource - */ - public function toRdfPhp() - { - if ($this->isBNode()) { - return array('type' => 'bnode', 'value' => $this->uri); - } else { - return array('type' => 'uri', 'value' => $this->uri); - } - } - - /** Return pretty-print view of the resource - * - * @param string $format Either 'html' or 'text' - * @param string $color The colour of the text - * @return string - */ - public function dumpValue($format = 'html', $color = 'blue') - { - return EasyRdf_Utils::dumpResourceValue($this, $format, $color); - } - - /** Magic method to return URI of resource when casted to string - * - * @return string The URI of the resource - */ - public function __toString() - { - return $this->uri; - } - - - - /** Throw can exception if the resource does not belong to a graph - * @ignore - */ - protected function checkHasGraph() - { - if (!$this->graph) { - throw new EasyRdf_Exception( - "EasyRdf_Resource is not part of a graph." - ); - } - } - - /** Perform a load (download of remote URI) of the resource into the graph - * - * The document type is optional but should be specified if it - * can't be guessed or got from the HTTP headers. - * - * @param string $format Optional format of the data (eg. rdfxml) - */ - public function load($format = null) - { - $this->checkHasGraph(); - return $this->graph->load($this->uri, $format); - } - - /** Delete a property (or optionally just a specific value) - * - * @param string $property The name of the property (e.g. foaf:name) - * @param object $value The value to delete (null to delete all values) - * @return null - */ - public function delete($property, $value = null) - { - $this->checkHasGraph(); - return $this->graph->delete($this->uri, $property, $value); - } - - /** Add values to for a property of the resource - * - * Example: - * $resource->add('prefix:property', 'value'); - * - * @param mixed $property The property name - * @param mixed $value The value for the property - * @return integer The number of values added (1 or 0) - */ - public function add($property, $value) - { - $this->checkHasGraph(); - return $this->graph->add($this->uri, $property, $value); - } - - /** Add a literal value as a property of the resource - * - * The value can either be a single value or an array of values. - * - * Example: - * $resource->add('dc:title', 'Title of Page'); - * - * @param mixed $property The property name - * @param mixed $values The value or values for the property - * @param string $lang The language of the literal - * @return integer The number of values added - */ - public function addLiteral($property, $values, $lang = null) - { - $this->checkHasGraph(); - return $this->graph->addLiteral($this->uri, $property, $values, $lang); - } - - /** Add a resource as a property of the resource - * - * Example: - * $bob->add('foaf:knows', 'http://example.com/alice'); - * - * @param mixed $property The property name - * @param mixed $resource2 The resource to be the value of the property - * @return integer The number of values added (1 or 0) - */ - public function addResource($property, $resource2) - { - $this->checkHasGraph(); - return $this->graph->addResource($this->uri, $property, $resource2); - } - - /** Set value for a property - * - * The new value(s) will replace the existing values for the property. - * The name of the property should be a string. - * If you set a property to null or an empty array, then the property - * will be deleted. - * - * @param string $property The name of the property (e.g. foaf:name) - * @param mixed $value The value for the property. - * @return integer The number of values added (1 or 0) - */ - public function set($property, $value) - { - $this->checkHasGraph(); - return $this->graph->set($this->uri, $property, $value); - } - - /** Get a single value for a property - * - * If multiple values are set for a property then the value returned - * may be arbitrary. - * - * If $property is an array, then the first item in the array that matches - * a property that exists is returned. - * - * This method will return null if the property does not exist. - * - * @param string|array $property The name of the property (e.g. foaf:name) - * @param string $type The type of value to filter by (e.g. literal or resource) - * @param string $lang The language to filter by (e.g. en) - * @return mixed A value associated with the property - */ - public function get($property, $type = null, $lang = null) - { - $this->checkHasGraph(); - return $this->graph->get($this->uri, $property, $type, $lang); - } - - /** Get a single literal value for a property of the resource - * - * If multiple values are set for a property then the value returned - * may be arbitrary. - * - * This method will return null if there is not literal value for the - * property. - * - * @param string|array $property The name of the property (e.g. foaf:name) - * @param string $lang The language to filter by (e.g. en) - * @return object EasyRdf_Literal Literal value associated with the property - */ - public function getLiteral($property, $lang = null) - { - $this->checkHasGraph(); - return $this->graph->get($this->uri, $property, 'literal', $lang); - } - - /** Get a single resource value for a property of the resource - * - * If multiple values are set for a property then the value returned - * may be arbitrary. - * - * This method will return null if there is not resource for the - * property. - * - * @param string|array $property The name of the property (e.g. foaf:name) - * @return object EasyRdf_Resource Resource associated with the property - */ - public function getResource($property) - { - $this->checkHasGraph(); - return $this->graph->get($this->uri, $property, 'resource'); - } - - /** Get all values for a property - * - * This method will return an empty array if the property does not exist. - * - * @param string $property The name of the property (e.g. foaf:name) - * @param string $type The type of value to filter by (e.g. literal) - * @param string $lang The language to filter by (e.g. en) - * @return array An array of values associated with the property - */ - public function all($property, $type = null, $lang = null) - { - $this->checkHasGraph(); - return $this->graph->all($this->uri, $property, $type, $lang); - } - - /** Get all literal values for a property of the resource - * - * This method will return an empty array if the resource does not - * has any literal values for that property. - * - * @param string $property The name of the property (e.g. foaf:name) - * @param string $lang The language to filter by (e.g. en) - * @return array An array of values associated with the property - */ - public function allLiterals($property, $lang = null) - { - $this->checkHasGraph(); - return $this->graph->all($this->uri, $property, 'literal', $lang); - } - - /** Get all resources for a property of the resource - * - * This method will return an empty array if the resource does not - * has any resources for that property. - * - * @param string $property The name of the property (e.g. foaf:name) - * @return array An array of values associated with the property - */ - public function allResources($property) - { - $this->checkHasGraph(); - return $this->graph->all($this->uri, $property, 'resource'); - } - - /** Count the number of values for a property of a resource - * - * This method will return 0 if the property does not exist. - * - * @param string $property The name of the property (e.g. foaf:name) - * @param string $type The type of value to filter by (e.g. literal) - * @param string $lang The language to filter by (e.g. en) - * @return integer The number of values associated with the property - */ - public function countValues($property, $type = null, $lang = null) - { - $this->checkHasGraph(); - return $this->graph->countValues($this->uri, $property, $type, $lang); - } - - /** Concatenate all values for a property into a string. - * - * The default is to join the values together with a space character. - * This method will return an empty string if the property does not exist. - * - * @param string $property The name of the property (e.g. foaf:name) - * @param string $glue The string to glue the values together with. - * @param string $lang The language to filter by (e.g. en) - * @return string Concatenation of all the values. - */ - public function join($property, $glue = ' ', $lang = null) - { - $this->checkHasGraph(); - return $this->graph->join($this->uri, $property, $glue, $lang); - } - - /** Get a list of the full URIs for the properties of this resource. - * - * This method will return an empty array if the resource has no properties. - * - * @return array Array of full URIs - */ - public function propertyUris() - { - $this->checkHasGraph(); - return $this->graph->propertyUris($this->uri); - } - - /** Get a list of all the shortened property names (qnames) for a resource. - * - * This method will return an empty array if the resource has no properties. - * - * @return array Array of shortened URIs - */ - public function properties() - { - $this->checkHasGraph(); - return $this->graph->properties($this->uri); - } - - /** Get a list of the full URIs for the properties that point to this resource. - * - * @return array Array of full property URIs - */ - public function reversePropertyUris() - { - $this->checkHasGraph(); - return $this->graph->reversePropertyUris($this->uri); - } - - /** Check to see if a property exists for this resource. - * - * This method will return true if the property exists. - * If the value parameter is given, then it will only return true - * if the value also exists for that property. - * - * @param string $property The name of the property (e.g. foaf:name) - * @param mixed $value An optional value of the property - * @return bool True if value the property exists. - */ - public function hasProperty($property, $value = null) - { - $this->checkHasGraph(); - return $this->graph->hasProperty($this->uri, $property, $value); - } - - /** Get a list of types for a resource. - * - * The types will each be a shortened URI as a string. - * This method will return an empty array if the resource has no types. - * - * @return array All types assocated with the resource (e.g. foaf:Person) - */ - public function types() - { - $this->checkHasGraph(); - return $this->graph->types($this->uri); - } - - /** Get a single type for a resource. - * - * The type will be a shortened URI as a string. - * If the resource has multiple types then the type returned - * may be arbitrary. - * This method will return null if the resource has no type. - * - * @return string A type assocated with the resource (e.g. foaf:Person) - */ - public function type() - { - $this->checkHasGraph(); - return $this->graph->type($this->uri); - } - - /** Get a single type for a resource, as a resource. - * - * The type will be returned as an EasyRdf_Resource. - * If the resource has multiple types then the type returned - * may be arbitrary. - * This method will return null if the resource has no type. - * - * @return EasyRdf_Resource A type assocated with the resource. - */ - public function typeAsResource() - { - $this->checkHasGraph(); - return $this->graph->typeAsResource($this->uri); - } - - /** - * Get a list of types for a resource, as Resources. - * - * @return EasyRdf_Resource[] - * @throws EasyRdf_Exception - */ - public function typesAsResources() - { - $this->checkHasGraph(); - return $this->graph->typesAsResources($this->uri); - } - - /** Check if a resource is of the specified type - * - * @param string $type The type to check (e.g. foaf:Person) - * @return boolean True if resource is of specified type. - */ - public function isA($type) - { - $this->checkHasGraph(); - return $this->graph->isA($this->uri, $type); - } - - /** Add one or more rdf:type properties to the resource - * - * @param string $types One or more types to add (e.g. foaf:Person) - * @return integer The number of types added - */ - public function addType($types) - { - $this->checkHasGraph(); - return $this->graph->addType($this->uri, $types); - } - - /** Change the rdf:type property for the resource - * - * Note that the PHP class of the resource will not change. - * - * @param string $type The new type (e.g. foaf:Person) - * @return integer The number of types added - */ - public function setType($type) - { - $this->checkHasGraph(); - return $this->graph->setType($this->uri, $type); - } - - /** Get the primary topic of this resource. - * - * Returns null if no primary topic is available. - * - * @return EasyRdf_Resource The primary topic of this resource. - */ - public function primaryTopic() - { - $this->checkHasGraph(); - return $this->graph->primaryTopic($this->uri); - } - - /** Get a human readable label for this resource - * - * This method will check a number of properties for the resource - * (in the order: skos:prefLabel, rdfs:label, foaf:name, dc:title) - * and return an approriate first that is available. If no label - * is available then it will return null. - * - * @return string A label for the resource. - */ - public function label($lang = null) - { - $this->checkHasGraph(); - return $this->graph->label($this->uri, $lang); - } - - /** Return a human readable view of the resource and its properties - * - * This method is intended to be a debugging aid and will - * print a resource and its properties. - * - * @param string $format Either 'html' or 'text' - * @return string - */ - public function dump($format = 'html') - { - $this->checkHasGraph(); - return $this->graph->dumpResource($this->uri, $format); - } - - /** Magic method to get a property of a resource - * - * Note that only properties in the default namespace can be accessed in this way. - * - * Example: - * $value = $resource->title; - * - * @see EasyRdf_Namespace::setDefault() - * @param string $name The name of the property - * @return string A single value for the named property - */ - public function __get($name) - { - return $this->graph->get($this->uri, $name); - } - - /** Magic method to set the value for a property of a resource - * - * Note that only properties in the default namespace can be accessed in this way. - * - * Example: - * $resource->title = 'Title'; - * - * @see EasyRdf_Namespace::setDefault() - * @param string $name The name of the property - * @param string $value The value for the property - */ - public function __set($name, $value) - { - return $this->graph->set($this->uri, $name, $value); - } - - /** Magic method to check if a property exists - * - * Note that only properties in the default namespace can be accessed in this way. - * - * Example: - * if (isset($resource->title)) { blah(); } - * - * @see EasyRdf_Namespace::setDefault() - * @param string $name The name of the property - */ - public function __isset($name) - { - return $this->graph->hasProperty($this->uri, $name); - } - - /** Magic method to delete a property of the resource - * - * Note that only properties in the default namespace can be accessed in this way. - * - * Example: - * unset($resource->title); - * - * @see EasyRdf_Namespace::setDefault() - * @param string $name The name of the property - */ - public function __unset($name) - { - return $this->graph->delete($this->uri, $name); - } -} diff --git a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser.php b/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser.php deleted file mode 100644 index 1c0acb8..0000000 --- a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser.php +++ /dev/null @@ -1,116 +0,0 @@ -prefixes[$prefix] = true; - } - - /** - * Check and cleanup parameters passed to serialise() method - * @ignore - */ - protected function checkSerialiseParams(&$graph, &$format) - { - if (is_null($graph) or !is_object($graph) or !($graph instanceof EasyRdf_Graph)) { - throw new InvalidArgumentException( - "\$graph should be an EasyRdf_Graph object and cannot be null" - ); - } - - if (is_null($format) or $format == '') { - throw new InvalidArgumentException( - "\$format cannot be null or empty" - ); - } elseif (is_object($format) and ($format instanceof EasyRdf_Format)) { - $format = $format->getName(); - } elseif (!is_string($format)) { - throw new InvalidArgumentException( - "\$format should be a string or an EasyRdf_Format object" - ); - } - } - - /** - * Protected method to get the number of reverse properties for a resource - * If a resource only has a single property, the number of values for that - * property is returned instead. - * @ignore - */ - protected function reversePropertyCount($resource) - { - $properties = $resource->reversePropertyUris(); - $count = count($properties); - if ($count == 1) { - $property = $properties[0]; - return $resource->countValues("^<$property>"); - } else { - return $count; - } - } - - /** - * Sub-classes must follow this protocol - * @ignore - */ - public function serialise($graph, $format, array $options = array()) - { - throw new EasyRdf_Exception( - "This method should be overridden by sub-classes." - ); - } -} diff --git a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser/Arc.php b/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser/Arc.php deleted file mode 100644 index 31bd8b7..0000000 --- a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser/Arc.php +++ /dev/null @@ -1,98 +0,0 @@ - 'RDFXML', - 'turtle' => 'Turtle', - 'ntriples' => 'NTriples', - 'posh' => 'POSHRDF' - ); - - /** - * Constructor - * - * @return object EasyRdf_Serialiser_Arc - */ - public function __construct() - { - require_once 'arc/ARC2.php'; - } - - /** - * Serialise an EasyRdf_Graph into RDF format of choice. - * - * @param EasyRdf_Graph $graph An EasyRdf_Graph object. - * @param string $format The name of the format to convert to. - * @param array $options - * @throws EasyRdf_Exception - * @return string The RDF in the new desired format. - */ - public function serialise($graph, $format, array $options = array()) - { - parent::checkSerialiseParams($graph, $format); - - if (array_key_exists($format, self::$supportedTypes)) { - $className = self::$supportedTypes[$format]; - } else { - throw new EasyRdf_Exception( - "EasyRdf_Serialiser_Arc does not support: $format" - ); - } - - $serialiser = ARC2::getSer($className); - if ($serialiser) { - return $serialiser->getSerializedIndex( - parent::serialise($graph, 'php') - ); - } else { - throw new EasyRdf_Exception( - "ARC2 failed to get a $className serialiser." - ); - } - } -} - -EasyRdf_Format::register('posh', 'poshRDF'); diff --git a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser/GraphViz.php b/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser/GraphViz.php deleted file mode 100644 index 2fd22da..0000000 --- a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser/GraphViz.php +++ /dev/null @@ -1,392 +0,0 @@ - 'utf-8'); - - /** - * Constructor - * - * @return object EasyRdf_Serialiser_GraphViz - */ - public function __construct() - { - } - - /** - * Set the path to the GraphViz 'dot' command - * - * Default is to search PATH for the command 'dot'. - * - * @param string $cmd The path to the 'dot' command. - * @return object EasyRdf_Serialiser_GraphViz - */ - public function setDotCommand($cmd) - { - $this->dotCommand = $cmd; - return $this; - } - - /** - * Get the path to the GraphViz 'dot' command - * - * The default value is simply 'dot' - * - * @return string The path to the 'dot' command. - */ - public function getDotCommand() - { - return $this->dotCommand; - } - - /** - * Turn on/off the option to display labels instead of URIs. - * - * When this option is turned on, then labels for resources will - * be displayed instead of the full URI of a resource. This makes - * it simpler to create friendly diagrams that non-technical people - * can understand. - * - * This option is turned off by default. - * - * @param bool $useLabels A boolean value to turn labels on and off - * @return object EasyRdf_Serialiser_GraphViz - */ - public function setUseLabels($useLabels) - { - $this->useLabels = $useLabels; - return $this; - } - - /** - * Get the state of the use labels option - * - * @return bool The current state of the use labels option - */ - public function getUseLabels() - { - return $this->useLabels; - } - - /** - * Turn on/off the option to only display nodes and edges with labels - * - * When this option is turned on, then only nodes (resources and literals) - * and edges (properties) will only be displayed if they have a label. You - * can use this option, to create concise, diagrams of your data, rather than - * the RDF. - * - * This option is turned off by default. - * - * @param bool $onlyLabelled A boolean value to enable/display only labelled items - * @return object EasyRdf_Serialiser_GraphViz - */ - public function setOnlyLabelled($onlyLabelled) - { - $this->onlyLabelled = $onlyLabelled; - return $this; - } - - /** - * Get the state of the only Only Labelled option - * - * @return bool The current state of the Only Labelled option - */ - public function getOnlyLabelled() - { - return $this->onlyLabelled; - } - - /** - * Set an attribute on the GraphViz graph - * - * Example: - * $serialiser->setAttribute('rotate', 90); - * - * See the GraphViz tool documentation for information about the - * available attributes. - * - * @param string $name The name of the attribute - * @param string $value The value for the attribute - * @return object EasyRdf_Serialiser_GraphViz - */ - public function setAttribute($name, $value) - { - $this->attributes[$name] = $value; - return $this; - } - - /** - * Get an attribute of the GraphViz graph - * - * @param string $name Attribute name - * @return string The value of the graph attribute - */ - public function getAttribute($name) - { - return $this->attributes[$name]; - } - - /** - * Convert an EasyRdf object into a GraphViz node identifier - * - * @ignore - */ - protected function nodeName($entity) - { - if ($entity instanceof EasyRdf_Resource) { - if ($entity->isBNode()) { - return "B".$entity->getUri(); - } else { - return "R".$entity->getUri(); - } - } else { - return "L".$entity; - } - } - - /** - * Internal function to escape a string into DOT safe syntax - * - * @ignore - */ - protected function escape($input) - { - if (preg_match('/^([a-z_][a-z_0-9]*|-?(\.[0-9]+|[0-9]+(\.[0-9]*)?))$/i', $input)) { - return $input; - } else { - return '"'.str_replace( - array("\r\n", "\n", "\r", '"'), - array('\n', '\n', '\n', '\"'), - $input - ).'"'; - } - } - - /** - * Internal function to escape an associate array of attributes and - * turns it into a DOT notation string - * - * @ignore - */ - protected function escapeAttributes($array) - { - $items = ''; - foreach ($array as $k => $v) { - $items[] = $this->escape($k).'='.$this->escape($v); - } - return '['.implode(',', $items).']'; - } - - /** - * Internal function to create dot syntax line for either a node or an edge - * - * @ignore - */ - protected function serialiseRow($node1, $node2 = null, $attributes = array()) - { - $result = ' '.$this->escape($node1); - if ($node2) { - $result .= ' -> '.$this->escape($node2); - } - if (count($attributes)) { - $result .= ' '.$this->escapeAttributes($attributes); - } - return $result.";\n"; - } - - /** - * Internal function to serialise an EasyRdf_Graph into a DOT formatted string - * - * @ignore - */ - protected function serialiseDot($graph) - { - $result = "digraph {\n"; - - // Write the graph attributes - foreach ($this->attributes as $k => $v) { - $result .= ' '.$this->escape($k).'='.$this->escape($v).";\n"; - } - - // Go through each of the properties and write the edges - $nodes = array(); - $result .= "\n // Edges\n"; - foreach ($graph->resources() as $resource) { - $name1 = $this->nodeName($resource); - foreach ($resource->propertyUris() as $property) { - $label = null; - if ($this->useLabels) { - $label = $graph->resource($property)->label(); - } - if ($label === null) { - if ($this->onlyLabelled == true) { - continue; - } else { - $label = EasyRdf_Namespace::shorten($property); - } - } - foreach ($resource->all("<$property>") as $value) { - $name2 = $this->nodeName($value); - $nodes[$name1] = $resource; - $nodes[$name2] = $value; - $result .= $this->serialiseRow( - $name1, - $name2, - array('label' => $label) - ); - } - } - } - - ksort($nodes); - - $result .= "\n // Nodes\n"; - foreach ($nodes as $name => $node) { - $type = substr($name, 0, 1); - $label = ''; - if ($type == 'R') { - if ($this->useLabels) { - $label = $node->label(); - } - if (!$label) { - $label = $node->shorten(); - } - if (!$label) { - $label = $node->getURI(); - } - $result .= $this->serialiseRow( - $name, - null, - array( - 'URL' => $node->getURI(), - 'label' => $label, - 'shape' => 'ellipse', - 'color' => 'blue' - ) - ); - } elseif ($type == 'B') { - if ($this->useLabels) { - $label = $node->label(); - } - $result .= $this->serialiseRow( - $name, - null, - array( - 'label' => $label, - 'shape' => 'circle', - 'color' => 'green' - ) - ); - } else { - $result .= $this->serialiseRow( - $name, - null, - array( - 'label' => strval($node), - 'shape' => 'record', - ) - ); - } - - } - - $result .= "}\n"; - - return $result; - } - - /** - * Internal function to render a graph into an image - * - * @ignore - */ - public function renderImage($graph, $format = 'png') - { - $dot = $this->serialiseDot($graph); - - return EasyRdf_Utils::execCommandPipe( - $this->dotCommand, - array("-T$format"), - $dot - ); - } - - /** - * Serialise an EasyRdf_Graph into a GraphViz dot document. - * - * Supported output format names: dot, gif, png, svg - * - * @param EasyRdf_Graph $graph An EasyRdf_Graph object. - * @param string $format The name of the format to convert to. - * @param array $options - * @throws EasyRdf_Exception - * @return string The RDF in the new desired format. - */ - public function serialise($graph, $format, array $options = array()) - { - parent::checkSerialiseParams($graph, $format); - - switch($format) { - case 'dot': - return $this->serialiseDot($graph); - case 'png': - case 'gif': - case 'svg': - return $this->renderImage($graph, $format); - default: - throw new EasyRdf_Exception( - "EasyRdf_Serialiser_GraphViz does not support: $format" - ); - } - } -} diff --git a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser/Json.php b/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser/Json.php deleted file mode 100644 index 2ff3f59..0000000 --- a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser/Json.php +++ /dev/null @@ -1,72 +0,0 @@ - 5 or (PHP_MAJOR_VERSION == 5 and PHP_MINOR_VERSION >= 3)) { - require dirname(__FILE__).'/JsonLd_real.php'; -} else { - throw new LogicException("JSON-LD support requires PHP 5.3+"); -} diff --git a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser/JsonLd_real.php b/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser/JsonLd_real.php deleted file mode 100644 index 4fb6c49..0000000 --- a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser/JsonLd_real.php +++ /dev/null @@ -1,141 +0,0 @@ -toRdfPhp() as $resource => $properties) { - if (array_key_exists($resource, $nodes)) { - $node = $nodes[$resource]; - } else { - $node = $ld_graph->createNode($resource); - $nodes[$resource] = $node; - } - - foreach ($properties as $property => $values) { - foreach ($values as $value) { - if ($value['type'] == 'bnode' or $value['type'] == 'uri') { - if (array_key_exists($value['value'], $nodes)) { - $_value = $nodes[$value['value']]; - } else { - $_value = $ld_graph->createNode($value['value']); - $nodes[$value['value']] = $_value; - } - } elseif ($value['type'] == 'literal') { - if (isset($value['lang'])) { - $_value = new \ML\JsonLD\LanguageTaggedString($value['value'], $value['lang']); - } elseif (isset($value['datatype'])) { - $_value = new \ML\JsonLD\TypedValue($value['value'], $value['datatype']); - } else { - $_value = $value['value']; - } - } else { - throw new EasyRdf_Exception( - "Unable to serialise object to JSON-LD: ".$value['type'] - ); - } - - if ($property == "http://www.w3.org/1999/02/22-rdf-syntax-ns#type") { - $node->addType($_value); - } else { - $node->addPropertyValue($property, $_value); - } - } - } - } - - // OPTIONS - $use_native_types = !(isset($options['expand_native_types']) and $options['expand_native_types'] == true); - $should_compact = (isset($options['compact']) and $options['compact'] == true); - $should_frame = isset($options['frame']); - - // expanded form - $data = $ld_graph->toJsonLd($use_native_types); - - if ($should_frame) { - $data = \ML\JsonLD\JsonLD::frame($data, $options['frame'], $options); - - } - - if ($should_compact) { - // compact form - $compact_context = isset($options['context']) ? $options['context'] : null; - $compact_options = array( - 'useNativeTypes' => $use_native_types, - 'base' => $graph->getUri() - ); - - $data = \ML\JsonLD\JsonLD::compact($data, $compact_context, $compact_options); - } - - return \ML\JsonLD\JsonLD::toString($data); - } -} diff --git a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser/Ntriples.php b/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser/Ntriples.php deleted file mode 100644 index d77a638..0000000 --- a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser/Ntriples.php +++ /dev/null @@ -1,221 +0,0 @@ -escChars[$c])) { - $this->escChars[$c] = $this->escapedChar($c); - } - $result .= $this->escChars[$c]; - } - return $result; - } - - /** - * @ignore - */ - protected function unicodeCharNo($c) - { - $cUtf = utf8_encode($c); - $bl = strlen($cUtf); /* binary length */ - $r = 0; - switch ($bl) { - case 1: /* 0####### (0-127) */ - $r = ord($cUtf); - break; - case 2: /* 110##### 10###### = 192+x 128+x */ - $r = ((ord($cUtf[0]) - 192) * 64) + - (ord($cUtf[1]) - 128); - break; - case 3: /* 1110#### 10###### 10###### = 224+x 128+x 128+x */ - $r = ((ord($cUtf[0]) - 224) * 4096) + - ((ord($cUtf[1]) - 128) * 64) + - (ord($cUtf[2]) - 128); - break; - case 4: /* 1111#### 10###### 10###### 10###### = 240+x 128+x 128+x 128+x */ - $r = ((ord($cUtf[0]) - 240) * 262144) + - ((ord($cUtf[1]) - 128) * 4096) + - ((ord($cUtf[2]) - 128) * 64) + - (ord($cUtf[3]) - 128); - break; - } - return $r; - } - - /** - * @ignore - */ - protected function escapedChar($c) - { - $no = $this->unicodeCharNo($c); - - /* see http://www.w3.org/TR/rdf-testcases/#ntrip_strings */ - if ($no < 9) { - return "\\u" . sprintf('%04X', $no); /* #x0-#x8 (0-8) */ - } elseif ($no == 9) { - return '\t'; /* #x9 (9) */ - } elseif ($no == 10) { - return '\n'; /* #xA (10) */ - } elseif ($no < 13) { - return "\\u" . sprintf('%04X', $no); /* #xB-#xC (11-12) */ - } elseif ($no == 13) { - return '\r'; /* #xD (13) */ - } elseif ($no < 32) { - return "\\u" . sprintf('%04X', $no); /* #xE-#x1F (14-31) */ - } elseif ($no < 34) { - return $c; /* #x20-#x21 (32-33) */ - } elseif ($no == 34) { - return '\"'; /* #x22 (34) */ - } elseif ($no < 92) { - return $c; /* #x23-#x5B (35-91) */ - } elseif ($no == 92) { - return '\\'; /* #x5C (92) */ - } elseif ($no < 127) { - return $c; /* #x5D-#x7E (93-126) */ - } elseif ($no < 65536) { - return "\\u" . sprintf('%04X', $no); /* #x7F-#xFFFF (128-65535) */ - } elseif ($no < 1114112) { - return "\\U" . sprintf('%08X', $no); /* #x10000-#x10FFFF (65536-1114111) */ - } else { - return ''; /* not defined => ignore */ - } - } - - /** - * @ignore - */ - protected function serialiseResource($res) - { - $escaped = $this->escapeString($res); - if (substr($res, 0, 2) == '_:') { - return $escaped; - } else { - return "<$escaped>"; - } - } - - /** - * Serialise an RDF value into N-Triples - * - * The value can either be an array in RDF/PHP form, or - * an EasyRdf_Literal or EasyRdf_Resource object. - * - * @param array|object $value An associative array or an object - * @throws EasyRdf_Exception - * @return string The RDF value serialised to N-Triples - */ - public function serialiseValue($value) - { - if (is_object($value)) { - $value = $value->toRdfPhp(); - } - - if ($value['type'] == 'uri' or $value['type'] == 'bnode') { - return $this->serialiseResource($value['value']); - } elseif ($value['type'] == 'literal') { - $escaped = $this->escapeString($value['value']); - if (isset($value['lang'])) { - $lang = $this->escapeString($value['lang']); - return '"' . $escaped . '"' . '@' . $lang; - } elseif (isset($value['datatype'])) { - $datatype = $this->escapeString($value['datatype']); - return '"' . $escaped . '"' . "^^<$datatype>"; - } else { - return '"' . $escaped . '"'; - } - } else { - throw new EasyRdf_Exception( - "Unable to serialise object of type '".$value['type']."' to ntriples: " - ); - } - } - - /** - * Serialise an EasyRdf_Graph into N-Triples - * - * @param EasyRdf_Graph $graph An EasyRdf_Graph object. - * @param string $format The name of the format to convert to. - * @param array $options - * @throws EasyRdf_Exception - * @return string The RDF in the new desired format. - */ - public function serialise($graph, $format, array $options = array()) - { - parent::checkSerialiseParams($graph, $format); - - if ($format == 'ntriples') { - $nt = ''; - foreach ($graph->toRdfPhp() as $resource => $properties) { - foreach ($properties as $property => $values) { - foreach ($values as $value) { - $nt .= $this->serialiseResource($resource)." "; - $nt .= "<" . $this->escapeString($property) . "> "; - $nt .= $this->serialiseValue($value)." .\n"; - } - } - } - return $nt; - } else { - throw new EasyRdf_Exception( - "EasyRdf_Serialiser_Ntriples does not support: $format" - ); - } - } -} diff --git a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser/Rapper.php b/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser/Rapper.php deleted file mode 100644 index ba42bc5..0000000 --- a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser/Rapper.php +++ /dev/null @@ -1,100 +0,0 @@ -/dev/null", $output, $status); - if ($status != 0) { - throw new EasyRdf_Exception( - "Failed to execute the command '$rapperCmd': $result" - ); - } else { - $this->rapperCmd = $rapperCmd; - } - } - - /** - * Serialise an EasyRdf_Graph to the RDF format of choice. - * - * @param EasyRdf_Graph $graph An EasyRdf_Graph object. - * @param string $format The name of the format to convert to. - * @param array $options - * @return string The RDF in the new desired format. - */ - public function serialise($graph, $format, array $options = array()) - { - parent::checkSerialiseParams($graph, $format); - - $ntriples = parent::serialise($graph, 'ntriples'); - - // Hack to produce more concise RDF/XML - if ($format == 'rdfxml') { - $format = 'rdfxml-abbrev'; - } - - return EasyRdf_Utils::execCommandPipe( - $this->rapperCmd, - array( - '--quiet', - '--input', 'ntriples', - '--output', $format, - '-', 'unknown://' - ), - $ntriples - ); - } -} diff --git a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser/RdfPhp.php b/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser/RdfPhp.php deleted file mode 100644 index ed851af..0000000 --- a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser/RdfPhp.php +++ /dev/null @@ -1,73 +0,0 @@ -toRdfPhp(); - } -} diff --git a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser/RdfXml.php b/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser/RdfXml.php deleted file mode 100644 index 289d7dc..0000000 --- a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser/RdfXml.php +++ /dev/null @@ -1,247 +0,0 @@ -propertyUris()); - $rpcount = $this->reversePropertyCount($obj); - $alreadyOutput = isset($this->outputtedResources[$obj->getUri()]); - - $tag = "{$indent}<{$property}"; - if ($obj->isBNode()) { - if ($alreadyOutput or $rpcount > 1 or $pcount == 0) { - $tag .= " rdf:nodeID=\"".htmlspecialchars($obj->getBNodeId()).'"'; - } - } else { - if ($alreadyOutput or $rpcount != 1 or $pcount == 0) { - $tag .= " rdf:resource=\"".htmlspecialchars($obj->getURI()).'"'; - } - } - - if ($alreadyOutput == false and $rpcount == 1 and $pcount > 0) { - $xml = $this->rdfxmlResource($obj, false, $depth+1); - if ($xml) { - return "$tag>$xml$indent\n\n"; - } else { - return ''; - } - } else { - return $tag."/>\n"; - } - - } elseif (is_object($obj) and $obj instanceof EasyRdf_Literal) { - $atrributes = ""; - $datatype = $obj->getDatatypeUri(); - if ($datatype) { - if ($datatype == self::RDF_XML_LITERAL) { - $atrributes .= " rdf:parseType=\"Literal\""; - $value = strval($obj); - } else { - $datatype = htmlspecialchars($datatype); - $atrributes .= " rdf:datatype=\"$datatype\""; - } - } elseif ($obj->getLang()) { - $atrributes .= ' xml:lang="'. - htmlspecialchars($obj->getLang()).'"'; - } - - // Escape the value - if (!isset($value)) { - $value = htmlspecialchars(strval($obj)); - } - - return "{$indent}<{$property}{$atrributes}>{$value}\n"; - } else { - throw new EasyRdf_Exception( - "Unable to serialise object to xml: ".getType($obj) - ); - } - } - - /** - * Protected method to serialise a whole resource and its properties - * @ignore - */ - protected function rdfxmlResource($res, $showNodeId, $depth = 1) - { - // Keep track of the resources we have already serialised - if (isset($this->outputtedResources[$res->getUri()])) { - return ''; - } else { - $this->outputtedResources[$res->getUri()] = true; - } - - // If the resource has no properties - don't serialise it - $properties = $res->propertyUris(); - if (count($properties) == 0) { - return ''; - } - - $type = $res->type(); - if ($type) { - $this->addPrefix($type); - } else { - $type = 'rdf:Description'; - } - - $indent = str_repeat(' ', $depth); - $xml = "\n$indent<$type"; - if ($res->isBNode()) { - if ($showNodeId) { - $xml .= ' rdf:nodeID="'.htmlspecialchars($res->getBNodeId()).'"'; - } - } else { - $xml .= ' rdf:about="'.htmlspecialchars($res->getUri()).'"'; - } - $xml .= ">\n"; - - if ($res instanceof EasyRdf_Container) { - foreach ($res as $item) { - $xml .= $this->rdfxmlObject('rdf:li', $item, $depth+1); - } - } else { - foreach ($properties as $property) { - $short = EasyRdf_Namespace::shorten($property, true); - if ($short) { - $this->addPrefix($short); - $objects = $res->all("<$property>"); - if ($short == 'rdf:type' && $type != 'rdf:Description') { - array_shift($objects); - } - foreach ($objects as $object) { - $xml .= $this->rdfxmlObject($short, $object, $depth+1); - } - } else { - throw new EasyRdf_Exception( - "It is not possible to serialse the property ". - "'$property' to RDF/XML." - ); - } - } - } - $xml .= "$indent\n"; - - return $xml; - } - - - /** - * Method to serialise an EasyRdf_Graph to RDF/XML - * - * @param EasyRdf_Graph $graph An EasyRdf_Graph object. - * @param string $format The name of the format to convert to. - * @param array $options - * @throws EasyRdf_Exception - * @return string The RDF in the new desired format. - */ - public function serialise($graph, $format, array $options = array()) - { - parent::checkSerialiseParams($graph, $format); - - if ($format != 'rdfxml') { - throw new EasyRdf_Exception( - "EasyRdf_Serialiser_RdfXml does not support: $format" - ); - } - - // store of namespaces to be appended to the rdf:RDF tag - $this->prefixes = array('rdf' => true); - - // store of the resource URIs we have serialised - $this->outputtedResources = array(); - - $xml = ''; - - // Serialise URIs first - foreach ($graph->resources() as $resource) { - if (!$resource->isBnode()) { - $xml .= $this->rdfxmlResource($resource, true); - } - } - - // Serialise bnodes afterwards - foreach ($graph->resources() as $resource) { - if ($resource->isBnode()) { - $xml .= $this->rdfxmlResource($resource, true); - } - } - - // iterate through namepsaces array prefix and output a string. - $namespaceStr = ''; - foreach ($this->prefixes as $prefix => $count) { - $url = EasyRdf_Namespace::get($prefix); - - if (strlen($namespaceStr)) { - $namespaceStr .= "\n "; - } - - if (strlen($prefix) === 0) { - $namespaceStr .= ' xmlns="'.htmlspecialchars($url).'"'; - } else { - $namespaceStr .= ' xmlns:'.$prefix.'="'.htmlspecialchars($url).'"'; - } - } - - return "\n". - "\n" . $xml . "\n\n"; - } -} diff --git a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser/Turtle.php b/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser/Turtle.php deleted file mode 100644 index b268201..0000000 --- a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser/Turtle.php +++ /dev/null @@ -1,363 +0,0 @@ -', '\\>', $resourceIri); - return "<$escapedIri>"; - } - - /** - * Given a string, enclose in quotes and escape any quotes in the string. - * Strings containing tabs, linefeeds or carriage returns will be - * enclosed in three double quotes ("""). - * - * @param string $value - * @return string - */ - public static function quotedString($value) - { - if (preg_match('/[\t\n\r]/', $value)) { - $escaped = str_replace(array('\\', '"""'), array('\\\\', '\\"""'), $value); - return '"""'.$escaped.'"""'; - } else { - $escaped = str_replace(array('\\', '"'), array('\\\\', '\\"'), $value); - return '"'.$escaped.'"'; - } - } - - /** - * Given a an EasyRdf_Resource or URI, convert it into a string, suitable to - * be written to a Turtle document. URIs will be shortened into CURIES - * where possible. - * - * @param EasyRdf_Resource $resource The resource to convert to a Turtle string - * @param boolean $createNamespace If true, a new namespace may be created - * @return string - */ - public function serialiseResource($resource, $createNamespace = false) - { - if (is_object($resource)) { - if ($resource->isBNode()) { - return $resource->getUri(); - } - - $resource = $resource->getUri(); - } - - $short = EasyRdf_Namespace::shorten($resource, $createNamespace); - - if ($short) { - $this->addPrefix($short); - return $short; - } - - return self::escapeIri($resource); - } - - /** - * Given an EasyRdf_Literal object, convert it into a string, suitable to - * be written to a Turtle document. Supports multiline literals and literals with - * datatypes or languages. - * - * @param EasyRdf_Literal $literal - * @return string - */ - public function serialiseLiteral($literal) - { - $value = strval($literal); - $quoted = self::quotedString($value); - - if ($datatype = $literal->getDatatypeUri()) { - if ($datatype == 'http://www.w3.org/2001/XMLSchema#integer') { - return sprintf('%d', $value); - } elseif ($datatype == 'http://www.w3.org/2001/XMLSchema#decimal') { - return sprintf('%s', $value); - } elseif ($datatype == 'http://www.w3.org/2001/XMLSchema#double') { - return sprintf('%e', $value); - } elseif ($datatype == 'http://www.w3.org/2001/XMLSchema#boolean') { - return sprintf('%s', $value); - } else { - $escaped = $this->serialiseResource($datatype, true); - return sprintf('%s^^%s', $quoted, $escaped); - } - } elseif ($lang = $literal->getLang()) { - return $quoted . '@' . $lang; - } else { - return $quoted; - } - } - - /** - * Convert an EasyRdf object into a string suitable to - * be written to a Turtle document. - * - * @param EasyRdf_Resource|EasyRdf_Literal $object - * @return string - */ - public function serialiseObject($object) - { - if ($object instanceof EasyRdf_Resource) { - return $this->serialiseResource($object); - } elseif ($object instanceof EasyRdf_Literal) { - return $this->serialiseLiteral($object); - } else { - throw new InvalidArgumentException( - "serialiseObject() requires \$object to be ". - "of type EasyRdf_Resource or EasyRdf_Literal" - ); - } - } - - - /** - * Protected method to serialise a RDF collection - * @ignore - */ - protected function serialiseCollection($node, $indent) - { - $turtle = '('; - $count = 0; - while ($node) { - if ($id = $node->getBNodeId()) { - $this->outputtedBnodes[$id] = true; - } - - $value = $node->get('rdf:first'); - $node = $node->get('rdf:rest'); - if ($node and $node->hasProperty('rdf:first')) { - $count++; - } - - if ($value !== null) { - $serialised = $this->serialiseObject($value); - if ($count) { - $turtle .= "\n$indent $serialised"; - } else { - $turtle .= " ".$serialised; - } - } - } - if ($count) { - $turtle .= "\n$indent)"; - } else { - $turtle .= " )"; - } - return $turtle; - } - - /** - * Protected method to serialise the properties of a resource - * @ignore - */ - protected function serialiseProperties($res, $depth = 1) - { - $properties = $res->propertyUris(); - $indent = str_repeat(' ', ($depth*2)-1); - - $turtle = ''; - if (count($properties) > 1) { - $turtle .= "\n$indent"; - } - - $pCount = 0; - foreach ($properties as $property) { - if ($property === 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type') { - $pStr = 'a'; - } else { - $pStr = $this->serialiseResource($property, true); - } - - if ($pCount) { - $turtle .= " ;\n$indent"; - } - - $turtle .= ' ' . $pStr; - - $oCount = 0; - foreach ($res->all("<$property>") as $object) { - if ($oCount) { - $turtle .= ','; - } - - if ($object instanceof EasyRdf_Collection) { - $turtle .= ' ' . $this->serialiseCollection($object, $indent); - } elseif ($object instanceof EasyRdf_Resource and $object->isBNode()) { - $id = $object->getBNodeId(); - $rpcount = $this->reversePropertyCount($object); - if ($rpcount <= 1 and !isset($this->outputtedBnodes[$id])) { - // Nested unlabelled Blank Node - $this->outputtedBnodes[$id] = true; - $turtle .= ' ['; - $turtle .= $this->serialiseProperties($object, $depth+1); - $turtle .= ' ]'; - } else { - // Multiple properties pointing to this blank node - $turtle .= ' ' . $this->serialiseObject($object); - } - } else { - $turtle .= ' ' . $this->serialiseObject($object); - } - $oCount++; - } - $pCount++; - } - - if ($depth == 1) { - $turtle .= " ."; - if ($pCount > 1) { - $turtle .= "\n"; - } - } elseif ($pCount > 1) { - $turtle .= "\n" . str_repeat(' ', (($depth-1)*2)-1); - } - - return $turtle; - } - - /** - * @ignore - */ - protected function serialisePrefixes() - { - $turtle = ''; - foreach ($this->prefixes as $prefix => $count) { - $url = EasyRdf_Namespace::get($prefix); - $turtle .= "@prefix $prefix: <$url> .\n"; - } - return $turtle; - } - - /** - * @ignore - */ - protected function serialiseSubjects(EasyRdf_Graph $graph, $filterType) - { - $turtle = ''; - foreach ($graph->resources() as $resource) { - /** @var $resource EasyRdf_Resource */ - // If the resource has no properties - don't serialise it - $properties = $resource->propertyUris(); - if (count($properties) == 0) { - continue; - } - - // Is this node of the right type? - $thisType = $resource->isBNode() ? 'bnode' : 'uri'; - if ($thisType != $filterType) { - continue; - } - - if ($thisType == 'bnode') { - $id = $resource->getBNodeId(); - - if (isset($this->outputtedBnodes[$id])) { - // Already been serialised - continue; - } - - $this->outputtedBnodes[$id] = true; - $rpcount = $this->reversePropertyCount($resource); - - if ($rpcount == 0) { - $turtle .= '[]'; - } else { - $turtle .= $this->serialiseResource($resource); - } - } else { - $turtle .= $this->serialiseResource($resource); - } - - $turtle .= $this->serialiseProperties($resource); - $turtle .= "\n"; - } - return $turtle; - } - - /** - * Serialise an EasyRdf_Graph to Turtle. - * - * @param EasyRdf_Graph $graph An EasyRdf_Graph object. - * @param string $format The name of the format to convert to. - * @param array $options - * @throws EasyRdf_Exception - * @return string The RDF in the new desired format. - */ - public function serialise($graph, $format, array $options = array()) - { - parent::checkSerialiseParams($graph, $format); - - if ($format != 'turtle' and $format != 'n3') { - throw new EasyRdf_Exception( - "EasyRdf_Serialiser_Turtle does not support: $format" - ); - } - - $this->prefixes = array(); - $this->outputtedBnodes = array(); - - $turtle = ''; - $turtle .= $this->serialiseSubjects($graph, 'uri'); - $turtle .= $this->serialiseSubjects($graph, 'bnode'); - - if (count($this->prefixes)) { - return $this->serialisePrefixes() . "\n" . $turtle; - } else { - return $turtle; - } - } -} diff --git a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Sparql/Client.php b/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Sparql/Client.php deleted file mode 100644 index 5f97138..0000000 --- a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Sparql/Client.php +++ /dev/null @@ -1,309 +0,0 @@ -queryUri = $queryUri; - - if (strlen(parse_url($queryUri, PHP_URL_QUERY)) > 0) { - $this->queryUri_has_params = true; - } else { - $this->queryUri_has_params = false; - } - - if ($updateUri) { - $this->updateUri = $updateUri; - } else { - $this->updateUri = $queryUri; - } - } - - /** Get the URI of the SPARQL query endpoint - * - * @return string The query URI of the SPARQL endpoint - */ - public function getQueryUri() - { - return $this->queryUri; - } - - /** Get the URI of the SPARQL update endpoint - * - * @return string The query URI of the SPARQL endpoint - */ - public function getUpdateUri() - { - return $this->updateUri; - } - - /** - * @depredated - * @ignore - */ - public function getUri() - { - return $this->queryUri; - } - - /** Make a query to the SPARQL endpoint - * - * SELECT and ASK queries will return an object of type - * EasyRdf_Sparql_Result. - * - * CONSTRUCT and DESCRIBE queries will return an object - * of type EasyRdf_Graph. - * - * @param string $query The query string to be executed - * @return object EasyRdf_Sparql_Result|EasyRdf_Graph Result of the query. - */ - public function query($query) - { - return $this->request('query', $query); - } - - /** Count the number of triples in a SPARQL 1.1 endpoint - * - * Performs a SELECT query to estriblish the total number of triples. - * - * Counts total number of triples by default but a conditional triple pattern - * can be given to count of a subset of all triples. - * - * @param string $condition Triple-pattern condition for the count query - * @return integer The number of triples - */ - public function countTriples($condition = '?s ?p ?o') - { - // SELECT (COUNT(*) AS ?count) - // WHERE { - // {?s ?p ?o} - // UNION - // {GRAPH ?g {?s ?p ?o}} - // } - $result = $this->query('SELECT (COUNT(*) AS ?count) {'.$condition.'}'); - return $result[0]->count->getValue(); - } - - /** Get a list of named graphs from a SPARQL 1.1 endpoint - * - * Performs a SELECT query to get a list of the named graphs - * - * @param string $limit Optional limit to the number of results - * @return array Array of EasyRdf_Resource objects for each named graph - */ - public function listNamedGraphs($limit = null) - { - $query = "SELECT DISTINCT ?g WHERE {GRAPH ?g {?s ?p ?o}}"; - if (!is_null($limit)) { - $query .= " LIMIT ".(int)$limit; - } - $result = $this->query($query); - - // Convert the result object into an array of resources - $graphs = array(); - foreach ($result as $row) { - array_push($graphs, $row->g); - } - return $graphs; - } - - /** Make an update request to the SPARQL endpoint - * - * Successful responses will return the HTTP response object - * - * Unsuccessful responses will throw an exception - * - * @param string $query The update query string to be executed - * @return object EasyRdf_Http_Response HTTP response - */ - public function update($query) - { - return $this->request('update', $query); - } - - public function insert($data, $graphUri = null) - { - #$this->updateData('INSET', - $query = 'INSERT DATA {'; - if ($graphUri) { - $query .= "GRAPH <$graphUri> {"; - } - $query .= $this->convertToTriples($data); - if ($graphUri) { - $query .= "}"; - } - $query .= '}'; - return $this->update($query); - } - - protected function updateData($operation, $data, $graphUri = null) - { - $query = "$operation DATA {"; - if ($graphUri) { - $query .= "GRAPH <$graphUri> {"; - } - $query .= $this->convertToTriples($data); - if ($graphUri) { - $query .= "}"; - } - $query .= '}'; - return $this->update($query); - } - - public function clear($graphUri, $silent = false) - { - $query = "CLEAR"; - if ($silent) { - $query .= " SILENT"; - } - if (preg_match('/^all|named|default$/i', $graphUri)) { - $query .= " $graphUri"; - } else { - $query .= " GRAPH <$graphUri>"; - } - return $this->update($query); - } - - /* - * Internal function to make an HTTP request to SPARQL endpoint - * - * @ignore - */ - protected function request($type, $query) - { - // Check for undefined prefixes - $prefixes = ''; - foreach (EasyRdf_Namespace::namespaces() as $prefix => $uri) { - if (strpos($query, "$prefix:") !== false and - strpos($query, "PREFIX $prefix:") === false) { - $prefixes .= "PREFIX $prefix: <$uri>\n"; - } - } - - $client = EasyRdf_Http::getDefaultHttpClient(); - $client->resetParameters(); - - // Tell the server which response formats we can parse - $accept = EasyRdf_Format::getHttpAcceptHeader( - array( - 'application/sparql-results+json' => 1.0, - 'application/sparql-results+xml' => 0.8 - ) - ); - $client->setHeaders('Accept', $accept); - - if ($type == 'update') { - $client->setMethod('POST'); - $client->setUri($this->updateUri); - $client->setRawData($prefixes . $query); - $client->setHeaders('Content-Type', 'application/sparql-update'); - } elseif ($type == 'query') { - // Use GET if the query is less than 2kB - // 2046 = 2kB minus 1 for '?' and 1 for NULL-terminated string on server - $encodedQuery = 'query='.urlencode($prefixes . $query); - if (strlen($encodedQuery) + strlen($this->queryUri) <= 2046) { - $delimiter = $this->queryUri_has_params ? '&' : '?'; - - $client->setMethod('GET'); - $client->setUri($this->queryUri.$delimiter.$encodedQuery); - } else { - // Fall back to POST instead (which is un-cacheable) - $client->setMethod('POST'); - $client->setUri($this->queryUri); - $client->setRawData($encodedQuery); - $client->setHeaders('Content-Type', 'application/x-www-form-urlencoded'); - } - } - - $response = $client->request(); - if ($response->getStatus() == 204) { - // No content - return $response; - } elseif ($response->isSuccessful()) { - list($type, $params) = EasyRdf_Utils::parseMimeType( - $response->getHeader('Content-Type') - ); - if (strpos($type, 'application/sparql-results') === 0) { - return new EasyRdf_Sparql_Result($response->getBody(), $type); - } else { - return new EasyRdf_Graph($this->queryUri, $response->getBody(), $type); - } - } else { - throw new EasyRdf_Exception( - "HTTP request for SPARQL query failed: ".$response->getBody() - ); - } - } - - protected function convertToTriples($data) - { - if (is_string($data)) { - return $data; - } elseif (is_object($data) and $data instanceof EasyRdf_Graph) { - # FIXME: insert Turtle when there is a way of seperateing out the prefixes - return $data->serialise('ntriples'); - } else { - throw new EasyRdf_Exception( - "Don't know how to convert to triples for SPARQL query: ".$response->getBody() - ); - } - } -} diff --git a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Sparql/Result.php b/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Sparql/Result.php deleted file mode 100644 index 22001e9..0000000 --- a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Sparql/Result.php +++ /dev/null @@ -1,384 +0,0 @@ -parseXml($data); - } elseif ($mimeType == 'application/sparql-results+json') { - return $this->parseJson($data); - } else { - throw new EasyRdf_Exception( - "Unsupported SPARQL Query Results format: $mimeType" - ); - } - } - - /** Get the query result type (boolean/bindings) - * - * ASK queries return a result of type 'boolean'. - * SELECT query return a result of type 'bindings'. - * - * @return string The query result type. - */ - public function getType() - { - return $this->type; - } - - /** Return the boolean value of the query result - * - * If the query was of type boolean then this method will - * return either true or false. If the query was of some other - * type then this method will return null. - * - * @return boolean The result of the query. - */ - public function getBoolean() - { - return $this->boolean; - } - - /** Return true if the result of the query was true. - * - * @return boolean True if the query result was true. - */ - public function isTrue() - { - return $this->boolean == true; - } - - /** Return false if the result of the query was false. - * - * @return boolean True if the query result was false. - */ - public function isFalse() - { - return $this->boolean == false; - } - - /** Return the number of fields in a query result of type bindings. - * - * @return integer The number of fields. - */ - public function numFields() - { - return count($this->fields); - } - - /** Return the number of rows in a query result of type bindings. - * - * @return integer The number of rows. - */ - public function numRows() - { - return count($this); - } - - /** Get the field names in a query result of type bindings. - * - * @return array The names of the fields in the result. - */ - public function getFields() - { - return $this->fields; - } - - /** Return a human readable view of the query result. - * - * This method is intended to be a debugging aid and will - * return a pretty-print view of the query result. - * - * @param string $format Either 'text' or 'html' - */ - public function dump($format = 'html') - { - if ($this->type == 'bindings') { - $result = ''; - if ($format == 'html') { - $result .= ""; - $result .= ""; - foreach ($this->fields as $field) { - $result .= ""; - } - $result .= ""; - foreach ($this as $row) { - $result .= ""; - foreach ($this->fields as $field) { - if (isset($row->$field)) { - $result .= ""; - } else { - $result .= ""; - } - } - $result .= ""; - } - $result .= "
". - "?$field
". - $row->$field->dumpValue($format)." 
"; - } else { - // First calculate the width of each comment - $colWidths = array(); - foreach ($this->fields as $field) { - $colWidths[$field] = strlen($field); - } - - $textData = array(); - foreach ($this as $row) { - $textRow = array(); - foreach ($row as $k => $v) { - $textRow[$k] = $v->dumpValue('text'); - $width = strlen($textRow[$k]); - if ($colWidths[$k] < $width) { - $colWidths[$k] = $width; - } - } - $textData[] = $textRow; - } - - // Create a horizontal rule - $hr = "+"; - foreach ($colWidths as $k => $v) { - $hr .= "-".str_repeat('-', $v).'-+'; - } - - // Output the field names - $result .= "$hr\n|"; - foreach ($this->fields as $field) { - $result .= ' '.str_pad("?$field", $colWidths[$field]).' |'; - } - - // Output each of the rows - $result .= "\n$hr\n"; - foreach ($textData as $textRow) { - $result .= '|'; - foreach ($textRow as $k => $v) { - $result .= ' '.str_pad($v, $colWidths[$k]).' |'; - } - $result .= "\n"; - } - $result .= "$hr\n"; - - } - return $result; - } elseif ($this->type == 'boolean') { - $str = ($this->boolean ? 'true' : 'false'); - if ($format == 'html') { - return "

Result: $str

"; - } else { - return "Result: $str"; - } - } else { - throw new EasyRdf_Exception( - "Failed to dump SPARQL Query Results format, unknown type: ". $this->type - ); - } - } - - /** Create a new EasyRdf_Resource or EasyRdf_Literal depending - * on the type of data passed in. - * - * @ignore - */ - protected function newTerm($data) - { - switch($data['type']) { - case 'bnode': - return new EasyRdf_Resource('_:'.$data['value']); - case 'uri': - return new EasyRdf_Resource($data['value']); - case 'literal': - case 'typed-literal': - return EasyRdf_Literal::create($data); - default: - throw new EasyRdf_Exception( - "Failed to parse SPARQL Query Results format, unknown term type: ". - $data['type'] - ); - } - } - - /** Parse a SPARQL result in the XML format into the object. - * - * @ignore - */ - protected function parseXml($data) - { - $doc = new DOMDocument(); - $doc->loadXML($data); - - # Check for valid root node. - if ($doc->hasChildNodes() == false or - $doc->childNodes->length != 1 or - $doc->firstChild->nodeName != 'sparql' or - $doc->firstChild->namespaceURI != self::SPARQL_XML_RESULTS_NS) { - throw new EasyRdf_Exception( - "Incorrect root node in SPARQL XML Query Results format" - ); - } - - # Is it the result of an ASK query? - $boolean = $doc->getElementsByTagName('boolean'); - if ($boolean->length) { - $this->type = 'boolean'; - $value = $boolean->item(0)->nodeValue; - $this->boolean = $value == 'true' ? true : false; - return; - } - - # Get a list of variables from the header - $head = $doc->getElementsByTagName('head'); - if ($head->length) { - $variables = $head->item(0)->getElementsByTagName('variable'); - foreach ($variables as $variable) { - $this->fields[] = $variable->getAttribute('name'); - } - } - - # Is it the result of a SELECT query? - $resultstag = $doc->getElementsByTagName('results'); - if ($resultstag->length) { - $this->type = 'bindings'; - $results = $resultstag->item(0)->getElementsByTagName('result'); - foreach ($results as $result) { - $bindings = $result->getElementsByTagName('binding'); - $t = new stdClass(); - foreach ($bindings as $binding) { - $key = $binding->getAttribute('name'); - foreach ($binding->childNodes as $node) { - if ($node->nodeType != XML_ELEMENT_NODE) { - continue; - } - $t->$key = $this->newTerm( - array( - 'type' => $node->nodeName, - 'value' => $node->nodeValue, - 'lang' => $node->getAttribute('xml:lang'), - 'datatype' => $node->getAttribute('datatype') - ) - ); - break; - } - } - $this[] = $t; - } - return $this; - } - - throw new EasyRdf_Exception( - "Failed to parse SPARQL XML Query Results format" - ); - } - - /** Parse a SPARQL result in the JSON format into the object. - * - * @ignore - */ - protected function parseJson($data) - { - // Decode JSON to an array - $data = json_decode($data, true); - - if (isset($data['boolean'])) { - $this->type = 'boolean'; - $this->boolean = $data['boolean']; - } elseif (isset($data['results'])) { - $this->type = 'bindings'; - if (isset($data['head']['vars'])) { - $this->fields = $data['head']['vars']; - } - - foreach ($data['results']['bindings'] as $row) { - $t = new stdClass(); - foreach ($row as $key => $value) { - $t->$key = $this->newTerm($value); - } - $this[] = $t; - } - } else { - throw new EasyRdf_Exception( - "Failed to parse SPARQL JSON Query Results format" - ); - } - } - - /** Magic method to return value of the result to string - * - * If this is a boolean result then it will return 'true' or 'false'. - * If it is a bindings type, then it will dump as a text based table. - * - * @return string A string representation of the result. - */ - public function __toString() - { - if ($this->type == 'boolean') { - return $this->boolean ? 'true' : 'false'; - } else { - return $this->dump('text'); - } - } -} diff --git a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/TypeMapper.php b/core/vendor/easyrdf/easyrdf/lib/EasyRdf/TypeMapper.php deleted file mode 100644 index 81404d2..0000000 --- a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/TypeMapper.php +++ /dev/null @@ -1,125 +0,0 @@ -$short"; - } else { - return "$escaped"; - } - } else { - if ($short) { - return $short; - } else { - return $resource; - } - } - } - - /** Return pretty-print view of a literal - * - * This method is mainly intended for internal use and is used by - * EasyRdf_Graph and EasyRdf_Sparql_Result to format a literal - * for display. - * - * @param mixed $literal An EasyRdf_Literal object or an associative array - * @param string $format Either 'html' or 'text' - * @param string $color The colour of the text - * @return string - */ - public static function dumpLiteralValue($literal, $format = 'html', $color = 'black') - { - if (!preg_match('/^#?[-\w]+$/', $color)) { - throw new InvalidArgumentException( - "\$color must be a legal color code or name" - ); - } - - if (is_object($literal)) { - $literal = $literal->toRdfPhp(); - } elseif (!is_array($literal)) { - $literal = array('value' => $literal); - } - - $text = '"'.$literal['value'].'"'; - if (isset($literal['lang'])) { - $text .= '@' . $literal['lang']; - } - if (isset($literal['datatype'])) { - $short = EasyRdf_Namespace::shorten($literal['datatype']); - if ($short) { - $text .= "^^$short"; - } else { - $text .= "^^<".$literal['datatype'].">"; - } - } - - if ($format == 'html') { - return "". - htmlentities($text, ENT_COMPAT, "UTF-8"). - ""; - } else { - return $text; - } - } - - /** Clean up and split a mime-type up into its parts - * - * @param string $mimeType A MIME Type, optionally with parameters - * @return array $type, $parameters - */ - public static function parseMimeType($mimeType) - { - $parts = explode(';', strtolower($mimeType)); - $type = trim(array_shift($parts)); - $params = array(); - foreach ($parts as $part) { - if (preg_match('/^\s*(\w+)\s*=\s*(.+?)\s*$/', $part, $matches)) { - $params[$matches[1]] = $matches[2]; - } - } - return array($type, $params); - } - - /** Execute a command as a pipe - * - * The proc_open() function is used to open a pipe to a - * a command line process, writing $input to STDIN, returning STDOUT - * and throwing an exception if anything is written to STDERR or the - * process returns non-zero. - * - * @param string $command The command to execute - * @param array $args Optional list of arguments to pass to the command - * @param string $input Optional buffer to send to the command - * @param string $dir Path to directory to run command in (defaults to /tmp) - * @return string The result of the command, printed to STDOUT - */ - public static function execCommandPipe($command, $args = null, $input = null, $dir = null) - { - $descriptorspec = array( - 0 => array('pipe', 'r'), - 1 => array('pipe', 'w'), - 2 => array('pipe', 'w') - ); - - // Use the system tmp directory by default - if (!$dir) { - $dir = sys_get_temp_dir(); - } - - if (is_array($args)) { - $fullCommand = implode( - ' ', - array_map('escapeshellcmd', array_merge(array($command), $args)) - ); - } else { - $fullCommand = escapeshellcmd($command); - if ($args) { - $fullCommand .= ' '.escapeshellcmd($args); - } - } - - $process = proc_open($fullCommand, $descriptorspec, $pipes, $dir); - if (is_resource($process)) { - // $pipes now looks like this: - // 0 => writeable handle connected to child stdin - // 1 => readable handle connected to child stdout - // 2 => readable handle connected to child stderr - - if ($input) { - fwrite($pipes[0], $input); - } - fclose($pipes[0]); - - $output = stream_get_contents($pipes[1]); - fclose($pipes[1]); - $error = stream_get_contents($pipes[2]); - fclose($pipes[2]); - - // It is important that you close any pipes before calling - // proc_close in order to avoid a deadlock - $returnValue = proc_close($process); - if ($returnValue) { - throw new EasyRdf_Exception( - "Error while executing command $command: ".$error - ); - } - } else { - throw new EasyRdf_Exception( - "Failed to execute command $command" - ); - } - - return $output; - } -} diff --git a/core/vendor/easyrdf/easyrdf/scripts/copyright_updater.php b/core/vendor/easyrdf/easyrdf/scripts/copyright_updater.php deleted file mode 100644 index 557356b..0000000 --- a/core/vendor/easyrdf/easyrdf/scripts/copyright_updater.php +++ /dev/null @@ -1,64 +0,0 @@ -isValid($email)) { - echo $email . ' is a valid email address'; -} -``` - -More advanced example (returns detailed diagnostic error codes): - -```php -isValid($email); - -if ($result) { - echo $email . ' is a valid email address'; -} else if ($validator->hasWarnings()) { - echo 'Warning! ' . $email . ' has unusual/deprecated features (result code ' . var_export($validator->getWarnings(), true) . ')'; -} else { - echo $email . ' is not a valid email address (result code ' . $validator->getError() . ')'; -} -``` - -##Contributors## -As this is a port from another library and work, here are other people related to the previous: - -* Ricard Clau [@ricardclau](http://github.com/ricardclau): Performance against PHP built-in filter_var -* Josepf Bielawski [@stloyd](http://github.com/stloyd): For its first re-work of Dominic's lib -* Dominic Sayers [@dominicsayers](http://github.com/dominicsayers): The original isemail function - -##License## -Released under the MIT License attached with this code. - diff --git a/core/vendor/egulias/email-validator/composer.json b/core/vendor/egulias/email-validator/composer.json deleted file mode 100644 index c8fb886..0000000 --- a/core/vendor/egulias/email-validator/composer.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "egulias/email-validator", - "description": "A library for validating emails", - "homepage": "https://github.com/egulias/EmailValidator", - "type": "Library", - "keywords": ["email", "validation", "validator"], - "license": "MIT", - "authors": [ - {"name": "Eduardo Gulias Davis"} - ], - "extra": { - "branch-alias": { - "dev-master": "1.3.x-dev" - } - }, - "require": { - "php": ">= 5.3.3", - "doctrine/lexer": "~1.0" - }, - "require-dev" : { - "satooshi/php-coveralls": "dev-master" - }, - "autoload": { - "psr-0": { - "Egulias\\": "src/" - } - } -} diff --git a/core/vendor/egulias/email-validator/composer.lock b/core/vendor/egulias/email-validator/composer.lock deleted file mode 100644 index 3e5a485..0000000 --- a/core/vendor/egulias/email-validator/composer.lock +++ /dev/null @@ -1,584 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", - "This file is @generated automatically" - ], - "hash": "9e9dff0cc08c7292600453e681201e13", - "packages": [ - { - "name": "doctrine/lexer", - "version": "v1.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/lexer.git", - "reference": "2f708a85bb3aab5d99dab8be435abd73e0b18acb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/2f708a85bb3aab5d99dab8be435abd73e0b18acb", - "reference": "2f708a85bb3aab5d99dab8be435abd73e0b18acb", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "type": "library", - "autoload": { - "psr-0": { - "Doctrine\\Common\\Lexer\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com", - "homepage": "http://www.instaclick.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com", - "homepage": "http://jmsyst.com", - "role": "Developer of wrapped JMSSerializerBundle" - } - ], - "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "lexer", - "parser" - ], - "time": "2013-01-12 18:59:04" - } - ], - "packages-dev": [ - { - "name": "guzzle/guzzle", - "version": "v3.9.2", - "source": { - "type": "git", - "url": "https://github.com/guzzle/guzzle3.git", - "reference": "54991459675c1a2924122afbb0e5609ade581155" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle3/zipball/54991459675c1a2924122afbb0e5609ade581155", - "reference": "54991459675c1a2924122afbb0e5609ade581155", - "shasum": "" - }, - "require": { - "ext-curl": "*", - "php": ">=5.3.3", - "symfony/event-dispatcher": "~2.1" - }, - "replace": { - "guzzle/batch": "self.version", - "guzzle/cache": "self.version", - "guzzle/common": "self.version", - "guzzle/http": "self.version", - "guzzle/inflection": "self.version", - "guzzle/iterator": "self.version", - "guzzle/log": "self.version", - "guzzle/parser": "self.version", - "guzzle/plugin": "self.version", - "guzzle/plugin-async": "self.version", - "guzzle/plugin-backoff": "self.version", - "guzzle/plugin-cache": "self.version", - "guzzle/plugin-cookie": "self.version", - "guzzle/plugin-curlauth": "self.version", - "guzzle/plugin-error-response": "self.version", - "guzzle/plugin-history": "self.version", - "guzzle/plugin-log": "self.version", - "guzzle/plugin-md5": "self.version", - "guzzle/plugin-mock": "self.version", - "guzzle/plugin-oauth": "self.version", - "guzzle/service": "self.version", - "guzzle/stream": "self.version" - }, - "require-dev": { - "doctrine/cache": "~1.3", - "monolog/monolog": "~1.0", - "phpunit/phpunit": "3.7.*", - "psr/log": "~1.0", - "symfony/class-loader": "~2.1", - "zendframework/zend-cache": "2.*,<2.3", - "zendframework/zend-log": "2.*,<2.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.9-dev" - } - }, - "autoload": { - "psr-0": { - "Guzzle": "src/", - "Guzzle\\Tests": "tests/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "Guzzle Community", - "homepage": "https://github.com/guzzle/guzzle/contributors" - } - ], - "description": "Guzzle is a PHP HTTP client library and framework for building RESTful web service clients", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "rest", - "web service" - ], - "time": "2014-08-11 04:32:36" - }, - { - "name": "psr/log", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b", - "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b", - "shasum": "" - }, - "type": "library", - "autoload": { - "psr-0": { - "Psr\\Log\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "keywords": [ - "log", - "psr", - "psr-3" - ], - "time": "2012-12-21 11:40:51" - }, - { - "name": "satooshi/php-coveralls", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/satooshi/php-coveralls.git", - "reference": "94389a0ebdb64857d6899b5e0254dffa99e5aa96" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/satooshi/php-coveralls/zipball/94389a0ebdb64857d6899b5e0254dffa99e5aa96", - "reference": "94389a0ebdb64857d6899b5e0254dffa99e5aa96", - "shasum": "" - }, - "require": { - "ext-json": "*", - "ext-simplexml": "*", - "guzzle/guzzle": ">=2.7", - "php": ">=5.3", - "psr/log": "1.0.0", - "symfony/config": ">=2.0", - "symfony/console": ">=2.0", - "symfony/stopwatch": ">=2.2", - "symfony/yaml": ">=2.0" - }, - "require-dev": { - "apigen/apigen": "2.8.*@stable", - "pdepend/pdepend": "dev-master as 2.0.0", - "phpmd/phpmd": "dev-master", - "phpunit/php-invoker": ">=1.1.0,<1.2.0", - "phpunit/phpunit": "3.7.*@stable", - "sebastian/finder-facade": "dev-master", - "sebastian/phpcpd": "1.4.*@stable", - "squizlabs/php_codesniffer": "1.4.*@stable", - "theseer/fdomdocument": "dev-master" - }, - "suggest": { - "symfony/http-kernel": "Allows Symfony integration" - }, - "bin": [ - "composer/bin/coveralls" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.7-dev" - } - }, - "autoload": { - "psr-0": { - "Satooshi\\Component": "src/", - "Satooshi\\Bundle": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Kitamura Satoshi", - "email": "with.no.parachute@gmail.com", - "homepage": "https://www.facebook.com/satooshi.jp" - } - ], - "description": "PHP client library for Coveralls API", - "homepage": "https://github.com/satooshi/php-coveralls", - "keywords": [ - "ci", - "coverage", - "github", - "test" - ], - "time": "2014-07-09 10:45:38" - }, - { - "name": "symfony/config", - "version": "v2.5.4", - "target-dir": "Symfony/Component/Config", - "source": { - "type": "git", - "url": "https://github.com/symfony/Config.git", - "reference": "080eabdc256c1d7a3a7cf6296271edb68eb1ab2b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Config/zipball/080eabdc256c1d7a3a7cf6296271edb68eb1ab2b", - "reference": "080eabdc256c1d7a3a7cf6296271edb68eb1ab2b", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "symfony/filesystem": "~2.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.5-dev" - } - }, - "autoload": { - "psr-0": { - "Symfony\\Component\\Config\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "Symfony Config Component", - "homepage": "http://symfony.com", - "time": "2014-08-31 03:22:04" - }, - { - "name": "symfony/console", - "version": "v2.5.4", - "target-dir": "Symfony/Component/Console", - "source": { - "type": "git", - "url": "https://github.com/symfony/Console.git", - "reference": "748beed2a1e73179c3f5154d33fe6ae100c1aeb1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Console/zipball/748beed2a1e73179c3f5154d33fe6ae100c1aeb1", - "reference": "748beed2a1e73179c3f5154d33fe6ae100c1aeb1", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/event-dispatcher": "~2.1" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.5-dev" - } - }, - "autoload": { - "psr-0": { - "Symfony\\Component\\Console\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "Symfony Console Component", - "homepage": "http://symfony.com", - "time": "2014-08-14 16:10:54" - }, - { - "name": "symfony/event-dispatcher", - "version": "v2.5.4", - "target-dir": "Symfony/Component/EventDispatcher", - "source": { - "type": "git", - "url": "https://github.com/symfony/EventDispatcher.git", - "reference": "8faf5cc7e80fde74a650a36e60d32ce3c3e0457b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/8faf5cc7e80fde74a650a36e60d32ce3c3e0457b", - "reference": "8faf5cc7e80fde74a650a36e60d32ce3c3e0457b", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~2.0", - "symfony/dependency-injection": "~2.0", - "symfony/stopwatch": "~2.2" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.5-dev" - } - }, - "autoload": { - "psr-0": { - "Symfony\\Component\\EventDispatcher\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "Symfony EventDispatcher Component", - "homepage": "http://symfony.com", - "time": "2014-07-28 13:20:46" - }, - { - "name": "symfony/filesystem", - "version": "v2.5.4", - "target-dir": "Symfony/Component/Filesystem", - "source": { - "type": "git", - "url": "https://github.com/symfony/Filesystem.git", - "reference": "a765efd199e02ff4001c115c318e219030be9364" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Filesystem/zipball/a765efd199e02ff4001c115c318e219030be9364", - "reference": "a765efd199e02ff4001c115c318e219030be9364", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.5-dev" - } - }, - "autoload": { - "psr-0": { - "Symfony\\Component\\Filesystem\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "Symfony Filesystem Component", - "homepage": "http://symfony.com", - "time": "2014-09-03 09:00:14" - }, - { - "name": "symfony/stopwatch", - "version": "v2.5.4", - "target-dir": "Symfony/Component/Stopwatch", - "source": { - "type": "git", - "url": "https://github.com/symfony/Stopwatch.git", - "reference": "22ab4f76cdeefd38b00022a6be5709190a2fd046" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Stopwatch/zipball/22ab4f76cdeefd38b00022a6be5709190a2fd046", - "reference": "22ab4f76cdeefd38b00022a6be5709190a2fd046", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.5-dev" - } - }, - "autoload": { - "psr-0": { - "Symfony\\Component\\Stopwatch\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "Symfony Stopwatch Component", - "homepage": "http://symfony.com", - "time": "2014-08-14 16:10:54" - }, - { - "name": "symfony/yaml", - "version": "v2.5.4", - "target-dir": "Symfony/Component/Yaml", - "source": { - "type": "git", - "url": "https://github.com/symfony/Yaml.git", - "reference": "01a7695bcfb013d0a15c6757e15aae120342986f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/01a7695bcfb013d0a15c6757e15aae120342986f", - "reference": "01a7695bcfb013d0a15c6757e15aae120342986f", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.5-dev" - } - }, - "autoload": { - "psr-0": { - "Symfony\\Component\\Yaml\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "Symfony Yaml Component", - "homepage": "http://symfony.com", - "time": "2014-08-31 03:22:04" - } - ], - "aliases": [ - - ], - "minimum-stability": "stable", - "stability-flags": { - "satooshi/php-coveralls": 20 - }, - "prefer-stable": false, - "platform": { - "php": ">= 5.3.3" - }, - "platform-dev": [ - - ] -} diff --git a/core/vendor/egulias/email-validator/documentation/Ohter.md b/core/vendor/egulias/email-validator/documentation/Ohter.md deleted file mode 100644 index 9ec4bd9..0000000 --- a/core/vendor/egulias/email-validator/documentation/Ohter.md +++ /dev/null @@ -1,69 +0,0 @@ -Email length ------------- -http://tools.ietf.org/html/rfc5321#section-4.1.2 - Forward-path = Path - - Path = "<" [ A-d-l ":" ] Mailbox ">" - -http://tools.ietf.org/html/rfc5321#section-4.5.3.1.3 -http://tools.ietf.org/html/rfc1035#section-2.3.4 - -DNS ---- - -http://tools.ietf.org/html/rfc5321#section-2.3.5 - Names that can - be resolved to MX RRs or address (i.e., A or AAAA) RRs (as discussed - in Section 5) are permitted, as are CNAME RRs whose targets can be - resolved, in turn, to MX or address RRs. - -http://tools.ietf.org/html/rfc5321#section-5.1 - The lookup first attempts to locate an MX record associated with the - name. If a CNAME record is found, the resulting name is processed as - if it were the initial name. ... If an empty list of MXs is returned, - the address is treated as if it was associated with an implicit MX - RR, with a preference of 0, pointing to that host. - -is_email() author's note: We will regard the existence of a CNAME to be -sufficient evidence of the domain's existence. For performance reasons -we will not repeat the DNS lookup for the CNAME's target, but we will -raise a warning because we didn't immediately find an MX record. - -Check for TLD addresses ------------------------ -TLD addresses are specifically allowed in RFC 5321 but they are -unusual to say the least. We will allocate a separate -status to these addresses on the basis that they are more likely -to be typos than genuine addresses (unless we've already -established that the domain does have an MX record) - -http://tools.ietf.org/html/rfc5321#section-2.3.5 - In the case - of a top-level domain used by itself in an email address, a single - string is used without any dots. This makes the requirement, - described in more detail below, that only fully-qualified domain - names appear in SMTP transactions on the public Internet, - particularly important where top-level domains are involved. - -TLD format ----------- -The format of TLDs has changed a number of times. The standards -used by IANA have been largely ignored by ICANN, leading to -confusion over the standards being followed. These are not defined -anywhere, except as a general component of a DNS host name (a label). -However, this could potentially lead to 123.123.123.123 being a -valid DNS name (rather than an IP address) and thereby creating -an ambiguity. The most authoritative statement on TLD formats that -the author can find is in a (rejected!) erratum to RFC 1123 -submitted by John Klensin, the author of RFC 5321: - -http://www.rfc-editor.org/errata_search.php?rfc=1123&eid=1353 - However, a valid host name can never have the dotted-decimal - form #.#.#.#, since this change does not permit the highest-level - component label to start with a digit even if it is not all-numeric. - -Comments --------- -Comments at the start of the domain are deprecated in the text -Comments at the start of a subdomain are obs-domain -(http://tools.ietf.org/html/rfc5322#section-3.4.1) diff --git a/core/vendor/egulias/email-validator/documentation/RFC5321BNF.html b/core/vendor/egulias/email-validator/documentation/RFC5321BNF.html deleted file mode 100644 index 2313f01..0000000 --- a/core/vendor/egulias/email-validator/documentation/RFC5321BNF.html +++ /dev/null @@ -1,89 +0,0 @@ - - - - - -The BNF from RFC 5321 defining parts of a valid SMTP address - - - -
-   Mailbox        = Local-part "@" ( Domain / address-literal )
-
-   Local-part     = Dot-string / Quoted-string
-                  ; MAY be case-sensitive
-
-
-   Dot-string     = Atom *("."  Atom)
-
-   Atom           = 1*atext
-
-   Quoted-string  = DQUOTE *QcontentSMTP DQUOTE
-
-   QcontentSMTP   = qtextSMTP / quoted-pairSMTP
-
-   quoted-pairSMTP  = %d92 %d32-126
-                    ; i.e., backslash followed by any ASCII
-                    ; graphic (including itself) or SPace
-
-   qtextSMTP      = %d32-33 / %d35-91 / %d93-126
-                  ; i.e., within a quoted string, any
-                  ; ASCII graphic or space is permitted
-                  ; without blackslash-quoting except
-                  ; double-quote and the backslash itself.
-
-   Domain         = sub-domain *("." sub-domain)
-
-   sub-domain     = Let-dig [Ldh-str]
-
-   Let-dig        = ALPHA / DIGIT
-
-   Ldh-str        = *( ALPHA / DIGIT / "-" ) Let-dig
-
-   address-literal  = "[" ( IPv4-address-literal /
-                    IPv6-address-literal /
-                    General-address-literal ) "]"
-                    ; See Section 4.1.3
-
-   IPv4-address-literal  = Snum 3("."  Snum)
-
-   IPv6-address-literal  = "IPv6:" IPv6-addr
-
-   General-address-literal  = Standardized-tag ":" 1*dcontent
-
-   Standardized-tag  = Ldh-str
-                     ; Standardized-tag MUST be specified in a
-                     ; Standards-Track RFC and registered with IANA
-
-   dcontent       = %d33-90 / ; Printable US-ASCII
-                  %d94-126 ; excl. "[", "\", "]"
-
-   Snum           = 1*3DIGIT
-                  ; representing a decimal integer
-                  ; value in the range 0 through 255
-
-   IPv6-addr      = IPv6-full / IPv6-comp / IPv6v4-full / IPv6v4-comp
-
-   IPv6-hex       = 1*4HEXDIG
-
-   IPv6-full      = IPv6-hex 7(":" IPv6-hex)
-
-   IPv6-comp      = [IPv6-hex *5(":" IPv6-hex)] "::"
-                  [IPv6-hex *5(":" IPv6-hex)]
-                  ; The "::" represents at least 2 16-bit groups of
-                  ; zeros.  No more than 6 groups in addition to the
-                  ; "::" may be present.
-
-   IPv6v4-full    = IPv6-hex 5(":" IPv6-hex) ":" IPv4-address-literal
-
-   IPv6v4-comp    = [IPv6-hex *3(":" IPv6-hex)] "::"
-                  [IPv6-hex *3(":" IPv6-hex) ":"]
-                  IPv4-address-literal
-                  ; The "::" represents at least 2 16-bit groups of
-                  ; zeros.  No more than 4 groups in addition to the
-                  ; "::" and IPv4-address-literal may be present.
-
-
- - - diff --git a/core/vendor/egulias/email-validator/documentation/RFC5322BNF.html b/core/vendor/egulias/email-validator/documentation/RFC5322BNF.html deleted file mode 100644 index e2f8fd7..0000000 --- a/core/vendor/egulias/email-validator/documentation/RFC5322BNF.html +++ /dev/null @@ -1,141 +0,0 @@ - - - - - -The BNF from RFC 5322 defining parts of a valid internet message address - - - -
-   addr-spec       =   local-part "@" domain
-
-   local-part      =   dot-atom / quoted-string / obs-local-part
-
-   dot-atom        =   [CFWS] dot-atom-text [CFWS]
-
-   CFWS            =   (1*([FWS] comment) [FWS]) / FWS
-
-   FWS             =   ([*WSP CRLF] 1*WSP) /  obs-FWS
-                                          ; Folding white space
-
-   WSP             =   SP / HTAB          ; white space
-
-   obs-FWS         =   1*([CRLF] WSP)     ; As amended in erratum #1908
-
-   ctext           =   %d33-39 /          ; Printable US-ASCII
-                       %d42-91 /          ;  characters not including
-                       %d93-126 /         ;  "(", ")", or "\"
-                       obs-ctext
-
-   obs-ctext       =   obs-NO-WS-CTL
-   ccontent        =   ctext / quoted-pair / comment
-
-   comment         =   "(" *([FWS] ccontent) [FWS] ")"
-
-   dot-atom-text   =   1*atext *("." 1*atext)
-
-   atext           =   ALPHA / DIGIT /    ; Printable US-ASCII
-                       "!" / "#" /        ;  characters not including
-                       "$" / "%" /        ;  specials.  Used for atoms.
-                       "&" / "'" /
-                       "*" / "+" /
-                       "-" / "/" /
-                       "=" / "?" /
-                       "^" / "_" /
-                       "`" / "{" /
-                       "|" / "}" /
-                       "~"
-
-   specials        =   "(" / ")" /        ; Special characters that do
-                       "<" / ">" /        ;  not appear in atext
-                       "[" / "]" /
-                       ":" / ";" /
-                       "@" / "\" /
-                       "," / "." /
-                       DQUOTE
-
-   quoted-string   =   [CFWS]
-                       DQUOTE *([FWS] qcontent) [FWS] DQUOTE
-                       [CFWS]
-
-   qcontent        =   qtext / quoted-pair
-
-   qtext           =   %d33 /             ; Printable US-ASCII
-                       %d35-91 /          ;  characters not including
-                       %d93-126 /         ;  "\" or the quote character
-                       obs-qtext
-
-   obs-qtext       =   obs-NO-WS-CTL
-
-   obs-NO-WS-CTL   =   %d1-8 /            ; US-ASCII control
-                       %d11 /             ;  characters that do not
-                       %d12 /             ;  include the carriage
-                       %d14-31 /          ;  return, line feed, and
-                       %d127              ;  white space characters
-
-   quoted-pair     =   ("\" (VCHAR / WSP)) / obs-qp
-
-   VCHAR           =   %x21-7E            ; visible (printing) characters
-
-   obs-qp          =   "\" (%d0 / obs-NO-WS-CTL / LF / CR)
-
-   obs-local-part  =   word *("." word)
-
-   word            =   atom / quoted-string
-
-   atom            =   [CFWS] 1*atext [CFWS]
-
-   domain          =   dot-atom / domain-literal / obs-domain
-
-   domain-literal  =   [CFWS] "[" *([FWS] dtext) [FWS] "]" [CFWS]
-
-   dtext           =   %d33-90 /          ; Printable US-ASCII
-                       %d94-126 /         ;  characters not including
-                       obs-dtext          ;  "[", "]", or "\"
-
-   obs-dtext       =   obs-NO-WS-CTL / quoted-pair
-
-   obs-domain      =   atom *("." atom)
-
-NB For SMTP mail, the domain-literal is restricted by RFC5321 as follows:
-
-   Mailbox        = Local-part "@" ( Domain / address-literal )
-
-   address-literal  = "[" ( IPv4-address-literal /
-                    IPv6-address-literal /
-                    General-address-literal ) "]"
-
-   IPv4-address-literal  = Snum 3("."  Snum)
-
-   IPv6-address-literal  = "IPv6:" IPv6-addr
-
-   Snum           = 1*3DIGIT
-                  ; representing a decimal integer
-                  ; value in the range 0 through 255
-
-   IPv6-addr      = IPv6-full / IPv6-comp / IPv6v4-full / IPv6v4-comp
-
-   IPv6-hex       = 1*4HEXDIG
-
-   IPv6-full      = IPv6-hex 7(":" IPv6-hex)
-
-   IPv6-comp      = [IPv6-hex *5(":" IPv6-hex)] "::"
-                  [IPv6-hex *5(":" IPv6-hex)]
-                  ; The "::" represents at least 2 16-bit groups of
-                  ; zeros.  No more than 6 groups in addition to the
-                  ; "::" may be present.
-
-   IPv6v4-full    = IPv6-hex 5(":" IPv6-hex) ":" IPv4-address-literal
-
-   IPv6v4-comp    = [IPv6-hex *3(":" IPv6-hex)] "::"
-                  [IPv6-hex *3(":" IPv6-hex) ":"]
-                  IPv4-address-literal
-                  ; The "::" represents at least 2 16-bit groups of
-                  ; zeros.  No more than 4 groups in addition to the
-                  ; "::" and IPv4-address-literal may be present.
-
-
- - - diff --git a/core/vendor/egulias/email-validator/phpunit.xml.dist b/core/vendor/egulias/email-validator/phpunit.xml.dist deleted file mode 100644 index f335ec1..0000000 --- a/core/vendor/egulias/email-validator/phpunit.xml.dist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - ./tests/egulias/Tests/ - ./vendor/ - - - - - - ./vendor - - - diff --git a/core/vendor/egulias/email-validator/src/Egulias/EmailValidator/EmailLexer.php b/core/vendor/egulias/email-validator/src/Egulias/EmailValidator/EmailLexer.php deleted file mode 100644 index 7056235..0000000 --- a/core/vendor/egulias/email-validator/src/Egulias/EmailValidator/EmailLexer.php +++ /dev/null @@ -1,214 +0,0 @@ - self::S_OPENPARENTHESIS, - ')' => self::S_CLOSEPARENTHESIS, - '<' => self::S_LOWERTHAN, - '>' => self::S_GREATERTHAN, - '[' => self::S_OPENBRACKET, - ']' => self::S_CLOSEBRACKET, - ':' => self::S_COLON, - ';' => self::S_SEMICOLON, - '@' => self::S_AT, - '\\' => self::S_BACKSLASH, - '/' => self::S_SLASH, - ',' => self::S_COMMA, - '.' => self::S_DOT, - '"' => self::S_DQUOTE, - '-' => self::S_HYPHEN, - '::' => self::S_DOUBLECOLON, - ' ' => self::S_SP, - "\t" => self::S_HTAB, - "\r" => self::S_CR, - "\n" => self::S_LF, - "\r\n" => self::CRLF, - 'IPv6' => self::S_IPV6TAG, - '<' => self::S_LOWERTHAN, - '>' => self::S_GREATERTHAN, - '{' => self::S_OPENQBRACKET, - '}' => self::S_CLOSEQBRACKET, - '' => self::S_EMPTY, - '\0' => self::C_NUL, - ); - - protected $invalidASCII = array(226 => 1,); - - protected $hasInvalidTokens = false; - - protected $previous; - - public function reset() - { - $this->hasInvalidTokens = false; - parent::reset(); - } - - public function hasInvalidTokens() - { - return $this->hasInvalidTokens; - } - - /** - * @param $type - * @throws \UnexpectedValueException - * @return boolean - */ - public function find($type) - { - $search = clone $this; - $search->skipUntil($type); - - if (!$search->lookahead) { - throw new \UnexpectedValueException($type . ' not found'); - } - return true; - } - - /** - * getPrevious - * - * @return array token - */ - public function getPrevious() - { - return $this->previous; - } - - /** - * moveNext - * - * @return boolean - */ - public function moveNext() - { - $this->previous = $this->token; - - return parent::moveNext(); - } - - /** - * Lexical catchable patterns. - * - * @return string[] - */ - protected function getCatchablePatterns() - { - return array( - '[a-zA-Z_]+[46]?', - '[0-9]+', - '\r\n', - '::', - '\s+', - '[\x10-\x1F]+', - '.', - ); - } - - /** - * Lexical non-catchable patterns. - * - * @return string[] - */ - protected function getNonCatchablePatterns() - { - return array('[\x7f-\xff]+'); - } - - /** - * Retrieve token type. Also processes the token value if necessary. - * - * @param string $value - * @throws \InvalidArgumentException - * @return integer - */ - protected function getType(&$value) - { - - if ($this->isNullType($value)) { - return self::C_NUL; - } - - if (isset($this->charValue[$value])) { - return $this->charValue[$value]; - } - - if ($this->isInvalid($value)) { - $this->hasInvalidTokens = true; - return self::INVALID; - } - - return self::GENERIC; - } - - /** - * @param string $value - */ - protected function isNullType($value) - { - if ($value === "\0") { - return true; - } - - return false; - } - - /** - * @param string $value - */ - protected function isInvalid($value) - { - if (preg_match('/[\x10-\x1F]+/', $value)) { - return true; - } - - if (isset($this->invalidASCII[ord($value)])) { - return true; - } - - return false; - } -} diff --git a/core/vendor/egulias/email-validator/src/Egulias/EmailValidator/EmailParser.php b/core/vendor/egulias/email-validator/src/Egulias/EmailValidator/EmailParser.php deleted file mode 100644 index 0c5d156..0000000 --- a/core/vendor/egulias/email-validator/src/Egulias/EmailValidator/EmailParser.php +++ /dev/null @@ -1,98 +0,0 @@ - - */ -class EmailParser -{ - const EMAIL_MAX_LENGTH = 254; - - protected $warnings = array(); - protected $domainPart = ''; - protected $localPart = ''; - protected $lexer; - protected $localPartParser; - protected $domainPartParser; - - public function __construct(EmailLexer $lexer) - { - $this->lexer = $lexer; - $this->localPartParser = new LocalPart($this->lexer); - $this->domainPartParser = new DomainPart($this->lexer); - } - - /** - * @param string $str - */ - public function parse($str) - { - $this->lexer->setInput($str); - - if (!$this->hasAtToken()) { - throw new \InvalidArgumentException('ERR_NOLOCALPART'); - } - - if ($this->lexer->hasInvalidTokens()) { - throw new \InvalidArgumentException('ERR_INVALID_ATEXT'); - } - - $this->localPartParser->parse($str); - $this->domainPartParser->parse($str); - - $this->setParts($str); - - return array('local' => $this->localPart, 'domain' => $this->domainPart); - } - - public function getWarnings() - { - $localPartWarnings = $this->localPartParser->getWarnings(); - $domainPartWarnings = $this->domainPartParser->getWarnings(); - - $this->warnings = array_merge($localPartWarnings, $domainPartWarnings); - $this->addLongEmailWarning($this->localPart, $this->domainPart); - - return $this->warnings; - } - - public function getParsedDomainPart() - { - return $this->domainPart; - } - - protected function setParts($email) - { - $parts = explode('@', $email); - $this->domainPart = $this->domainPartParser->getDomainPart(); - $this->localPart = $parts[0]; - } - - protected function hasAtToken() - { - $this->lexer->moveNext(); - $this->lexer->moveNext(); - if ($this->lexer->token['type'] === EmailLexer::S_AT) { - return false; - } - - return true; - } - - /** - * @param string $localPart - * @param string $parsedDomainPart - */ - protected function addLongEmailWarning($localPart, $parsedDomainPart) - { - if (strlen($localPart . '@' . $parsedDomainPart) > self::EMAIL_MAX_LENGTH) { - $this->warnings[] = EmailValidator::RFC5322_TOOLONG; - } - } -} diff --git a/core/vendor/egulias/email-validator/src/Egulias/EmailValidator/EmailValidator.php b/core/vendor/egulias/email-validator/src/Egulias/EmailValidator/EmailValidator.php deleted file mode 100644 index d047dec..0000000 --- a/core/vendor/egulias/email-validator/src/Egulias/EmailValidator/EmailValidator.php +++ /dev/null @@ -1,169 +0,0 @@ - - */ -class EmailValidator -{ - const ERR_CONSECUTIVEATS = 128; - const ERR_EXPECTING_DTEXT = 129; - const ERR_NOLOCALPART = 130; - const ERR_NODOMAIN = 131; - const ERR_CONSECUTIVEDOTS = 132; - const ERR_ATEXT_AFTER_CFWS = 133; - const ERR_ATEXT_AFTER_QS = 134; - const ERR_ATEXT_AFTER_DOMLIT = 135; - const ERR_EXPECTING_QPAIR = 136; - const ERR_EXPECTING_ATEXT = 137; - const ERR_EXPECTING_QTEXT = 138; - const ERR_EXPECTING_CTEXT = 139; - const ERR_BACKSLASHEND = 140; - const ERR_DOT_START = 141; - const ERR_DOT_END = 142; - const ERR_DOMAINHYPHENSTART = 143; - const ERR_DOMAINHYPHENEND = 144; - const ERR_UNCLOSEDQUOTEDSTR = 145; - const ERR_UNCLOSEDCOMMENT = 146; - const ERR_UNCLOSEDDOMLIT = 147; - const ERR_FWS_CRLF_X2 = 148; - const ERR_FWS_CRLF_END = 149; - const ERR_CR_NO_LF = 150; - const ERR_DEPREC_REACHED = 151; - const RFC5321_TLD = 9; - const RFC5321_TLDNUMERIC = 10; - const RFC5321_QUOTEDSTRING = 11; - const RFC5321_ADDRESSLITERAL = 12; - const RFC5321_IPV6DEPRECATED = 13; - const CFWS_COMMENT = 17; - const CFWS_FWS = 18; - const DEPREC_LOCALPART = 33; - const DEPREC_FWS = 34; - const DEPREC_QTEXT = 35; - const DEPREC_QP = 36; - const DEPREC_COMMENT = 37; - const DEPREC_CTEXT = 38; - const DEPREC_CFWS_NEAR_AT = 49; - const RFC5322_LOCAL_TOOLONG = 64; - const RFC5322_LABEL_TOOLONG = 63; - const RFC5322_DOMAIN = 65; - const RFC5322_TOOLONG = 66; - const RFC5322_DOMAIN_TOOLONG = 255; - const RFC5322_DOMAINLITERAL = 70; - const RFC5322_DOMLIT_OBSDTEXT = 71; - const RFC5322_IPV6_GRPCOUNT = 72; - const RFC5322_IPV6_2X2XCOLON = 73; - const RFC5322_IPV6_BADCHAR = 74; - const RFC5322_IPV6_MAXGRPS = 75; - const RFC5322_IPV6_COLONSTRT = 76; - const RFC5322_IPV6_COLONEND = 77; - const DNSWARN_NO_MX_RECORD = 5; - const DNSWARN_NO_RECORD = 6; - - protected $parser; - protected $warnings = array(); - protected $error; - protected $threshold = 255; - - public function __construct() - { - $this->parser = new EmailParser(new EmailLexer()); - } - - public function isValid($email, $checkDNS = false, $strict = false) - { - try { - $this->parser->parse((string)$email); - $this->warnings = $this->parser->getWarnings(); - } catch (\Exception $e) { - $rClass = new \ReflectionClass($this); - $this->error = $rClass->getConstant($e->getMessage()); - return false; - } - - $dns = true; - if ($checkDNS) { - $dns = $this->checkDNS(); - } - - if ($this->hasWarnings() && ((int) max($this->warnings) > $this->threshold)) { - $this->error = self::ERR_DEPREC_REACHED; - - return false; - } - - return !$strict || (!$this->hasWarnings() && $dns); - } - - /** - * @return boolean - */ - public function hasWarnings() - { - return !empty($this->warnings); - } - - /** - * @return array - */ - public function getWarnings() - { - return $this->warnings; - } - - /** - * @return string - */ - public function getError() - { - return $this->error; - } - - /** - * @param int $threshold - * - * @return EmailValidator - */ - public function setThreshold($threshold) - { - $this->threshold = (int) $threshold; - - return $this; - } - - /** - * @return int - */ - public function getThreshold() - { - return $this->threshold; - } - - protected function checkDNS() - { - $checked = true; - - $result = checkdnsrr(trim($this->parser->getParsedDomainPart()), 'MX'); - - if (!$result) { - $this->warnings[] = self::DNSWARN_NO_RECORD; - $checked = false; - $this->addTLDWarnings(); - } - - return $checked; - } - - protected function addTLDWarnings() - { - if (!in_array(self::DNSWARN_NO_RECORD, $this->warnings) && - !in_array(self::DNSWARN_NO_MX_RECORD, $this->warnings) && - in_array(self::RFC5322_DOMAINLITERAL, $this->warnings) - ) { - $this->warnings[] = self::RFC5321_TLD; - } - } -} diff --git a/core/vendor/egulias/email-validator/src/Egulias/EmailValidator/Parser/DomainPart.php b/core/vendor/egulias/email-validator/src/Egulias/EmailValidator/Parser/DomainPart.php deleted file mode 100644 index 33875a4..0000000 --- a/core/vendor/egulias/email-validator/src/Egulias/EmailValidator/Parser/DomainPart.php +++ /dev/null @@ -1,308 +0,0 @@ -lexer->moveNext(); - - if ($this->lexer->token['type'] === EmailLexer::S_DOT) { - throw new \InvalidArgumentException('ERR_DOT_START'); - } - - if ($this->lexer->token['type'] === EmailLexer::S_EMPTY) { - throw new \InvalidArgumentException('ERR_NODOMAIN'); - } - if ($this->lexer->token['type'] === EmailLexer::S_HYPHEN) { - throw new \InvalidArgumentException('ERR_DOMAINHYPHENEND'); - } - - if ($this->lexer->token['type'] === EmailLexer::S_OPENPARENTHESIS) { - $this->warnings[] = EmailValidator::DEPREC_COMMENT; - $this->parseDomainComments(); - } - - $domain = $this->doParseDomainPart(); - - $prev = $this->lexer->getPrevious(); - $length = strlen($domain); - - if ($prev['type'] === EmailLexer::S_DOT) { - throw new \InvalidArgumentException('ERR_DOT_END'); - } - if ($prev['type'] === EmailLexer::S_HYPHEN) { - throw new \InvalidArgumentException('ERR_DOMAINHYPHENEND'); - } - if ($length > self::DOMAIN_MAX_LENGTH) { - $this->warnings[] = EmailValidator::RFC5322_DOMAIN_TOOLONG; - } - if ($prev['type'] === EmailLexer::S_CR) { - throw new \InvalidArgumentException('ERR_FWS_CRLF_END'); - } - $this->domainPart = $domain; - } - - public function getDomainPart() - { - return $this->domainPart; - } - - public function checkIPV6Tag($addressLiteral, $maxGroups = 8) - { - $prev = $this->lexer->getPrevious(); - if ($prev['type'] === EmailLexer::S_COLON) { - $this->warnings[] = EmailValidator::RFC5322_IPV6_COLONEND; - } - - $IPv6 = substr($addressLiteral, 5); - //Daniel Marschall's new IPv6 testing strategy - $matchesIP = explode(':', $IPv6); - $groupCount = count($matchesIP); - $colons = strpos($IPv6, '::'); - - if (count(preg_grep('/^[0-9A-Fa-f]{0,4}$/', $matchesIP, PREG_GREP_INVERT)) !== 0) { - $this->warnings[] = EmailValidator::RFC5322_IPV6_BADCHAR; - } - - if ($colons === false) { - // We need exactly the right number of groups - if ($groupCount !== $maxGroups) { - $this->warnings[] = EmailValidator::RFC5322_IPV6_GRPCOUNT; - } - return; - } - - if ($colons !== strrpos($IPv6, '::')) { - $this->warnings[] = EmailValidator::RFC5322_IPV6_2X2XCOLON; - return; - } - - if ($colons === 0 || $colons === (strlen($IPv6) - 2)) { - // RFC 4291 allows :: at the start or end of an address - //with 7 other groups in addition - ++$maxGroups; - } - - if ($groupCount > $maxGroups) { - $this->warnings[] = EmailValidator::RFC5322_IPV6_MAXGRPS; - } elseif ($groupCount === $maxGroups) { - $this->warnings[] = EmailValidator::RFC5321_IPV6DEPRECATED; - } - } - - protected function doParseDomainPart() - { - $domain = ''; - do { - $prev = $this->lexer->getPrevious(); - - if ($this->lexer->token['type'] === EmailLexer::S_SLASH) { - throw new \InvalidArgumentException('ERR_DOMAIN_CHAR_NOT_ALLOWED'); - } - - if ($this->lexer->token['type'] === EmailLexer::S_OPENPARENTHESIS) { - $this->parseComments(); - $this->lexer->moveNext(); - } - - $this->checkConsecutiveDots(); - $this->checkDomainPartExceptions($prev); - - if ($this->hasBrackets()) { - $this->parseDomainLiteral(); - } - - $this->checkLabelLength($prev); - - if ($this->isFWS()) { - $this->parseFWS(); - } - - $domain .= $this->lexer->token['value']; - $this->lexer->moveNext(); - } while ($this->lexer->token); - - return $domain; - } - - protected function parseDomainLiteral() - { - if ($this->lexer->isNextToken(EmailLexer::S_COLON)) { - $this->warnings[] = EmailValidator::RFC5322_IPV6_COLONSTRT; - } - if ($this->lexer->isNextToken(EmailLexer::S_IPV6TAG)) { - $lexer = clone $this->lexer; - $lexer->moveNext(); - if ($lexer->isNextToken(EmailLexer::S_DOUBLECOLON)) { - $this->warnings[] = EmailValidator::RFC5322_IPV6_COLONSTRT; - } - } - - return $this->doParseDomainLiteral(); - } - - protected function doParseDomainLiteral() - { - $IPv6TAG = false; - $addressLiteral = ''; - do { - if ($this->lexer->token['type'] === EmailLexer::C_NUL) { - throw new \InvalidArgumentException('ERR_EXPECTING_DTEXT'); - } - - if ($this->lexer->token['type'] === EmailLexer::INVALID || - $this->lexer->token['type'] === EmailLexer::C_DEL || - $this->lexer->token['type'] === EmailLexer::S_LF - ) { - $this->warnings[] = EmailValidator::RFC5322_DOMLIT_OBSDTEXT; - } - - if ($this->lexer->isNextTokenAny(array(EmailLexer::S_OPENQBRACKET, EmailLexer::S_OPENBRACKET))) { - throw new \InvalidArgumentException('ERR_EXPECTING_DTEXT'); - } - - if ($this->lexer->isNextTokenAny( - array(EmailLexer::S_HTAB, EmailLexer::S_SP, $this->lexer->token['type'] === EmailLexer::CRLF) - )) { - $this->warnings[] = EmailValidator::CFWS_FWS; - $this->parseFWS(); - } - - if ($this->lexer->isNextToken(EmailLexer::S_CR)) { - throw new \InvalidArgumentException("ERR_CR_NO_LF"); - } - if ($this->lexer->token['type'] === EmailLexer::S_BACKSLASH) { - $this->warnings[] = EmailValidator::RFC5322_DOMLIT_OBSDTEXT; - $addressLiteral .= $this->lexer->token['value']; - $this->lexer->moveNext(); - $this->validateQuotedPair(); - } - if ($this->lexer->token['type'] === EmailLexer::S_IPV6TAG) { - $IPv6TAG = true; - } - if ($this->lexer->token['type'] === EmailLexer::S_CLOSEQBRACKET) { - break; - } - - $addressLiteral .= $this->lexer->token['value']; - - } while ($this->lexer->moveNext()); - - $addressLiteral = str_replace('[', '', $addressLiteral); - $addressLiteral = $this->checkIPV4Tag($addressLiteral); - - if (false === $addressLiteral) { - return $addressLiteral; - } - - if (!$IPv6TAG) { - $this->warnings[] = EmailValidator::RFC5322_DOMAINLITERAL; - return $addressLiteral; - } - - $this->warnings[] = EmailValidator::RFC5321_ADDRESSLITERAL; - - $this->checkIPV6Tag($addressLiteral); - - return $addressLiteral; - } - - /** - * @param string $addressLiteral - */ - protected function checkIPV4Tag($addressLiteral) - { - $matchesIP = array(); - - // Extract IPv4 part from the end of the address-literal (if there is one) - if (preg_match( - '/\\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/', - $addressLiteral, - $matchesIP - ) > 0 - ) { - $index = strrpos($addressLiteral, $matchesIP[0]); - if ($index === 0) { - $this->warnings[] = EmailValidator::RFC5321_ADDRESSLITERAL; - return false; - } - // Convert IPv4 part to IPv6 format for further testing - $addressLiteral = substr($addressLiteral, 0, $index) . '0:0'; - } - - return $addressLiteral; - } - - protected function checkDomainPartExceptions($prev) - { - if ($this->lexer->token['type'] === EmailLexer::S_COMMA) { - throw new \InvalidArgumentException('ERR_COMMA_IN_DOMAIN'); - } - - if ($this->lexer->token['type'] === EmailLexer::S_AT) { - throw new \InvalidArgumentException('ERR_CONSECUTIVEATS'); - } - - if ($this->lexer->token['type'] === EmailLexer::S_OPENQBRACKET && $prev['type'] !== EmailLexer::S_AT) { - throw new \InvalidArgumentException('ERR_EXPECTING_ATEXT'); - } - - if ($this->lexer->token['type'] === EmailLexer::S_HYPHEN && $this->lexer->isNextToken(EmailLexer::S_DOT)) { - throw new \InvalidArgumentException('ERR_DOMAINHYPHENEND'); - } - - if ($this->lexer->token['type'] === EmailLexer::S_BACKSLASH - && $this->lexer->isNextToken(EmailLexer::GENERIC)) { - throw new \InvalidArgumentException('ERR_EXPECTING_ATEXT'); - } - } - - protected function hasBrackets() - { - if ($this->lexer->token['type'] !== EmailLexer::S_OPENBRACKET) { - return false; - } - - try { - $this->lexer->find(EmailLexer::S_CLOSEBRACKET); - } catch (\RuntimeException $e) { - throw new \InvalidArgumentException('ERR_EXPECTING_DOMLIT_CLOSE'); - } - - return true; - } - - protected function checkLabelLength($prev) - { - if ($this->lexer->token['type'] === EmailLexer::S_DOT && - $prev['type'] === EmailLexer::GENERIC && - strlen($prev['value']) > 63 - ) { - $this->warnings[] = EmailValidator::RFC5322_LABEL_TOOLONG; - } - } - - protected function parseDomainComments() - { - $this->isUnclosedComment(); - while (!$this->lexer->isNextToken(EmailLexer::S_CLOSEPARENTHESIS)) { - $this->warnEscaping(); - $this->lexer->moveNext(); - } - - $this->lexer->moveNext(); - if ($this->lexer->isNextToken(EmailLexer::S_DOT)) { - throw new \InvalidArgumentException('ERR_EXPECTING_ATEXT'); - } - } -} diff --git a/core/vendor/egulias/email-validator/src/Egulias/EmailValidator/Parser/LocalPart.php b/core/vendor/egulias/email-validator/src/Egulias/EmailValidator/Parser/LocalPart.php deleted file mode 100644 index 4db0ea6..0000000 --- a/core/vendor/egulias/email-validator/src/Egulias/EmailValidator/Parser/LocalPart.php +++ /dev/null @@ -1,122 +0,0 @@ -lexer->token['type'] !== EmailLexer::S_AT && $this->lexer->token) { - - if ($this->lexer->token['type'] === EmailLexer::S_DOT && !$this->lexer->getPrevious()) { - throw new \InvalidArgumentException('ERR_DOT_START'); - } - - $closingQuote = $this->checkDQUOTE($closingQuote); - if ($closingQuote && $parseDQuote) { - $parseDQuote = $this->parseDoubleQuote(); - } - - if ($this->lexer->token['type'] === EmailLexer::S_OPENPARENTHESIS) { - $this->parseComments(); - } - - $this->checkConsecutiveDots(); - - if ( - $this->lexer->token['type'] === EmailLexer::S_DOT && - $this->lexer->isNextToken(EmailLexer::S_AT) - ) { - throw new \InvalidArgumentException('ERR_DOT_END'); - } - - $this->warnEscaping(); - $this->isInvalidToken($this->lexer->token, $closingQuote); - - if ($this->isFWS()) { - $this->parseFWS(); - } - - $this->lexer->moveNext(); - } - - $prev = $this->lexer->getPrevious(); - if (strlen($prev['value']) > EmailValidator::RFC5322_LOCAL_TOOLONG) { - $this->warnings[] = EmailValidator::RFC5322_LOCAL_TOOLONG; - } - } - - protected function parseDoubleQuote() - { - $parseAgain = true; - $special = array( - EmailLexer::S_CR => true, - EmailLexer::S_HTAB => true, - EmailLexer::S_LF => true - ); - - $invalid = array( - EmailLexer::C_NUL => true, - EmailLexer::S_HTAB => true, - EmailLexer::S_CR => true, - EmailLexer::S_LF => true - ); - $setSpecialsWarning = true; - - $this->lexer->moveNext(); - - while ($this->lexer->token['type'] !== EmailLexer::S_DQUOTE && $this->lexer->token) { - $parseAgain = false; - if (isset($special[$this->lexer->token['type']]) && $setSpecialsWarning) { - $this->warnings[] = EmailValidator::CFWS_FWS; - $setSpecialsWarning = false; - } - - $this->lexer->moveNext(); - - if (!$this->escaped() && isset($invalid[$this->lexer->token['type']])) { - throw new InvalidArgumentException("ERR_EXPECTED_ATEXT"); - } - } - - $prev = $this->lexer->getPrevious(); - - if ($prev['type'] === EmailLexer::S_BACKSLASH) { - if (!$this->checkDQUOTE(false)) { - throw new \InvalidArgumentException("ERR_UNCLOSED_DQUOTE"); - } - } - - if (!$this->lexer->isNextToken(EmailLexer::S_AT) && $prev['type'] !== EmailLexer::S_BACKSLASH) { - throw new \InvalidArgumentException("ERR_EXPECED_AT"); - } - - return $parseAgain; - } - - protected function isInvalidToken($token, $closingQuote) - { - $forbidden = array( - EmailLexer::S_COMMA, - EmailLexer::S_CLOSEBRACKET, - EmailLexer::S_OPENBRACKET, - EmailLexer::S_GREATERTHAN, - EmailLexer::S_LOWERTHAN, - EmailLexer::S_COLON, - EmailLexer::S_SEMICOLON, - EmailLexer::INVALID - ); - - if (in_array($token['type'], $forbidden) && !$closingQuote) { - throw new \InvalidArgumentException('ERR_EXPECTING_ATEXT'); - } - } -} diff --git a/core/vendor/egulias/email-validator/src/Egulias/EmailValidator/Parser/Parser.php b/core/vendor/egulias/email-validator/src/Egulias/EmailValidator/Parser/Parser.php deleted file mode 100644 index b66279e..0000000 --- a/core/vendor/egulias/email-validator/src/Egulias/EmailValidator/Parser/Parser.php +++ /dev/null @@ -1,190 +0,0 @@ -lexer = $lexer; - } - - public function getWarnings() - { - return $this->warnings; - } - - abstract function parse($str); - - /** - * validateQuotedPair - */ - protected function validateQuotedPair() - { - if (!($this->lexer->token['type'] === EmailLexer::INVALID - || $this->lexer->token['type'] === EmailLexer::C_DEL)) { - throw new \InvalidArgumentException('ERR_EXPECTING_QPAIR'); - } - - $this->warnings[] = EmailValidator::DEPREC_QP; - } - - /** - * @return string the the comment - * @throws \InvalidArgumentException - */ - protected function parseComments() - { - $this->isUnclosedComment(); - $this->warnings[] = EmailValidator::CFWS_COMMENT; - while (!$this->lexer->isNextToken(EmailLexer::S_CLOSEPARENTHESIS)) { - $this->warnEscaping(); - $this->lexer->moveNext(); - } - - $this->lexer->moveNext(); - if ($this->lexer->isNextTokenAny(array(EmailLexer::GENERIC, EmailLexer::S_EMPTY))) { - throw new \InvalidArgumentException('ERR_EXPECTING_ATEXT'); - } - - if ($this->lexer->isNextToken(EmailLexer::S_AT)) { - $this->warnings[] = EmailValidator::DEPREC_CFWS_NEAR_AT; - } - } - - protected function isUnclosedComment() - { - try { - $this->lexer->find(EmailLexer::S_CLOSEPARENTHESIS); - return true; - } catch (\RuntimeException $e) { - throw new \InvalidArgumentException('ERR_UNCLOSEDCOMMENT'); - } - } - - protected function parseFWS() - { - $previous = $this->lexer->getPrevious(); - - $this->checkCRLFInFWS(); - - if ($this->lexer->token['type'] === EmailLexer::S_CR) { - throw new \InvalidArgumentException("ERR_CR_NO_LF"); - } - - if ($this->lexer->isNextToken(EmailLexer::GENERIC) && $previous['type'] !== EmailLexer::S_AT) { - throw new \InvalidArgumentException("ERR_ATEXT_AFTER_CFWS"); - } - - if ($this->lexer->token['type'] === EmailLexer::S_LF || $this->lexer->token['type'] === EmailLexer::C_NUL) { - throw new \InvalidArgumentException('ERR_EXPECTING_CTEXT'); - } - - if ($this->lexer->isNextToken(EmailLexer::S_AT) || $previous['type'] === EmailLexer::S_AT) { - $this->warnings[] = EmailValidator::DEPREC_CFWS_NEAR_AT; - } else { - $this->warnings[] = EmailValidator::CFWS_FWS; - } - } - - protected function checkConsecutiveDots() - { - if ($this->lexer->token['type'] === EmailLexer::S_DOT && $this->lexer->isNextToken(EmailLexer::S_DOT)) { - throw new \InvalidArgumentException('ERR_CONSECUTIVEDOTS'); - } - } - - protected function isFWS() - { - if ($this->escaped()) { - return false; - } - - if ($this->lexer->token['type'] === EmailLexer::S_SP || - $this->lexer->token['type'] === EmailLexer::S_HTAB || - $this->lexer->token['type'] === EmailLexer::S_CR || - $this->lexer->token['type'] === EmailLexer::S_LF || - $this->lexer->token['type'] === EmailLexer::CRLF - ) { - return true; - } - - return false; - } - - protected function escaped() - { - $previous = $this->lexer->getPrevious(); - - if ($previous['type'] === EmailLexer::S_BACKSLASH - && - $this->lexer->token['type'] !== EmailLexer::GENERIC - ) { - return true; - } - - return false; - } - - protected function warnEscaping() - { - if ($this->lexer->token['type'] !== EmailLexer::S_BACKSLASH) { - return false; - } - - if ($this->lexer->isNextToken(EmailLexer::GENERIC)) { - throw new \InvalidArgumentException('ERR_EXPECTING_ATEXT'); - } - - if (!$this->lexer->isNextTokenAny(array(EmailLexer::S_SP, EmailLexer::S_HTAB, EmailLexer::C_DEL))) { - return false; - } - - $this->warnings[] = EmailValidator::DEPREC_QP; - return true; - - } - - protected function checkDQUOTE($hasClosingQuote) - { - if ($this->lexer->token['type'] !== EmailLexer::S_DQUOTE) { - return $hasClosingQuote; - } - if ($hasClosingQuote) { - return $hasClosingQuote; - } - $previous = $this->lexer->getPrevious(); - if ($this->lexer->isNextToken(EmailLexer::GENERIC) && $previous['type'] === EmailLexer::GENERIC) { - throw new \InvalidArgumentException('ERR_EXPECTING_ATEXT'); - } - - $this->warnings[] = EmailValidator::RFC5321_QUOTEDSTRING; - try { - $this->lexer->find(EmailLexer::S_DQUOTE); - $hasClosingQuote = true; - } catch (\Exception $e) { - throw new \InvalidArgumentException('ERR_UNCLOSEDQUOTEDSTR'); - } - - return $hasClosingQuote; - } - - protected function checkCRLFInFWS() - { - if ($this->lexer->token['type'] !== EmailLexer::CRLF) { - return; - } - if ($this->lexer->isNextToken(EmailLexer::CRLF)) { - throw new \InvalidArgumentException("ERR_FWS_CRLF_X2"); - } - if (!$this->lexer->isNextTokenAny(array(EmailLexer::S_SP, EmailLexer::S_HTAB))) { - throw new \InvalidArgumentException("ERR_FWS_CRLF_END"); - } - } -} diff --git a/core/vendor/egulias/email-validator/tests/bootstrap.php b/core/vendor/egulias/email-validator/tests/bootstrap.php deleted file mode 100644 index 676c4b1..0000000 --- a/core/vendor/egulias/email-validator/tests/bootstrap.php +++ /dev/null @@ -1,8 +0,0 @@ -isValid($testingMail); -} -$b = microtime(true); -echo ($b - $a) . ' seconds with EmailValidator + instantiation' . PHP_EOL; - -$a = microtime(true); -$validator = new EmailValidator(); -for ($i = 0; $i < $iterations; $i++) { - $isValid = $validator->isValid($testingMail); -} -$b = microtime(true); -echo ($b - $a) . ' seconds with EmailValidator once instanced' . PHP_EOL; diff --git a/core/vendor/egulias/email-validator/tests/egulias/Performance/AgainstOldIsemail.php b/core/vendor/egulias/email-validator/tests/egulias/Performance/AgainstOldIsemail.php deleted file mode 100644 index 99476c1..0000000 --- a/core/vendor/egulias/email-validator/tests/egulias/Performance/AgainstOldIsemail.php +++ /dev/null @@ -1,34 +0,0 @@ -isValid($testingMail); -} -$b = microtime(true); -echo ($b - $a) . ' seconds with EmailValidator + instantiation' . PHP_EOL; - -$a = microtime(true); -$validator = new EmailValidator(); -for ($i = 0; $i < $iterations; $i++) { - $isValid = $validator->isValid($testingMail); -} -$b = microtime(true); -echo ($b - $a) . ' seconds with EmailValidator once instanced' . PHP_EOL; diff --git a/core/vendor/egulias/email-validator/tests/egulias/Tests/EmailValidator/EmailLexerTest.php b/core/vendor/egulias/email-validator/tests/egulias/Tests/EmailValidator/EmailLexerTest.php deleted file mode 100644 index 4af771c..0000000 --- a/core/vendor/egulias/email-validator/tests/egulias/Tests/EmailValidator/EmailLexerTest.php +++ /dev/null @@ -1,92 +0,0 @@ -assertInstanceOf('Doctrine\Common\Lexer\AbstractLexer', $lexer); - } - - /** - * @dataProvider getTokens - * - */ - public function testLexerTokens($str, $token) - { - $lexer = new EmailLexer(); - $lexer->setInput($str); - $lexer->moveNext(); - $lexer->moveNext(); - $this->assertEquals($token, $lexer->token['type']); - } - - public function testLexerForTab() - { - $lexer = new EmailLexer(); - $lexer->setInput("foo\tbar"); - $lexer->moveNext(); - $lexer->skipUntil(EmailLexer::S_HTAB); - $lexer->moveNext(); - $this->assertEquals(EmailLexer::S_HTAB, $lexer->token['type']); - } - - public function testLexerSearchToken() - { - $lexer = new EmailLexer(); - $lexer->setInput("foo\tbar"); - $lexer->moveNext(); - $this->assertTrue($lexer->find(EmailLexer::S_HTAB)); - } - - public function testLexerHasInvalidTokens() - { - $lexer = new EmailLexer(); - $lexer->setInput(chr(226)); - $lexer->moveNext(); - $lexer->moveNext(); - $this->assertTrue($lexer->hasInvalidTokens()); - } - - public function getTokens() - { - return array( - array("foo", EmailLexer::GENERIC), - array("\r", EmailLexer::S_CR), - array("\t", EmailLexer::S_HTAB), - array("\r\n", EmailLexer::CRLF), - array("\n", EmailLexer::S_LF), - array(" ", EmailLexer::S_SP), - array("@", EmailLexer::S_AT), - array("IPv6", EmailLexer::S_IPV6TAG), - array("::", EmailLexer::S_DOUBLECOLON), - array(":", EmailLexer::S_COLON), - array(".", EmailLexer::S_DOT), - array("\"", EmailLexer::S_DQUOTE), - array("-", EmailLexer::S_HYPHEN), - array("\\", EmailLexer::S_BACKSLASH), - array("/", EmailLexer::S_SLASH), - array("(", EmailLexer::S_OPENPARENTHESIS), - array(")", EmailLexer::S_CLOSEPARENTHESIS), - array('<', EmailLexer::S_LOWERTHAN), - array('>', EmailLexer::S_GREATERTHAN), - array('[', EmailLexer::S_OPENBRACKET), - array(']', EmailLexer::S_CLOSEBRACKET), - array(';', EmailLexer::S_SEMICOLON), - array(',', EmailLexer::S_COMMA), - array('<', EmailLexer::S_LOWERTHAN), - array('>', EmailLexer::S_GREATERTHAN), - array('{', EmailLexer::S_OPENQBRACKET), - array('}', EmailLexer::S_CLOSEQBRACKET), - array('', EmailLexer::S_EMPTY), - array(chr(31), EmailLexer::INVALID), - array(chr(226), EmailLexer::INVALID), - array(chr(0), EmailLexer::C_NUL) - ); - } -} diff --git a/core/vendor/egulias/email-validator/tests/egulias/Tests/EmailValidator/EmailValidatorTest.php b/core/vendor/egulias/email-validator/tests/egulias/Tests/EmailValidator/EmailValidatorTest.php deleted file mode 100644 index e72fde4..0000000 --- a/core/vendor/egulias/email-validator/tests/egulias/Tests/EmailValidator/EmailValidatorTest.php +++ /dev/null @@ -1,327 +0,0 @@ -validator = new EmailValidator(); - } - - protected function tearDown() - { - $this->validator = null; - } - - /** - * @dataProvider getValidEmails - */ - public function testValidEmails($email) - { - $this->assertTrue($this->validator->isValid($email)); - } - - public function getValidEmails() - { - return array( - array('fabien@symfony.com'), - array('example@example.co.uk'), - array('fabien_potencier@example.fr'), - array('example@localhost'), - array('fab\'ien@symfony.com'), - array('fab\ ien@symfony.com'), - array('example((example))@fakedfake.co.uk'), - array('example@faked(fake).co.uk'), - array('fabien+@symfony.com'), - array('инфо@письмо.рф'), - array('"username"@example.com'), - array('"user,name"@example.com'), - array('"user name"@example.com'), - array('"user@name"@example.com'), - array('"\a"@iana.org'), - array('"test\ test"@iana.org'), - array('""@iana.org'), - array('"\""@iana.org'), - ); - } - - /** - * @dataProvider getInvalidEmails - */ - public function testInvalidEmails($email) - { - $this->assertFalse($this->validator->isValid($email)); - } - - public function getInvalidEmails() - { - return array( - - array('example.@example.co.uk'), - array('example@example@example.co.uk'), - array('(test_exampel@example.fr)'), - array('example(example)example@example.co.uk'), - array('.example@localhost'), - array('ex\ample@localhost'), - array('example@local\host'), - array('example@localhost.'), - array('user name@example.com'), - array('username@ example . com'), - array('example@(fake).com'), - array('example@(fake.com'), - array('username@example,com'), - array('usern,ame@example.com'), - array('user[na]me@example.com'), - array('"""@iana.org'), - array('"\"@iana.org'), - array('"test"test@iana.org'), - array('"test""test"@iana.org'), - array('"test"."test"@iana.org'), - array('"test".test@iana.org'), - array('"test"' . chr(0) . '@iana.org'), - array('"test\"@iana.org'), - array(chr(226) . '@iana.org'), - array('test@' . chr(226) . '.org'), - array('\r\ntest@iana.org'), - array('\r\n test@iana.org'), - array('\r\n \r\ntest@iana.org'), - array('\r\n \r\ntest@iana.org'), - array('\r\n \r\n test@iana.org'), - array('test@iana.org \r\n'), - array('test@iana.org \r\n '), - array('test@iana.org \r\n \r\n'), - array('test@iana.org \r\n\r\n'), - array('test@iana.org \r\n\r\n '), - array('test@iana/icann.org'), - ); - } - - /** - * @dataProvider getInvalidEmailsWithErrors - */ - public function testInvalidEmailsWithErrorsCheck($errors, $email) - { - $this->assertFalse($this->validator->isValid($email)); - - $this->assertEquals($errors, $this->validator->getError()); - } - - public function getInvalidEmailsWithErrors() - { - return array( - array(EmailValidator::ERR_NOLOCALPART, '@example.co.uk'), - array(EmailValidator::ERR_NODOMAIN, 'example@'), - array(EmailValidator::ERR_DOMAINHYPHENEND, 'example@example-.co.uk'), - array(EmailValidator::ERR_DOMAINHYPHENEND, 'example@example-'), - array(EmailValidator::ERR_CONSECUTIVEATS, 'example@@example.co.uk'), - array(EmailValidator::ERR_CONSECUTIVEDOTS, 'example..example@example.co.uk'), - array(EmailValidator::ERR_CONSECUTIVEDOTS, 'example@example..co.uk'), - array(EmailValidator::ERR_EXPECTING_ATEXT, '@example.fr'), - array(EmailValidator::ERR_DOT_START, '.example@localhost'), - array(EmailValidator::ERR_DOT_START, 'example@.localhost'), - array(EmailValidator::ERR_DOT_END, 'example@localhost.'), - array(EmailValidator::ERR_DOT_END, 'example.@example.co.uk'), - array(EmailValidator::ERR_UNCLOSEDCOMMENT, '(example@localhost'), - array(EmailValidator::ERR_UNCLOSEDQUOTEDSTR, '"example@localhost'), - array(EmailValidator::ERR_EXPECTING_ATEXT, 'exa"mple@localhost'), - //This was the original. But atext is not allowed after \n - //array(EmailValidator::ERR_EXPECTING_ATEXT, "exampl\ne@example.co.uk"), - array(EmailValidator::ERR_ATEXT_AFTER_CFWS, "exampl\ne@example.co.uk"), - array(EmailValidator::ERR_EXPECTING_DTEXT, "example@[[]"), - array(EmailValidator::ERR_ATEXT_AFTER_CFWS, "exampl\te@example.co.uk"), - array(EmailValidator::ERR_CR_NO_LF, "example@exa\rmple.co.uk"), - array(EmailValidator::ERR_CR_NO_LF, "example@[\r]"), - array(EmailValidator::ERR_CR_NO_LF, "exam\rple@example.co.uk"), - ); - } - - /** - * @dataProvider getInvalidEmailsWithWarnings - */ - public function testValidEmailsWithWarningsCheck($warnings, $email) - { - $this->assertTrue($this->validator->isValid($email, true)); - - $this->assertEquals($warnings, $this->validator->getWarnings()); - } - - /** - * @dataProvider getInvalidEmailsWithWarnings - */ - public function testInvalidEmailsWithDnsCheckAndStrictMode($warnings, $email) - { - $this->assertFalse($this->validator->isValid($email, true, true)); - - $this->assertEquals($warnings, $this->validator->getWarnings()); - } - - public function getInvalidEmailsWithWarnings() - { - return array( - array(array( EmailValidator::DEPREC_CFWS_NEAR_AT,), 'example @example.co.uk'), - array(array( EmailValidator::DEPREC_CFWS_NEAR_AT,), 'example@ example.co.uk'), - array(array( EmailValidator::CFWS_COMMENT,), 'example@example(examplecomment).co.uk'), - array( - array( - EmailValidator::CFWS_COMMENT, - EmailValidator::DEPREC_CFWS_NEAR_AT, - ), - 'example(examplecomment)@example.co.uk' - ), - array( - array( - EmailValidator::RFC5321_QUOTEDSTRING, - EmailValidator::CFWS_FWS, - ), - "\"\t\"@example.co.uk" - ), - array( - array( - EmailValidator::RFC5321_QUOTEDSTRING, - EmailValidator::CFWS_FWS, - ), - "\"\r\"@example.co.uk" - ), - array( - array( - EmailValidator::RFC5321_ADDRESSLITERAL, - EmailValidator::DNSWARN_NO_RECORD, - ), - 'example@[127.0.0.1]' - ), - array( - array( - EmailValidator::RFC5321_ADDRESSLITERAL, - EmailValidator::DNSWARN_NO_RECORD, - ), - 'example@[IPv6:2001:0db8:85a3:0000:0000:8a2e:0370:7334]' - ), - array( - array( - EmailValidator::RFC5321_ADDRESSLITERAL, - EmailValidator::RFC5321_IPV6DEPRECATED, - EmailValidator::DNSWARN_NO_RECORD, - ), - 'example@[IPv6:2001:0db8:85a3:0000:0000:8a2e:0370::]' - ), - array( - array( - EmailValidator::RFC5321_ADDRESSLITERAL, - EmailValidator::RFC5322_IPV6_MAXGRPS, - EmailValidator::DNSWARN_NO_RECORD, - ), - 'example@[IPv6:2001:0db8:85a3:0000:0000:8a2e:0370:7334::]' - ), - array( - array( - EmailValidator::RFC5321_ADDRESSLITERAL, - EmailValidator::RFC5322_IPV6_2X2XCOLON, - EmailValidator::DNSWARN_NO_RECORD, - ), - 'example@[IPv6:1::1::1]' - ), - array( - array( - EmailValidator::RFC5322_DOMLIT_OBSDTEXT, - EmailValidator::RFC5322_DOMAINLITERAL, - EmailValidator::DNSWARN_NO_RECORD, - ), - "example@[\n]" - ), - array( - array( - EmailValidator::RFC5322_DOMAINLITERAL, - EmailValidator::DNSWARN_NO_RECORD, - ), - 'example@[::1]' - ), - array( - array( - EmailValidator::RFC5322_DOMAINLITERAL, - EmailValidator::DNSWARN_NO_RECORD, - ), - 'example@[::123.45.67.178]' - ), - array( - array( - EmailValidator::RFC5322_IPV6_COLONSTRT, - EmailValidator::RFC5321_ADDRESSLITERAL, - EmailValidator::RFC5322_IPV6_GRPCOUNT, - EmailValidator::DNSWARN_NO_RECORD, - ), - 'example@[IPv6::2001:0db8:85a3:0000:0000:8a2e:0370:7334]' - ), - array( - array( - EmailValidator::RFC5321_ADDRESSLITERAL, - EmailValidator::RFC5322_IPV6_BADCHAR, - EmailValidator::DNSWARN_NO_RECORD, - ), - 'example@[IPv6:z001:0db8:85a3:0000:0000:8a2e:0370:7334]' - ), - array( - array( - EmailValidator::RFC5321_ADDRESSLITERAL, - EmailValidator::RFC5322_IPV6_COLONEND, - EmailValidator::DNSWARN_NO_RECORD, - ), - 'example@[IPv6:2001:0db8:85a3:0000:0000:8a2e:0370:]' - ), - array( - array( - EmailValidator::RFC5321_QUOTEDSTRING, - ), - '"example"@example.co.uk' - ), - array( - array( - EmailValidator::RFC5322_LOCAL_TOOLONG, - ), - 'too_long_localpart_too_long_localpart_too_long_localpart_too_long_localpart@example.co.uk' - ), - array( - array( - EmailValidator::RFC5322_LABEL_TOOLONG, - EmailValidator::DNSWARN_NO_RECORD, - ), - 'example@toolonglocalparttoolonglocalparttoolonglocalparttoolonglocalpart.co.uk' - ), - array( - array( - EmailValidator::RFC5322_DOMAIN_TOOLONG, - EmailValidator::RFC5322_TOOLONG, - EmailValidator::DNSWARN_NO_RECORD, - ), - 'example@toolonglocalparttoolonglocalparttoolonglocalparttoolonglocalparttoolonglocalparttoolonglocal'. - 'parttoolonglocalparttoolonglocalparttoolonglocalparttoolonglocalparttoolonglocalparttoolonglocalpart'. - 'toolonglocalparttoolonglocalparttoolonglocalparttoolonglocalpart' - ), - array( - array( - EmailValidator::RFC5322_DOMAIN_TOOLONG, - EmailValidator::RFC5322_TOOLONG, - EmailValidator::DNSWARN_NO_RECORD, - ), - 'example@toolonglocalparttoolonglocalparttoolonglocalparttoolonglocalparttoolonglocalparttoolonglocal'. - 'parttoolonglocalparttoolonglocalparttoolonglocalparttoolonglocalparttoolonglocalparttoolonglocalpart'. - 'toolonglocalparttoolonglocalparttoolonglocalparttoolonglocalpar' - ), - array( - array( - EmailValidator::DNSWARN_NO_RECORD, - ), - 'test@test' - ), - ); - } - - public function testInvalidEmailsWithStrict() - { - $this->assertFalse($this->validator->isValid('"test"@test', false, true)); - } -} diff --git a/core/vendor/fabpot/goutte/.gitignore b/core/vendor/fabpot/goutte/.gitignore deleted file mode 100644 index 81b9258..0000000 --- a/core/vendor/fabpot/goutte/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -composer.lock -phpunit.xml -vendor diff --git a/core/vendor/fabpot/goutte/.travis.yml b/core/vendor/fabpot/goutte/.travis.yml deleted file mode 100644 index 66cf320..0000000 --- a/core/vendor/fabpot/goutte/.travis.yml +++ /dev/null @@ -1,17 +0,0 @@ -language: php - -php: - - 5.6 - - 5.5 - - 5.4 - - hhvm - -install: - - travis_retry composer install --no-interaction --prefer-source - -script: - - phpunit - -matrix: - allow_failures: - - php: hhvm diff --git a/core/vendor/fabpot/goutte/Goutte/Client.php b/core/vendor/fabpot/goutte/Goutte/Client.php deleted file mode 100644 index cde3ea3..0000000 --- a/core/vendor/fabpot/goutte/Goutte/Client.php +++ /dev/null @@ -1,171 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Goutte; - -use GuzzleHttp\Client as GuzzleClient; -use GuzzleHttp\ClientInterface as GuzzleClientInterface; -use GuzzleHttp\Exception\RequestException; -use GuzzleHttp\Message\RequestInterface; -use GuzzleHttp\Message\Response as GuzzleResponse; -use GuzzleHttp\Post\PostFile; -use Symfony\Component\BrowserKit\Client as BaseClient; -use Symfony\Component\BrowserKit\Response; - -/** - * Client. - * - * @author Fabien Potencier - * @author Michael Dowling - */ -class Client extends BaseClient -{ - protected $client; - - private $headers = array(); - private $auth = null; - - public function setClient(GuzzleClientInterface $client) - { - $this->client = $client; - - return $this; - } - - public function getClient() - { - if (!$this->client) { - $this->client = new GuzzleClient(array('defaults' => array('allow_redirects' => false, 'cookies' => true))); - } - - return $this->client; - } - - public function setHeader($name, $value) - { - $this->headers[$name] = $value; - - return $this; - } - - public function removeHeader($name) - { - unset($this->headers[$name]); - } - - public function setAuth($user, $password = '', $type = 'basic') - { - $this->auth = array($user, $password, $type); - - return $this; - } - - public function resetAuth() - { - $this->auth = null; - - return $this; - } - - protected function doRequest($request) - { - $headers = array(); - foreach ($request->getServer() as $key => $val) { - $key = strtolower(str_replace('_', '-', $key)); - $contentHeaders = array('content-length' => true, 'content-md5' => true, 'content-type' => true); - if (0 === strpos($key, 'http-')) { - $headers[substr($key, 5)] = $val; - } - // CONTENT_* are not prefixed with HTTP_ - elseif (isset($contentHeaders[$key])) { - $headers[$key] = $val; - } - } - - $body = null; - if (!in_array($request->getMethod(), array('GET', 'HEAD'))) { - if (null !== $request->getContent()) { - $body = $request->getContent(); - } else { - $body = $request->getParameters(); - } - } - - $this->getClient()->setDefaultOption('auth', $this->auth); - - $requestOptions = array( - 'body' => $body, - 'cookies' => $this->getCookieJar()->allRawValues($request->getUri()), - 'allow_redirects' => false, - 'timeout' => 30, - ); - - if (!empty($headers)) { - $requestOptions['headers'] = $headers; - } - - $guzzleRequest = $this->getClient()->createRequest( - $request->getMethod(), - $request->getUri(), - $requestOptions - ); - - foreach ($this->headers as $name => $value) { - $guzzleRequest->setHeader($name, $value); - } - - if ('POST' == $request->getMethod() || 'PUT' == $request->getMethod()) { - $this->addPostFiles($guzzleRequest, $request->getFiles()); - } - - // Let BrowserKit handle redirects - try { - $response = $this->getClient()->send($guzzleRequest); - } catch (RequestException $e) { - $response = $e->getResponse(); - if (null === $response) { - throw $e; - } - } - - return $this->createResponse($response); - } - - protected function addPostFiles(RequestInterface $request, array $files, $arrayName = '') - { - foreach ($files as $name => $info) { - if (!empty($arrayName)) { - $name = $arrayName.'['.$name.']'; - } - - if (is_array($info)) { - if (isset($info['tmp_name'])) { - if ('' !== $info['tmp_name']) { - $request->getBody()->addFile(new PostFile($name, fopen($info['tmp_name'], 'r'), isset($info['name']) ? $info['name'] : null)); - } else { - continue; - } - } else { - $this->addPostFiles($request, $info, $name); - } - } else { - $request->getBody()->addFile(new PostFile($name, fopen($info, 'r'))); - } - } - } - - protected function createResponse(GuzzleResponse $response) - { - $headers = $response->getHeaders(); - - return new Response($response->getBody(true), $response->getStatusCode(), $headers); - } -} diff --git a/core/vendor/fabpot/goutte/Goutte/Resources/phar-stub.php b/core/vendor/fabpot/goutte/Goutte/Resources/phar-stub.php deleted file mode 100644 index b9c3b44..0000000 --- a/core/vendor/fabpot/goutte/Goutte/Resources/phar-stub.php +++ /dev/null @@ -1,14 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -require_once 'phar://'.__FILE__.'/vendor/autoload.php'; - -__HALT_COMPILER(); diff --git a/core/vendor/fabpot/goutte/Goutte/Tests/ClientTest.php b/core/vendor/fabpot/goutte/Goutte/Tests/ClientTest.php deleted file mode 100644 index da2e47c..0000000 --- a/core/vendor/fabpot/goutte/Goutte/Tests/ClientTest.php +++ /dev/null @@ -1,319 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Goutte\Tests; - -use Goutte\Client; -use GuzzleHttp\Client as GuzzleClient; -use GuzzleHttp\Exception\RequestException; -use GuzzleHttp\Message\Response as GuzzleResponse; -use GuzzleHttp\Stream\Stream; -use GuzzleHttp\Subscriber\History; -use GuzzleHttp\Subscriber\Mock; -use GuzzleHttp\Post\PostFile; -use Symfony\Component\BrowserKit\Cookie; - -/** - * Goutte Client Test - * - * @author Michael Dowling - */ -class ClientTest extends \PHPUnit_Framework_TestCase -{ - protected $history; - protected $mock; - - protected function getGuzzle() - { - $this->history = new History(); - $this->mock = new Mock(); - $this->mock->addResponse(new GuzzleResponse(200, array(), Stream::factory('

Hi

'))); - $guzzle = new GuzzleClient(array('redirect.disable' => true, 'base_url' => '')); - $guzzle->getEmitter()->attach($this->mock); - $guzzle->getEmitter()->attach($this->history); - - return $guzzle; - } - - public function testCreatesDefaultClient() - { - $client = new Client(); - $this->assertInstanceOf('GuzzleHttp\\ClientInterface', $client->getClient()); - } - - public function testUsesCustomClient() - { - $guzzle = new GuzzleClient(); - $client = new Client(); - $this->assertSame($client, $client->setClient($guzzle)); - $this->assertSame($guzzle, $client->getClient()); - } - - public function testUsesCustomHeaders() - { - $guzzle = $this->getGuzzle(); - $client = new Client(); - $client->setClient($guzzle); - $client->setHeader('X-Test', 'test'); - $crawler = $client->request('GET', 'http://www.example.com/'); - $this->assertEquals('test', $this->history->getLastRequest()->getHeader('X-Test')); - } - - public function testCustomUserAgent() - { - $guzzle = $this->getGuzzle(); - $client = new Client(); - $client->setClient($guzzle); - $client->setHeader('User-Agent', 'foo'); - $crawler = $client->request('GET', 'http://www.example.com/'); - $this->assertEquals('foo', $this->history->getLastRequest()->getHeader('User-Agent')); - } - - public function testUsesAuth() - { - $guzzle = $this->getGuzzle(); - $client = new Client(); - $client->setClient($guzzle); - $client->setAuth('me', '**'); - $crawler = $client->request('GET', 'http://www.example.com/'); - $request = $this->history->getLastRequest(); - $this->assertEquals('me', $request->getConfig()->get('auth')[0]); - $this->assertEquals('**', $request->getConfig()->get('auth')[1]); - $this->assertEquals('basic', $request->getConfig()->get('auth')[2]); - } - - public function testResetsAuth() - { - $guzzle = $this->getGuzzle(); - $client = new Client(); - $client->setClient($guzzle); - $client->setAuth('me', '**'); - $client->resetAuth(); - $crawler = $client->request('GET', 'http://www.example.com/'); - $request = $this->history->getLastRequest(); - $this->assertNull($request->getConfig()->get('auth')[0]); - $this->assertNull($request->getConfig()->get('auth')[1]); - } - - public function testUsesCookies() - { - $guzzle = $this->getGuzzle(); - $client = new Client(); - $client->setClient($guzzle); - $client->getCookieJar()->set(new Cookie('test', '123')); - $crawler = $client->request('GET', 'http://www.example.com/'); - $request = $this->history->getLastRequest(); - $this->assertEquals('test=123', $request->getHeader('Cookie')); - } - - public function testUsesPostFiles() - { - $guzzle = $this->getGuzzle(); - $client = new Client(); - $client->setClient($guzzle); - $files = array( - 'test' => array( - 'name' => 'test.txt', - 'tmp_name' => __FILE__, - ), - ); - - $crawler = $client->request('POST', 'http://www.example.com/', array(), $files); - $request = $this->history->getLastRequest(); - - $files = $request->getBody()->getFiles(); - $this->assertFile(reset($files), 'test', 'test.txt', array( - 'Content-Type' => 'text/plain', - 'Content-Disposition' => 'form-data; filename="test.txt"; name="test"', - )); - } - - public function testUsesPostNamedFiles() - { - $guzzle = $this->getGuzzle(); - $client = new Client(); - $client->setClient($guzzle); - $files = array( - 'test' => __FILE__, - ); - - $crawler = $client->request('POST', 'http://www.example.com/', array(), $files); - $request = $this->history->getLastRequest(); - $files = $request->getBody()->getFiles(); - $this->assertFile(reset($files), 'test', __FILE__, array( - 'Content-Type' => 'text/x-php', - 'Content-Disposition' => 'form-data; filename="ClientTest.php"; name="test"', - )); - } - - public function testUsesPostFilesNestedFields() - { - $guzzle = $this->getGuzzle(); - $client = new Client(); - $client->setClient($guzzle); - $files = array( - 'form' => array( - 'test' => array( - 'name' => 'test.txt', - 'tmp_name' => __FILE__, - ), - ), - ); - - $crawler = $client->request('POST', 'http://www.example.com/', array(), $files); - $request = $this->history->getLastRequest(); - $files = $request->getBody()->getFiles(); - $this->assertFile(reset($files), 'form[test]', 'test.txt', array( - 'Content-Type' => 'text/plain', - 'Content-Disposition' => 'form-data; filename="test.txt"; name="form[test]"', - )); - } - - public function testUsesPostFilesOnClientSide() - { - $guzzle = $this->getGuzzle(); - $client = new Client(); - $client->setClient($guzzle); - $files = array( - 'test' => __FILE__, - ); - - $crawler = $client->request('POST', 'http://www.example.com/', array(), $files); - $request = $this->history->getLastRequest(); - $files = $request->getBody()->getFiles(); - $this->assertFile(reset($files), 'test', __FILE__, array( - 'Content-Type' => 'text/x-php', - 'Content-Disposition' => 'form-data; filename="ClientTest.php"; name="test"', - )); - } - - public function testUsesPostFilesUploadError() - { - $guzzle = $this->getGuzzle(); - $client = new Client(); - $client->setClient($guzzle); - $files = array( - 'test' => array( - 'name' => '', - 'type' => '', - 'tmp_name' => '', - 'error' => 4, - 'size' => 0, - ), - ); - - $crawler = $client->request('POST', 'http://www.example.com/', array(), $files); - $request = $this->history->getLastRequest(); - - $this->assertEquals(array(), $request->getBody()->getFiles()); - } - - public function testCreatesResponse() - { - $guzzle = $this->getGuzzle(); - $client = new Client(); - $client->setClient($guzzle); - $crawler = $client->request('GET', 'http://www.example.com/'); - $this->assertEquals('Hi', $crawler->filter('p')->text()); - } - - public function testHandlesRedirectsCorrectly() - { - $guzzle = $this->getGuzzle(); - - $this->mock->clearQueue(); - $this->mock->addResponse(new GuzzleResponse(301, array( - 'Location' => 'http://www.example.com/', - ))); - $this->mock->addResponse(new GuzzleResponse(200, [], Stream::factory('

Test

'))); - - $client = new Client(); - $client->setClient($guzzle); - - $crawler = $client->request('GET', 'http://www.example.com/'); - $this->assertEquals('Test', $crawler->filter('p')->text()); - - // Ensure that two requests were sent - $this->assertEquals(2, count($this->history)); - } - - public function testConvertsGuzzleHeadersToArrays() - { - $guzzle = $this->getGuzzle(); - - $this->mock->clearQueue(); - $this->mock->addResponse(new GuzzleResponse(200, array( - 'Date' => 'Tue, 04 Jun 2013 13:22:41 GMT', - ))); - - $client = new Client(); - $client->setClient($guzzle); - $client->request('GET', 'http://www.example.com/'); - $response = $client->getResponse(); - $headers = $response->getHeaders(); - - $this->assertInternalType("array", array_shift($headers), "Header not converted from Guzzle\Http\Message\Header to array"); - } - - public function testNullResponseException() - { - $this->setExpectedException('GuzzleHttp\Exception\RequestException'); - $guzzle = $this->getGuzzle(); - $this->mock->clearQueue(); - $exception = new RequestException('', $this->getMock('GuzzleHttp\Message\RequestInterface')); - $this->mock->addException($exception); - $client = new Client(); - $client->setClient($guzzle); - $client->request('GET', 'http://www.example.com/'); - $response = $client->getResponse(); - } - - protected function assertFile(PostFile $postFile, $fieldName, $fileName, $headers) - { - $this->assertEquals($postFile->getName(), $fieldName); - $this->assertEquals($postFile->getFilename(), $fileName); - - $postFileHeaders = $postFile->getHeaders(); - - // Note: Sort 'Content-Disposition' values before comparing, because the order changed in Guzzle 4.2.2 - $postFileHeaders['Content-Disposition'] = explode('; ', $postFileHeaders['Content-Disposition']); - sort($postFileHeaders['Content-Disposition']); - $headers['Content-Disposition'] = explode('; ', $headers['Content-Disposition']); - sort($headers['Content-Disposition']); - - $this->assertEquals($postFileHeaders, $headers); - } - - public function testHttps() - { - $guzzle = $this->getGuzzle(); - - $this->mock->clearQueue(); - $this->mock->addResponse(new GuzzleResponse(200, [], Stream::factory('

Test

'))); - $client = new Client(); - $client->setClient($guzzle); - $crawler = $client->request('GET', 'https://www.example.com/'); - $this->assertEquals('https', $this->history->getLastRequest()->getScheme()); - $this->assertEquals('Test', $crawler->filter('p')->text()); - } - - public function testCustomUserAgentConstructor() - { - $guzzle = $this->getGuzzle(); - $client = new Client([ - 'HTTP_HOST' => '1.2.3.4', - 'HTTP_USER_AGENT' => 'SomeHost', - ]); - $client->setClient($guzzle); - $crawler = $client->request('GET', 'http://www.example.com/'); - $this->assertEquals('SomeHost', $this->history->getLastRequest()->getHeader('User-Agent')); - } -} diff --git a/core/vendor/fabpot/goutte/LICENSE b/core/vendor/fabpot/goutte/LICENSE deleted file mode 100644 index ff727f4..0000000 --- a/core/vendor/fabpot/goutte/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2010-2013 Fabien Potencier - -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/core/vendor/fabpot/goutte/README.rst b/core/vendor/fabpot/goutte/README.rst deleted file mode 100644 index 58eecdb..0000000 --- a/core/vendor/fabpot/goutte/README.rst +++ /dev/null @@ -1,114 +0,0 @@ -Goutte, a simple PHP Web Scraper -================================ - -Goutte is a screen scraping and web crawling library for PHP. - -Goutte provides a nice API to crawl websites and extract data from the HTML/XML -responses. - -Requirements ------------- - -Goutte depends on PHP 5.4+ and Guzzle 4+. - -.. tip:: - - If you need support for PHP 5.3 or Guzzle 3, use Goutte 1.0.6. - -Installation ------------- - -Add ``fabpot/goutte`` as a require dependency in your ``composer.json`` file: - -.. code-block:: bash - - php composer.phar require fabpot/goutte:~2.0 - -.. tip:: - - You can also download the `Goutte.phar`_ file: - - .. code-block:: php - - require_once '/path/to/goutte.phar'; - -Usage ------ - -Create a Goutte Client instance (which extends -``Symfony\Component\BrowserKit\Client``): - -.. code-block:: php - - use Goutte\Client; - - $client = new Client(); - -Make requests with the ``request()`` method: - -.. code-block:: php - - // Go to the symfony.com website - $crawler = $client->request('GET', 'http://www.symfony.com/blog/'); - -The method returns a ``Crawler`` object -(``Symfony\Component\DomCrawler\Crawler``). - -Fine-tune cURL options: - -.. code-block:: php - - $client->getClient()->setDefaultOption('config/curl/'.CURLOPT_TIMEOUT, 60); - -Click on links: - -.. code-block:: php - - // Click on the "Security Advisories" link - $link = $crawler->selectLink('Security Advisories')->link(); - $crawler = $client->click($link); - -Extract data: - -.. code-block:: php - - // Get the latest post in this category and display the titles - $crawler->filter('h2.post > a')->each(function ($node) { - print $node->text()."\n"; - }); - -Submit forms: - -.. code-block:: php - - $crawler = $client->request('GET', 'http://github.com/'); - $crawler = $client->click($crawler->selectLink('Sign in')->link()); - $form = $crawler->selectButton('Sign in')->form(); - $crawler = $client->submit($form, array('login' => 'fabpot', 'password' => 'xxxxxx')); - $crawler->filter('.flash-error')->each(function ($node) { - print $node->text()."\n"; - }); - -More Information ----------------- - -Read the documentation of the BrowserKit and DomCrawler Symfony Components for -more information about what you can do with Goutte. - -Technical Information ---------------------- - -Goutte is a thin wrapper around the following fine PHP libraries: - -* Symfony Components: BrowserKit, CssSelector and DomCrawler; - -* `Guzzle`_ HTTP Component. - -License -------- - -Goutte is licensed under the MIT license. - -.. _`Composer`: http://getcomposer.org -.. _`Goutte.phar`: http://get.sensiolabs.org/goutte.phar -.. _`Guzzle`: http://docs.guzzlephp.org diff --git a/core/vendor/fabpot/goutte/box.json b/core/vendor/fabpot/goutte/box.json deleted file mode 100644 index 943c61e..0000000 --- a/core/vendor/fabpot/goutte/box.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "output": "goutte.phar", - "chmod": "0755", - "compactors": [ - "Herrera\\Box\\Compactor\\Php" - ], - "extract": false, - "files": [ - "LICENSE", - "Goutte/Client.php" - ], - "finder": [ - { - "name": ["*.php", "*.pem*"], - "exclude": ["Tests", "tests"], - "in": "vendor" - } - ], - "stub": "Goutte/Resources/phar-stub.php", - "web": false -} diff --git a/core/vendor/fabpot/goutte/composer.json b/core/vendor/fabpot/goutte/composer.json deleted file mode 100644 index 63d87e7..0000000 --- a/core/vendor/fabpot/goutte/composer.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "fabpot/goutte", - "type": "application", - "description": "A simple PHP Web Scraper", - "keywords": ["scraper"], - "homepage": "https://github.com/FriendsOfPHP/Goutte", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "require": { - "php": ">=5.4.0", - "symfony/browser-kit": "~2.1", - "symfony/css-selector": "~2.1", - "symfony/dom-crawler": "~2.1", - "guzzlehttp/guzzle": ">=4,<6" - }, - "autoload": { - "psr-4": { "Goutte\\": "Goutte" } - }, - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - } -} diff --git a/core/vendor/fabpot/goutte/phpunit.xml.dist b/core/vendor/fabpot/goutte/phpunit.xml.dist deleted file mode 100644 index 9e7ff98..0000000 --- a/core/vendor/fabpot/goutte/phpunit.xml.dist +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - ./Goutte/Tests - - - diff --git a/core/vendor/guzzlehttp/guzzle/.gitignore b/core/vendor/guzzlehttp/guzzle/.gitignore deleted file mode 100644 index 83ec41e..0000000 --- a/core/vendor/guzzlehttp/guzzle/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -phpunit.xml -composer.phar -composer.lock -composer-test.lock -vendor/ -build/artifacts/ -artifacts/ -docs/_build -docs/*.pyc -.idea -.DS_STORE diff --git a/core/vendor/guzzlehttp/guzzle/.travis.yml b/core/vendor/guzzlehttp/guzzle/.travis.yml deleted file mode 100644 index 77bcf4a..0000000 --- a/core/vendor/guzzlehttp/guzzle/.travis.yml +++ /dev/null @@ -1,39 +0,0 @@ -language: php - -php: - - 5.4 - - 5.5 - - 5.6 - - hhvm - -before_script: - - curl --version - - pear config-set php_ini ~/.phpenv/versions/`php -r 'echo phpversion();'`/etc/php.ini || echo 'Error modifying PEAR' - - pecl install uri_template || echo 'Error installing uri_template' - - composer self-update - - composer install --no-interaction --prefer-source --dev - - ~/.nvm/nvm.sh install v0.6.14 - - ~/.nvm/nvm.sh run v0.6.14 - -script: make test - -matrix: - allow_failures: - - php: hhvm - fast_finish: true - -before_deploy: - - make package - -deploy: - provider: releases - api_key: - secure: UpypqlYgsU68QT/x40YzhHXvzWjFwCNo9d+G8KAdm7U9+blFfcWhV1aMdzugvPMl6woXgvJj7qHq5tAL4v6oswCORhpSBfLgOQVFaica5LiHsvWlAedOhxGmnJqMTwuepjBCxXhs3+I8Kof1n4oUL9gKytXjOVCX/f7XU1HiinU= - file: - - build/artifacts/guzzle.phar - - build/artifacts/guzzle.zip - on: - repo: guzzle/guzzle - tags: true - all_branches: true - php: 5.4 diff --git a/core/vendor/guzzlehttp/guzzle/CHANGELOG.md b/core/vendor/guzzlehttp/guzzle/CHANGELOG.md deleted file mode 100644 index caafb42..0000000 --- a/core/vendor/guzzlehttp/guzzle/CHANGELOG.md +++ /dev/null @@ -1,1043 +0,0 @@ -# CHANGELOG - -## 5.2.0 - 2015-01-27 - -* Added `AppliesHeadersInterface` to make applying headers to a request based - on the body more generic and not specific to `PostBodyInterface`. -* Reduced the number of stack frames needed to send requests. -* Nested futures are now resolved in the client rather than the RequestFsm -* Finishing state transitions is now handled in the RequestFsm rather than the - RingBridge. -* Added a guard in the Pool class to not use recursion for request retries. - -## 5.1.0 - 2014-12-19 - -* Pool class no longer uses recursion when a request is intercepted. -* The size of a Pool can now be dynamically adjusted using a callback. - See https://github.com/guzzle/guzzle/pull/943. -* Setting a request option to `null` when creating a request with a client will - ensure that the option is not set. This allows you to overwrite default - request options on a per-request basis. - See https://github.com/guzzle/guzzle/pull/937. -* Added the ability to limit which protocols are allowed for redirects by - specifying a `protocols` array in the `allow_redirects` request option. -* Nested futures due to retries are now resolved when waiting for synchronous - responses. See https://github.com/guzzle/guzzle/pull/947. -* `"0"` is now an allowed URI path. See - https://github.com/guzzle/guzzle/pull/935. -* `Query` no longer typehints on the `$query` argument in the constructor, - allowing for strings and arrays. -* Exceptions thrown in the `end` event are now correctly wrapped with Guzzle - specific exceptions if necessary. - -## 5.0.3 - 2014-11-03 - -This change updates query strings so that they are treated as un-encoded values -by default where the value represents an un-encoded value to send over the -wire. A Query object then encodes the value before sending over the wire. This -means that even value query string values (e.g., ":") are url encoded. This -makes the Query class match PHP's http_build_query function. However, if you -want to send requests over the wire using valid query string characters that do -not need to be encoded, then you can provide a string to Url::setQuery() and -pass true as the second argument to specify that the query string is a raw -string that should not be parsed or encoded (unless a call to getQuery() is -subsequently made, forcing the query-string to be converted into a Query -object). - -## 5.0.2 - 2014-10-30 - -* Added a trailing `\r\n` to multipart/form-data payloads. See - https://github.com/guzzle/guzzle/pull/871 -* Added a `GuzzleHttp\Pool::send()` convenience method to match the docs. -* Status codes are now returned as integers. See - https://github.com/guzzle/guzzle/issues/881 -* No longer overwriting an existing `application/x-www-form-urlencoded` header - when sending POST requests, allowing for customized headers. See - https://github.com/guzzle/guzzle/issues/877 -* Improved path URL serialization. - - * No longer double percent-encoding characters in the path or query string if - they are already encoded. - * Now properly encoding the supplied path to a URL object, instead of only - encoding ' ' and '?'. - * Note: This has been changed in 5.0.3 to now encode query string values by - default unless the `rawString` argument is provided when setting the query - string on a URL: Now allowing many more characters to be present in the - query string without being percent encoded. See http://tools.ietf.org/html/rfc3986#appendix-A - -## 5.0.1 - 2014-10-16 - -Bugfix release. - -* Fixed an issue where connection errors still returned response object in - error and end events event though the response is unusable. This has been - corrected so that a response is not returned in the `getResponse` method of - these events if the response did not complete. https://github.com/guzzle/guzzle/issues/867 -* Fixed an issue where transfer statistics were not being populated in the - RingBridge. https://github.com/guzzle/guzzle/issues/866 - -## 5.0.0 - 2014-10-12 - -Adding support for non-blocking responses and some minor API cleanup. - -### New Features - -* Added support for non-blocking responses based on `guzzlehttp/guzzle-ring`. -* Added a public API for creating a default HTTP adapter. -* Updated the redirect plugin to be non-blocking so that redirects are sent - concurrently. Other plugins like this can now be updated to be non-blocking. -* Added a "progress" event so that you can get upload and download progress - events. -* Added `GuzzleHttp\Pool` which implements FutureInterface and transfers - requests concurrently using a capped pool size as efficiently as possible. -* Added `hasListeners()` to EmitterInterface. -* Removed `GuzzleHttp\ClientInterface::sendAll` and marked - `GuzzleHttp\Client::sendAll` as deprecated (it's still there, just not the - recommended way). - -### Breaking changes - -The breaking changes in this release are relatively minor. The biggest thing to -look out for is that request and response objects no longer implement fluent -interfaces. - -* Removed the fluent interfaces (i.e., `return $this`) from requests, - responses, `GuzzleHttp\Collection`, `GuzzleHttp\Url`, - `GuzzleHttp\Query`, `GuzzleHttp\Post\PostBody`, and - `GuzzleHttp\Cookie\SetCookie`. This blog post provides a good outline of - why I did this: http://ocramius.github.io/blog/fluent-interfaces-are-evil/. - This also makes the Guzzle message interfaces compatible with the current - PSR-7 message proposal. -* Removed "functions.php", so that Guzzle is truly PSR-4 compliant. Except - for the HTTP request functions from function.php, these functions are now - implemented in `GuzzleHttp\Utils` using camelCase. `GuzzleHttp\json_decode` - moved to `GuzzleHttp\Utils::jsonDecode`. `GuzzleHttp\get_path` moved to - `GuzzleHttp\Utils::getPath`. `GuzzleHttp\set_path` moved to - `GuzzleHttp\Utils::setPath`. `GuzzleHttp\batch` should now be - `GuzzleHttp\Pool::batch`, which returns an `objectStorage`. Using functions.php - caused problems for many users: they aren't PSR-4 compliant, require an - explicit include, and needed an if-guard to ensure that the functions are not - declared multiple times. -* Rewrote adapter layer. - * Removing all classes from `GuzzleHttp\Adapter`, these are now - implemented as callables that are stored in `GuzzleHttp\Ring\Client`. - * Removed the concept of "parallel adapters". Sending requests serially or - concurrently is now handled using a single adapter. - * Moved `GuzzleHttp\Adapter\Transaction` to `GuzzleHttp\Transaction`. The - Transaction object now exposes the request, response, and client as public - properties. The getters and setters have been removed. -* Removed the "headers" event. This event was only useful for changing the - body a response once the headers of the response were known. You can implement - a similar behavior in a number of ways. One example might be to use a - FnStream that has access to the transaction being sent. For example, when the - first byte is written, you could check if the response headers match your - expectations, and if so, change the actual stream body that is being - written to. -* Removed the `asArray` parameter from - `GuzzleHttp\Message\MessageInterface::getHeader`. If you want to get a header - value as an array, then use the newly added `getHeaderAsArray()` method of - `MessageInterface`. This change makes the Guzzle interfaces compatible with - the PSR-7 interfaces. -* `GuzzleHttp\Message\MessageFactory` no longer allows subclasses to add - custom request options using double-dispatch (this was an implementation - detail). Instead, you should now provide an associative array to the - constructor which is a mapping of the request option name mapping to a - function that applies the option value to a request. -* Removed the concept of "throwImmediately" from exceptions and error events. - This control mechanism was used to stop a transfer of concurrent requests - from completing. This can now be handled by throwing the exception or by - cancelling a pool of requests or each outstanding future request individually. -* Updated to "GuzzleHttp\Streams" 3.0. - * `GuzzleHttp\Stream\StreamInterface::getContents()` no longer accepts a - `maxLen` parameter. This update makes the Guzzle streams project - compatible with the current PSR-7 proposal. - * `GuzzleHttp\Stream\Stream::__construct`, - `GuzzleHttp\Stream\Stream::factory`, and - `GuzzleHttp\Stream\Utils::create` no longer accept a size in the second - argument. They now accept an associative array of options, including the - "size" key and "metadata" key which can be used to provide custom metadata. - -## 4.2.2 - 2014-09-08 - -* Fixed a memory leak in the CurlAdapter when reusing cURL handles. -* No longer using `request_fulluri` in stream adapter proxies. -* Relative redirects are now based on the last response, not the first response. - -## 4.2.1 - 2014-08-19 - -* Ensuring that the StreamAdapter does not always add a Content-Type header -* Adding automated github releases with a phar and zip - -## 4.2.0 - 2014-08-17 - -* Now merging in default options using a case-insensitive comparison. - Closes https://github.com/guzzle/guzzle/issues/767 -* Added the ability to automatically decode `Content-Encoding` response bodies - using the `decode_content` request option. This is set to `true` by default - to decode the response body if it comes over the wire with a - `Content-Encoding`. Set this value to `false` to disable decoding the - response content, and pass a string to provide a request `Accept-Encoding` - header and turn on automatic response decoding. This feature now allows you - to pass an `Accept-Encoding` header in the headers of a request but still - disable automatic response decoding. - Closes https://github.com/guzzle/guzzle/issues/764 -* Added the ability to throw an exception immediately when transferring - requests in parallel. Closes https://github.com/guzzle/guzzle/issues/760 -* Updating guzzlehttp/streams dependency to ~2.1 -* No longer utilizing the now deprecated namespaced methods from the stream - package. - -## 4.1.8 - 2014-08-14 - -* Fixed an issue in the CurlFactory that caused setting the `stream=false` - request option to throw an exception. - See: https://github.com/guzzle/guzzle/issues/769 -* TransactionIterator now calls rewind on the inner iterator. - See: https://github.com/guzzle/guzzle/pull/765 -* You can now set the `Content-Type` header to `multipart/form-data` - when creating POST requests to force multipart bodies. - See https://github.com/guzzle/guzzle/issues/768 - -## 4.1.7 - 2014-08-07 - -* Fixed an error in the HistoryPlugin that caused the same request and response - to be logged multiple times when an HTTP protocol error occurs. -* Ensuring that cURL does not add a default Content-Type when no Content-Type - has been supplied by the user. This prevents the adapter layer from modifying - the request that is sent over the wire after any listeners may have already - put the request in a desired state (e.g., signed the request). -* Throwing an exception when you attempt to send requests that have the - "stream" set to true in parallel using the MultiAdapter. -* Only calling curl_multi_select when there are active cURL handles. This was - previously changed and caused performance problems on some systems due to PHP - always selecting until the maximum select timeout. -* Fixed a bug where multipart/form-data POST fields were not correctly - aggregated (e.g., values with "&"). - -## 4.1.6 - 2014-08-03 - -* Added helper methods to make it easier to represent messages as strings, - including getting the start line and getting headers as a string. - -## 4.1.5 - 2014-08-02 - -* Automatically retrying cURL "Connection died, retrying a fresh connect" - errors when possible. -* cURL implementation cleanup -* Allowing multiple event subscriber listeners to be registered per event by - passing an array of arrays of listener configuration. - -## 4.1.4 - 2014-07-22 - -* Fixed a bug that caused multi-part POST requests with more than one field to - serialize incorrectly. -* Paths can now be set to "0" -* `ResponseInterface::xml` now accepts a `libxml_options` option and added a - missing default argument that was required when parsing XML response bodies. -* A `save_to` stream is now created lazily, which means that files are not - created on disk unless a request succeeds. - -## 4.1.3 - 2014-07-15 - -* Various fixes to multipart/form-data POST uploads -* Wrapping function.php in an if-statement to ensure Guzzle can be used - globally and in a Composer install -* Fixed an issue with generating and merging in events to an event array -* POST headers are only applied before sending a request to allow you to change - the query aggregator used before uploading -* Added much more robust query string parsing -* Fixed various parsing and normalization issues with URLs -* Fixing an issue where multi-valued headers were not being utilized correctly - in the StreamAdapter - -## 4.1.2 - 2014-06-18 - -* Added support for sending payloads with GET requests - -## 4.1.1 - 2014-06-08 - -* Fixed an issue related to using custom message factory options in subclasses -* Fixed an issue with nested form fields in a multi-part POST -* Fixed an issue with using the `json` request option for POST requests -* Added `ToArrayInterface` to `GuzzleHttp\Cookie\CookieJar` - -## 4.1.0 - 2014-05-27 - -* Added a `json` request option to easily serialize JSON payloads. -* Added a `GuzzleHttp\json_decode()` wrapper to safely parse JSON. -* Added `setPort()` and `getPort()` to `GuzzleHttp\Message\RequestInterface`. -* Added the ability to provide an emitter to a client in the client constructor. -* Added the ability to persist a cookie session using $_SESSION. -* Added a trait that can be used to add event listeners to an iterator. -* Removed request method constants from RequestInterface. -* Fixed warning when invalid request start-lines are received. -* Updated MessageFactory to work with custom request option methods. -* Updated cacert bundle to latest build. - -4.0.2 (2014-04-16) ------------------- - -* Proxy requests using the StreamAdapter now properly use request_fulluri (#632) -* Added the ability to set scalars as POST fields (#628) - -## 4.0.1 - 2014-04-04 - -* The HTTP status code of a response is now set as the exception code of - RequestException objects. -* 303 redirects will now correctly switch from POST to GET requests. -* The default parallel adapter of a client now correctly uses the MultiAdapter. -* HasDataTrait now initializes the internal data array as an empty array so - that the toArray() method always returns an array. - -## 4.0.0 - 2014-03-29 - -* For more information on the 4.0 transition, see: - http://mtdowling.com/blog/2014/03/15/guzzle-4-rc/ -* For information on changes and upgrading, see: - https://github.com/guzzle/guzzle/blob/master/UPGRADING.md#3x-to-40 -* Added `GuzzleHttp\batch()` as a convenience function for sending requests in - parallel without needing to write asynchronous code. -* Restructured how events are added to `GuzzleHttp\ClientInterface::sendAll()`. - You can now pass a callable or an array of associative arrays where each - associative array contains the "fn", "priority", and "once" keys. - -## 4.0.0.rc-2 - 2014-03-25 - -* Removed `getConfig()` and `setConfig()` from clients to avoid confusion - around whether things like base_url, message_factory, etc. should be able to - be retrieved or modified. -* Added `getDefaultOption()` and `setDefaultOption()` to ClientInterface -* functions.php functions were renamed using snake_case to match PHP idioms -* Added support for `HTTP_PROXY`, `HTTPS_PROXY`, and - `GUZZLE_CURL_SELECT_TIMEOUT` environment variables -* Added the ability to specify custom `sendAll()` event priorities -* Added the ability to specify custom stream context options to the stream - adapter. -* Added a functions.php function for `get_path()` and `set_path()` -* CurlAdapter and MultiAdapter now use a callable to generate curl resources -* MockAdapter now properly reads a body and emits a `headers` event -* Updated Url class to check if a scheme and host are set before adding ":" - and "//". This allows empty Url (e.g., "") to be serialized as "". -* Parsing invalid XML no longer emits warnings -* Curl classes now properly throw AdapterExceptions -* Various performance optimizations -* Streams are created with the faster `Stream\create()` function -* Marked deprecation_proxy() as internal -* Test server is now a collection of static methods on a class - -## 4.0.0-rc.1 - 2014-03-15 - -* See https://github.com/guzzle/guzzle/blob/master/UPGRADING.md#3x-to-40 - -## 3.8.1 - 2014-01-28 - -* Bug: Always using GET requests when redirecting from a 303 response -* Bug: CURLOPT_SSL_VERIFYHOST is now correctly set to false when setting `$certificateAuthority` to false in - `Guzzle\Http\ClientInterface::setSslVerification()` -* Bug: RedirectPlugin now uses strict RFC 3986 compliance when combining a base URL with a relative URL -* Bug: The body of a request can now be set to `"0"` -* Sending PHP stream requests no longer forces `HTTP/1.0` -* Adding more information to ExceptionCollection exceptions so that users have more context, including a stack trace of - each sub-exception -* Updated the `$ref` attribute in service descriptions to merge over any existing parameters of a schema (rather than - clobbering everything). -* Merging URLs will now use the query string object from the relative URL (thus allowing custom query aggregators) -* Query strings are now parsed in a way that they do no convert empty keys with no value to have a dangling `=`. - For example `foo&bar=baz` is now correctly parsed and recognized as `foo&bar=baz` rather than `foo=&bar=baz`. -* Now properly escaping the regular expression delimiter when matching Cookie domains. -* Network access is now disabled when loading XML documents - -## 3.8.0 - 2013-12-05 - -* Added the ability to define a POST name for a file -* JSON response parsing now properly walks additionalProperties -* cURL error code 18 is now retried automatically in the BackoffPlugin -* Fixed a cURL error when URLs contain fragments -* Fixed an issue in the BackoffPlugin retry event where it was trying to access all exceptions as if they were - CurlExceptions -* CURLOPT_PROGRESS function fix for PHP 5.5 (69fcc1e) -* Added the ability for Guzzle to work with older versions of cURL that do not support `CURLOPT_TIMEOUT_MS` -* Fixed a bug that was encountered when parsing empty header parameters -* UriTemplate now has a `setRegex()` method to match the docs -* The `debug` request parameter now checks if it is truthy rather than if it exists -* Setting the `debug` request parameter to true shows verbose cURL output instead of using the LogPlugin -* Added the ability to combine URLs using strict RFC 3986 compliance -* Command objects can now return the validation errors encountered by the command -* Various fixes to cache revalidation (#437 and 29797e5) -* Various fixes to the AsyncPlugin -* Cleaned up build scripts - -## 3.7.4 - 2013-10-02 - -* Bug fix: 0 is now an allowed value in a description parameter that has a default value (#430) -* Bug fix: SchemaFormatter now returns an integer when formatting to a Unix timestamp - (see https://github.com/aws/aws-sdk-php/issues/147) -* Bug fix: Cleaned up and fixed URL dot segment removal to properly resolve internal dots -* Minimum PHP version is now properly specified as 5.3.3 (up from 5.3.2) (#420) -* Updated the bundled cacert.pem (#419) -* OauthPlugin now supports adding authentication to headers or query string (#425) - -## 3.7.3 - 2013-09-08 - -* Added the ability to get the exception associated with a request/command when using `MultiTransferException` and - `CommandTransferException`. -* Setting `additionalParameters` of a response to false is now honored when parsing responses with a service description -* Schemas are only injected into response models when explicitly configured. -* No longer guessing Content-Type based on the path of a request. Content-Type is now only guessed based on the path of - an EntityBody. -* Bug fix: ChunkedIterator can now properly chunk a \Traversable as well as an \Iterator. -* Bug fix: FilterIterator now relies on `\Iterator` instead of `\Traversable`. -* Bug fix: Gracefully handling malformed responses in RequestMediator::writeResponseBody() -* Bug fix: Replaced call to canCache with canCacheRequest in the CallbackCanCacheStrategy of the CachePlugin -* Bug fix: Visiting XML attributes first before visiting XML children when serializing requests -* Bug fix: Properly parsing headers that contain commas contained in quotes -* Bug fix: mimetype guessing based on a filename is now case-insensitive - -## 3.7.2 - 2013-08-02 - -* Bug fix: Properly URL encoding paths when using the PHP-only version of the UriTemplate expander - See https://github.com/guzzle/guzzle/issues/371 -* Bug fix: Cookie domains are now matched correctly according to RFC 6265 - See https://github.com/guzzle/guzzle/issues/377 -* Bug fix: GET parameters are now used when calculating an OAuth signature -* Bug fix: Fixed an issue with cache revalidation where the If-None-Match header was being double quoted -* `Guzzle\Common\AbstractHasDispatcher::dispatch()` now returns the event that was dispatched -* `Guzzle\Http\QueryString::factory()` now guesses the most appropriate query aggregator to used based on the input. - See https://github.com/guzzle/guzzle/issues/379 -* Added a way to add custom domain objects to service description parsing using the `operation.parse_class` event. See - https://github.com/guzzle/guzzle/pull/380 -* cURL multi cleanup and optimizations - -## 3.7.1 - 2013-07-05 - -* Bug fix: Setting default options on a client now works -* Bug fix: Setting options on HEAD requests now works. See #352 -* Bug fix: Moving stream factory before send event to before building the stream. See #353 -* Bug fix: Cookies no longer match on IP addresses per RFC 6265 -* Bug fix: Correctly parsing header parameters that are in `<>` and quotes -* Added `cert` and `ssl_key` as request options -* `Host` header can now diverge from the host part of a URL if the header is set manually -* `Guzzle\Service\Command\LocationVisitor\Request\XmlVisitor` was rewritten to change from using SimpleXML to XMLWriter -* OAuth parameters are only added via the plugin if they aren't already set -* Exceptions are now thrown when a URL cannot be parsed -* Returning `false` if `Guzzle\Http\EntityBody::getContentMd5()` fails -* Not setting a `Content-MD5` on a command if calculating the Content-MD5 fails via the CommandContentMd5Plugin - -## 3.7.0 - 2013-06-10 - -* See UPGRADING.md for more information on how to upgrade. -* Requests now support the ability to specify an array of $options when creating a request to more easily modify a - request. You can pass a 'request.options' configuration setting to a client to apply default request options to - every request created by a client (e.g. default query string variables, headers, curl options, etc.). -* Added a static facade class that allows you to use Guzzle with static methods and mount the class to `\Guzzle`. - See `Guzzle\Http\StaticClient::mount`. -* Added `command.request_options` to `Guzzle\Service\Command\AbstractCommand` to pass request options to requests - created by a command (e.g. custom headers, query string variables, timeout settings, etc.). -* Stream size in `Guzzle\Stream\PhpStreamRequestFactory` will now be set if Content-Length is returned in the - headers of a response -* Added `Guzzle\Common\Collection::setPath($path, $value)` to set a value into an array using a nested key - (e.g. `$collection->setPath('foo/baz/bar', 'test'); echo $collection['foo']['bar']['bar'];`) -* ServiceBuilders now support storing and retrieving arbitrary data -* CachePlugin can now purge all resources for a given URI -* CachePlugin can automatically purge matching cached items when a non-idempotent request is sent to a resource -* CachePlugin now uses the Vary header to determine if a resource is a cache hit -* `Guzzle\Http\Message\Response` now implements `\Serializable` -* Added `Guzzle\Cache\CacheAdapterFactory::fromCache()` to more easily create cache adapters -* `Guzzle\Service\ClientInterface::execute()` now accepts an array, single command, or Traversable -* Fixed a bug in `Guzzle\Http\Message\Header\Link::addLink()` -* Better handling of calculating the size of a stream in `Guzzle\Stream\Stream` using fstat() and caching the size -* `Guzzle\Common\Exception\ExceptionCollection` now creates a more readable exception message -* Fixing BC break: Added back the MonologLogAdapter implementation rather than extending from PsrLog so that older - Symfony users can still use the old version of Monolog. -* Fixing BC break: Added the implementation back in for `Guzzle\Http\Message\AbstractMessage::getTokenizedHeader()`. - Now triggering an E_USER_DEPRECATED warning when used. Use `$message->getHeader()->parseParams()`. -* Several performance improvements to `Guzzle\Common\Collection` -* Added an `$options` argument to the end of the following methods of `Guzzle\Http\ClientInterface`: - createRequest, head, delete, put, patch, post, options, prepareRequest -* Added an `$options` argument to the end of `Guzzle\Http\Message\Request\RequestFactoryInterface::createRequest()` -* Added an `applyOptions()` method to `Guzzle\Http\Message\Request\RequestFactoryInterface` -* Changed `Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $body = null)` to - `Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $options = array())`. You can still pass in a - resource, string, or EntityBody into the $options parameter to specify the download location of the response. -* Changed `Guzzle\Common\Collection::__construct($data)` to no longer accepts a null value for `$data` but a - default `array()` -* Added `Guzzle\Stream\StreamInterface::isRepeatable` -* Removed `Guzzle\Http\ClientInterface::setDefaultHeaders(). Use - $client->getConfig()->setPath('request.options/headers/{header_name}', 'value')`. or - $client->getConfig()->setPath('request.options/headers', array('header_name' => 'value'))`. -* Removed `Guzzle\Http\ClientInterface::getDefaultHeaders(). Use $client->getConfig()->getPath('request.options/headers')`. -* Removed `Guzzle\Http\ClientInterface::expandTemplate()` -* Removed `Guzzle\Http\ClientInterface::setRequestFactory()` -* Removed `Guzzle\Http\ClientInterface::getCurlMulti()` -* Removed `Guzzle\Http\Message\RequestInterface::canCache` -* Removed `Guzzle\Http\Message\RequestInterface::setIsRedirect` -* Removed `Guzzle\Http\Message\RequestInterface::isRedirect` -* Made `Guzzle\Http\Client::expandTemplate` and `getUriTemplate` protected methods. -* You can now enable E_USER_DEPRECATED warnings to see if you are using a deprecated method by setting - `Guzzle\Common\Version::$emitWarnings` to true. -* Marked `Guzzle\Http\Message\Request::isResponseBodyRepeatable()` as deprecated. Use - `$request->getResponseBody()->isRepeatable()` instead. -* Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use - `Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead. -* Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use - `Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead. -* Marked `Guzzle\Http\Message\Request::setIsRedirect()` as deprecated. Use the HistoryPlugin instead. -* Marked `Guzzle\Http\Message\Request::isRedirect()` as deprecated. Use the HistoryPlugin instead. -* Marked `Guzzle\Cache\CacheAdapterFactory::factory()` as deprecated -* Marked 'command.headers', 'command.response_body' and 'command.on_complete' as deprecated for AbstractCommand. - These will work through Guzzle 4.0 -* Marked 'request.params' for `Guzzle\Http\Client` as deprecated. Use [request.options][params]. -* Marked `Guzzle\Service\Client::enableMagicMethods()` as deprecated. Magic methods can no longer be disabled on a Guzzle\Service\Client. -* Marked `Guzzle\Service\Client::getDefaultHeaders()` as deprecated. Use $client->getConfig()->getPath('request.options/headers')`. -* Marked `Guzzle\Service\Client::setDefaultHeaders()` as deprecated. Use $client->getConfig()->setPath('request.options/headers/{header_name}', 'value')`. -* Marked `Guzzle\Parser\Url\UrlParser` as deprecated. Just use PHP's `parse_url()` and percent encode your UTF-8. -* Marked `Guzzle\Common\Collection::inject()` as deprecated. -* Marked `Guzzle\Plugin\CurlAuth\CurlAuthPlugin` as deprecated. Use `$client->getConfig()->setPath('request.options/auth', array('user', 'pass', 'Basic|Digest');` -* CacheKeyProviderInterface and DefaultCacheKeyProvider are no longer used. All of this logic is handled in a - CacheStorageInterface. These two objects and interface will be removed in a future version. -* Always setting X-cache headers on cached responses -* Default cache TTLs are now handled by the CacheStorageInterface of a CachePlugin -* `CacheStorageInterface::cache($key, Response $response, $ttl = null)` has changed to `cache(RequestInterface - $request, Response $response);` -* `CacheStorageInterface::fetch($key)` has changed to `fetch(RequestInterface $request);` -* `CacheStorageInterface::delete($key)` has changed to `delete(RequestInterface $request);` -* Added `CacheStorageInterface::purge($url)` -* `DefaultRevalidation::__construct(CacheKeyProviderInterface $cacheKey, CacheStorageInterface $cache, CachePlugin - $plugin)` has changed to `DefaultRevalidation::__construct(CacheStorageInterface $cache, - CanCacheStrategyInterface $canCache = null)` -* Added `RevalidationInterface::shouldRevalidate(RequestInterface $request, Response $response)` - -## 3.6.0 - 2013-05-29 - -* ServiceDescription now implements ToArrayInterface -* Added command.hidden_params to blacklist certain headers from being treated as additionalParameters -* Guzzle can now correctly parse incomplete URLs -* Mixed casing of headers are now forced to be a single consistent casing across all values for that header. -* Messages internally use a HeaderCollection object to delegate handling case-insensitive header resolution -* Removed the whole changedHeader() function system of messages because all header changes now go through addHeader(). -* Specific header implementations can be created for complex headers. When a message creates a header, it uses a - HeaderFactory which can map specific headers to specific header classes. There is now a Link header and - CacheControl header implementation. -* Removed from interface: Guzzle\Http\ClientInterface::setUriTemplate -* Removed from interface: Guzzle\Http\ClientInterface::setCurlMulti() -* Removed Guzzle\Http\Message\Request::receivedRequestHeader() and implemented this functionality in - Guzzle\Http\Curl\RequestMediator -* Removed the optional $asString parameter from MessageInterface::getHeader(). Just cast the header to a string. -* Removed the optional $tryChunkedTransfer option from Guzzle\Http\Message\EntityEnclosingRequestInterface -* Removed the $asObjects argument from Guzzle\Http\Message\MessageInterface::getHeaders() -* Removed Guzzle\Parser\ParserRegister::get(). Use getParser() -* Removed Guzzle\Parser\ParserRegister::set(). Use registerParser(). -* All response header helper functions return a string rather than mixing Header objects and strings inconsistently -* Removed cURL blacklist support. This is no longer necessary now that Expect, Accept, etc. are managed by Guzzle - directly via interfaces -* Removed the injecting of a request object onto a response object. The methods to get and set a request still exist - but are a no-op until removed. -* Most classes that used to require a `Guzzle\Service\Command\CommandInterface` typehint now request a - `Guzzle\Service\Command\ArrayCommandInterface`. -* Added `Guzzle\Http\Message\RequestInterface::startResponse()` to the RequestInterface to handle injecting a response - on a request while the request is still being transferred -* The ability to case-insensitively search for header values -* Guzzle\Http\Message\Header::hasExactHeader -* Guzzle\Http\Message\Header::raw. Use getAll() -* Deprecated cache control specific methods on Guzzle\Http\Message\AbstractMessage. Use the CacheControl header object - instead. -* `Guzzle\Service\Command\CommandInterface` now extends from ToArrayInterface and ArrayAccess -* Added the ability to cast Model objects to a string to view debug information. - -## 3.5.0 - 2013-05-13 - -* Bug: Fixed a regression so that request responses are parsed only once per oncomplete event rather than multiple times -* Bug: Better cleanup of one-time events across the board (when an event is meant to fire once, it will now remove - itself from the EventDispatcher) -* Bug: `Guzzle\Log\MessageFormatter` now properly writes "total_time" and "connect_time" values -* Bug: Cloning an EntityEnclosingRequest now clones the EntityBody too -* Bug: Fixed an undefined index error when parsing nested JSON responses with a sentAs parameter that reference a - non-existent key -* Bug: All __call() method arguments are now required (helps with mocking frameworks) -* Deprecating Response::getRequest() and now using a shallow clone of a request object to remove a circular reference - to help with refcount based garbage collection of resources created by sending a request -* Deprecating ZF1 cache and log adapters. These will be removed in the next major version. -* Deprecating `Response::getPreviousResponse()` (method signature still exists, but it'sdeprecated). Use the - HistoryPlugin for a history. -* Added a `responseBody` alias for the `response_body` location -* Refactored internals to no longer rely on Response::getRequest() -* HistoryPlugin can now be cast to a string -* HistoryPlugin now logs transactions rather than requests and responses to more accurately keep track of the requests - and responses that are sent over the wire -* Added `getEffectiveUrl()` and `getRedirectCount()` to Response objects - -## 3.4.3 - 2013-04-30 - -* Bug fix: Fixing bug introduced in 3.4.2 where redirect responses are duplicated on the final redirected response -* Added a check to re-extract the temp cacert bundle from the phar before sending each request - -## 3.4.2 - 2013-04-29 - -* Bug fix: Stream objects now work correctly with "a" and "a+" modes -* Bug fix: Removing `Transfer-Encoding: chunked` header when a Content-Length is present -* Bug fix: AsyncPlugin no longer forces HEAD requests -* Bug fix: DateTime timezones are now properly handled when using the service description schema formatter -* Bug fix: CachePlugin now properly handles stale-if-error directives when a request to the origin server fails -* Setting a response on a request will write to the custom request body from the response body if one is specified -* LogPlugin now writes to php://output when STDERR is undefined -* Added the ability to set multiple POST files for the same key in a single call -* application/x-www-form-urlencoded POSTs now use the utf-8 charset by default -* Added the ability to queue CurlExceptions to the MockPlugin -* Cleaned up how manual responses are queued on requests (removed "queued_response" and now using request.before_send) -* Configuration loading now allows remote files - -## 3.4.1 - 2013-04-16 - -* Large refactoring to how CurlMulti handles work. There is now a proxy that sits in front of a pool of CurlMulti - handles. This greatly simplifies the implementation, fixes a couple bugs, and provides a small performance boost. -* Exceptions are now properly grouped when sending requests in parallel -* Redirects are now properly aggregated when a multi transaction fails -* Redirects now set the response on the original object even in the event of a failure -* Bug fix: Model names are now properly set even when using $refs -* Added support for PHP 5.5's CurlFile to prevent warnings with the deprecated @ syntax -* Added support for oauth_callback in OAuth signatures -* Added support for oauth_verifier in OAuth signatures -* Added support to attempt to retrieve a command first literally, then ucfirst, the with inflection - -## 3.4.0 - 2013-04-11 - -* Bug fix: URLs are now resolved correctly based on http://tools.ietf.org/html/rfc3986#section-5.2. #289 -* Bug fix: Absolute URLs with a path in a service description will now properly override the base URL. #289 -* Bug fix: Parsing a query string with a single PHP array value will now result in an array. #263 -* Bug fix: Better normalization of the User-Agent header to prevent duplicate headers. #264. -* Bug fix: Added `number` type to service descriptions. -* Bug fix: empty parameters are removed from an OAuth signature -* Bug fix: Revalidating a cache entry prefers the Last-Modified over the Date header -* Bug fix: Fixed "array to string" error when validating a union of types in a service description -* Bug fix: Removed code that attempted to determine the size of a stream when data is written to the stream -* Bug fix: Not including an `oauth_token` if the value is null in the OauthPlugin. -* Bug fix: Now correctly aggregating successful requests and failed requests in CurlMulti when a redirect occurs. -* The new default CURLOPT_TIMEOUT setting has been increased to 150 seconds so that Guzzle works on poor connections. -* Added a feature to EntityEnclosingRequest::setBody() that will automatically set the Content-Type of the request if - the Content-Type can be determined based on the entity body or the path of the request. -* Added the ability to overwrite configuration settings in a client when grabbing a throwaway client from a builder. -* Added support for a PSR-3 LogAdapter. -* Added a `command.after_prepare` event -* Added `oauth_callback` parameter to the OauthPlugin -* Added the ability to create a custom stream class when using a stream factory -* Added a CachingEntityBody decorator -* Added support for `additionalParameters` in service descriptions to define how custom parameters are serialized. -* The bundled SSL certificate is now provided in the phar file and extracted when running Guzzle from a phar. -* You can now send any EntityEnclosingRequest with POST fields or POST files and cURL will handle creating bodies -* POST requests using a custom entity body are now treated exactly like PUT requests but with a custom cURL method. This - means that the redirect behavior of POST requests with custom bodies will not be the same as POST requests that use - POST fields or files (the latter is only used when emulating a form POST in the browser). -* Lots of cleanup to CurlHandle::factory and RequestFactory::createRequest - -## 3.3.1 - 2013-03-10 - -* Added the ability to create PHP streaming responses from HTTP requests -* Bug fix: Running any filters when parsing response headers with service descriptions -* Bug fix: OauthPlugin fixes to allow for multi-dimensional array signing, and sorting parameters before signing -* Bug fix: Removed the adding of default empty arrays and false Booleans to responses in order to be consistent across - response location visitors. -* Bug fix: Removed the possibility of creating configuration files with circular dependencies -* RequestFactory::create() now uses the key of a POST file when setting the POST file name -* Added xmlAllowEmpty to serialize an XML body even if no XML specific parameters are set - -## 3.3.0 - 2013-03-03 - -* A large number of performance optimizations have been made -* Bug fix: Added 'wb' as a valid write mode for streams -* Bug fix: `Guzzle\Http\Message\Response::json()` now allows scalar values to be returned -* Bug fix: Fixed bug in `Guzzle\Http\Message\Response` where wrapping quotes were stripped from `getEtag()` -* BC: Removed `Guzzle\Http\Utils` class -* BC: Setting a service description on a client will no longer modify the client's command factories. -* BC: Emitting IO events from a RequestMediator is now a parameter that must be set in a request's curl options using - the 'emit_io' key. This was previously set under a request's parameters using 'curl.emit_io' -* BC: `Guzzle\Stream\Stream::getWrapper()` and `Guzzle\Stream\Stream::getSteamType()` are no longer converted to - lowercase -* Operation parameter objects are now lazy loaded internally -* Added ErrorResponsePlugin that can throw errors for responses defined in service description operations' errorResponses -* Added support for instantiating responseType=class responseClass classes. Classes must implement - `Guzzle\Service\Command\ResponseClassInterface` -* Added support for additionalProperties for top-level parameters in responseType=model responseClasses. These - additional properties also support locations and can be used to parse JSON responses where the outermost part of the - JSON is an array -* Added support for nested renaming of JSON models (rename sentAs to name) -* CachePlugin - * Added support for stale-if-error so that the CachePlugin can now serve stale content from the cache on error - * Debug headers can now added to cached response in the CachePlugin - -## 3.2.0 - 2013-02-14 - -* CurlMulti is no longer reused globally. A new multi object is created per-client. This helps to isolate clients. -* URLs with no path no longer contain a "/" by default -* Guzzle\Http\QueryString does no longer manages the leading "?". This is now handled in Guzzle\Http\Url. -* BadResponseException no longer includes the full request and response message -* Adding setData() to Guzzle\Service\Description\ServiceDescriptionInterface -* Adding getResponseBody() to Guzzle\Http\Message\RequestInterface -* Various updates to classes to use ServiceDescriptionInterface type hints rather than ServiceDescription -* Header values can now be normalized into distinct values when multiple headers are combined with a comma separated list -* xmlEncoding can now be customized for the XML declaration of a XML service description operation -* Guzzle\Http\QueryString now uses Guzzle\Http\QueryAggregator\QueryAggregatorInterface objects to add custom value - aggregation and no longer uses callbacks -* The URL encoding implementation of Guzzle\Http\QueryString can now be customized -* Bug fix: Filters were not always invoked for array service description parameters -* Bug fix: Redirects now use a target response body rather than a temporary response body -* Bug fix: The default exponential backoff BackoffPlugin was not giving when the request threshold was exceeded -* Bug fix: Guzzle now takes the first found value when grabbing Cache-Control directives - -## 3.1.2 - 2013-01-27 - -* Refactored how operation responses are parsed. Visitors now include a before() method responsible for parsing the - response body. For example, the XmlVisitor now parses the XML response into an array in the before() method. -* Fixed an issue where cURL would not automatically decompress responses when the Accept-Encoding header was sent -* CURLOPT_SSL_VERIFYHOST is never set to 1 because it is deprecated (see 5e0ff2ef20f839e19d1eeb298f90ba3598784444) -* Fixed a bug where redirect responses were not chained correctly using getPreviousResponse() -* Setting default headers on a client after setting the user-agent will not erase the user-agent setting - -## 3.1.1 - 2013-01-20 - -* Adding wildcard support to Guzzle\Common\Collection::getPath() -* Adding alias support to ServiceBuilder configs -* Adding Guzzle\Service\Resource\CompositeResourceIteratorFactory and cleaning up factory interface - -## 3.1.0 - 2013-01-12 - -* BC: CurlException now extends from RequestException rather than BadResponseException -* BC: Renamed Guzzle\Plugin\Cache\CanCacheStrategyInterface::canCache() to canCacheRequest() and added CanCacheResponse() -* Added getData to ServiceDescriptionInterface -* Added context array to RequestInterface::setState() -* Bug: Removing hard dependency on the BackoffPlugin from Guzzle\Http -* Bug: Adding required content-type when JSON request visitor adds JSON to a command -* Bug: Fixing the serialization of a service description with custom data -* Made it easier to deal with exceptions thrown when transferring commands or requests in parallel by providing - an array of successful and failed responses -* Moved getPath from Guzzle\Service\Resource\Model to Guzzle\Common\Collection -* Added Guzzle\Http\IoEmittingEntityBody -* Moved command filtration from validators to location visitors -* Added `extends` attributes to service description parameters -* Added getModels to ServiceDescriptionInterface - -## 3.0.7 - 2012-12-19 - -* Fixing phar detection when forcing a cacert to system if null or true -* Allowing filename to be passed to `Guzzle\Http\Message\Request::setResponseBody()` -* Cleaning up `Guzzle\Common\Collection::inject` method -* Adding a response_body location to service descriptions - -## 3.0.6 - 2012-12-09 - -* CurlMulti performance improvements -* Adding setErrorResponses() to Operation -* composer.json tweaks - -## 3.0.5 - 2012-11-18 - -* Bug: Fixing an infinite recursion bug caused from revalidating with the CachePlugin -* Bug: Response body can now be a string containing "0" -* Bug: Using Guzzle inside of a phar uses system by default but now allows for a custom cacert -* Bug: QueryString::fromString now properly parses query string parameters that contain equal signs -* Added support for XML attributes in service description responses -* DefaultRequestSerializer now supports array URI parameter values for URI template expansion -* Added better mimetype guessing to requests and post files - -## 3.0.4 - 2012-11-11 - -* Bug: Fixed a bug when adding multiple cookies to a request to use the correct glue value -* Bug: Cookies can now be added that have a name, domain, or value set to "0" -* Bug: Using the system cacert bundle when using the Phar -* Added json and xml methods to Response to make it easier to parse JSON and XML response data into data structures -* Enhanced cookie jar de-duplication -* Added the ability to enable strict cookie jars that throw exceptions when invalid cookies are added -* Added setStream to StreamInterface to actually make it possible to implement custom rewind behavior for entity bodies -* Added the ability to create any sort of hash for a stream rather than just an MD5 hash - -## 3.0.3 - 2012-11-04 - -* Implementing redirects in PHP rather than cURL -* Added PECL URI template extension and using as default parser if available -* Bug: Fixed Content-Length parsing of Response factory -* Adding rewind() method to entity bodies and streams. Allows for custom rewinding of non-repeatable streams. -* Adding ToArrayInterface throughout library -* Fixing OauthPlugin to create unique nonce values per request - -## 3.0.2 - 2012-10-25 - -* Magic methods are enabled by default on clients -* Magic methods return the result of a command -* Service clients no longer require a base_url option in the factory -* Bug: Fixed an issue with URI templates where null template variables were being expanded - -## 3.0.1 - 2012-10-22 - -* Models can now be used like regular collection objects by calling filter, map, etc. -* Models no longer require a Parameter structure or initial data in the constructor -* Added a custom AppendIterator to get around a PHP bug with the `\AppendIterator` - -## 3.0.0 - 2012-10-15 - -* Rewrote service description format to be based on Swagger - * Now based on JSON schema - * Added nested input structures and nested response models - * Support for JSON and XML input and output models - * Renamed `commands` to `operations` - * Removed dot class notation - * Removed custom types -* Broke the project into smaller top-level namespaces to be more component friendly -* Removed support for XML configs and descriptions. Use arrays or JSON files. -* Removed the Validation component and Inspector -* Moved all cookie code to Guzzle\Plugin\Cookie -* Magic methods on a Guzzle\Service\Client now return the command un-executed. -* Calling getResult() or getResponse() on a command will lazily execute the command if needed. -* Now shipping with cURL's CA certs and using it by default -* Added previousResponse() method to response objects -* No longer sending Accept and Accept-Encoding headers on every request -* Only sending an Expect header by default when a payload is greater than 1MB -* Added/moved client options: - * curl.blacklist to curl.option.blacklist - * Added ssl.certificate_authority -* Added a Guzzle\Iterator component -* Moved plugins from Guzzle\Http\Plugin to Guzzle\Plugin -* Added a more robust backoff retry strategy (replaced the ExponentialBackoffPlugin) -* Added a more robust caching plugin -* Added setBody to response objects -* Updating LogPlugin to use a more flexible MessageFormatter -* Added a completely revamped build process -* Cleaning up Collection class and removing default values from the get method -* Fixed ZF2 cache adapters - -## 2.8.8 - 2012-10-15 - -* Bug: Fixed a cookie issue that caused dot prefixed domains to not match where popular browsers did - -## 2.8.7 - 2012-09-30 - -* Bug: Fixed config file aliases for JSON includes -* Bug: Fixed cookie bug on a request object by using CookieParser to parse cookies on requests -* Bug: Removing the path to a file when sending a Content-Disposition header on a POST upload -* Bug: Hardening request and response parsing to account for missing parts -* Bug: Fixed PEAR packaging -* Bug: Fixed Request::getInfo -* Bug: Fixed cases where CURLM_CALL_MULTI_PERFORM return codes were causing curl transactions to fail -* Adding the ability for the namespace Iterator factory to look in multiple directories -* Added more getters/setters/removers from service descriptions -* Added the ability to remove POST fields from OAuth signatures -* OAuth plugin now supports 2-legged OAuth - -## 2.8.6 - 2012-09-05 - -* Added the ability to modify and build service descriptions -* Added the use of visitors to apply parameters to locations in service descriptions using the dynamic command -* Added a `json` parameter location -* Now allowing dot notation for classes in the CacheAdapterFactory -* Using the union of two arrays rather than an array_merge when extending service builder services and service params -* Ensuring that a service is a string before doing strpos() checks on it when substituting services for references - in service builder config files. -* Services defined in two different config files that include one another will by default replace the previously - defined service, but you can now create services that extend themselves and merge their settings over the previous -* The JsonLoader now supports aliasing filenames with different filenames. This allows you to alias something like - '_default' with a default JSON configuration file. - -## 2.8.5 - 2012-08-29 - -* Bug: Suppressed empty arrays from URI templates -* Bug: Added the missing $options argument from ServiceDescription::factory to enable caching -* Added support for HTTP responses that do not contain a reason phrase in the start-line -* AbstractCommand commands are now invokable -* Added a way to get the data used when signing an Oauth request before a request is sent - -## 2.8.4 - 2012-08-15 - -* Bug: Custom delay time calculations are no longer ignored in the ExponentialBackoffPlugin -* Added the ability to transfer entity bodies as a string rather than streamed. This gets around curl error 65. Set `body_as_string` in a request's curl options to enable. -* Added a StreamInterface, EntityBodyInterface, and added ftell() to Guzzle\Common\Stream -* Added an AbstractEntityBodyDecorator and a ReadLimitEntityBody decorator to transfer only a subset of a decorated stream -* Stream and EntityBody objects will now return the file position to the previous position after a read required operation (e.g. getContentMd5()) -* Added additional response status codes -* Removed SSL information from the default User-Agent header -* DELETE requests can now send an entity body -* Added an EventDispatcher to the ExponentialBackoffPlugin and added an ExponentialBackoffLogger to log backoff retries -* Added the ability of the MockPlugin to consume mocked request bodies -* LogPlugin now exposes request and response objects in the extras array - -## 2.8.3 - 2012-07-30 - -* Bug: Fixed a case where empty POST requests were sent as GET requests -* Bug: Fixed a bug in ExponentialBackoffPlugin that caused fatal errors when retrying an EntityEnclosingRequest that does not have a body -* Bug: Setting the response body of a request to null after completing a request, not when setting the state of a request to new -* Added multiple inheritance to service description commands -* Added an ApiCommandInterface and added `getParamNames()` and `hasParam()` -* Removed the default 2mb size cutoff from the Md5ValidatorPlugin so that it now defaults to validating everything -* Changed CurlMulti::perform to pass a smaller timeout to CurlMulti::executeHandles - -## 2.8.2 - 2012-07-24 - -* Bug: Query string values set to 0 are no longer dropped from the query string -* Bug: A Collection object is no longer created each time a call is made to `Guzzle\Service\Command\AbstractCommand::getRequestHeaders()` -* Bug: `+` is now treated as an encoded space when parsing query strings -* QueryString and Collection performance improvements -* Allowing dot notation for class paths in filters attribute of a service descriptions - -## 2.8.1 - 2012-07-16 - -* Loosening Event Dispatcher dependency -* POST redirects can now be customized using CURLOPT_POSTREDIR - -## 2.8.0 - 2012-07-15 - -* BC: Guzzle\Http\Query - * Query strings with empty variables will always show an equal sign unless the variable is set to QueryString::BLANK (e.g. ?acl= vs ?acl) - * Changed isEncodingValues() and isEncodingFields() to isUrlEncoding() - * Changed setEncodeValues(bool) and setEncodeFields(bool) to useUrlEncoding(bool) - * Changed the aggregation functions of QueryString to be static methods - * Can now use fromString() with querystrings that have a leading ? -* cURL configuration values can be specified in service descriptions using `curl.` prefixed parameters -* Content-Length is set to 0 before emitting the request.before_send event when sending an empty request body -* Cookies are no longer URL decoded by default -* Bug: URI template variables set to null are no longer expanded - -## 2.7.2 - 2012-07-02 - -* BC: Moving things to get ready for subtree splits. Moving Inflection into Common. Moving Guzzle\Http\Parser to Guzzle\Parser. -* BC: Removing Guzzle\Common\Batch\Batch::count() and replacing it with isEmpty() -* CachePlugin now allows for a custom request parameter function to check if a request can be cached -* Bug fix: CachePlugin now only caches GET and HEAD requests by default -* Bug fix: Using header glue when transferring headers over the wire -* Allowing deeply nested arrays for composite variables in URI templates -* Batch divisors can now return iterators or arrays - -## 2.7.1 - 2012-06-26 - -* Minor patch to update version number in UA string -* Updating build process - -## 2.7.0 - 2012-06-25 - -* BC: Inflection classes moved to Guzzle\Inflection. No longer static methods. Can now inject custom inflectors into classes. -* BC: Removed magic setX methods from commands -* BC: Magic methods mapped to service description commands are now inflected in the command factory rather than the client __call() method -* Verbose cURL options are no longer enabled by default. Set curl.debug to true on a client to enable. -* Bug: Now allowing colons in a response start-line (e.g. HTTP/1.1 503 Service Unavailable: Back-end server is at capacity) -* Guzzle\Service\Resource\ResourceIteratorApplyBatched now internally uses the Guzzle\Common\Batch namespace -* Added Guzzle\Service\Plugin namespace and a PluginCollectionPlugin -* Added the ability to set POST fields and files in a service description -* Guzzle\Http\EntityBody::factory() now accepts objects with a __toString() method -* Adding a command.before_prepare event to clients -* Added BatchClosureTransfer and BatchClosureDivisor -* BatchTransferException now includes references to the batch divisor and transfer strategies -* Fixed some tests so that they pass more reliably -* Added Guzzle\Common\Log\ArrayLogAdapter - -## 2.6.6 - 2012-06-10 - -* BC: Removing Guzzle\Http\Plugin\BatchQueuePlugin -* BC: Removing Guzzle\Service\Command\CommandSet -* Adding generic batching system (replaces the batch queue plugin and command set) -* Updating ZF cache and log adapters and now using ZF's composer repository -* Bug: Setting the name of each ApiParam when creating through an ApiCommand -* Adding result_type, result_doc, deprecated, and doc_url to service descriptions -* Bug: Changed the default cookie header casing back to 'Cookie' - -## 2.6.5 - 2012-06-03 - -* BC: Renaming Guzzle\Http\Message\RequestInterface::getResourceUri() to getResource() -* BC: Removing unused AUTH_BASIC and AUTH_DIGEST constants from -* BC: Guzzle\Http\Cookie is now used to manage Set-Cookie data, not Cookie data -* BC: Renaming methods in the CookieJarInterface -* Moving almost all cookie logic out of the CookiePlugin and into the Cookie or CookieJar implementations -* Making the default glue for HTTP headers ';' instead of ',' -* Adding a removeValue to Guzzle\Http\Message\Header -* Adding getCookies() to request interface. -* Making it easier to add event subscribers to HasDispatcherInterface classes. Can now directly call addSubscriber() - -## 2.6.4 - 2012-05-30 - -* BC: Cleaning up how POST files are stored in EntityEnclosingRequest objects. Adding PostFile class. -* BC: Moving ApiCommand specific functionality from the Inspector and on to the ApiCommand -* Bug: Fixing magic method command calls on clients -* Bug: Email constraint only validates strings -* Bug: Aggregate POST fields when POST files are present in curl handle -* Bug: Fixing default User-Agent header -* Bug: Only appending or prepending parameters in commands if they are specified -* Bug: Not requiring response reason phrases or status codes to match a predefined list of codes -* Allowing the use of dot notation for class namespaces when using instance_of constraint -* Added any_match validation constraint -* Added an AsyncPlugin -* Passing request object to the calculateWait method of the ExponentialBackoffPlugin -* Allowing the result of a command object to be changed -* Parsing location and type sub values when instantiating a service description rather than over and over at runtime - -## 2.6.3 - 2012-05-23 - -* [BC] Guzzle\Common\FromConfigInterface no longer requires any config options. -* [BC] Refactoring how POST files are stored on an EntityEnclosingRequest. They are now separate from POST fields. -* You can now use an array of data when creating PUT request bodies in the request factory. -* Removing the requirement that HTTPS requests needed a Cache-Control: public directive to be cacheable. -* [Http] Adding support for Content-Type in multipart POST uploads per upload -* [Http] Added support for uploading multiple files using the same name (foo[0], foo[1]) -* Adding more POST data operations for easier manipulation of POST data. -* You can now set empty POST fields. -* The body of a request is only shown on EntityEnclosingRequest objects that do not use POST files. -* Split the Guzzle\Service\Inspector::validateConfig method into two methods. One to initialize when a command is created, and one to validate. -* CS updates - -## 2.6.2 - 2012-05-19 - -* [Http] Better handling of nested scope requests in CurlMulti. Requests are now always prepares in the send() method rather than the addRequest() method. - -## 2.6.1 - 2012-05-19 - -* [BC] Removing 'path' support in service descriptions. Use 'uri'. -* [BC] Guzzle\Service\Inspector::parseDocBlock is now protected. Adding getApiParamsForClass() with cache. -* [BC] Removing Guzzle\Common\NullObject. Use https://github.com/mtdowling/NullObject if you need it. -* [BC] Removing Guzzle\Common\XmlElement. -* All commands, both dynamic and concrete, have ApiCommand objects. -* Adding a fix for CurlMulti so that if all of the connections encounter some sort of curl error, then the loop exits. -* Adding checks to EntityEnclosingRequest so that empty POST files and fields are ignored. -* Making the method signature of Guzzle\Service\Builder\ServiceBuilder::factory more flexible. - -## 2.6.0 - 2012-05-15 - -* [BC] Moving Guzzle\Service\Builder to Guzzle\Service\Builder\ServiceBuilder -* [BC] Executing a Command returns the result of the command rather than the command -* [BC] Moving all HTTP parsing logic to Guzzle\Http\Parsers. Allows for faster C implementations if needed. -* [BC] Changing the Guzzle\Http\Message\Response::setProtocol() method to accept a protocol and version in separate args. -* [BC] Moving ResourceIterator* to Guzzle\Service\Resource -* [BC] Completely refactored ResourceIterators to iterate over a cloned command object -* [BC] Moved Guzzle\Http\UriTemplate to Guzzle\Http\Parser\UriTemplate\UriTemplate -* [BC] Guzzle\Guzzle is now deprecated -* Moving Guzzle\Common\Guzzle::inject to Guzzle\Common\Collection::inject -* Adding Guzzle\Version class to give version information about Guzzle -* Adding Guzzle\Http\Utils class to provide getDefaultUserAgent() and getHttpDate() -* Adding Guzzle\Curl\CurlVersion to manage caching curl_version() data -* ServiceDescription and ServiceBuilder are now cacheable using similar configs -* Changing the format of XML and JSON service builder configs. Backwards compatible. -* Cleaned up Cookie parsing -* Trimming the default Guzzle User-Agent header -* Adding a setOnComplete() method to Commands that is called when a command completes -* Keeping track of requests that were mocked in the MockPlugin -* Fixed a caching bug in the CacheAdapterFactory -* Inspector objects can be injected into a Command object -* Refactoring a lot of code and tests to be case insensitive when dealing with headers -* Adding Guzzle\Http\Message\HeaderComparison for easy comparison of HTTP headers using a DSL -* Adding the ability to set global option overrides to service builder configs -* Adding the ability to include other service builder config files from within XML and JSON files -* Moving the parseQuery method out of Url and on to QueryString::fromString() as a static factory method. - -## 2.5.0 - 2012-05-08 - -* Major performance improvements -* [BC] Simplifying Guzzle\Common\Collection. Please check to see if you are using features that are now deprecated. -* [BC] Using a custom validation system that allows a flyweight implementation for much faster validation. No longer using Symfony2 Validation component. -* [BC] No longer supporting "{{ }}" for injecting into command or UriTemplates. Use "{}" -* Added the ability to passed parameters to all requests created by a client -* Added callback functionality to the ExponentialBackoffPlugin -* Using microtime in ExponentialBackoffPlugin to allow more granular backoff strategies. -* Rewinding request stream bodies when retrying requests -* Exception is thrown when JSON response body cannot be decoded -* Added configurable magic method calls to clients and commands. This is off by default. -* Fixed a defect that added a hash to every parsed URL part -* Fixed duplicate none generation for OauthPlugin. -* Emitting an event each time a client is generated by a ServiceBuilder -* Using an ApiParams object instead of a Collection for parameters of an ApiCommand -* cache.* request parameters should be renamed to params.cache.* -* Added the ability to set arbitrary curl options on requests (disable_wire, progress, etc.). See CurlHandle. -* Added the ability to disable type validation of service descriptions -* ServiceDescriptions and ServiceBuilders are now Serializable diff --git a/core/vendor/guzzlehttp/guzzle/LICENSE b/core/vendor/guzzlehttp/guzzle/LICENSE deleted file mode 100644 index 71d3b78..0000000 --- a/core/vendor/guzzlehttp/guzzle/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2014 Michael Dowling, https://github.com/mtdowling - -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/core/vendor/guzzlehttp/guzzle/Makefile b/core/vendor/guzzlehttp/guzzle/Makefile deleted file mode 100644 index 69bf327..0000000 --- a/core/vendor/guzzlehttp/guzzle/Makefile +++ /dev/null @@ -1,50 +0,0 @@ -all: clean coverage docs - -start-server: - cd vendor/guzzlehttp/ringphp && make start-server - -stop-server: - cd vendor/guzzlehttp/ringphp && make stop-server - -test: start-server - vendor/bin/phpunit - $(MAKE) stop-server - -coverage: start-server - vendor/bin/phpunit --coverage-html=artifacts/coverage - $(MAKE) stop-server - -view-coverage: - open artifacts/coverage/index.html - -clean: - rm -rf artifacts/* - -docs: - cd docs && make html && cd .. - -view-docs: - open docs/_build/html/index.html - -tag: - $(if $(TAG),,$(error TAG is not defined. Pass via "make tag TAG=4.2.1")) - @echo Tagging $(TAG) - chag update $(TAG) - sed -i '' -e "s/VERSION = '.*'/VERSION = '$(TAG)'/" src/ClientInterface.php - php -l src/ClientInterface.php - git add -A - git commit -m '$(TAG) release' - chag tag - -perf: start-server - php tests/perf.php - $(MAKE) stop-server - -package: burgomaster - php build/packager.php - -burgomaster: - mkdir -p build/artifacts - curl -s https://raw.githubusercontent.com/mtdowling/Burgomaster/0.0.2/src/Burgomaster.php > build/artifacts/Burgomaster.php - -.PHONY: docs burgomaster diff --git a/core/vendor/guzzlehttp/guzzle/README.md b/core/vendor/guzzlehttp/guzzle/README.md deleted file mode 100644 index 9df6981..0000000 --- a/core/vendor/guzzlehttp/guzzle/README.md +++ /dev/null @@ -1,70 +0,0 @@ -Guzzle, PHP HTTP client and webservice framework -================================================ - -[![Build Status](https://secure.travis-ci.org/guzzle/guzzle.png?branch=master)](http://travis-ci.org/guzzle/guzzle) - -Guzzle is a PHP HTTP client that makes it easy to send HTTP requests and -trivial to integrate with web services. - -- Manages things like persistent connections, represents query strings as - collections, simplifies sending streaming POST requests with fields and - files, and abstracts away the underlying HTTP transport layer. -- Can send both synchronous and asynchronous requests using the same interface - without requiring a dependency on a specific event loop. -- Pluggable HTTP adapters allows Guzzle to integrate with any method you choose - for sending HTTP requests over the wire (e.g., cURL, sockets, PHP's stream - wrapper, non-blocking event loops like ReactPHP. -- Guzzle makes it so that you no longer need to fool around with cURL options, - stream contexts, or sockets. - -```php -$client = new GuzzleHttp\Client(); -$response = $client->get('http://guzzlephp.org'); -$res = $client->get('https://api.github.com/user', ['auth' => ['user', 'pass']]); -echo $res->getStatusCode(); -// "200" -echo $res->getHeader('content-type'); -// 'application/json; charset=utf8' -echo $res->getBody(); -// {"type":"User"...' -var_export($res->json()); -// Outputs the JSON decoded data - -// Send an asynchronous request. -$req = $client->createRequest('GET', 'http://httpbin.org', ['future' => true]); -$client->send($req)->then(function ($response) { - echo 'I completed! ' . $response; -}); -``` - -Get more information and answers with the -[Documentation](http://guzzlephp.org/), -[Forums](https://groups.google.com/forum/?hl=en#!forum/guzzle), -and [Gitter](https://gitter.im/guzzle/guzzle). - -### Installing via Composer - -The recommended way to install Guzzle is through -[Composer](http://getcomposer.org). - -```bash -# Install Composer -curl -sS https://getcomposer.org/installer | php -``` - -Next, run the Composer command to install the latest stable version of Guzzle: - -```bash -composer require guzzlehttp/guzzle -``` - -After installing, you need to require Composer's autoloader: - -```php -require 'vendor/autoload.php'; -``` - -### Documentation - -More information can be found in the online documentation at -http://guzzlephp.org/. diff --git a/core/vendor/guzzlehttp/guzzle/UPGRADING.md b/core/vendor/guzzlehttp/guzzle/UPGRADING.md deleted file mode 100644 index ee8c39d..0000000 --- a/core/vendor/guzzlehttp/guzzle/UPGRADING.md +++ /dev/null @@ -1,1050 +0,0 @@ -Guzzle Upgrade Guide -==================== - -4.x to 5.0 ----------- - -## Rewritten Adapter Layer - -Guzzle now uses `RingPHP `_ to send -HTTP requests. The `adapter` option in a `GuzzleHttp\Client` constructor -is still supported, but it has now been renamed to `handler`. Instead of -passing a `GuzzleHttp\Adapter\AdapterInterface`, you must now pass a PHP -`callable` that follows the RingPHP specification. - -## Removed Fluent Interfaces - -`Fluent interfaces were removed `_ -from the following classes: - -- `GuzzleHttp\Collection` -- `GuzzleHttp\Url` -- `GuzzleHttp\Query` -- `GuzzleHttp\Post\PostBody` -- `GuzzleHttp\Cookie\SetCookie` - -## Removed functions.php - -Removed "functions.php", so that Guzzle is truly PSR-4 compliant. The following -functions can be used as replacements. - -- `GuzzleHttp\json_decode` -> `GuzzleHttp\Utils::jsonDecode` -- `GuzzleHttp\get_path` -> `GuzzleHttp\Utils::getPath` -- `GuzzleHttp\Utils::setPath` -> `GuzzleHttp\set_path` -- `GuzzleHttp\Pool::batch` -> `GuzzleHttp\batch`. This function is, however, - deprecated in favor of using `GuzzleHttp\Pool::batch()`. - -The "procedural" global client has been removed with no replacement (e.g., -`GuzzleHttp\get()`, `GuzzleHttp\post()`, etc.). Use a `GuzzleHttl\Client` -object as a replacement. - -## `throwImmediately` has been removed - -The concept of "throwImmediately" has been removed from exceptions and error -events. This control mechanism was used to stop a transfer of concurrent -requests from completing. This can now be handled by throwing the exception or -by cancelling a pool of requests or each outstanding future request -individually. - -## headers event has been removed - -Removed the "headers" event. This event was only useful for changing the -body a response once the headers of the response were known. You can implement -a similar behavior in a number of ways. One example might be to use a -FnStream that has access to the transaction being sent. For example, when the -first byte is written, you could check if the response headers match your -expectations, and if so, change the actual stream body that is being -written to. - -## Updates to HTTP Messages - -Removed the `asArray` parameter from -`GuzzleHttp\Message\MessageInterface::getHeader`. If you want to get a header -value as an array, then use the newly added `getHeaderAsArray()` method of -`MessageInterface`. This change makes the Guzzle interfaces compatible with -the PSR-7 interfaces. - -3.x to 4.0 ----------- - -## Overarching changes: - -- Now requires PHP 5.4 or greater. -- No longer requires cURL to send requests. -- Guzzle no longer wraps every exception it throws. Only exceptions that are - recoverable are now wrapped by Guzzle. -- Various namespaces have been removed or renamed. -- No longer requiring the Symfony EventDispatcher. A custom event dispatcher - based on the Symfony EventDispatcher is - now utilized in `GuzzleHttp\Event\EmitterInterface` (resulting in significant - speed and functionality improvements). - -Changes per Guzzle 3.x namespace are described below. - -## Batch - -The `Guzzle\Batch` namespace has been removed. This is best left to -third-parties to implement on top of Guzzle's core HTTP library. - -## Cache - -The `Guzzle\Cache` namespace has been removed. (Todo: No suitable replacement -has been implemented yet, but hoping to utilize a PSR cache interface). - -## Common - -- Removed all of the wrapped exceptions. It's better to use the standard PHP - library for unrecoverable exceptions. -- `FromConfigInterface` has been removed. -- `Guzzle\Common\Version` has been removed. The VERSION constant can be found - at `GuzzleHttp\ClientInterface::VERSION`. - -### Collection - -- `getAll` has been removed. Use `toArray` to convert a collection to an array. -- `inject` has been removed. -- `keySearch` has been removed. -- `getPath` no longer supports wildcard expressions. Use something better like - JMESPath for this. -- `setPath` now supports appending to an existing array via the `[]` notation. - -### Events - -Guzzle no longer requires Symfony's EventDispatcher component. Guzzle now uses -`GuzzleHttp\Event\Emitter`. - -- `Symfony\Component\EventDispatcher\EventDispatcherInterface` is replaced by - `GuzzleHttp\Event\EmitterInterface`. -- `Symfony\Component\EventDispatcher\EventDispatcher` is replaced by - `GuzzleHttp\Event\Emitter`. -- `Symfony\Component\EventDispatcher\Event` is replaced by - `GuzzleHttp\Event\Event`, and Guzzle now has an EventInterface in - `GuzzleHttp\Event\EventInterface`. -- `AbstractHasDispatcher` has moved to a trait, `HasEmitterTrait`, and - `HasDispatcherInterface` has moved to `HasEmitterInterface`. Retrieving the - event emitter of a request, client, etc. now uses the `getEmitter` method - rather than the `getDispatcher` method. - -#### Emitter - -- Use the `once()` method to add a listener that automatically removes itself - the first time it is invoked. -- Use the `listeners()` method to retrieve a list of event listeners rather than - the `getListeners()` method. -- Use `emit()` instead of `dispatch()` to emit an event from an emitter. -- Use `attach()` instead of `addSubscriber()` and `detach()` instead of - `removeSubscriber()`. - -```php -$mock = new Mock(); -// 3.x -$request->getEventDispatcher()->addSubscriber($mock); -$request->getEventDispatcher()->removeSubscriber($mock); -// 4.x -$request->getEmitter()->attach($mock); -$request->getEmitter()->detach($mock); -``` - -Use the `on()` method to add a listener rather than the `addListener()` method. - -```php -// 3.x -$request->getEventDispatcher()->addListener('foo', function (Event $event) { /* ... */ } ); -// 4.x -$request->getEmitter()->on('foo', function (Event $event, $name) { /* ... */ } ); -``` - -## Http - -### General changes - -- The cacert.pem certificate has been moved to `src/cacert.pem`. -- Added the concept of adapters that are used to transfer requests over the - wire. -- Simplified the event system. -- Sending requests in parallel is still possible, but batching is no longer a - concept of the HTTP layer. Instead, you must use the `complete` and `error` - events to asynchronously manage parallel request transfers. -- `Guzzle\Http\Url` has moved to `GuzzleHttp\Url`. -- `Guzzle\Http\QueryString` has moved to `GuzzleHttp\Query`. -- QueryAggregators have been rewritten so that they are simply callable - functions. -- `GuzzleHttp\StaticClient` has been removed. Use the functions provided in - `functions.php` for an easy to use static client instance. -- Exceptions in `GuzzleHttp\Exception` have been updated to all extend from - `GuzzleHttp\Exception\TransferException`. - -### Client - -Calling methods like `get()`, `post()`, `head()`, etc. no longer create and -return a request, but rather creates a request, sends the request, and returns -the response. - -```php -// 3.0 -$request = $client->get('/'); -$response = $request->send(); - -// 4.0 -$response = $client->get('/'); - -// or, to mirror the previous behavior -$request = $client->createRequest('GET', '/'); -$response = $client->send($request); -``` - -`GuzzleHttp\ClientInterface` has changed. - -- The `send` method no longer accepts more than one request. Use `sendAll` to - send multiple requests in parallel. -- `setUserAgent()` has been removed. Use a default request option instead. You - could, for example, do something like: - `$client->setConfig('defaults/headers/User-Agent', 'Foo/Bar ' . $client::getDefaultUserAgent())`. -- `setSslVerification()` has been removed. Use default request options instead, - like `$client->setConfig('defaults/verify', true)`. - -`GuzzleHttp\Client` has changed. - -- The constructor now accepts only an associative array. You can include a - `base_url` string or array to use a URI template as the base URL of a client. - You can also specify a `defaults` key that is an associative array of default - request options. You can pass an `adapter` to use a custom adapter, - `batch_adapter` to use a custom adapter for sending requests in parallel, or - a `message_factory` to change the factory used to create HTTP requests and - responses. -- The client no longer emits a `client.create_request` event. -- Creating requests with a client no longer automatically utilize a URI - template. You must pass an array into a creational method (e.g., - `createRequest`, `get`, `put`, etc.) in order to expand a URI template. - -### Messages - -Messages no longer have references to their counterparts (i.e., a request no -longer has a reference to it's response, and a response no loger has a -reference to its request). This association is now managed through a -`GuzzleHttp\Adapter\TransactionInterface` object. You can get references to -these transaction objects using request events that are emitted over the -lifecycle of a request. - -#### Requests with a body - -- `GuzzleHttp\Message\EntityEnclosingRequest` and - `GuzzleHttp\Message\EntityEnclosingRequestInterface` have been removed. The - separation between requests that contain a body and requests that do not - contain a body has been removed, and now `GuzzleHttp\Message\RequestInterface` - handles both use cases. -- Any method that previously accepts a `GuzzleHttp\Response` object now accept a - `GuzzleHttp\Message\ResponseInterface`. -- `GuzzleHttp\Message\RequestFactoryInterface` has been renamed to - `GuzzleHttp\Message\MessageFactoryInterface`. This interface is used to create - both requests and responses and is implemented in - `GuzzleHttp\Message\MessageFactory`. -- POST field and file methods have been removed from the request object. You - must now use the methods made available to `GuzzleHttp\Post\PostBodyInterface` - to control the format of a POST body. Requests that are created using a - standard `GuzzleHttp\Message\MessageFactoryInterface` will automatically use - a `GuzzleHttp\Post\PostBody` body if the body was passed as an array or if - the method is POST and no body is provided. - -```php -$request = $client->createRequest('POST', '/'); -$request->getBody()->setField('foo', 'bar'); -$request->getBody()->addFile(new PostFile('file_key', fopen('/path/to/content', 'r'))); -``` - -#### Headers - -- `GuzzleHttp\Message\Header` has been removed. Header values are now simply - represented by an array of values or as a string. Header values are returned - as a string by default when retrieving a header value from a message. You can - pass an optional argument of `true` to retrieve a header value as an array - of strings instead of a single concatenated string. -- `GuzzleHttp\PostFile` and `GuzzleHttp\PostFileInterface` have been moved to - `GuzzleHttp\Post`. This interface has been simplified and now allows the - addition of arbitrary headers. -- Custom headers like `GuzzleHttp\Message\Header\Link` have been removed. Most - of the custom headers are now handled separately in specific - subscribers/plugins, and `GuzzleHttp\Message\HeaderValues::parseParams()` has - been updated to properly handle headers that contain parameters (like the - `Link` header). - -#### Responses - -- `GuzzleHttp\Message\Response::getInfo()` and - `GuzzleHttp\Message\Response::setInfo()` have been removed. Use the event - system to retrieve this type of information. -- `GuzzleHttp\Message\Response::getRawHeaders()` has been removed. -- `GuzzleHttp\Message\Response::getMessage()` has been removed. -- `GuzzleHttp\Message\Response::calculateAge()` and other cache specific - methods have moved to the CacheSubscriber. -- Header specific helper functions like `getContentMd5()` have been removed. - Just use `getHeader('Content-MD5')` instead. -- `GuzzleHttp\Message\Response::setRequest()` and - `GuzzleHttp\Message\Response::getRequest()` have been removed. Use the event - system to work with request and response objects as a transaction. -- `GuzzleHttp\Message\Response::getRedirectCount()` has been removed. Use the - Redirect subscriber instead. -- `GuzzleHttp\Message\Response::isSuccessful()` and other related methods have - been removed. Use `getStatusCode()` instead. - -#### Streaming responses - -Streaming requests can now be created by a client directly, returning a -`GuzzleHttp\Message\ResponseInterface` object that contains a body stream -referencing an open PHP HTTP stream. - -```php -// 3.0 -use Guzzle\Stream\PhpStreamRequestFactory; -$request = $client->get('/'); -$factory = new PhpStreamRequestFactory(); -$stream = $factory->fromRequest($request); -$data = $stream->read(1024); - -// 4.0 -$response = $client->get('/', ['stream' => true]); -// Read some data off of the stream in the response body -$data = $response->getBody()->read(1024); -``` - -#### Redirects - -The `configureRedirects()` method has been removed in favor of a -`allow_redirects` request option. - -```php -// Standard redirects with a default of a max of 5 redirects -$request = $client->createRequest('GET', '/', ['allow_redirects' => true]); - -// Strict redirects with a custom number of redirects -$request = $client->createRequest('GET', '/', [ - 'allow_redirects' => ['max' => 5, 'strict' => true] -]); -``` - -#### EntityBody - -EntityBody interfaces and classes have been removed or moved to -`GuzzleHttp\Stream`. All classes and interfaces that once required -`GuzzleHttp\EntityBodyInterface` now require -`GuzzleHttp\Stream\StreamInterface`. Creating a new body for a request no -longer uses `GuzzleHttp\EntityBody::factory` but now uses -`GuzzleHttp\Stream\Stream::factory` or even better: -`GuzzleHttp\Stream\create()`. - -- `Guzzle\Http\EntityBodyInterface` is now `GuzzleHttp\Stream\StreamInterface` -- `Guzzle\Http\EntityBody` is now `GuzzleHttp\Stream\Stream` -- `Guzzle\Http\CachingEntityBody` is now `GuzzleHttp\Stream\CachingStream` -- `Guzzle\Http\ReadLimitEntityBody` is now `GuzzleHttp\Stream\LimitStream` -- `Guzzle\Http\IoEmittyinEntityBody` has been removed. - -#### Request lifecycle events - -Requests previously submitted a large number of requests. The number of events -emitted over the lifecycle of a request has been significantly reduced to make -it easier to understand how to extend the behavior of a request. All events -emitted during the lifecycle of a request now emit a custom -`GuzzleHttp\Event\EventInterface` object that contains context providing -methods and a way in which to modify the transaction at that specific point in -time (e.g., intercept the request and set a response on the transaction). - -- `request.before_send` has been renamed to `before` and now emits a - `GuzzleHttp\Event\BeforeEvent` -- `request.complete` has been renamed to `complete` and now emits a - `GuzzleHttp\Event\CompleteEvent`. -- `request.sent` has been removed. Use `complete`. -- `request.success` has been removed. Use `complete`. -- `error` is now an event that emits a `GuzzleHttp\Event\ErrorEvent`. -- `request.exception` has been removed. Use `error`. -- `request.receive.status_line` has been removed. -- `curl.callback.progress` has been removed. Use a custom `StreamInterface` to - maintain a status update. -- `curl.callback.write` has been removed. Use a custom `StreamInterface` to - intercept writes. -- `curl.callback.read` has been removed. Use a custom `StreamInterface` to - intercept reads. - -`headers` is a new event that is emitted after the response headers of a -request have been received before the body of the response is downloaded. This -event emits a `GuzzleHttp\Event\HeadersEvent`. - -You can intercept a request and inject a response using the `intercept()` event -of a `GuzzleHttp\Event\BeforeEvent`, `GuzzleHttp\Event\CompleteEvent`, and -`GuzzleHttp\Event\ErrorEvent` event. - -See: http://docs.guzzlephp.org/en/latest/events.html - -## Inflection - -The `Guzzle\Inflection` namespace has been removed. This is not a core concern -of Guzzle. - -## Iterator - -The `Guzzle\Iterator` namespace has been removed. - -- `Guzzle\Iterator\AppendIterator`, `Guzzle\Iterator\ChunkedIterator`, and - `Guzzle\Iterator\MethodProxyIterator` are nice, but not a core requirement of - Guzzle itself. -- `Guzzle\Iterator\FilterIterator` is no longer needed because an equivalent - class is shipped with PHP 5.4. -- `Guzzle\Iterator\MapIterator` is not really needed when using PHP 5.5 because - it's easier to just wrap an iterator in a generator that maps values. - -For a replacement of these iterators, see https://github.com/nikic/iter - -## Log - -The LogPlugin has moved to https://github.com/guzzle/log-subscriber. The -`Guzzle\Log` namespace has been removed. Guzzle now relies on -`Psr\Log\LoggerInterface` for all logging. The MessageFormatter class has been -moved to `GuzzleHttp\Subscriber\Log\Formatter`. - -## Parser - -The `Guzzle\Parser` namespace has been removed. This was previously used to -make it possible to plug in custom parsers for cookies, messages, URI -templates, and URLs; however, this level of complexity is not needed in Guzzle -so it has been removed. - -- Cookie: Cookie parsing logic has been moved to - `GuzzleHttp\Cookie\SetCookie::fromString`. -- Message: Message parsing logic for both requests and responses has been moved - to `GuzzleHttp\Message\MessageFactory::fromMessage`. Message parsing is only - used in debugging or deserializing messages, so it doesn't make sense for - Guzzle as a library to add this level of complexity to parsing messages. -- UriTemplate: URI template parsing has been moved to - `GuzzleHttp\UriTemplate`. The Guzzle library will automatically use the PECL - URI template library if it is installed. -- Url: URL parsing is now performed in `GuzzleHttp\Url::fromString` (previously - it was `Guzzle\Http\Url::factory()`). If custom URL parsing is necessary, - then developers are free to subclass `GuzzleHttp\Url`. - -## Plugin - -The `Guzzle\Plugin` namespace has been renamed to `GuzzleHttp\Subscriber`. -Several plugins are shipping with the core Guzzle library under this namespace. - -- `GuzzleHttp\Subscriber\Cookie`: Replaces the old CookiePlugin. Cookie jar - code has moved to `GuzzleHttp\Cookie`. -- `GuzzleHttp\Subscriber\History`: Replaces the old HistoryPlugin. -- `GuzzleHttp\Subscriber\HttpError`: Throws errors when a bad HTTP response is - received. -- `GuzzleHttp\Subscriber\Mock`: Replaces the old MockPlugin. -- `GuzzleHttp\Subscriber\Prepare`: Prepares the body of a request just before - sending. This subscriber is attached to all requests by default. -- `GuzzleHttp\Subscriber\Redirect`: Replaces the RedirectPlugin. - -The following plugins have been removed (third-parties are free to re-implement -these if needed): - -- `GuzzleHttp\Plugin\Async` has been removed. -- `GuzzleHttp\Plugin\CurlAuth` has been removed. -- `GuzzleHttp\Plugin\ErrorResponse\ErrorResponsePlugin` has been removed. This - functionality should instead be implemented with event listeners that occur - after normal response parsing occurs in the guzzle/command package. - -The following plugins are not part of the core Guzzle package, but are provided -in separate repositories: - -- `Guzzle\Http\Plugin\BackoffPlugin` has been rewritten to be muchs simpler - to build custom retry policies using simple functions rather than various - chained classes. See: https://github.com/guzzle/retry-subscriber -- `Guzzle\Http\Plugin\Cache\CachePlugin` has moved to - https://github.com/guzzle/cache-subscriber -- `Guzzle\Http\Plugin\Log\LogPlugin` has moved to - https://github.com/guzzle/log-subscriber -- `Guzzle\Http\Plugin\Md5\Md5Plugin` has moved to - https://github.com/guzzle/message-integrity-subscriber -- `Guzzle\Http\Plugin\Mock\MockPlugin` has moved to - `GuzzleHttp\Subscriber\MockSubscriber`. -- `Guzzle\Http\Plugin\Oauth\OauthPlugin` has moved to - https://github.com/guzzle/oauth-subscriber - -## Service - -The service description layer of Guzzle has moved into two separate packages: - -- http://github.com/guzzle/command Provides a high level abstraction over web - services by representing web service operations using commands. -- http://github.com/guzzle/guzzle-services Provides an implementation of - guzzle/command that provides request serialization and response parsing using - Guzzle service descriptions. - -## Stream - -Stream have moved to a separate package available at -https://github.com/guzzle/streams. - -`Guzzle\Stream\StreamInterface` has been given a large update to cleanly take -on the responsibilities of `Guzzle\Http\EntityBody` and -`Guzzle\Http\EntityBodyInterface` now that they have been removed. The number -of methods implemented by the `StreamInterface` has been drastically reduced to -allow developers to more easily extend and decorate stream behavior. - -## Removed methods from StreamInterface - -- `getStream` and `setStream` have been removed to better encapsulate streams. -- `getMetadata` and `setMetadata` have been removed in favor of - `GuzzleHttp\Stream\MetadataStreamInterface`. -- `getWrapper`, `getWrapperData`, `getStreamType`, and `getUri` have all been - removed. This data is accessible when - using streams that implement `GuzzleHttp\Stream\MetadataStreamInterface`. -- `rewind` has been removed. Use `seek(0)` for a similar behavior. - -## Renamed methods - -- `detachStream` has been renamed to `detach`. -- `feof` has been renamed to `eof`. -- `ftell` has been renamed to `tell`. -- `readLine` has moved from an instance method to a static class method of - `GuzzleHttp\Stream\Stream`. - -## Metadata streams - -`GuzzleHttp\Stream\MetadataStreamInterface` has been added to denote streams -that contain additional metadata accessible via `getMetadata()`. -`GuzzleHttp\Stream\StreamInterface::getMetadata` and -`GuzzleHttp\Stream\StreamInterface::setMetadata` have been removed. - -## StreamRequestFactory - -The entire concept of the StreamRequestFactory has been removed. The way this -was used in Guzzle 3 broke the actual interface of sending streaming requests -(instead of getting back a Response, you got a StreamInterface). Streeaming -PHP requests are now implemented throught the `GuzzleHttp\Adapter\StreamAdapter`. - -3.6 to 3.7 ----------- - -### Deprecations - -- You can now enable E_USER_DEPRECATED warnings to see if you are using any deprecated methods.: - -```php -\Guzzle\Common\Version::$emitWarnings = true; -``` - -The following APIs and options have been marked as deprecated: - -- Marked `Guzzle\Http\Message\Request::isResponseBodyRepeatable()` as deprecated. Use `$request->getResponseBody()->isRepeatable()` instead. -- Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use `Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead. -- Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use `Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead. -- Marked `Guzzle\Http\Message\Request::setIsRedirect()` as deprecated. Use the HistoryPlugin instead. -- Marked `Guzzle\Http\Message\Request::isRedirect()` as deprecated. Use the HistoryPlugin instead. -- Marked `Guzzle\Cache\CacheAdapterFactory::factory()` as deprecated -- Marked `Guzzle\Service\Client::enableMagicMethods()` as deprecated. Magic methods can no longer be disabled on a Guzzle\Service\Client. -- Marked `Guzzle\Parser\Url\UrlParser` as deprecated. Just use PHP's `parse_url()` and percent encode your UTF-8. -- Marked `Guzzle\Common\Collection::inject()` as deprecated. -- Marked `Guzzle\Plugin\CurlAuth\CurlAuthPlugin` as deprecated. Use - `$client->getConfig()->setPath('request.options/auth', array('user', 'pass', 'Basic|Digest|NTLM|Any'));` or - `$client->setDefaultOption('auth', array('user', 'pass', 'Basic|Digest|NTLM|Any'));` - -3.7 introduces `request.options` as a parameter for a client configuration and as an optional argument to all creational -request methods. When paired with a client's configuration settings, these options allow you to specify default settings -for various aspects of a request. Because these options make other previous configuration options redundant, several -configuration options and methods of a client and AbstractCommand have been deprecated. - -- Marked `Guzzle\Service\Client::getDefaultHeaders()` as deprecated. Use `$client->getDefaultOption('headers')`. -- Marked `Guzzle\Service\Client::setDefaultHeaders()` as deprecated. Use `$client->setDefaultOption('headers/{header_name}', 'value')`. -- Marked 'request.params' for `Guzzle\Http\Client` as deprecated. Use `$client->setDefaultOption('params/{param_name}', 'value')` -- Marked 'command.headers', 'command.response_body' and 'command.on_complete' as deprecated for AbstractCommand. These will work through Guzzle 4.0 - - $command = $client->getCommand('foo', array( - 'command.headers' => array('Test' => '123'), - 'command.response_body' => '/path/to/file' - )); - - // Should be changed to: - - $command = $client->getCommand('foo', array( - 'command.request_options' => array( - 'headers' => array('Test' => '123'), - 'save_as' => '/path/to/file' - ) - )); - -### Interface changes - -Additions and changes (you will need to update any implementations or subclasses you may have created): - -- Added an `$options` argument to the end of the following methods of `Guzzle\Http\ClientInterface`: - createRequest, head, delete, put, patch, post, options, prepareRequest -- Added an `$options` argument to the end of `Guzzle\Http\Message\Request\RequestFactoryInterface::createRequest()` -- Added an `applyOptions()` method to `Guzzle\Http\Message\Request\RequestFactoryInterface` -- Changed `Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $body = null)` to - `Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $options = array())`. You can still pass in a - resource, string, or EntityBody into the $options parameter to specify the download location of the response. -- Changed `Guzzle\Common\Collection::__construct($data)` to no longer accepts a null value for `$data` but a - default `array()` -- Added `Guzzle\Stream\StreamInterface::isRepeatable` -- Made `Guzzle\Http\Client::expandTemplate` and `getUriTemplate` protected methods. - -The following methods were removed from interfaces. All of these methods are still available in the concrete classes -that implement them, but you should update your code to use alternative methods: - -- Removed `Guzzle\Http\ClientInterface::setDefaultHeaders(). Use - `$client->getConfig()->setPath('request.options/headers/{header_name}', 'value')`. or - `$client->getConfig()->setPath('request.options/headers', array('header_name' => 'value'))` or - `$client->setDefaultOption('headers/{header_name}', 'value')`. or - `$client->setDefaultOption('headers', array('header_name' => 'value'))`. -- Removed `Guzzle\Http\ClientInterface::getDefaultHeaders(). Use `$client->getConfig()->getPath('request.options/headers')`. -- Removed `Guzzle\Http\ClientInterface::expandTemplate()`. This is an implementation detail. -- Removed `Guzzle\Http\ClientInterface::setRequestFactory()`. This is an implementation detail. -- Removed `Guzzle\Http\ClientInterface::getCurlMulti()`. This is a very specific implementation detail. -- Removed `Guzzle\Http\Message\RequestInterface::canCache`. Use the CachePlugin. -- Removed `Guzzle\Http\Message\RequestInterface::setIsRedirect`. Use the HistoryPlugin. -- Removed `Guzzle\Http\Message\RequestInterface::isRedirect`. Use the HistoryPlugin. - -### Cache plugin breaking changes - -- CacheKeyProviderInterface and DefaultCacheKeyProvider are no longer used. All of this logic is handled in a - CacheStorageInterface. These two objects and interface will be removed in a future version. -- Always setting X-cache headers on cached responses -- Default cache TTLs are now handled by the CacheStorageInterface of a CachePlugin -- `CacheStorageInterface::cache($key, Response $response, $ttl = null)` has changed to `cache(RequestInterface - $request, Response $response);` -- `CacheStorageInterface::fetch($key)` has changed to `fetch(RequestInterface $request);` -- `CacheStorageInterface::delete($key)` has changed to `delete(RequestInterface $request);` -- Added `CacheStorageInterface::purge($url)` -- `DefaultRevalidation::__construct(CacheKeyProviderInterface $cacheKey, CacheStorageInterface $cache, CachePlugin - $plugin)` has changed to `DefaultRevalidation::__construct(CacheStorageInterface $cache, - CanCacheStrategyInterface $canCache = null)` -- Added `RevalidationInterface::shouldRevalidate(RequestInterface $request, Response $response)` - -3.5 to 3.6 ----------- - -* Mixed casing of headers are now forced to be a single consistent casing across all values for that header. -* Messages internally use a HeaderCollection object to delegate handling case-insensitive header resolution -* Removed the whole changedHeader() function system of messages because all header changes now go through addHeader(). - For example, setHeader() first removes the header using unset on a HeaderCollection and then calls addHeader(). - Keeping the Host header and URL host in sync is now handled by overriding the addHeader method in Request. -* Specific header implementations can be created for complex headers. When a message creates a header, it uses a - HeaderFactory which can map specific headers to specific header classes. There is now a Link header and - CacheControl header implementation. -* Moved getLinks() from Response to just be used on a Link header object. - -If you previously relied on Guzzle\Http\Message\Header::raw(), then you will need to update your code to use the -HeaderInterface (e.g. toArray(), getAll(), etc.). - -### Interface changes - -* Removed from interface: Guzzle\Http\ClientInterface::setUriTemplate -* Removed from interface: Guzzle\Http\ClientInterface::setCurlMulti() -* Removed Guzzle\Http\Message\Request::receivedRequestHeader() and implemented this functionality in - Guzzle\Http\Curl\RequestMediator -* Removed the optional $asString parameter from MessageInterface::getHeader(). Just cast the header to a string. -* Removed the optional $tryChunkedTransfer option from Guzzle\Http\Message\EntityEnclosingRequestInterface -* Removed the $asObjects argument from Guzzle\Http\Message\MessageInterface::getHeaders() - -### Removed deprecated functions - -* Removed Guzzle\Parser\ParserRegister::get(). Use getParser() -* Removed Guzzle\Parser\ParserRegister::set(). Use registerParser(). - -### Deprecations - -* The ability to case-insensitively search for header values -* Guzzle\Http\Message\Header::hasExactHeader -* Guzzle\Http\Message\Header::raw. Use getAll() -* Deprecated cache control specific methods on Guzzle\Http\Message\AbstractMessage. Use the CacheControl header object - instead. - -### Other changes - -* All response header helper functions return a string rather than mixing Header objects and strings inconsistently -* Removed cURL blacklist support. This is no longer necessary now that Expect, Accept, etc. are managed by Guzzle - directly via interfaces -* Removed the injecting of a request object onto a response object. The methods to get and set a request still exist - but are a no-op until removed. -* Most classes that used to require a `Guzzle\Service\Command\CommandInterface` typehint now request a - `Guzzle\Service\Command\ArrayCommandInterface`. -* Added `Guzzle\Http\Message\RequestInterface::startResponse()` to the RequestInterface to handle injecting a response - on a request while the request is still being transferred -* `Guzzle\Service\Command\CommandInterface` now extends from ToArrayInterface and ArrayAccess - -3.3 to 3.4 ----------- - -Base URLs of a client now follow the rules of http://tools.ietf.org/html/rfc3986#section-5.2.2 when merging URLs. - -3.2 to 3.3 ----------- - -### Response::getEtag() quote stripping removed - -`Guzzle\Http\Message\Response::getEtag()` no longer strips quotes around the ETag response header - -### Removed `Guzzle\Http\Utils` - -The `Guzzle\Http\Utils` class was removed. This class was only used for testing. - -### Stream wrapper and type - -`Guzzle\Stream\Stream::getWrapper()` and `Guzzle\Stream\Stream::getStreamType()` are no longer converted to lowercase. - -### curl.emit_io became emit_io - -Emitting IO events from a RequestMediator is now a parameter that must be set in a request's curl options using the -'emit_io' key. This was previously set under a request's parameters using 'curl.emit_io' - -3.1 to 3.2 ----------- - -### CurlMulti is no longer reused globally - -Before 3.2, the same CurlMulti object was reused globally for each client. This can cause issue where plugins added -to a single client can pollute requests dispatched from other clients. - -If you still wish to reuse the same CurlMulti object with each client, then you can add a listener to the -ServiceBuilder's `service_builder.create_client` event to inject a custom CurlMulti object into each client as it is -created. - -```php -$multi = new Guzzle\Http\Curl\CurlMulti(); -$builder = Guzzle\Service\Builder\ServiceBuilder::factory('/path/to/config.json'); -$builder->addListener('service_builder.create_client', function ($event) use ($multi) { - $event['client']->setCurlMulti($multi); -} -}); -``` - -### No default path - -URLs no longer have a default path value of '/' if no path was specified. - -Before: - -```php -$request = $client->get('http://www.foo.com'); -echo $request->getUrl(); -// >> http://www.foo.com/ -``` - -After: - -```php -$request = $client->get('http://www.foo.com'); -echo $request->getUrl(); -// >> http://www.foo.com -``` - -### Less verbose BadResponseException - -The exception message for `Guzzle\Http\Exception\BadResponseException` no longer contains the full HTTP request and -response information. You can, however, get access to the request and response object by calling `getRequest()` or -`getResponse()` on the exception object. - -### Query parameter aggregation - -Multi-valued query parameters are no longer aggregated using a callback function. `Guzzle\Http\Query` now has a -setAggregator() method that accepts a `Guzzle\Http\QueryAggregator\QueryAggregatorInterface` object. This object is -responsible for handling the aggregation of multi-valued query string variables into a flattened hash. - -2.8 to 3.x ----------- - -### Guzzle\Service\Inspector - -Change `\Guzzle\Service\Inspector::fromConfig` to `\Guzzle\Common\Collection::fromConfig` - -**Before** - -```php -use Guzzle\Service\Inspector; - -class YourClient extends \Guzzle\Service\Client -{ - public static function factory($config = array()) - { - $default = array(); - $required = array('base_url', 'username', 'api_key'); - $config = Inspector::fromConfig($config, $default, $required); - - $client = new self( - $config->get('base_url'), - $config->get('username'), - $config->get('api_key') - ); - $client->setConfig($config); - - $client->setDescription(ServiceDescription::factory(__DIR__ . DIRECTORY_SEPARATOR . 'client.json')); - - return $client; - } -``` - -**After** - -```php -use Guzzle\Common\Collection; - -class YourClient extends \Guzzle\Service\Client -{ - public static function factory($config = array()) - { - $default = array(); - $required = array('base_url', 'username', 'api_key'); - $config = Collection::fromConfig($config, $default, $required); - - $client = new self( - $config->get('base_url'), - $config->get('username'), - $config->get('api_key') - ); - $client->setConfig($config); - - $client->setDescription(ServiceDescription::factory(__DIR__ . DIRECTORY_SEPARATOR . 'client.json')); - - return $client; - } -``` - -### Convert XML Service Descriptions to JSON - -**Before** - -```xml - - - - - - Get a list of groups - - - Uses a search query to get a list of groups - - - - Create a group - - - - - Delete a group by ID - - - - - - - Update a group - - - - - - -``` - -**After** - -```json -{ - "name": "Zendesk REST API v2", - "apiVersion": "2012-12-31", - "description":"Provides access to Zendesk views, groups, tickets, ticket fields, and users", - "operations": { - "list_groups": { - "httpMethod":"GET", - "uri": "groups.json", - "summary": "Get a list of groups" - }, - "search_groups":{ - "httpMethod":"GET", - "uri": "search.json?query=\"{query} type:group\"", - "summary": "Uses a search query to get a list of groups", - "parameters":{ - "query":{ - "location": "uri", - "description":"Zendesk Search Query", - "type": "string", - "required": true - } - } - }, - "create_group": { - "httpMethod":"POST", - "uri": "groups.json", - "summary": "Create a group", - "parameters":{ - "data": { - "type": "array", - "location": "body", - "description":"Group JSON", - "filters": "json_encode", - "required": true - }, - "Content-Type":{ - "type": "string", - "location":"header", - "static": "application/json" - } - } - }, - "delete_group": { - "httpMethod":"DELETE", - "uri": "groups/{id}.json", - "summary": "Delete a group", - "parameters":{ - "id":{ - "location": "uri", - "description":"Group to delete by ID", - "type": "integer", - "required": true - } - } - }, - "get_group": { - "httpMethod":"GET", - "uri": "groups/{id}.json", - "summary": "Get a ticket", - "parameters":{ - "id":{ - "location": "uri", - "description":"Group to get by ID", - "type": "integer", - "required": true - } - } - }, - "update_group": { - "httpMethod":"PUT", - "uri": "groups/{id}.json", - "summary": "Update a group", - "parameters":{ - "id": { - "location": "uri", - "description":"Group to update by ID", - "type": "integer", - "required": true - }, - "data": { - "type": "array", - "location": "body", - "description":"Group JSON", - "filters": "json_encode", - "required": true - }, - "Content-Type":{ - "type": "string", - "location":"header", - "static": "application/json" - } - } - } -} -``` - -### Guzzle\Service\Description\ServiceDescription - -Commands are now called Operations - -**Before** - -```php -use Guzzle\Service\Description\ServiceDescription; - -$sd = new ServiceDescription(); -$sd->getCommands(); // @returns ApiCommandInterface[] -$sd->hasCommand($name); -$sd->getCommand($name); // @returns ApiCommandInterface|null -$sd->addCommand($command); // @param ApiCommandInterface $command -``` - -**After** - -```php -use Guzzle\Service\Description\ServiceDescription; - -$sd = new ServiceDescription(); -$sd->getOperations(); // @returns OperationInterface[] -$sd->hasOperation($name); -$sd->getOperation($name); // @returns OperationInterface|null -$sd->addOperation($operation); // @param OperationInterface $operation -``` - -### Guzzle\Common\Inflection\Inflector - -Namespace is now `Guzzle\Inflection\Inflector` - -### Guzzle\Http\Plugin - -Namespace is now `Guzzle\Plugin`. Many other changes occur within this namespace and are detailed in their own sections below. - -### Guzzle\Http\Plugin\LogPlugin and Guzzle\Common\Log - -Now `Guzzle\Plugin\Log\LogPlugin` and `Guzzle\Log` respectively. - -**Before** - -```php -use Guzzle\Common\Log\ClosureLogAdapter; -use Guzzle\Http\Plugin\LogPlugin; - -/** @var \Guzzle\Http\Client */ -$client; - -// $verbosity is an integer indicating desired message verbosity level -$client->addSubscriber(new LogPlugin(new ClosureLogAdapter(function($m) { echo $m; }, $verbosity = LogPlugin::LOG_VERBOSE); -``` - -**After** - -```php -use Guzzle\Log\ClosureLogAdapter; -use Guzzle\Log\MessageFormatter; -use Guzzle\Plugin\Log\LogPlugin; - -/** @var \Guzzle\Http\Client */ -$client; - -// $format is a string indicating desired message format -- @see MessageFormatter -$client->addSubscriber(new LogPlugin(new ClosureLogAdapter(function($m) { echo $m; }, $format = MessageFormatter::DEBUG_FORMAT); -``` - -### Guzzle\Http\Plugin\CurlAuthPlugin - -Now `Guzzle\Plugin\CurlAuth\CurlAuthPlugin`. - -### Guzzle\Http\Plugin\ExponentialBackoffPlugin - -Now `Guzzle\Plugin\Backoff\BackoffPlugin`, and other changes. - -**Before** - -```php -use Guzzle\Http\Plugin\ExponentialBackoffPlugin; - -$backoffPlugin = new ExponentialBackoffPlugin($maxRetries, array_merge( - ExponentialBackoffPlugin::getDefaultFailureCodes(), array(429) - )); - -$client->addSubscriber($backoffPlugin); -``` - -**After** - -```php -use Guzzle\Plugin\Backoff\BackoffPlugin; -use Guzzle\Plugin\Backoff\HttpBackoffStrategy; - -// Use convenient factory method instead -- see implementation for ideas of what -// you can do with chaining backoff strategies -$backoffPlugin = BackoffPlugin::getExponentialBackoff($maxRetries, array_merge( - HttpBackoffStrategy::getDefaultFailureCodes(), array(429) - )); -$client->addSubscriber($backoffPlugin); -``` - -### Known Issues - -#### [BUG] Accept-Encoding header behavior changed unintentionally. - -(See #217) (Fixed in 09daeb8c666fb44499a0646d655a8ae36456575e) - -In version 2.8 setting the `Accept-Encoding` header would set the CURLOPT_ENCODING option, which permitted cURL to -properly handle gzip/deflate compressed responses from the server. In versions affected by this bug this does not happen. -See issue #217 for a workaround, or use a version containing the fix. diff --git a/core/vendor/guzzlehttp/guzzle/build/packager.php b/core/vendor/guzzlehttp/guzzle/build/packager.php deleted file mode 100644 index 724bf63..0000000 --- a/core/vendor/guzzlehttp/guzzle/build/packager.php +++ /dev/null @@ -1,21 +0,0 @@ -deepCopy($file, $file); -} - -// Copy each dependency to the staging directory. Copy *.php and *.pem files. -$packager->recursiveCopy('src', 'GuzzleHttp', ['php']); -$packager->recursiveCopy('vendor/react/promise/src', 'React/Promise'); -$packager->recursiveCopy('vendor/guzzlehttp/ringphp/src', 'GuzzleHttp/Ring'); -$packager->recursiveCopy('vendor/guzzlehttp/streams/src', 'GuzzleHttp/Stream'); -$packager->createAutoloader(['React/Promise/functions.php']); -$packager->createPhar(__DIR__ . '/artifacts/guzzle.phar'); -$packager->createZip(__DIR__ . '/artifacts/guzzle.zip'); diff --git a/core/vendor/guzzlehttp/guzzle/composer.json b/core/vendor/guzzlehttp/guzzle/composer.json deleted file mode 100644 index e9615a0..0000000 --- a/core/vendor/guzzlehttp/guzzle/composer.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "guzzlehttp/guzzle", - "type": "library", - "description": "Guzzle is a PHP HTTP client library and framework for building RESTful web service clients", - "keywords": ["framework", "http", "rest", "web service", "curl", "client", "HTTP client"], - "homepage": "http://guzzlephp.org/", - "license": "MIT", - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "require": { - "php": ">=5.4.0", - "guzzlehttp/ringphp": "~1.0" - }, - "require-dev": { - "ext-curl": "*", - "psr/log": "~1.0", - "phpunit/phpunit": "~4.0" - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "GuzzleHttp\\Tests\\": "tests/" - } - }, - "extra": { - "branch-alias": { - "dev-master": "5.0-dev" - } - } -} diff --git a/core/vendor/guzzlehttp/guzzle/docs/Makefile b/core/vendor/guzzlehttp/guzzle/docs/Makefile deleted file mode 100644 index d92e03f..0000000 --- a/core/vendor/guzzlehttp/guzzle/docs/Makefile +++ /dev/null @@ -1,153 +0,0 @@ -# Makefile for Sphinx documentation -# - -# You can set these variables from the command line. -SPHINXOPTS = -SPHINXBUILD = sphinx-build -PAPER = -BUILDDIR = _build - -# Internal variables. -PAPEROPT_a4 = -D latex_paper_size=a4 -PAPEROPT_letter = -D latex_paper_size=letter -ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . -# the i18n builder cannot share the environment and doctrees with the others -I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . - -.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext - -help: - @echo "Please use \`make ' where is one of" - @echo " html to make standalone HTML files" - @echo " dirhtml to make HTML files named index.html in directories" - @echo " singlehtml to make a single large HTML file" - @echo " pickle to make pickle files" - @echo " json to make JSON files" - @echo " htmlhelp to make HTML files and a HTML help project" - @echo " qthelp to make HTML files and a qthelp project" - @echo " devhelp to make HTML files and a Devhelp project" - @echo " epub to make an epub" - @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" - @echo " latexpdf to make LaTeX files and run them through pdflatex" - @echo " text to make text files" - @echo " man to make manual pages" - @echo " texinfo to make Texinfo files" - @echo " info to make Texinfo files and run them through makeinfo" - @echo " gettext to make PO message catalogs" - @echo " changes to make an overview of all changed/added/deprecated items" - @echo " linkcheck to check all external links for integrity" - @echo " doctest to run all doctests embedded in the documentation (if enabled)" - -clean: - -rm -rf $(BUILDDIR)/* - -html: - $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." - -dirhtml: - $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." - -singlehtml: - $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml - @echo - @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." - -pickle: - $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle - @echo - @echo "Build finished; now you can process the pickle files." - -json: - $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json - @echo - @echo "Build finished; now you can process the JSON files." - -htmlhelp: - $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp - @echo - @echo "Build finished; now you can run HTML Help Workshop with the" \ - ".hhp project file in $(BUILDDIR)/htmlhelp." - -qthelp: - $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp - @echo - @echo "Build finished; now you can run "qcollectiongenerator" with the" \ - ".qhcp project file in $(BUILDDIR)/qthelp, like this:" - @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Guzzle.qhcp" - @echo "To view the help file:" - @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Guzzle.qhc" - -devhelp: - $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp - @echo - @echo "Build finished." - @echo "To view the help file:" - @echo "# mkdir -p $$HOME/.local/share/devhelp/Guzzle" - @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Guzzle" - @echo "# devhelp" - -epub: - $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub - @echo - @echo "Build finished. The epub file is in $(BUILDDIR)/epub." - -latex: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo - @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." - @echo "Run \`make' in that directory to run these through (pdf)latex" \ - "(use \`make latexpdf' here to do that automatically)." - -latexpdf: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo "Running LaTeX files through pdflatex..." - $(MAKE) -C $(BUILDDIR)/latex all-pdf - @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." - -text: - $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text - @echo - @echo "Build finished. The text files are in $(BUILDDIR)/text." - -man: - $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man - @echo - @echo "Build finished. The manual pages are in $(BUILDDIR)/man." - -texinfo: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo - @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." - @echo "Run \`make' in that directory to run these through makeinfo" \ - "(use \`make info' here to do that automatically)." - -info: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo "Running Texinfo files through makeinfo..." - make -C $(BUILDDIR)/texinfo info - @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." - -gettext: - $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale - @echo - @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." - -changes: - $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes - @echo - @echo "The overview file is in $(BUILDDIR)/changes." - -linkcheck: - $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck - @echo - @echo "Link check complete; look for any errors in the above output " \ - "or in $(BUILDDIR)/linkcheck/output.txt." - -doctest: - $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest - @echo "Testing of doctests in the sources finished, look at the " \ - "results in $(BUILDDIR)/doctest/output.txt." diff --git a/core/vendor/guzzlehttp/guzzle/docs/_static/guzzle-icon.png b/core/vendor/guzzlehttp/guzzle/docs/_static/guzzle-icon.png deleted file mode 100644 index f1017f7..0000000 --- a/core/vendor/guzzlehttp/guzzle/docs/_static/guzzle-icon.png +++ /dev/null @@ -1,4 +0,0 @@ -PNG - - IHDR&bKGD̿ pHYsgRtIME,BIDAT8˕Kex4ljsN ƊQD"^n џ0.#X/x6E Z3_[f:[,j6/K,p.|zRHzG-q pْJ|'73^ g kY)q,5$1פQf9wtwB%92:"R2qZ5qK.@A9/.%=ryb"  ]|pUgxKM_S.nUZ(3i;4gŐrs>4^^ܰ`nN}YI5vPk. ÞguXW~0 1ɤc -tYP0i8hR z$k$+„1u[ ᴣn1fL[6h7D؈jgeg(=IENDB` \ No newline at end of file diff --git a/core/vendor/guzzlehttp/guzzle/docs/_static/logo.png b/core/vendor/guzzlehttp/guzzle/docs/_static/logo.png deleted file mode 100644 index 965a4ef..0000000 --- a/core/vendor/guzzlehttp/guzzle/docs/_static/logo.png +++ /dev/null @@ -1,936 +0,0 @@ -PNG - - IHDR_d` pHYsgR@IDATx]U7>2s$ɤM - @ʄŒO,iև=}C' -P$**F;If#$Ap{.뜻koQ9y %@^Wv-/K@^柃K H |π]%@^yK /3 =Bw@^y oK /΀ =e^y %Wg /8+3 |y %@^柁K H |π]%@^yK /3 =Bw@^y lto߾];.ɟ@^y TJ*`63#G<Ҟh,Nܞo"JCokit_ULQ>4OMMM)hm5uCthry:r[KYLSlzЯB5IK$u\dRWSkSJVbnϪGSWX1򽣬=P N9arz`S6UBg4dN7G!Y2cUNW*b=m5m9UEΟ",\ džt&U8j˒jzqaAr"S.*@%o:ʙffM:6ץ ;獳ǖnʦ"ZNmHMye - bj#M6A(ߕ+W -]]'葈).H-뮾B&Aa.K"qw˒ۥDhEY%uױb'*P(KĥNĢpe@ -GR‹J%a]өIQV -cS2jGH{PNt 6\m+jQ DljYXM9<Lb?P(VvvlS U_8x(_J xʯ5m97(sNB:]2L(Ȱ~X$ϑM>ۼ=x-&$&1m+\kl)sbs3Y&1s-f6\ eŃTb('0.,N"S]͉xLKETI"1 g3g*%2u9#+3Υܶ_0EYt] ަ xz#n٧ښ si c$)ur-Ͷ8(2*v\v΅@JPEZfߺe˖YJ6uVB-Q;.D>9B?@/ {D -'@J_]$7 ,H_粒 #cy.Xh,vŬf( -3wߣ+{Ju莥(JX;6X޼H-\ž=EMn[ r3i_R wZIRTJc%;$j*ӣJj3}*!r˪d̽.[U9UHRB_2MF j\&qK@KQ+Qiޒ:[͝rOr;tCu%̧*XT3v'إ55_xIݣ|_(kMqKRдj[,ܫHPNᔘsĭEI'z|X_]X^Mߘ"uU\!r)Em#)+޳9&4ltrJ45XBK +RyP&;G2Xj$c[ht ?lI3 {',u(|r/4}z'(hIbu,ha^li2wI: -HLmQ).ĤfAEBɍ?u+OZ ?py82G?MŴ8@A7Neݽ,EâZ&gӹe*M i|nqxumh%WaMئ!}ѭH 2;aDӱrZ֋nO;& @/Ux`Oa;>aQT"(#KF0'dEzDg+ -3I~&$ tղW{ +.L -fW/Zaߒ" &hjL=$} -N -7hsrtrX0:">ؤi֏-;ߛ6] oC.|{Bpmem ;BTG+JK.Q& 'ki+,.Bi ̏ xC&ww6}m Y9hBqR͍DX%m/wM#r[H2%O4gfb{HM\5#(m󑞀u>!m z7"JՈ^sIzxvm$nA?wՎ9īXy 8hG:eRKH'`.On ёX!M\гᖲCG"|c*&nMp~{)qh݊4,š̊ܦTBQ -$JIKtn=^nNM/~K_* X-0BHS(΂Rqa_]`~aロ _u0) zv.ZW,,w#ȋcf9"es@ȬYPY;a?%pILZ K#k;}BRا  26il#uuٱ;^q~בsTMȦd+TZ|g2{Sv ^""%J}!&|`Sl]mm,[z!&\9#E26w't*!X|n%T"0k=7g%mkaXͪFG3QlֶJKnȘzA!F܊q6{c8Mp$ҌE|֬}G %galC1^0 -{CI{9QD/ǜ봗Sz\R"f>'ݱ'9quuQ^zM2 - um>}D 3Zn?+V8w sdfdzww?l6I"(ӭ|^*x* 姖B=/Cܶ;ndSM3.庺cp#7o|:߶MN?~B0={`'ԄY¥ԢSs^mxSO1luσօD@ǣʧ(/CeU&B|Ol+[|p]W HǗ>zſ7iM*vw\^i2jNqL[{\5Ý1No8 %p:3Y#J*e2wұDgG6:]x?x|2hF ?m OrB2R='r - ԃaBAXm'D&oв>g= \N( CI2ȗ1(Ndf&rg{;(j I֖׌ y0mqFGs^&; -\DmJGBYX蟂Y@q3:-;P\܊7u[tTo6BmfyWMCMfܚ:tYXtb@vY&2K&͗/!'E<0m2[i'54,fDsh$y{OK*{wd~.r,\Cn)nǧLJJN#>/Z2@`TY䉳-S tkP %ޛl'n 1?& lwRULvN/jD%؋M&-О0vw2yMF蹰xˡe3YT]YR5L6ߖgCqlthJ]*Dj+=h&M:=V̥œ SN}e%YsOSE?׬e NTu]uO4]/JOVO` *a(oS=0rZsCvHɚ B,q1͇֦͝݋Ս—:4#ķY"Ht -|evݤ]1%[86d@SNF20md@:D m3:xUX\R7PU gCS3Xv%jn E>%fVzg7"S,=Pucs}0INZSuy(|mϮoGRľQnwz+Ql2%566 -疗ZǏu䳓TR96VV%z pf!W\FvyKlx:TiBUnM}FC6z2UOjeQQv"ʮv4s -6SզO-*M3l-Ų9T#r3vmd |ahԬe(nϸre+M\xqӲa!2ێ!YUiSm_v C62}zr]^- {BZ -+^4+dE-U\}eskЖdآB). c7X> ` &^f)* - _BH0A^bL/ NJM -^I,40$Uܹy=V=N(?dr ztd05wKa&Ajq0vӆX"坥patm{\KKgr$a zAHʁns¯zy/r=frUEAp?8k%pƠff & ~P[PU͒ɢJ\]l3=H4j-o} \9i1o‡F6{T1?Ĺ^I|nqN zot֛IXj,?LByA׷ y]"t/bMh uBmPiZCIQY}e3D$]\ 1=ܲ׃σbjZlF0<.f߯i] 9sAX XF?h021sv&Xݫ$.U ܣ}P%]5'2kf.QYyFk(ekO&h|S>]٣ti)LY*0v?8$gZt{LJ&FҪtQ;)axܜPگ SH~ & Ir݇w.M x)Ms־؅ӷa ]H ' wrpfRvNǐ%~$NZT䡉Ζ1 2@?4Ww\Ud=X H"QΜ4왰o[ecs;hJ 5!]l.|' 6W^Bf2TxNk y{tnJm@HQ( IB#s^ߕ$‚R{Q?lµ'IY 6[?>_:cE~!X!YjfKpMM/2^$d=V<2k^gN`ޑq:G#?.5kL61ZՏZ1NJ#.6:"@a8?2je48θ&G,)ýae4 v{=0`s=nYrv/*/.+ϳ_@6['M5 *#*a 49.snRK b)Q k5PwƮ熃;6,^n_g 㜏bs>Z_XzYQ1-< Љ{*c}! HI#ߤ=@CO͉_s46“<|/Ձ[AM\p7n͒[7&A?DD5.md~׬Lskz%![_M|}]6e`+"@W"e,nn}d&2Y.>G{naji -%$|C;f*r>a1vƒ?88-w],WMu-f80a=RW &mW B QSwK[b[d#(4؟Yv3%cm 'GJlwY?B"Pp|t٭ڞ͖\yήWӰ_PaA3cP5:ǒ3a!/ -(8>a_֓ցFBL&]lra%4"JX%[oCGiÑ 0@Bxo2yݽ4>ͧB~2ւʒ@< -<`y>mAm_ZU®v2s闣C_]ߙA;ǐX.7)wWT"6c_7WŖL 8v[+ Dul}pwN_5X-<ӴNW3nIϖUVā 0ѹsg~-RD6 tmSJV8xǕ`uH8,3"&LmhN( `i|!-M2h4fҀ{hI[jSm퉚W{7|~WCM(PYwy =p1BAq#~$0әWVv|Un}G̔q_̮m_?[UJ 넨>{U:WX~ -G8%X w׃k37c-p93_lqY@;SFۗa⏥qnHMiBpv mh̯ 9c*,ɟ#(H ]uUԏ, 9-w -Ua# T.߰/Š^d>SAѤȊE@S>ĽTu~E]gIP,s?rl UsG]2j g@ C' $ !浘W^sONNU[c*5MʐK;""ٟ;ԊGk%ԴU}T&03٥KA2P4V&!B!Y9>ZKݸMm:P[/}C\by諃F 4.hyAn88ņL8“7DFj# nƼ V}+B5ʨ8p|nSMM&L<9+뻤$5A+L :u ,ͦ߆{BOKwrP!wX_ {Vv֊ز;1;{٠;խ;0XŊuN*lg4 lTtq@vvt48r~ 웰 _0eE?e6BܰXQs_~cWUDf*ŞUm .ms*?$Foeuni[<ʃ߰}K;|*$ދ9y=pnʖwaSaLxfp{tNQe@_w8iP~(JXjm*Mee fYrMY`}vCv("jUx cH:[⥾<.lr +PvE-K̴B!M%5%<;7FƳߦ\}4eťrաZ}̇;Vb]Ilf\U^lEPN{Ft( `~=+X=Dm^o5lad"}8~ɦ/w8&n)ic/Xe Yx#@ц*%R)R ުY,nv,#QahlY3fTj*aB?hCwv%C ~XɝX82S[%@OgV-T6gơȮ7zoad\c_wޓT.a/d[< ԏS5dxJD>q]{z@qNVْ='r#k7-#geH7/OOw_6fT[ȿK)|_<#.D~xޔlPm$[xX_vg.ϘVV|mgu=W +e"LJj$cȼ?x(Yx;U&Sm-榦ϯ 80 nQDA🏀5.(-Qp@ghHein#XlVݫ^;}{ ˺QAbnӴx9r@#v0bM!c@oPoyG"ؼXW-V.S*%+1$.A/SN-삽=+t]$ndz9XEo6|*nj]¸<. - (Ԍe`9mKO؎1Ԉԗn 1T'o+&N}@ HYn1-DǦ\:)#P),f՚vmy0X*Ax@/EGR7'S"D15L\CTe%D0^PDp0ҹ,sIX9M hpxUBR(2^-iLcwDMgnpՎg'R=y"E5[2 [%Y\+-*DS2ƃià*LO.HFMfY6ie^ *ܱ#f~y瀺bo4k}Erë^/_bX:uCT|WyK!n)9)#y=tҌ -'\vy LXpY q$9rٻ]3@G%p,ߑWN,C8~mnfC%Ml3?lAitḠU{z~5NA_y[m-+_/'O%`,Gc2D=tEX |B=Wƛ%x^7HhU!:)v$x4 XA. Ӛ m#b")d*Pj~XXc5ruaSѭ(:ӶW<̎s1&H_GJӭџ}ߜғ\1]TTD7/!,jJH"Q[F}9fJ#B"( -\غz$Q6sU ɋ$1^mBet>A5 87LwcX4ȗ8WjȗZ=6oz:W}C(ȏS'GX<,r2 ys%~pa\6Į\Iq{slw~,J+_Ѹr| 楶؅jݰ-_\? I*sR3a˝vwQ Yj233?kY?tMFq f5WȆd`hɊ:eVCc/óU+SɡS3;%J+jgIOdJgT禕È3?4uUIܵ=9tFY09VI -"l?JEo 7w䱥{o"`DhIkJڕ - !qCQ,5KqY}S<Xv]`(#^' -jܺzIvñ@ž{~GcJ+_gUoyQRL(;F,IrO@P:`kKT[rqHGteVred{8t"ӭVdrm:)/]"7-šE`hN'ոfaTq/V@`(߅hN<ﻏ{W QLGd@2yr*uXROHu:yta1w֣鿥=I.>giχUVH5PƮ[=U5o8pTZ׊e.Tuw‘A 85--;,rŕEx]Fd=;%pʕXU-1{=~nMkI"`3 _-ĶxM*e$:[32}J}|՞U0| -aD%K )˥r`$hʽw)JV;`1V[qO.HZfoWM?yC83&]}, -*N.JBSEKbߝR+T]mn -Lrct6Bni:\JH*3'EB֏-mcϏD J c݂)/t (k@^AE2E!줊ך@`دזBME^UKl8T]]=M)ݔe=r84>I:`u yWH:D^3 -aMl>xQs?z|aLftWO\iCRLe3(N -3drkvĝDc4*Qa;ͽ^(Uo?*mugc:NuInb c\i8b`J%N}2/gνuߧ\d 1cZw`{s{ :VE9[j?f;F9uMM x!_[8k1pU󭧙 JF(P=V/ ecRw?7o^^ bݝC(?˯XćH 0Awpxrh\%ylCPEtT2y7ji99\"9/< VNff >[;w+~_`K?=u]wUe_,\VT'}sw#L/8nM66 iy>8nAJnɞT?Vڎ_͝CaRPL`,ӻ5JxF;!ԩ xEdLrke+! a*ص ++E@z`%F_UHWxUc|۳׊6՝]]Z:Y ugqb7`Wo. -nfZ9xVzPk ð9 -w;N<ȟ\PtbE鬛)W _9W$zS`'64XLyY.ǣemH^la1LSɠnҚkuCQƦ>XD+CũnYS}Ej+҈5C`(@[r}Uh['Ǫ"7kd 1;I>}7RY D?3pw=,@ɖB05{ w:F {[ *AvwyV~VQ4:!93  Nј蠖(to% -t]wyk_;g4 3C; &<i`[|WI*' -&PdS^& |~-˦𫜬>p[OL@?hr3_~w.L,Fp9l8gf,uQq 9&a"(,ܛm-d%~mP&m}}D:}j^0$nՊֹer&z^@A՟){xG/8Pc2os((LmJ۶P#ޠqUp4|SOig>ؘH[rCJ2E}ږt +q#stE AV.#7Zl'5t\^Ge'mn8D` SKP3AyPЁm.5zXѥ2ںwt 9 zDDQ!UȺk1}5E"uѫ]MX`J.!s 5|?[J -NU(J_em}Ͳq<fAX-Q `PS^u'v3܊ġA{*3%@뫉e|.+WaFO9>2/0\^^ Aj"%i9 >o?\ףVI/oT~/Q;+ni̶^5⊽Aj1J;J!Q/UX ݼ }[/"OZN\m}x헃/7)ҵEMOu:5v؆R*0},\Ȃ<1"ٯ97 /2dwМfBV]QY?AOOSlgNiiH[$̌+nFt"vzC83Sru˜7!vq-hSuUA2P}e^N{ ׄ!Yne3ɗꊎ߸غt'"%nI:7YDRLﺬ0{FW{zeg'I6 8JEzMvͶX#/WrJwT$By1!?OV|aYOo_|8bs &mMœ+{"9p4gJ_m0L}'-aPVΞ: ->tWW >\H `XV@ͱ{n9-75]D,ow(S8SY(rw\ٽqCZUע̴2)pu($N&;X-:;vy-? --=H5復ɖ -(ήɀU?xJй҈dH_(q TdS܆y7>Gj}MɄ,̨ { -K?R\9; V(eUqO4+mV4{wٲv$QAWe$0m„RwtIat-cXF̈́&W!0p4&S@cni<4-.~\Q9o! -C)u,}2rGmʺ~MIv 5\PSӇ65qKҊގu6Jtud%Խԋl#rhR_[дd4>_Pox<3EbW)G6J!+>B@ˡ -k"L 㟠Dm J7D6 -QXXL@޻#~=.C-3a"AӲo)\1O)@ "i GiRl܏@GZ+6o?SF# LV~g9CJfːE&. $uҚp`4HŖKZI+fd;ѩL%qi8Փ[a@G?K5e@iɮhIIfK2{U{mYx3I.08=;wPDQAS^I!vvj$pvmuE$ 0?Q&rwr)X7{C/Rf"㍋%ikQ4_dML Ԁ x?P( (_gE>kwoi>od,Eb$?6(%iKz|"d1YxH!fٿcs%UݘN˱3Ο/ٶ"&C(53s8 JNN^^DS@c"EӑDQ>v@ i$N#H ?tS(rYVK~d(_dY-7G^{"+MLWΎy4ȩb m>_ݹs.ZpbG7Ea2:wP9īQ}ގBUу$)eh;Dі)Bx:)~檫ͬKND}r߼gj;jhI$3w&{~.ڲ(>md.,8b9eam :A;vnF:tb'fC|n%]h>N@JNd+߳5Orۓ%O>="㴱ٕ H`:3;S'=:!с]advu\x{V2{^6aPX;os|9f!I(] -rH}} O-]gIpHVyxUŇ--Q!#\Ie Ώ9w-ǖH6jJd; ]ayRY9sɦxm{WО7(cJ`DoP ysgGPk1.gVzR9` WI]Mh5ԟ>䮫N*sMcw hF`=NHU_n[,e˧Yr=K^EE ๧k?詀H_ޟYzRTRij ~,ϯxAݺqSx=?)㰚 ܌Q`6Ix6Z3{fMEAVk?1[Zm?~槩3N۰t%Ce{-³&q"&`>AmM/,m<Fzr:^brV_-$pwkL~8SV|NOOԇYb1ZPij&]`´/7-ҟN[v%%9Oj[P]Au޸4wÜbD mp߶H;g4ܻxꕘD1 9Ty'\duJQ!2>}E7d-[i/;v[[<@=v[fޑfX'`ƔdӸ4$egbQ֢`XνP'it_B}oZ]^֋$&8)kP1u7ܞfZi[^9Ub'ý_={{=p!}^> +0V9vwH)ue"Vjە> bX#[N_1ȣK=H=[#mmqlk=aUg -ˉ$& $Ga?(. Xy%E | Rlofԋsf0,)m]Es.uMųl(qU4TCKm W sa%v99[Iq=EPfOOs"%ҀR!OƤ$. -]B`8=L+ELEU< -KTH3 -(ji7bl-)ߤpM -p5Ö sZ8JO%S9Sz{NpTsK$=}) 7 -i9cffY&p{˄ˈ|agmRO4I$-h[^UeJNvsg/>T!@H dHp&odz1Owt\`S#]aum _G@'*R< ymr۔))A9ʟx5coInOP(}g uK/~P^,D,b 5˳ ?/-+e~}?UTTVV8aMaAU|BB ;ArϠD؃/5|jUW9hiLG|MV=yLO enB_PJ>>g#MLdpqo))= naE㊄%g@WBg*gXoԜZsk줺. Ǚ`/5zKHwz$a`\K?wc_)_tW<*\زG}~=pgmI*B5ww,. 8 LZIqt#!W`"b'cgZ AM?T:>[D$+42"8ZEl^p guLJ:ս+%J{?OVzo񰙋ϠOB!_jG\I֌wfV>UV{Q%b&',>v|p!YYT?'UI{,tǹg:<5H%o|>bnGsY1JYpljm6AϕYP -bV:pGw^z?Ak ?y1'T8=C,ꄲ4(M %rH SkL~eU&cex |?É"+S̖3@ީM oK.Uԣ3xrƒ c¨AHڿL.k=B6Gs7%\^F'? -| Ѷ{m{PM-[2)bvSn{0'f1)$lUWh&gq-tUV ՊPvCXQfmK -Ԗo D +*0`bŪaQSn ( 8Wi ,ߩ5yfpƱ#}]]̰m025Ev騳؄\OVy$ӓŻ)ڻUr/2خ{Q8_WQdg[usTB/w?{,^)}c~='avs| w NS|7b6ƊTg{-VHH?8UUmWDa*KFi}w.̙2@֙GBFU{ R? ޏuwyR),,^Pz*kW38P璊s”@ܬorY|n6 6+c6[5!κU^o[他x:RzW -{JɃ)Bt>T8aYKI[\-gduޔEv$͐IFq/fgN 'C[7 -CLPdzQlRI"y#ǐi$Tqv3"45Cl^%KMdC{/X $d6@'+7gƙdJJGA֑%kƞ)q*{6k%.N҂@ejK"s[m|mÑn7Foڙ\r<`R/ػl\Q۟M͛c&_P^@-bhvl6"Aa|܂'儲tm~wd]7oHɾA;H6fdvȜ4$1l:>xl1{ܯ~LhUD:䂖 -pK~h_8#޻EH}5AX`\얋f$}J;cgF 82~%&k1R:5ONHkDl+(NZ| -\vM1]nVUeݞX4xh] jթ4I~;Fѿ[AeU9bs=~BxΣ%K3ϽC;>v8yxZe듼WCk_MsI]y& -2s=vF ~2 im4=q"Jw-!ij-NCPȊ&|V%Z޾Y$5kST䵴J߱Wc_ W]2V#ePZ3_Vens+(Z*]N>@-V;-߷"W9 -?h8 pn8uXQ##-hR\)~wcϘ4(+nmC ˴PVTT9j2BSRgvtn(hy\3 Hrbu#9Pd횜'+cF |kf#:{e7gwIIQ4ϧ]z+ߒ$~}Q~@d3 -I2 : -Ba%%QBۭbN@~| -wϿsPπ232 8_- L tI4RI:5Jk~ii\2.rb}T(Y*?a!UQΚ. v v5uwg&&xVŲ6'$BY@Bhkp/w$jO⾙D;YT YRC#yqKA66;2˱ۣ>:_8,źw+|5. )ZdBD8.1h8s|_.o xz#jDbTT>LkL$U:=ꓞ};ɖIx}fXT؄xLlV9U {l ,aNx&9݆>ۥI!LXЩ>L\|?*˥9$u>Mu}b*޺61Lq >܏0X9_U_ OoKQd6y3/mB8oٴw/]XQd1ϱ~-{X] F0E9 pF%sON -V?ۧxg"#3+P6+f"s5Y斜NdwDb[-c2T6ݵ+(x۲) tufJ@"v3g/KQ- -KTV -f]؟C ?v]*6o3\Pz+Vü05;3<_] >rC p9vL.pqM_ߢ .M=/OEM}z9 }=>re<mmiqt"篼iՠ9S|VNLfQCmD % -TW _qWښEg-a -v}dmyI)Ǖ3gڪ_W%&5mu޺ػ(CޟϏ)='?sznՙm#Fˁؓ'v2EvnjZw(l:HC(\iHh|_G yNT@r*EQW?]S~OINK2-י9p 6CuF#{dmow6%moc֬Y:NU]Xt}D"%SĀM1 ]W8)) <ɞWT$ -@kU8b%_\`(L6]˚:)q*\ 5DgwozhhAi8@g{ҪT^OSnX.L24I-MYg>|[o3OX >\Xiж%WD7`&?.X1t~yA)K-.o͑TTFfFmif:+}?G&]>ᗤ~1646fv\ T&^ݽMiﲋ4ʊ6͆ 2hrl﹟l[= (=@GG $eiH>~?nSt!1T>x؀𫇪\H5Kx6~mڂDJsb뻰@:~)_zr^)T''YHD\ ޕ.4Ό6q8΅iIEqY:nvg)hIcJ)H9  PG}O+ ' -;(iӦi\?xS(Bԧ{ 0V~|(qBAä1iߓYδ -Jat<8r地n#C?Woa~$vXYGv|^ΒemS'hW|3QY9C(=D?yL$fLXtlĖb&eeF mCRgjpLƷ*\Rj3 H{wX܀e:Nri 2[y[ ࢣT BTXu;oZii&"` On2sqҥp-{6>^Yk1[Swe)|U=tM:<ҧjc nʡPxCϤ 9F)qK| ?Wng(^vT{,0bLYeEM]˞ӻMSUC4s^>t">r, ǎ1lJF1c=nypj WDϲ R/qOrGz?PPDyA7Y='4=s; D()S3;V0_J^Y7x+3x ݄|XLOy%$%(N5U-sSCD VpxCK#W+*F7{Q7̼D:/}ggwÚ+y>h-T5!ކOV ^p5T )"] p/wDZ~.Υҿr1ҡ\齻kmXP:Km<>?e,!6/ݿ$Mմ_9'%]\>gi@'YK&ZXA1ȳyj8<捽a >帿|&5\r0C?ˮTŌ 齞"AYK҇]g*ZJ׹^} \¥<%Kp2:mVү8ZJlNrs}-?Ao/c.K5:KQp`{h!0ލ.T+.3>4 ('$`aqPw7&MO[\L\Sd! -?A;ewV.fͼvvTM(}{ :ѹDsRȢы֎'-go[E|u̗}UT:><KÜL-~=^YCk{{n'嫇64seT17pLw䰢0ӱso}i|Gc4T竾hߑ:`#9)TgSBІMO^uUHM|ŖXSU/ Y{H)½R z jgcpJ&9dzwm~"rՠ&&#>R%߽{kMyÖiܹ~IEܙ(ر6c$!S&9abdVaau]S4ё-jW'(IxN /ˉM[ |c lJWhW>,Yu-=]H@ދ,;WfwZ{"Uvme2W/\U x /`7L)N >A."voaTGf0H/#kղw WL:N퐒$+a[YAn3u\ -V37: 5,1^TP~ 5(kRBEɹQQ{Qx 03IcmH@,SB7ȏis - *NxE P|ۺHW|Q)I_`,+~. whsG!¥ٹ-<pLu[ Ǹ25zôOKMBIOm{oeȀcfB -u5v]0zPFI]~S^h)Y2rTĂbn@rOj(s"ǿJ֗Yx-.Lz=e$489ﶟĂ(2ht XA;)eRG*h-g\㲬Y7C玽I$TiK&Ot#X,}rI(Z]:FWT(Rx;q޻G;MKRkU*3ɀ2њ9S qZU;~da&QĠ }m?$ -OXEtR_3i V_tE=#^zI!0lDVGjŨyxBAMPX G~oWkBdىK-[e~ng ^vQewv{ Jyi]6-+~ FEDLs?ߋ6-𶗃w\ZU[qPPTXy -Y0s^ҘŒ^Z-7T8+̊pLs]sVs2I+z٤Pʚn/WP弨4wFdʹLçIYyslpZ<מٳp_|4`U[.Be\Ew#PXT赖_X -迾()ЗWetĚ_Xϴu0M@0m$=o[CAoNYSa@>1Wم/>0GRAhG}=M=vNg,*RExp{=;% 0WrKz[ZP5Pą-]xZM|@IDATU+yzM+|Of8 zؽS~NF -YJ,)r_}n5 W!f,(er^DkJ|$I b.Ty(\bq_jG'y/7f8}lv& Uj{5㞧 `Yce˶ݟ)|e^@sWAk ++)O46)0=%Q/VC>L/ B7RK͜ʳAH3$@Wn[֦7}*Yׯo-yE",]6BϒޕҢ+kg+-M-bp\?2>G?b -{SmS Uč^u -2h@LT| *qTdno}! 'W*'6! JNZf\B -ؙ/(|t&"@iPGZw%sf[XyEhE㽆!ȸ-Gq י@49c(ғI<ǿXW- 78L;NY @re/[NCPB&9|,L*l1@{`T"ÅM/LG&6c0gޏ~ xq8m}2HJE)?4[:ۛEqM-C\MX?YcYZ -q2cCU0HX_&fK%VȥC\^i޹{A+'tjK ",.U$P @ރ\7ݺj[x&4!]sDZZen&> v'$2c BK'LU(2 \?k_mYbC{ޖtIe{ǧ\tAVim7+*=NY -k[**EFR$UQ g;Wf~KnuMr:I/yE9iêێUn gZH@ˑ -Q6kyZkµ]2rOٙQ*m# `7Ob MZ1˲7ò:iI@fǔ YU3uwr}Cmq@•xV=`=S5Md\/\;zUL6WZvqzThK r mwUj6 -dʹvo(ۙ k^^^paObG\jEVj/G4̓/k}-bŐ5\ fąEH.] DmSVb{z9}5 }O+k)g63/f 8pH\*|x7Z]*\}p" d(f?ݽM[Ufy=vEd#ϭW g87xPR/]ڏ9MbM d+@ۍ6:6SGO.:sicoFhRxVJ\rc/%@B/\5u3 3^}pd>NĺGv9t">4EJH2\ 7k<4٦e;d &`w{<*]m1">WCp|&`q~kkG?aPBqHX)ܵl7d¸\K -aQGE2Io;¥= #RB -'˱eߟ0ETz -uTGvUQk+=3D=jPAx=pkE="!/(RmP֦ G`kNGլ#aEQҶHrv0U -RT%ag_clq1‡RAC4)ZR=ΪiW #7Ƈ{:n x Է)Y+"Ja~PڊΛS_=BG}N~<Ll[nڢPr#5E7͌h#wʾ9ky_ -ۗu4QkKK\F'ʿ://Ѿn^*=xN̋W(p'{:="W\I/B]%>.립ݡ(똲k>AVQVn\r)N0u#b{$Dt;(*w: n-x 45$aY \2e-Fm~[N m@KI CQ -" xw P"q '$)ҋKEm5P߫_x*\'}o" -N}I@ʄ0Mok{ܔb Ro YZrx"(?xK$ "|=RB|/|n<;t4+c={/d*-k75> CZcY՛;:K -&\9bGT(f0IH `@rnt߽ʞbk$Nn@nNXN*uh-nJ,^ w26ޅ*VJJ-H;ݤᏋFnȦtt=P75L; 0{6$߮*h0߬/꺃w>n>*cmӇmpp{}W>~'q*2Cج/_Ew8D@Mk'iNYLC{{Zn#'G FKLsXu8WbٶAX5\0D75%W<4BxƎIHMT}R>$O>_o -[}fSI``[K9pqgbKx0H9Yմ=BDjCڊ&M{Je إCH 46.HΔ5k/|\Vٹv%{Dd))m<}|y2w ka m Ek{OcS#sv=Eo) 켬F`53ǖ{I3*=^dSc&=w8w -F&u}4@ǻ#CY=ZϼtHYt =B,ˑr|^9 4euu|ުUǹ'PRu$=qku?J8pG=,A;e"t=NQrק0RUAy$5~˖7QT >c!?3 4>.qaqFPtt?/sL;ݰ]pЎJ缄y^ȡNiDn_VpZہەu b;c#׼Lqq?cͅF|JUI{,• //p6/WOMkVZ ɟ ZTsu.kzMo”i{^6s`\NNBO̸|[.)ߕN?ھ&'xP8Xe$6bĔ/,fzm","2 ߁A4+׻厴vFST'km1`.7ZZLä㼞$v]l }x\{_s8:/HʂV>]Fa/TH+y!F$Liv~Hr9N Da^=M94_2mY̓Ųq?]#  ԿJQ=3}A]жUIqbfYjP@|I?ܟ c#)!\7W*+nDJoE]_\ 1Ley'qڶO%E< uTH? wC#|nﮜ2_g,aBYg ώX),s@<2 c}T*̲rr(Y؛B0_D@Ko=O8o_He %kf",EԯV2xx -$q0t(|s٧E -ky%kY 1KWRzRMdvZJof\8qр T\}7Mb19 \.e2n}ٳicKनoU 0; Dap-FEW;1>}j&5 -TAdgzګmɀhLTu{=|ܿCe(CoHx uA"$-e)>NE -!3N8b$Qvx*,KEW@<7)f/甖UU{NQy~ E9;H =vn.Uvwިn^4/vF!#t{ֲo8yhu&_9LDCz_Yc0c @,3x?2"{x t M~YB9'2]]!#XX~(#>2S&4L[ݖR%l6K=fX*CeyyiWENŲK@rEfETyv PZ瘲P vV|W"Tه&4׌|}t~XC 0xëLlG N̪MQ6!̴5력~&q903k -Dvtt&ހU^=r|1{A~N&RF1kv _M PN-Zņ;Q8׾xs-ӹ|sЮVhqxyr_huc} |ཟK[[3eZWյ\?]8iRf؃H~9J5-ɨVb ¹@8}rU.[yU&%;r?U %\uBSz if#FH](!N!qT;Y n $7"nN !cLN2m/̟%DNm~z=`oSn{ r!nIDz##{Fu)p=`-S '*%b^Ps8] S(=I+;ίTL~ڶ Fa !VJާ5.b't s Y}YVz?RL) -tǠɼG~`'XrRd7n{d݁S_㽺"T|k]ik7c^I㐷 ugѥd(1F҈m\.2DִH ÖHk`/`p崱`Vǽ9ikD3'#/N|i^g+UX/spBY=|tX76dt%ɸb+(P$͉"(Yv6&aGR3KB1vy)z8^51aݩY eeԓD&@\dz_w%(o^55IpK`> ->pWnfƧoZH'!bn[Uqr-5k;C"|ۗe%EmLU]I,J<O=¤R &#gXg.]pkV!w[a*_ڰa`kq8uܑs{- ` 0놁8RI?䎤.s I~,#<7(4|)|PZlƷ[ãG|uȞ>V5[q~!Qvڳ{YgJb2f$w=.bCْZ (!6AQ y?Ll x8WczʚY %vlչY8fb* h)ڴ!_){H=R=z~`͙*!h8_GB{E:qNBa/0q8-u,9qؖ:ROZwY*8@n0ryA%㲬ӜuQq xN#z;cs P.p7@ sY}b]v‰#Bϰ nm0rl~RM.(.X7r<3D!~j#װpwޗ{[Fnz@v$--85DZO>13Tzzm^ڬ^]= - ܗ97K,y7I?X"Ⳝ_))%g!$d:Ԣ' 8wI1f2ܥLX噂Ap/AZPFD -{l{Ig7 {v=xBJʜgC]ΐߗۢ'=!t"|~b`cOzCfB[ʡwH'đ 坝!nRg`z"2g]FOf̟S_~b_;hŨa fa/{:RQd}6ߍ-"v;Yu{[>A%}wEQ-c{Ţ6O%7vᤡCS1q'4&ПOѤ϶D4h%6qޞSQkFô;T.K?d/V"^΢F )(o[V26>#?~n{`<;/V"}+Z3iM M>|@8ؘX#3õ͛,ǝH8G8l:Rg%0$VNZU WuT;3#/x}f9;:/k\R[\opOiP?nǻO|ʮm&;ǑU3H0CĄyZ}} IZ0oEefO*d>l>urAE9%RxLEM-k0trmmݛ|i':#8"k/>I?zXJm'MpF{ oH"/5D f<ϺWdv[/p(ou' <>;Ly I=JgcJ;4bImRׇ1_"&ƺ9M- 4GRXFPT(ĽByȥ ]Re#~w 8I'\9XKTtg팺|wXHPlʩ-X%Ĵ.AB&xU,9`Wrobsε9$@milOc>WbI0'pգwN;||Pmyϔ>NWK[$xt.pdM!qYjG*Prvf=aqn۰'~:K9y̸ZslIJ78r^"OrLl=G);!ǐ_')P@mT5׶E0%SYFxLa[HfYtO!^c}e; -dV`7DDӻcAM9#?=pL1bٶ]7;Ycք^6f;'z PF>; .ZV$R8T\osX -j%/:7#*ȻKi(I7ϩۛxp _$ }o[?/tb:i⑯ GMmPLNF==Q3펈҈:4E-xq,ZSkǯV),ȁގswA}7̕l@9XwC2],sa7kb {˨c"s]pBʀӧ>Os=NtS9ފh@T?FP߸S -J3Y涭;LF'ך8KN_y)ݙ],tsu &ΦBAMWğAkX-.?Ska u\3 l]u;`[0\{QI8zu˒v Ht0Q/ ୉kwc1?R#A1|9yZjEBQ%N-A[5|jsZ7 Η6~EGbVG1E/_j?e| -}YƪN2A<3rZ3";ngX%ֳ3gxL S\2%nmv},kC̚3.\:P/_ K*}.3<8v~Biԩ<CG^-WWʕt{ P̏bE e<}Եb-k 1%N{zgOIHK_JR7kϸ[ri1UOE 4V#}ke[Ϣڱc] 4,D;s"M ;DWwxR{+`޼G -V=mpOAbwO#/eXXa%eD~7KdXwOϨ ]4nzestˉc56鱃5 'Md9hb;Ů4sRY|-a9,?)ɚ\Xޥ$<;(eH4_H!:~'"sqo)7pA4s+ )778iR{a˦Mk?e˫êq306cfZaȏy~xɗ~VXhNC־H*hpBV 1F5 kN[Tҏrek"\x)Zђ)˛ShSᆫ3'`b;4Sѵ"i ͟?"DKCZaW>Gn=u!۷dz KA_B\jֶnm{m;qgBP>AwB_U ށucZH"{e-|?-=Dd5N7oM_7$0@+MAǝ;l3%5բ}n`k4_Vk゜br۶] 29^b̌5'ST4F!k|&11f;нYg/@{N&NJ-}YS7vu7 1 [_ye/H5=e.!|_l/rram6_]7Y~#rC]qTIp77 d5R+I A8d3/?slMM>u9+I춌ҺpsF],{dH)vb*=mDѳgˁRN H$;B@>eV<3>U D!kt)ݒLwӥ@cgXyVIZq$B9V+LwM! _op8Q~G @u'~UWBpq$"*x]ZPo*1> 6ZwZց8àG(P:/ck9,GBbDC&?71&%j -9.R{OtJW*3ʃu y4MݺÆK4[ .C_5A-y ^3}8l̥RVn 2=b=U0מ]_GvLbqy>~W0u~mEdRNb5 lE{'-k s"0s`Yѝk|r鉥<'O -T2ݹpapЗ SQж}T7WP?J،,e!^i; 11ty4XC=xC+}Tn%SekaP3d!+I菓`~IFoy - !pTjD. ~5r,IسUڀ>3r聉gI5Rl^SjC3e @®ѕoQ]x(\ȩX?K(0P:0/c__S -9G`أN8*צgMrƥMN-M'% -#^*T0PѶEz5^bͿ *Dp zDOcG -&vhia& ӽQN*+%532q윓`J`~QI~p}my5ƟW䣒bp'sAif8A f_5kvލkF4*<^ vF2wz8Km4Bgz -rY3^>pM B'^[d|HVʱjF\_o?xN{ ݍ^Ǵ/s/7N*L -T8yB:G4(`i>c0~O[X69n|[g_ȫiɍ-v]ͳ@K~6LBSGN)7*vMmed9=:Y-)v~$u5JEIcτyk|ҥvLj]+rlo"$y0F޵kǪU> -ϣ\desɻ3ߏa|e"WŌ)*xv㙂ܢ53+57YQ -]^;}4 NܨYm=[64= CK(!̽ OӨ4EAM EDQ˚yE9&URW2nN\7P#0%kF 5ˍ84Y.GW7m :_oCOg3doSa)HL7PGM;غV0;$ZXRF8!ђ헣Qο:B4-Hj3+[0|m'%G}EcKFqHp:cVXƹ4cBC**oz0lȶl -h#,2Brei7lPw$r&}tJMa}O`0]u0 -wCP-c9FAƶ]⎜Xߑbì3X9Ԉ#k -O`mKS=oq/o]QsOūK3ٔ޿%KE"e5Ulzw@IDAT^ag}(XZȄ%]=h1&Ǵ2F)u vҸ9$N)˲O]g]L?<],v-Ei[o<֞1l7L):ٯC@΄.C^l(fPX}5QP|NП8쮻ijIuEwlDC9~63$fS&JaR޳ut`JM/u8w5LQ\ApT[Iu^mi$ ,wh빫 =m-+lO=~畦ŋs[YZ}4b,+ / -a=\Qro - VHL0hCOHG 6/I%47` y(-t..}tbBq Fr<)&gcT]S!N` {tu²BWM>F3^Iz$N2 -?*n.%g:I Z| jX\@= -U#A& 3#x`5ٕv˰ ͚w ak+"8!hߧb1/2?əgwBmY'Mܘ H!30[['^y-0%#l zJ[Fm/r]=*'h. -xGM6 Ç{j&/ lf'x%HR@-|| ^Y?Hzۓ0܄F!@r"#UKѶQ$i9~d{wo6߅S>sG${Ko<@<Á{U$w1ٟc0o|)]L*?K?zNat#&wʮ?Kttx#FM9v -jrahYJz mNv;AlaMtR-QϺ;[ʹ==Cf|y[;:@Ìmv|L-Hۓb9I6]'i3V2-F`ZEmӆўYHvꑖX},^儊'3ѥFw6`vuAeٟ6i=.4_# -w,H4g-rg.4'B~JCU2ןTpB .sM@gxdclǽJZrQç{^J7z=E -5%ϑ{T%OdxK3k;_8a356:%e}-(pobh1T -F6pxe^9mHpH5몙'r9 ]"iP/'šgTH"4,xwX{Yu4\[V/&]6} l -nY'L20w-[I7zbS퍷-5K;r ҈]'ӷc&C0]3a?AuC; t]ImvTaRf 9 fa(97v[-'}߾~1TYt,Ǒ(gMi1N. /'-ȬvcG*WHʠgSYqpYQ9Fg4-NF1t;gVXm ,ڽ~eǚNk%?37[ -ޛ Ahx!GV+L;ҹ5()w$!% b0Yؕл 6dIﵮWTzoK Nw91~Vڪ.QE1PbcѤY0kue}Q^'q„a=jOO -\;طvQl^[䗴9D˅þ$)̥;g-W7hptư닄J} 2Du=efJ.-T<~컲^(dh"{FIֱ~v2b u ޻PR,^)eM/=8БT#'h%S>mȩ`HGzfaҰw?/^|Y*ʕvءjp4^ ѼH"ߎ.aƪK="J;&A9!t+ qƽ4w{ࠇ?kjj3~J Lӄ+gY%٨Rc*) 4ŞҺSO{g$ۙ,l{W9iqs"𩖂ʶ0YLQ7jI+2/ĘrϤĶ~N4c&1r -on\eq1}  .H,xf/=k.$lZStk{|n!qỚsm,؀HHxEGJP^B zs -NӐ8e -Yz,YHvaLe`ċD2S2k׍{dkK;%wm-b?^?غ$L.mo*Ϳ%ߕB+ٞ#nLfO -\XVR6D,6ϸHB$%a~ uX#e9[W1%N85il5a2U1sOϝ/2f=^qEx[{?+P~"1%e9{q*[Ce-+ȇHPJYqfY@.#:#n1D*/,^btFev IZ 1WQ6֚N$ǖ՝ -XSw8w"X:,AǴ^XT>@8R@=>v,iRÁY|aF#Ⱥ?=rp쉵?.}F$F3WS՟k\Յr8LxK8 SM$tz67sc"MMGL"Y*8Rvyx'>1(q_F?)e@vo9dΐ嵮^rSjC`T۪,.ϔ ĄhwQe1L2})ab?rweBwA*hEWjWc -z(uX=re_}4ϒiANӧknVj/<4~_4`1 "d' 3TN.cI&G (KI Y^Յ:lo0J[!,@2?M؎;=?Բ}[)KR4|+Lf*Q7̮/{o-2T%$:|L5O&'ƐG'kEc0J -4ǃפ97aЄ-K3dx[ܛX#T4 ?=h>e[=|of\\XNZ'r9.o)2i3u]OdГ]>?5Ѡ&oGDJ<@_3`sxL8XaB --D3}agn?dkl!8/(L ][XKXW՛FH"YLG:{:f֌@u1-V9S-b<Gqjhjw7LVH\0U"ZZ?V把>1\TDƤ}7B8FDd;-2n:&PH`ЉG#xE)ҟ(#ـp"6 X7g]ݛ):4trL42E 1ٹ'I}i&0u4mTf;˼vU7gN*^[ n9JFOxzgUq1B?r|dw;0'UwnS\G̼-xewK oDN j ZAujZ Vd Sk4ՒJH|zR|3]J< -ndfBD=9A<ՎLgMg}%QhRio}W%so(x籅v?M* \`&@n䶌`/tԽK-"38>\wgGʲߕa.W [lN?Nw6;DZݗ 99\Ь/-Ջ -œnq]+;mF1Nxtae`C>6I "lq}7YֱIqh :I[Q/5Ma>T6\;463\[A# -? F%>F{e$ZhWOH3B f`GDn ،aT8דm{x"'ã!B{,큝N+u/R6+2ل-=JKy=O}t_#`jL1tŷj8YG&I/S.>#cؙ/ooK 791ͽ@ht^M랉68ˏ*?p8}35sA*4]"BqnLdEvWbZ-lPTCmtk?NKZ-fɘP"0]"&\=v,tqeW'4748EClJGxdWy w7$oGE?jvYNp0Um3.d8ҝ ͸۟ٳqG=[9gyb9%@%0P6l pu8ņ}!(C1#%t#,a -l*30IbE^؉~܂?h}Dwfj/?Gj+Ff1/IĜĵ^~?(to}xVb:~̎ADl$nnt%AHCJ-B2yC * ^92,E&P-+w0\7! - xBgeaɷ|;;s9h[<+w+"kM\f>{}S,| O@;ج`\ՀɁ^~8/])V- rU L1ŲS@a+;lJ - KW:rjȣz>~-_W<^ue׍anL#>&oKg0e0E+Y}xC.{[zJqVg;'gE^5ɇA= 3`%[D?Em}Q"{ uǟa6M{-q`f pg#DZg D50[` C@`yFCDwjb$О9D 1h$:J.j|; -zl*e{ew;B?J} eh$vh^:@/7g?<8 ]bbe63AX'tjq8/ 66GvԝKAmM4dS޾ot&W_" H6RQ bQ2+CЀM@g vlp9/W6|1o{`q pQHlq;uU^{{Wv)rrFo<(~d<邫de{kMSj%h is`ڢ;Ո؟: >zTwz+ᛃ. !Ɏ-Y6;lkzHiDҦ wYa#<1E3֮m" 9K;|Μ9=!;pB;@+V=E%xF2 \\eX pj~4_ַo Ivzs< [ly]@H{9^'@t|RN@0uCʚKf&!2l6ԗrٲ.ӪL:6QwW,A'51̝x -&mbI2f=76nc^o2X4 G1Zir@pƲĐ6UM˨$ew#Lu*faz@LZ*m[IL> CBv -;F 4>ձ {T~Ch=KPxeG|QLipv@£9|DʡUֶ56MKE_%뜑 ᰥ.ڢފ=ͪ`N`YI׊X -w1 ԅڹr,@xnWSic[@^d;)OO=d+ƏuESėV- u |?bgo/[٬~G!IO7pYЃƤsf1;]i("/n=ǡG -%ˮH\ePauPh<1wyvmɗO14:M'1J,þ_޻-hn^~``S% _6 oIM%fr"p4O vG%70 j謇6; ᥿uO -#|ggTZ|6g'<mnjFxcj͆t -lIFlϹE 6B еlL=cCwN*eVZ#DpҁWQ ^;M> -č䝑(Ҏ5~׻ &u.D ]_vd%hD`πvk8a! 83dߕ%!,_.B F"R NqC'N; -i@2E{Acخe^ -d`_;-Yk)^.E'ږZ@ -XtqgK쪪tϝ窺5RLB @B`A1QDEA@EhmlnEā" aH2O2U*5ߺC-*}I|s39kֿs(2މ0&5Jx=F? w"kr]/98[D~O<9F㐼v E>d{I7n ,DVTpL+}~\;`-u]TΝ{i|ŀ2,6 vNpɵוi89 $ʢ#iȘH&h_Zuk1 ˟`X_TP¯Xt/\XzÙcT 8R+RuV5,ëͳVx ;0yA$.PC.nۄDb|VQ"FuNu`^Ae5i8HfXM؂R r} /; A 'T{9qbCz"eu6cQkw;b_iD_`?Z20CkO7)_hZ'<)@n?xÈ[\:LƞWx뛤 %U+u5[M଱ #ŤF@ sG -<бtwwK9rHGm3Ő#xVmx3P<Յk\բ>Q&77셮.kbš^w?[+d޼v|_F͘6k==7%]Ariʄgj^  `gNeɍV -JFO2ɿv+3›%K&cڎ^] *I\V2U6h^.:^TI3lQ2@\y~ k]qE4Y*;Ie?F%]`=AP|Yuav6*2S{_SCi!s,`{u?p~xZ9?'HN`QB`܎@]N t)VB ¢9ºԵ| ?slh۱׶y. M3߯?A֓9aᥪkѢ<4[CJBxm{eZj}dZ"s~ Tu` CNnnk;K9;hj%MAOyG^>+g̞?Eۼ2[4v1.)'Ǥ&+g_ 皳ma'׈> [%h6i>s!,oq1ZbiUwӡ>4&$_Zl%\խGC@H(rZ5L`d7'|dνO1S7tM]ݤltjjO.-s[|)2b2Qآewzwڍpq*P -|~J- S]2SSg[mTR486mԫ(9nKd8eg;qKhnDgO)=HhK.Ʋ"YF7=h] oV4U/ a `V2䕸|3lVt]>dIT [j&Jms!  n8~yqYBXu'o Ngwlri&EN}}bʉL غd_$YAwf@ED͸S2!O2~`Sބ2 -,V܈Qq3 T׿2t?Wg2ATol8ؑۺDjGrE*=*Hz/`_~KjsjuR|*H5"qPb%3@ڧ 1-"ʃT&ܟ]x z="Қ/{l9iiώh|+~jq Ei-/ܘȻ`6d|P-1̀Jأk'1ȣk'[, 0*7j"*PfYQqW<,p5SxWxdRK@rw b߭RA#apaZ,Z䁙nRM$>_#q3bczcZk( {@Y1l26¾S\s6Lt!3;'U%b 1ŎV˰p;ϣ"I 5 !$UEeM+Z# Y;;<}0pn NxM5{T[ --V6_Sެ~%e{| C*<1T4f߈J'Kb*C$o KK6;G=D-eEn6 >Avl4;aֽ7ƆrnG*rAG5bs)䦿{ jX6}?EO"n?)yL-Dk*@i-=,-˖!>'ag [mҘ兾(w <2pN9ljc__3־*?[ ] :Q?|ldF^̲&I\m1nX#Pn1S!F%Ԑ9$P$$Ǧi.-m'kt4x)*WY{ntn "4q=H;oEAXZL~GuN׮jv7?vqWjdE -m8+@h493и'EL"yS=3@[Q<~_au#4%Y$x|nAݿI/m'|yB#!|m>X;.@:cU;wkfu'=h$B4V`7J2\ c*։ -ILTxc'ˬ"՜z| - DBUa_ -ҳ'yS\+FS'iXFAtH)kjHN .^P?WMO+ߥefj a EtDPyz281@-x@^fD/LMa{y(]'l@,kd9zW-~ss>#D{q 9>wRI9P>gq}qq]\ ;_qr'W_3Ab9JZ9G!fL˸dƙ@X}B"g-Y(g c4w* %♸ v^ d@R?Z'ΰ^+d4<CY0Kcly*`+ Oi܀gyηntͽj 6@تΗʄD|m-kgzIa{NW=o?;%LQ$hV"_[s7[˳wR2>^B>7yδXQ<˴{(bހs  +0!-Ɵ/py]8O#n, vLDMzq7d{K4ۖ􌊐џ},N>E{S ާVϟ1 BvLϡAu/CqĆTy3C^4wh52MLzpǽ-5%OEYZ$z E}93z*Xxܵѩ!oI+&ٯ!<ǻӞkHj'>_F-ӴR2RPc͙mc&aHu z@BU-٘"LkkECAI1MZj`;dQ]^ƛ*kjgY mFŰUkh- 1$1w\P70KU!4I4`q.r܍\JE4G̴ Qy+[@7PF*&1 ,юuFմT'OZ(pM L^(t3(u-=`l[ʞ#ԓ\&s<> T4S><πlC6}p0*_.~GC\ޭ7 :sHؕ`LNZ dTxQk~ N:yAO-Oo;< 4^!bK_jȽ@oʉ{ݢHoUZSMtoYH;ʕ~}~AxO&b7[u'=s~o{@0][7q.WGGS>\T#L_&Sn_zO͕C]g{C}:|U$u|i`e&WfSOz.TݸQ^*Z֗1en1BNtJ:$P0qnp'ݗzW&)yg5Xư@g%>{rrlڞUzN`{?T kN^\ќ~V/O -\ 5>%۔f=ڀ6yb>ج 韙sX2<+غ5/ph6^T6t珥iar84G\޷DV'3qH-!զK:6GG`ЯŨ9@Д~DJil>AM2f!]U@U~x߻ EI VS1@P͐رҸw%< )b mfx,vP&"ID6mK]v( FxjU!lW&oA`umBT24 3W -VLkuKLNe2.mz>1o.{-3A7)LJ{53BM$FG_¶1*I-fZnĴ]tml<@{)ηdYsuH濨V@IDAT]nP֜ȡvbw&x^^gO|fBj P JףCG(yRP[Z( `8,XL5L40SwK^@(IHfDYCMW'ZrZʝFk?u=.^O,jT>Dj9 s03;ݍΟRiȼ"_{2L[D;XbFlqG[v黻}IgDCOg^6[-~uTl`pzbiWU0[o|)lWʜM%V,Ԡ$ 4c, Yg(L`}i[qzWA-c e!`r";;edLmNv~SAq:bRd9oWp)WTPit<Y~=pME%fDO -`[3֠dc]Ǭ;-/dm?M:752c!<(έYٸ(H!Iu5 ꯰Ɨv$^Ca۷%{ṭs9G賊w>I͞u+2ÙpѠvu*c0HiM;TU㟢QhI^K:B <譧CRnL5TvAqL(]MI(_[B~y,5bw\v)NR<T5۹ !怠,i`YbՉJ Ff, tX{jvZ%5xП%xTT%D0R,p)XNann:36R,m r'r5. Bf%'Z(#'HOV ^PAƻC9*oص蜱\)[KhOG -Ndpm[:oK^yדk:R^WvZ\YWGٓN#F>Yނ[R5QX]\2KsҖ8 -lw-e|$KqШ 0+j1n{^eۘCl?w1ēܨ[qoWa55PnLduff/3j 1^ya : !y}*a - -k$~%AÏS g 9ůKSX*!<3JߵFX~'4Ը.ﹱfcos h8! -[yB꽜~fj%Kj߳bdv%|0-$'(~쳩e0 Һiթ'B,*NSSm}ldqxKWEv6$TQC2xR,d%H֐ؖnCu)WX; F8.) $;d:K :Ɗv|'B)7۩ntH)XGY_HQUx(Ey<.RuHsvO=$Erc^ B A&< K֏3&PR\0? V^|0j"iXvCuϸucOg+WB`gϯ cutGS[v87.\ƴdH6dBXmRd`]1y z4C W3̰*"P=aD/umUёxe,]-"Z*Yq^]ZBqu}8 -|ҼΔe}0.ko|iBQ]Xd6, kՍAj B<$< [LYs*={Y[ldv$^-3XnuxU?햓4\?6z /%;%pիO8bIoGWf֖=ZFSqaC. B@V4<{ttq1,R5ʶ)sr ]<ڲs 'Ş iQeG`L#nu9f̫^S qtcOIڙr5Wu+{dx)BAR)`fF:ꮒ7c.1e>קnЇԦ :U ?!aC+;qoqM衾yR;1/6w-5S4@VĒ洀x#t?]rz kg5@6icD\oWZGv8M9MT-s.KJ0DV24A1ۑ-?z+JӈxOr^{]_m+d\&P_: (/HG4Yv% : I핝|b|cx@1pNa)mm,ٚZ߰xdd)8<=<.h ݋و/LF~Nuܛj0YlZ fl}GXK a.f/ Ұ[Wo0# NK WШIBOj9XuqX$8w1|#lԇ4Pky"؇>ivIR)0DY/^L}Z]l`A(ԨfLsãɐۀ\>8tHAp!PQqdXwVgm<h@lCSF㳽' -sҝ~R+V6ߛ%sz>|?dYx i#p) -Y*X-f| v&CҮ-jqFf"$p5K0 80w+mhr:Tki>˨17xۦ.] :]ӥ}}ji*Ȃ^X#<`U4yC*>*"c/mfc_okbcW^oWxCvi&@Zgս{m9^Lϳm8Zy+7t-)I}oHg'pl(kw\ -DpG=B`mLBe~}q3~LZPjo%'Cocqŭ Řv.ţCL㊯0pb>NT - ƣTL*bں+1 yWP~RKU|T4г5]{DڍXk;3Qm=obZ%1Cd^3Pÿ́~;toʌ)k׆+  qϳ'sP?΍cn`4``c$8'LxQ"qeE3Bo "Rcn5C1G(.il̢)u>e^~yXQLe -Cܕ^8u9X/ e-]GPŖPɍ<b'Ty۞)!w,s:02 - t;pJ6`?  ݋ YXI'_3!2\1|aIߐ_̬˔:;WvDvP:{o4Zg+ɷQ|dP9(X.n4γ^db#.(NɡU&'{K<={B39`l^4#U1Z;wv(h5שhV4$k=O,Z;dy^tF`Gx&¹>%;q 8 gwp-dF ZY:7?dk%3$R2mzͤ9tU*27묵>iK[5ɜ+VGbOKTQ&-+/VmPmmSI}N܉B. -uS[mFwFc yk&H:T/"oz :DFhm9.n7VaQ1:6mbko/2Jl2ad `"b_3NǗ&'5AJpR}t!q=y0ZhDcc0ʱʦm*'M O|Cgmk 3w9LEU{SDQ"a4lx4"9++t{y^8 vNiMC@s.;nXS}n}&f60a?`7)tgt4ϥ8ichDZ\{Zy?r -ǼqhRr4߭M8>!b}VgC9}lqO竀X]jcGF˜L/e)MI3łQo_ЄJ}1H!QNQ֤j/D1|J#8圕/hs'-O.nX^>a|U`U4I9u\q0K>o;@6ڟiAߑ Ѕ?$s%MtH! JzsO"׸jMR18/Y7>' "%]~^Kp+yᮜB :KY6 oE:?]?ד+qjT&׈xgmqT; b4| T7ޙ[)'ۚ!YoS|T+vxh yK_6oNTԐiOɐ 2x$xbȈKDt;Ɵ5$ ]\hMS U<{ kܣ{`ypJ&s'{\*ɘo$fS.xU2 NEZb~NgA'WB|To"'E #DXڟj j -I:~ lP,V%;Y7{uL#a;+`F05&.-Hy`"}Zvn#=|MC\~oK#8 uLyIC8tF5{%s[ Qw.XE.="U#],Du/u :8GScԨEd+ I3~dT-u.m%*̪0aͼzjTWyX>O7 )y9> Av'[/t@݃;wDNÑAaڳ1 /=_fKhmN9!TL?/⨜֔~>y;oGAͿa0] t "MlOH2AlG j(9EVY8[r’ۨeB#uWh3)ӆJCH4gG@^{W9f&;PU˚'8}1ój8ae6do,0E7:.F/~eJ[=18x>Z1Tw_H ~88fr5]#NM6rRcAsFdn/fBMMotlD̅;yyQ ۉ_w^F {bZ; +^b!>:!9XG>h_у-Z ˱/+;د 5 ~Ut3ƽ?T)?9P[VyK!Էz{bՌ,r12[AJ58e;P3^^2:%*0f .?UƒlU!e?3ė5^q& -^Rc1Ϩ HWL[R\Rm̐b^ernA'lߛȽ10<$P:$/EՄӻ;󤦆~GPE VPfĐX):_nߟx2 6;3QL3n+ީzCx'MyҎ$1u>> dawۖӴGP)a2>WC(~]T(9/?==0Z"a߾Ќ[> ?~i梔=@8^ MW-2f3* -wBSl ҃r;,=x<˗űtp`Zy5F@_1%,_`5ZʑTh JY齦71۵d8&9L{lC#{̲[KČaJ?E5/dm_wmx?ƗNؽY5kp{g5~u%y$/{w\™9%&oG-V,-(. rqɝ3`"YKBcRiK 53wXͫң]Bs b0?Ujjyqw9cc`KHU:~5.64zV A 8;iy);`7Zx /U}tSwrZ -^xyG Zaܠdn^gt* o /hVbe2i@iv - w)N*5*-dq*g>8sqiV'1S̯v񰔟tE|zS%%},ߟ䂵AJA#( 65e5#ty+,;)Sg6W8s+ {MhG("A)M8jJPnOp![t6o -*%V"h"u+|?Rۉ@F2) -O6F|>VF|r4kYhtuYbLH>.I 7r/M|Ep)AI3dS5tkE X2)iqti7I#4@ ,yfun2kBeojb_2詚k5FԘ$߳#,G%...y~n[ LM6oL[gɌzx -$1jP#bQ_ҕ= vNg<+Ẍ́yʈ%\0̌ͺBE[G.00i08#cƍgnP̪`P|b0G ơ{Ux rG[ι鋪:\>TLb_SyOp o:%GǦ+kw#HMAܾ2ސ٩lb3H5%G7 -ZT{`& -Tl2U#4R9*ٵ3+oLK&!MÎv)ja%j~_FTk!DZsqLj n}6y -emEFm9Zoly܈Fod}F,*9F:n;Vf-DI|0 tMMR>Y5l!5 \N= @0h@JrN_߁Q?GPCfFecaߚUy-.@ - 4F,i NAà !=]_Ƕ>S<q*/!OE _s"\F~6 I$PS| {!7z:=zc/b`hMz?xeCa]t~.oOEN-G {Y_TAe$$`` r\b;ϝ/+<)1`SUwpOp+!$~nF*Zfa{p'cʾjrdL{ J\mX*?EDurIo+4*PD*׉f3">_&z*\P^0, v|Oco/G kc.-+=ƽµB݅:K %y.Uϭ-j qM]v.*m3V2y"| -H~V+n,d9NhGI)FL 'SLe|Pcyk[=M}s W 6*U[[Z,<5u\ oX+-*mxA6RvŸȍt͋m&b9P%QF//h9DS[@Kwл=fpf4G/<$kt~_Az%Wa#e.&X:Ma/---3t2] 7 Eg MD;BPf@*s"{Cb/?n.O +Zmg%T@3\I^'bQk -6R@uE`jٜ.;ɱJ#Ca׵ -+K5ӨpUQ-3fcS@sCݎPgezbm. l8;Q6K y2&zeX-7֑#k֥sfm4EaӶ v׌2:1Āj&#IF{b!<[Ix b xF95 iK'⛕>똞Lr3u&seqL2k}8K&e_bҏh3 Zٝ#e Gf"k a2g=:K#8.y,3k<JPZl `̳+–j~!)}O2)e/uhIfQQaK:Q+'|ܱ1%~x8b*ut"ޮCi΅,6lsLjrlPfscs#x:-v8u>gGH&'Ui #DYQh|0K1 6q_:qVCK!ːP^.;%t^i3AwJ40g ܢ 8_8 -uȠڄޏ z9 - 3{9քmm࢕+ d8a!QPqQVᆠȂr*afMrC?C6DnCwhY Y2eDZwaRWDAS\+buAh @ - ŧ%~AJInכKy.;lV:bj'Lgz@i^43?00&x

~Lp+51,]0{+&/@8)n9ҥ]HZ0=]؅4SuU<ÿ;CWeơ~!z`)h&0- ipB[zhM*˻sݷsgd2I&dH TD*"ڐjZX*njdQ2!@ɞ6̾}3wmXI/Lv,\{z@;6 ,y3nV#F`š!$Npzq-YFԍj_a3LӎiJ *@]N*LiB,N@gB9}fj,nmjʼn?]^ehsP ztK||Kno rHh`Ɩ/ W\M 6.˅{Z}e1b3(T$\iVePV|UC:` -:C-Eq1*[|`|`úXOS6bٙ~ ,)%FSwÌ~I/Y?^ IaO |o4ׄZIHTD=J?5}@b2„4 ׮͛l'/S- f2X,z1h/bYȴSݛ){ Qвۥ{[iU׉*c6A{ÑyU܇Tρ]\m?'誢?+W_q>Y.RmKq6W3E]~lr_v@Њj(ޢN$`M݂ g3 f7'?NG-M@tp“3(<ĆhH!~0Ku4NJWIXe"/A)&3>(QEAtRer%(iwvA&y;Q0_x$ϗz{?h7ajb^fyi%qX&cԺV92Py"fӣeq3 1F;weߟρԯPoJ߸NbhZ299|mLL9w f6SڪSF7O mK ʅ3Zj R,2zh5d/+峕e&f^bRgw\6\4jc|!jU&P#ѝN*1;x)|0dsN2^+ÛfOd]B8zFi7ZW#=_Zڡvr z=Ztdkog*- +23,"Ի;ΰ>C "Mv]P7Z =D*^e@"Bk;W6b10"\BKJZ=ω‰8'Ֆ1YF9Gs}{h"Kn38lZ&/[q H-?'a݇<u$9R:H^V -@d}s! !A(/Y&\GW\Vw`(Tw7]t=t3 F6<ATo*{X9LpzŒ)R9A9ͨ q\ >(0lg!2c׶7WS0#Eԫ3ZZ(-\ސO9o `Ȍl d{+Epi=ЩF k76U OÕ1,3kUw93O=h m6z7KCD$Xt|+=^V;ؽ7zz@{ HV9n<`g]%6K( _\h.8LK8>X5Wx͌:3㭼Jsv:z\ ҴHKbS@dҦj<}:cӟ<鬢]^eӯ 4c/!@f駾&[뙤z7WGTggH~jWtQmb me-*Lh,?BNE(,6%f:Г EC)!Ls7zz dc,v'YhX 8=pkGBwf;*&6RuS %<9nYPNvvT(.sOkͮNu<|cR-(+%BAw4e }^i_E5*X[;@5h7Dz87Tx&D&;B ǓBAuEږs/[,J* H|;j5+sB d!C w,toEn7v/ I}Tԋ_rZ<.tQ/ /b?D\R5h~ z# T9, -m[B*di4jm$rl&)_iأ%%5@IDATUr!:__ޞ=dX[Ƞc/3+= 8m;+<ӏtI7[6 CgF;&+0)nK$*,\O<umNS9'PClSN+ϦS= ^.HQx>쑁3W/lH;_C+O9||> kmeD~J|Ma67ݛp))C}/f/K!2p|LgR·Jr0Y XC(4z6Jwsĸ;?^Lil~/XmñٛlO,"9ksEm)9y }ZKz?_h1۹Qf/+` x_gW:C췟-Eώ[E <)rx Sf,?ػ-LQtRlJ8}&A$HL"!|>Vd?+:F࿄1jnnXH!m_0.k{5c&!YJ )rAðj}.ERU3|0wDH@^m&ғ"еwU.Ô+ljL@H_ m,3l:]>r6r;Ӌ}ɖb-$K$ITl17-e;z(?]dMHpnch=\Ft~RTz05Æ߄E8Axl re[D2XF H2ź1uU3oGzLxJ#葲tsS&4u$hsRbca_cz=27znHQq=ERqT5|x5Y6ݚR/ffȇ2 >Ώ;"-€i j upz>כ\H9NQbM Z:]97;>2f*)Ԃ#=.yD{rrR^.4Ph1+.ڄܓI)?b#2K`?Q,[h٫˗}#W/tM7'l LQ"E*k5{Is5&חi`~*Vqlv5o dR/F^=G -}4[w/r-0P1Žšh禍s{dz/fbQ&6n,Q9Ջ*0OckP9Y`{WK/(ڕ8La07"CLYvF&1#!ᢍ'JN\v.}90gC[ʁJ8+ -'iU *wmg5bYAxWt3E]gZ A<=pp^ułGh -rL-t' FuL Z*f5JDn0IRhGSX!h3dPfW Pu~z'`fkvهӥdb7 -7[nir٨pY}Tc ځ"N ei0O#@3Xȱ!4bJIY~ҎSs9k1qzɕ0TLUvcb`b@e/V"ȑ3F? ѰafNn ?b!^Sdӥ"}DN%,] 9Akz_DA0W iBT؉ 1Y6 OZъgD6b{噇bi`-0x}a5(Vr@FVHp2ɓb G hTMbAK\uXjլ6Bi*Z4DqЛ6HR~y 0~xϥ;Ǹrp,L;O $PFv"gqS#3B۳}Yt%DT*z)1\¢|^Qob"bOn 9BT)CQ܌~wL<k(s/?<cIYQFdp,}Y7X,̌q*eфH+<3nP8+޺\[j[ΩmLRAOiG\%ydE[~Ĕ/8Q/<)Lj]36sr`B#E1fVR5s'O }~)h0i0_9xK"gҕ8]T[.A. Ph5PcRfW9jխ=c#T]-|iD^N%r1jηm?;')3O3%T2m(yp}m۟W߳-_ <(+cRA¿PpIވvAufa;d ;Npv.KI}@-UH;(ԩ`|dF%0B@ҳAvz8Bϩ-f&LspԁZScY(>Y>rGC/2srM4?CY$9g,,@3`آ{Ky㋘w"ʁ9[ -]i".nה'tP6 GAIUsbI8ޮd6R`Ց*dQgxJQE EHǢ 6ğ>]*Xj˟F"! WDdn\F!:B|9vE -1k TpߑrJxHҝWɄ x @DɠE7kp#9*Qd6b:\ns1]Eu]D nh -D'dwq@S*R>XP՜#޽|wvV5A|ZyoF6~ -mQގg( -=vQC/V+%II*>$/t][ -09k/,RQ :v9NouZٖ'pEUMH_[8B rU:6kuoQ/ ]p> t:RXz7+Ll6HuIXPxˤ6O|۵sE@IU :2iL}+ˀՒ3@L.(!IvMP&LwafD 8A|dEaoZD3v&Zq걋aR5wl՜Lt%''+<&S' -ч%yTsLsهmDPVGeux #Mtg60[.YÛ&ǙaCd GuU͸\‡2Fis=Қ=&,2VJь#ܓl+,../d׻ l&#LB~n9;YaEKZ.` go'NeGJfC*y:pOU*|z߈?fS87k|%_~S\ШAQq_^B6/4X -Fh9p~IKC=Q!ËZ*]g-'Sb5C>J*[VOW@`7{ps(^D PX6nitJvRԩdQبbçX9tAh 4ĩ񆘪%\=PĠ_ț645(>"4QD|y:-`lyC_1t 4U`8kM:_IMT!slU; Q}픞S lHgy_٭QnS6MPtV6"ds]H_!̣?_/7!hJL Q r-`*.Aqo~F&/D¥yu_>qV[Qǽ- .Qg$;d@X` )b]XMeK8˂B\:z]r09}7_}mql*g gFW,B6"]HI8ق`yQj0.}]{vPj|\WbJW̩}m2 ;QM Uӑg$-;Q2(%j<(|`Q[3Ȃ,ܵs"x ůC?Te)H -c"6(< `M-|ӏ~_r_͐Isz; E0kPꚇJjI56B!CJxJ4a'*6[O :G~^L*&R2Td2~O9MEQ3 *B) /g`) ' vqp!x.k^;]b#eɺQ* \& yJ@</jQ|lxA9ɯ{ZC_YAuԇXΚųOnҿ!F9!Y5 -gXՎApŠ %meJ )+dMʷɈpOmGT֍Z|9R hd\~)(.tT349=(z" a9&Qx+ r`|Xz(`5&Jl -dc&@ 3*/lebMkUZWiۓpO4b72i…qDQ .0y< -mR%z&W%I{/I)6Q| Dqf.d^'%VZ,oUоb:&s - %G)!6}b<#^+P! Fhä[y#^w}'CY$ _M90l0cPͱDd~QwT>mmZ3qΊlz.4gAR܅~T*BEmao\$29,:\HNea@1JQiq.8/f% -e[h5󐍿VlZ8/m.Yt!YCKr>Xfw Ed[r𚪪HR=ϿXQN)R-йª 45S9I g_| n<7^@fw)I傣٬O񗢞HoPf*}cR -+&y%xz=g09eb-T!@-N3ЋFn&U5EJؑnⱴ^/.6(R<`3 Z+&ļ(X0Qxs' ~G0)fΰʗ-E[o+{4Mq1v='8E.C421}K-=m&t;AIꧡJ=}|۵rԦ5+,}o1C(Lw /bC"I VxA!t) .ێ&})(LR0g)\ql`˃Zr76 dK$,u~󑌺F'sI3F] M)0JZf#z6CuS̫OzOVJ0U_up=KoģBG32B£"YԆ\w9U+1 Z[}Vg -gȏ}6bg|=F-tGA+TPzK甃dYАcn,߿,, c7 9G+ܯp0*-!6E>\9RTgj!W"ODYpi<ͅrQ>ܫ Z.½Xvy"4&F/FFl0]V˸V^qM]Ӻ l@TJ\lࢹ -!I܌o׋m?N P&!_8hb2qX_D!ԈQY? &4;XVs`"hO㱱5Rfpr T`lYL$bq+6d%|(DܡoL{畂Yk m2OUٌZ}F411Pw0qed̸e{Q1i>VQ M-?2NmvH 1dƸ6Ma> Dm\n0 CAi YNlf"iٚpvKx@HF],i$p) l]ps$ cȢJg`hOhڷ2Kf kj\#]ƱvԤBDf̘ھ(9IyR0Nma6K!(Yn.Qp//i(2(=a8S -0<4ʧ XDkbn8/{R˧b}MF0h2̍k`ذ>lm0:> 2f^SI_}XOfd&"}eU*}T}EK\͙oZhKW@@_= _(jαo yHGq*v_6gBhA9Ւ=gE@l -!yzNk"DL>*rl\'&ڦ&y`-tjȲ9 ))o8k83@6jt;R)/F}8Eٟ4ZXP:<I$4[;97"Bh1:IyUb”ve//:{L}Vkcd(rwo#ol-Yfi:dA ,3 )l5)K{GJ@K+p\:aQ4L)Me'Y)z+%G܀vv;ZΪ+ ?|_)o"XDu'ODo7FbBAڷYCZVgwVGxK{`qF+g =?yhd]aÆ_ggz]JDk"wfqp֫C[ nn)goDm!WpQ! k5ioc1y>4Ţ3SLv/@`n ϧw-kutY+7ex~ |?яtt`)+|??Շ : qdN]bw Tø4o$FE *NwczrpWYSnU5n9aB)vrJPo )6$̗] èxQgfaW:Z$m=l5#Ev+~5 N'{>>~uka͚IýMOW,y5޹n( -y4͖ -;[ - i!/'MUK^L^5Ez5U]'OJye˥l*\qcι78/.59p#hɖ Ӂڪ֎z虻- 'VPQ<2C`nF.ޤГ%4&U6ULNp #w|:{Ympa5U6C = ^F"sn#0s"򎠜ܚB4M6 -ONli(mCgc]̪wP|XI/&K[j 8Xc㘖s8Y 'Y?;20c -"q+ 7ȇ@ׄd̺S#=C˲NO޾V pΐ_ѫ)9?^2Ͻq&ر-NKosۄ?uJC G=AE1Y -@P jijvw} ͘Ź||Ьzmw#'K߀285phiHq|AD̉9Tn=黃}W\ο(˲єeMK:vBAo k OQ) )vX3/pcܤz}(]8}6]u ׊4Yt >^19#+g(qi(b@h4v1V4"WS&fEYgEo:9i'a(FѬnZ;F,/YT{{DfhnPe{)rl)y.{Z焕38{Rȳ%k,!=/oWӃbyh;`B lJ `u|dOA4 yP:V 'Lw,,>%Ao1v kM; -a \x JΜN ];&:?-o[qI+4)?:y\8VL1T@ )jwjqL6squu}2?ʨ= xODҼD˲ȉ$F]w= ߝ: %;+b?ZZ(AN8!\> pV7#K\>טWT𨡫SMIB%uHxeRi?PN(Nw2wȮ>` 蝚.keZȰUz)j*fHLQ)I RF}}}| xy.+Ee]mϸ0}0wEN@-6wc LlFh A/E4ܬ[KQ#6܈;Gqb'-reۺW]WyE螪`jߝf),|+ -l3s6p(o|T!EAo/DRٖX#uU sʖ255M89dٯly1 ,Q_ZdA}7D?cBP͊>Jt3Y)]}ZyS3SpDOM^z-> qʐwSsK2FvgMM\&oH)N&HS?J:%Mzf@~MT#ȹ9,}g#.JOr3,/)⿂~/; -8j%Lc%Wmsr}  s Ť\ ʃ j/i"F>J륁K/#F<;"9:y7MSsz>X;n(<̘6 -* xY k!չ0WdK${hɎFb"~V3D]D+ Ct];pSb6ec>/PxFPF<܋hUE&} -[]/cf"d>Ez$ו}eAD-1-w=gTEM܋.nVw[\ގvADz K[$bxmS}} چlFPt♟묀,j8!e=esqRQclpR)ֳ9vs/H`427Aϗ|lgU[یyeZd%co4i{9lcf-1,sHwN 1w@N>$ uf=3DaaV:e 4~䙍hn+Y:/P]he=\hWH`2lAR$ <[Kn`HOCJh˟F}=&h sR04)|d9P H2D5R FJXF?&JCOIwݳZ3 1(,pY3{N1 .DZ*O,CC۷o?ikkK%Z':RL2mP=X P9`UJ.*ɋB c$aBHA $\0gS{$_+-ߺ/o9z⹤}7ƚ, >_ Ɣ;Q߃L"2R3D ˷5DS W k飐-vU1߬ұ}V=wb<vaAy'#ߏ&f5I8j7#8DGYrS@IoHq -0M O>oLX֮LJ;j'9ECZ|eH_hƌ\"Q@UWWOPM͔nl/s9 (6mpl:n8 :Xݲ@ Fj܊,"`;mBQ`yV*6A&6:嫣0 XdMnuc_&j1n| s-Ys)#W<=} Dkb b?*Wuy!n[f7 &k"єWAU^ض~t <8,(VI^;jb+;U{˖BxÆjv64@v# UE\ 8((־7"yJz:ܜ<r8zP5_wh숻K!ݗC!mײ@YyM wL4BZ$ -ybQW(Bح\:jA(\'a90ȦɉOGRA-ؓN5;{Kh}/!'C{'\lU,Qc:h?!fl2G.*ÄꊧYG-aPfSDP9! ,,YRch1?5]:P͢sx+Et; ){ŴO Hme̙JxI@* 3^jI9Ylko= _r80</@ cF3;޼ŬЎ'NM "X6`" DJr䘵FP]ꤧp%8c_&'KFAa0UZ -q ! %3LoN=+ud+UT(̘D\Hrd*BkjY UAdxX8Ŀ s\0+RI:}[zoEs;V&^'4Jbjq9G@~Ȏ👦RƨTrmx7Oefgi>q.;w?c+K$\’%9H -xpk 0IK7R$žyaΗ-2m(zbW đF/idrm>EmdA6 (6u(Hޕ9M4[ctn__%0%vl&H`(*,O[6Je &6$%ba+ JqC -id 7Pj|Mx @ : 7b6̖(\5rb(ʎsnr)F.3_?eڣ_vE\:DX`xܝZHgzBDmhjVƋ@IDAT?=D皐r30 @;Dc4FNf,?䠧O!V3P;^7B>M϶".G9* X V ZS8xKi^w۱kB]ҭ|!Kg!;<"@ց]/RRI{EGs1Qj|à9C&s;5X}Љ -to{C]Y@~rAi;*⯐,rчkIvM_y+U4Pj`6kEz;A1s~7RՖ^ev9GsqMGL,^|i0V׬4Y'|UV_lAT7!.立5Ivoq}pG|O)̈́O+| ~g%iֈp7YmtHn1\(Oe[-0 ZA\dۡSHʘ)#wz~kV'!(8>n<~Jk%!Nb;*.xvgl>GY_J%~+TI4+=)9Y`@I腔~mv{6h6}s@0LU5J|ٜdN)cd% a"peA>'W9nx4,Qa y7( ՙ66"e -1-!LimW^Os-pM-V"s4%^ IgŮ;ůXX(QhP[AɝG6z<:x鑌Ubt~P&ɒk 3 Ȃr`; AB}F̘7]-H_ -Ն& GU"ktA>Gq3fw@B5aڈ^y;alʙQ?,yLtJW76H η ,yYi^oΩyp)!kqgezѨbْ{,c8HLB %!&KMXۛR4@,d[nf4!\I3=8(S -E͵qԔ"C;Rd|X"0|DI^S*ry6itēNd! :捇L_pD8#q~ފ}u>ܢ]y;/Uj#ο BMN?_Q"wfX-vl5f;qS.1( \Bx@2'+`h%qLi'|vo/,)ukMxF}\ǟN<^ -П®?oƷGFR*< ܎bބAUt@Ә?$'P P)m3X-C4^c`A4C|뎡&xb>8J?GEQ~oXb-94L~p)aw=JJ=`FD'r l<>OCYbmHqfjZmc/Jy.~5냃}]Fs-_?7  V`@s>"W|;OltQA }cvG$!6&m -P@2N<$U>T9N璺:ӐNnhOcAvI;ǟNHӗ4{;.vB -,O|}ޟbrޒU;=,((IşB._v ľ -GM%^\6li5H;y{S;DK^ =[ kGaS#]%:=6$3XAGŸY2s['::DYsSu=o3 @=\=N~ș*&˜~ ,c+xj $ky1ENOok.`iXqelc VRw߰ &!w/ţ ?EE7GsF-`c)~0i0E5luČJ_lj"̃]z<|QI;\.l6"=9D0(j*_kgHR5Sѝwb{f[_4J2\?ǟ dx$wM㷨j"dY:xor% -Zv0*Juozr#=FX^Q4އozݯ:.ONF+ -}Ȅx0}8"ek&p++@ϩ!@=9fG]?MfG,u#m]wWSv=EKj CL9Fs^%n)<>AVs5/YS(NĻbsu4<͙~ B;okzq|<98pi-I{)7fy WVTR$A3p%QtrLQD)\ NH-X68RMY}iOwM.UL{zhN_eEE]-nohV4feuu`$3U{Rjwzy7qq8뭧qfVA'!ܤr+{nB}qHQF2Wbuڎb?\XI 7|j٫)޺ T*8<:H{Dw[&`AIiuz%1򮷢wvI.WľCX\!pm3[kdЀ >l^E=dњL"F gb4ԭ8v'`_Tʠx߬^F֚qH4< -',e*T%t8_N r[b\nnXG?c J1F pc':w%QKGDE((2zdY -Z;vc@PaR:W͔G0!ƋvC:ݜWB B`N^yܓt=٦2|6_Ho>y98"_h`@/!n/XxoIܯxBG?E_( ^iu` pF6u,=;tDy*)Rڋ/,kjqxw]-)55eMf7~ח"kyκ ݵC >] җIn[TPB52x3tvy;M~cQڟlR([rB1rC;yKBy.9sB$4@[dx1RMd&J:w --= 9x`I?flOxɛͿK:宍#ѱao".֘N`DM-D\8'UӈkّÙLr m`qdu5kŊ&-QMPRg`}1p f|=WE4w_ݑ4]#0agOv`/mB9CbU4b=(t%~Eп[˖>êV+.[ZA,CG{-AK8vm8`O^?$N}B$wK (YL*$%O%TZ[[. zâ54+'І| dMqi `ỪluFvJk,oyFzOmVk>wMd^D{3rs^RKj -0m]CQgfڼt+U6",!bWW[YoRt};[]${5=!`O $(ߝgTgF`M@.k UUC@5vpyIUJBa]ug9] ѕoz[L ~ɨ͟8ߴ@ 2$}D?%$B`<gMt %J\  |pO8ҢY7h-njW_9Q@ -Ȝ}~D`}㺤?F~@rIu9y" { "7C@9t iKpМ1Xkoi8zRt 氮' 63Y ppMdҊr{ִlX91J.xMll \\ fj;A5B?4^(Y z+w;@,;[&&>g7릁qn?v7x+CC6 ߅2NnM HUQ/$KkH%/݇YH%?똮*7^~QtLSS(} -a|5f/*#+/d:Uȑx*=}~[ -b33S"dJ2-ֺ\4Bo,* -<},D@bc)9|8 eS*q.g&1D7"$b?eW"mчd<M -0|)^;o4)[`$)*COcc="w>w!c}6n?m=^̙bu޶ ^P!hń<O|:UbW<{ -~/ye(NP'<*&Sa-sP/$1#C Zzx.֧qIp - Xbډ%r,ભV7<3[R#.F6UT@o[-3ģp44RTjKU~3{!c k:+I:y[ ug0 nh֕@eHw;vc\{ 6Yerq]2M bccBe*Y![*Ln/] %^ -Թܞ?ߝyƠj)oըf7Fwf*AKF ,( hGȞWQɇ>mRtqjhFtD*:dsD\Ge1?vp]A#@@:ޞ7t6D\~fvOfLf[K#3Q*KAbֹ^Qny(% WvSVq(^ ]SG/FA>nD|| Ksˑ+9'?r&{+˲tŬkk2v"pN.F$緹+To$9 苲7)N{(5dj9B+/,rU?hQaK-yMY#fʪ "QeY<$l!ù-TDl:c),J_CwޢB?D{_Aֶg1g@S`͔Ays:"xFRn[M79qJO7R!k3#ޤO.2@h  tJ&btYg4{84݋Isӆ -&'sbxtvP<" `VND&SۇVbRjrfM |'Sm}'B\}#J1SDɷLT&wg[zs~);E#Rr\fbHdrٻwnfu085j $1! Whxh -M(YEJp-94gMu!5Kn=<ǩY^` U.0d|p?. w:Tehԝ}{~iiы _\$I6\kPy$ҐZ" -zʛvcr^)W{rlv>>::إ~_rd^վ|֏t؄|ow6R .M3V2 M<+ -2&$LyUc/ M]C9EF:qPF7D ' #e -50BQ46]B#P*صtH8X[HHEƟF}oOlrą͉e-&0ocXhCɚ5$ fc}~9ur`-nޯ:ӷP&xNaG~ LThr'TrMGVq̷PWpWB"y|WBuZ%rBc -8X~3τ"m6*1e0stZZXBSTc^^ˀq@EVhCt‡:j"Lޱzh ճnzJ5ߞQU7?, -"gFAoӍhly?_b}ݨB*~̆R;#u֡] :W(CMc譢"ǀLHHsրݬ|Ǧ7D&Q@PaM3-Mpoҵl &Om,Y~~tS_Rߒ5#TIxRvj[PDg[U3NZ7 -+zPT:bs2E↮ YE]|t]m50[\l F/6 q#jVi% %~0Ȯnn:"G΁dJY7¡k/+[1߾bOLf$í~9s9o6튪ߡ7, Z7{?6LpA|@ y <ݰadf"כ;t,&AC'gy{ftFM(۝B :PFP]HFUq:sцѬfF1;B9Eȝ$W[Ifp)Y`A nfbEFJc6;'͗ _}; -m٤H+ -*b7Ɵ8Y[Cic7 ݆l ٳ0W=Be@̵!5[4ra~%?ўTQդ4O /Rz7u p64BQѢH^Hwt%бGNԪ^Ɗ>h: pr <#NQ3ڋ'5zs^# μ4h1͏k#zn0)r$m\ޅB_YuZrSy}~a-؍U凨|# - -J- n_ y0ij౮ t0l%dS -SP"lIA7k4TatG!Uw6#`78ñt`vhg,FS"4(AD$L&mw"Z`w O lq„B#1@(}3v*U*rR &YB_lcR˫^ʿOL9s<{oog8Ro,FM]\M&xO]mi›oY eA^,涾"#j܁L&cF>;f .YAMQ.kjm>|94O(P~cٛƵI_gAܮk"F? -e+w0c{ L.÷y٥@I2J4}J/"pPdǑNW̓:utqڅ ,|k o hZ&Q`<_y5eha>u!s]Ϟ=NZK ݢK1fq|݀W3hnAgʌþS']l][2pɊ/#G_I3y5y~Ԃgۓu6nSʔie*\dǟ>P5]6"ݤpNCvLù=zd~ %R[B[ph6pt~Oνf=çcGT^ 'oGS$rLoLq o;7]jirKLC5tRw4.XF:^gxwW Zp}rk18+"סJ B+n<&1ts:>kl`1[RJx?%}WFՎxL!/(0:ݞb3Yƈst# (B4|SPiYjHQv0=ڣ6E`GA .baQie&Nd %JRZQ1_H [T&n3f }Ȉ36kiBcuCO+lJ"a7o9.p /񮅧 Of_Ioj)vixM8dIC錁t[c@1s}]\svZZWK]8t(I<#a3Ń˄ Fi+]j6En7rXK J>*[2WGܯҳqZ `~M/O5b0pΣSkglzo{'ZZV)B5 `3 }O/_ts!0İ 5v <@gjkN(oJ2IՅT&-M\SjBٚ7cAP363<丒Lx.+9muן<@QpZynH+7HηQ`٣u%Bj8hզfAMum}KkKzG`yݏYWwZ tj[N wsEV-WZx-cz=极Ǡ`㚂0E*Gl]E=iEn_7 ƹ!x s(៸c3xҳ[/ܨ!tڋM(S5VW+q1709|Bm5 ?1XaLTv)zw`3v{0BЕXϞ 9n[ܰH$rʦU: ȢwvZ)Gtѿlqt f3>8"P@GdFtU21+z2R[~*8wũ#k˗! ˩2oqX9do'}pze9dgf6,N(=H)1mY:A?O75Ht q?ͩlZrя~h^ϗTK̓fF4DQ~PraxyE XoH%2v_vfGΕ;(ZQw0>N-bLRMe +W=pēz - -լd鮟hEB#F}<cxoH2?PߓCn*Lorm~Y/=7* Y܌t-Ǒ,A.BH*,@*fk(8y5yG Y2 ~ڇ|F3. FѲRŐMwy e_C* )ƚ`st iEϬ٣rg"1gmo]A0sIш^Xw JO:&T7w -!~.ܙ<12b|Nibtq+ ?dWg@f X؉nGб˧,{mHr=6\RPH$JX*f8,8я^## Rx3;9`WvWTvZPdC|iy$/Rq${Q=_ ޳P}j o]E=5l.,Şs'`qRtnuĴՓfuFwVPȦ0S-oz*G| YV-V9F(m%U:4BfaF& JYQ\ӐzS`9K'xf#MWg  Z~%Ԁ>>G"Jb*sF -& 2x / -9R0kP.#|ѡ>ՀgY7Noogt#Jp3鯍8h :)<1u?'ФeMA{ IWW%H(lU;?hs$;x4,mɥY -ykz3=]5ҙR&~T߿?zKkӷc_vr~OY=V5$QCHוw6v#x]ҏVһfcg_HO3kс"c/ -xowđ UFq,<|4@M3 ݐ/QքN&ƣp<^RK\ogߵDnP 4ԓnC-֩S]H?W:c`mH~o2M`1IFyhԳ܋}yMp$ۚ,&lz<'s^lu=mFT%]J]u r52]at7[1KdP0,gȖiO%RVIH8%Hϥ X1'ᱢ(Ttl ex! ̯2QѲe˶#W{`{wxY(Hi뙄UərY.fy #+VhOBer{%QBY eʫ/pQӵzDӲ -a'?e`8Cgg0HSͻOcЈqF& 4;J\-(9""Am&#;Ŗ}w͙3|8ی6q raIץ8+>@QKFuh -քN)4,aN-('O2|h 9׿7)?x~/B.,SM -efݣJˣv-'; #?\ŝmtI^B(h[<բomZ\e:H.n\@5(m X(ɨ@R &\5L{5w2Sғmy -jlvm@3i> r 6Sp鱓fw5P+3r=Z. F#1kȦ!Dw /ՎTKJU#'RA~?2WV?UNf?0{g@x/5HS]}xOT<0lE"J*50 -@ 5F[RlRwZr/Ϛe\i0OfwDb&t3sK3 ֆ@$C ݖ6ZٛڎBVˆ;i*x1 !C4܁n (X,u -E2-g /V_v#ɸhgAGLW&x⻗;"jq5O3a yCC]0ԅx -"y#n0[70W㯬m~ +yސV0@>bzȳnv˹po{J3,e.KX+k} =!ph|am$dHQ)g -yͷ+s~4ᅕov FyF1 FD3߆9C1"QӐ.>&Z \t(jh06e@IDATȆ!%2IC^~ݺTKXZ}{Ut wr }ڸ mģqޗ :JXp@ug6o=Mk]crÂ1 -2 --Pnv<XU!֝.r?*=}GA}ŷF2g{R6ӆ(qkk45~*1 mӲy -A8~0PiUE4ϛp:_1zc!b<;5ى\k\!N0,2W[!CvN4A4'3yMK촳LM6.&-;t&f[$uH&N|"ޤLE!XhSqjLw;@I -;$1%Bh4PS#[ebonΰHl㹬ܗxOD[ -vq8h Tݘce+рQX(9{qV5FJ3.˫BN6L6!& І[owp4*)sSAgRӁı0m%&£0n'Bj23^.{ik^x v~ySS]-h[mU!;2d\T 쯵7%v sz'}67|4?dpDHɼfOˣr ƍ^CQTK&[^IeYluf{}KdҺ"F PlMpt%O.W ` ̌*.*_^mwe F´Hy08EN,iyI፡!D,~8VZv^ЃƇy7k00_IͦSH$1UΥ(F4PYQjxzR4|Vc:< JxPzs]PYkL81їץcEBx-_X-|r@VSK{DFMn4PEf,g #+)ErmUM$n)>VyT\ 34E/>9wL~Ea';X䡹,iZB.ބd7{Љ9Or6>䙸-jBY >zxS}pcmSq/→K$@X\W@937[ڽ{sHk gp_vlt"c;zMj*=f:7LHpj f|5wB/\›Ul#sHvA&睝YHpX1Fݤڊ?Ǒh"R+0:dž-S v=zNtZ[F<_O걨P{ڣ'lAY` \N4\x zVLP%xkR6#ad ioH`]boć{8Xt\cܚqE|;8ܢl8$A=|ލ_o?D4ƂSپ!gRD)3vws*G3@=8I^#i% 9Enld @V`'߄w{LjGvInS!x[V[nїB,t0+m= b'e9Pǵ|I|5eeUa^BOS:;׍ -5 Uǚ%豻 -ơ3E|QXOhd/ߴt$dj=Z,k'EE){yp>q. -& VTMX/5kV%0]]Q 's/(2ƲB -lETveѬ;{U) inyeB"x[_uQ}} -U'@C"7|; D'_;"ӂ+ٓ >0)A1oɢyY۵P vǦu-1"1vtZfUa,JFe(G9@Q;0khrA~"4#b!> 7~ -ԏ{wȒ Tn;2hqKgkUvҬ+-'A>mScBQR$i-#JT:Yhq@$攅XwץY5 Z_Y_1`INQJ1;wC%y^zŗCL-)Ҙl^ɔ3Ҍ!ws΁X]Zu Z!ZQgA0q/(dןydЛ&|-pn߸z9/ɍ AF2)J `h5Ɔ{-ߎԯ*r:O͙TOʌ0A5.boF!3(VX qBk8|:{# 6J/22k-cC3dRgƟ侐sJ½C}J^/_6e8N1eRjAh~"~Cz!/߅!@w3_(GS;J7 8# 1~(󭟕͖gDwIs:BPt,PWFTR)"Sqazm`4خ*fҳ0.'L5㢝:S1xHbޫڅ'~ f|KvR59š]qdϻђepY1s 4d9 cWfWY'i(c)-{6?FaSc:~b|S'zNg jvP0'XZ]kEL,vtV]'|КVAU6d䴈)ÜsRӦ&tXq u |6Ncv&)x #oʺ삉=b5K'C eyeEdRf@ĘkfCvpȪÃ濃ip Wo-]E0Y Q,& yks)gbOuc_d7h+C/A&,6i;灠|wU!+~.v駚f8{Bw.x/c#/4Gj䄦&Ri z0ӭ,rCrc=Q+E ųv-]{XCGlɦʜѶ,']6ف6|zUgu -)`-)EՉ0^/޹!gj'P6H]+; R& ,0ֆ"Aچ>Ɲ3R;lOZC`ya!j@>]o7l]_;<#q߄)E$S:)%;N8 `3eF!Ahh|8dnHmxY0yꋑk =`]aؚaA?/Ɨo2]3@Y%[|cXBɛSjlS<@P(q|&}r>7y'tZ'N8i"5\AE]n=iRz1UB[Ɉ1Ëci)Z9cv`ósfs}_yᡭĪ*mȑ‚$kkSc;f)[?LvF[<+55C&w &NAA8(y@y6vt/WC= ImY7kfpx*u8YIrS \E /E0sw|S (P^BX-xKEŞ8U 7-vmpՐ, -K*Ȁ8KP>^rT{~v;ǟ_ߑply5°aMȎ -tb ,C+Р%LQ)݆@;Cp{[7Pg("~m]ot+c{PJ,l T D?>SfH%}4~(!};{[֍yokK<9.m~ [``/򳾖S1K2HoE?D%oYSXɶf͚+/oX?yo[iK(s7yFo'?Q̗+Qjvŋ%ƍK/A`hYj@;FTM?Iũ. m$~@oF}~' EE#v z)I,{w3("R6eX?e*%sY ձ{&# ȅUl{^,ƛoPHU^5CJyXMyl!F` 6HqT)$ tH%?*(]N ri`#2,}Eo6'댏/ -Ռm8pˉEhWL%6_"gTx~ }~$`bw d0XEѵ JJN:rU~!qh.X 02NڋTwV^s?AdŃ]tte3Xdn, -vWͮ-O@T'#]xz5d8snTS]n|/@ELvFpUTpN׃P/-V?ҥsHx T141 2.lO9`V'dxo~0FpL$w) tM1E["]H|@ 4/&}1$&C`pnhqm_ x$M,n^ҭ~vV_(4PE;[??lCacqͨs :i[vH^ Fain?M*=s -1\~~]X$((]K8x4Xk/b{Gb.[sXJ5iO73B -$*Cc?gd'?H3+z5&({ws~Ќ>_d{p!kKDh3ʫ$elZ@YN#g -R.=a[mDi۴ ە%%9zO -cfyζ};0_ guf؛9:{k&(%tٲ9#D½o;9%SoFʁ6Itw99Pcp 9 <~̛znS0gԹ(J]*Κ;~Y{F3&'~˰:@x Cժ}ciFqB{edZl5X@ĉŠ^QU!W~a⣧0♹CTe6k?8>jnɷ+VW@!ʮq^Bx22 TwDgR2s\čk/M\'ax+ I_0 V=0v'#̣t UIBrޥ!?gFcmvn -TIE~% BKs5?U(xT핸ŝPY@]Oܞ'!LD̵yFz:Ip_맞c'H]هZ^Y’ \=@r޽||Eu.DBuȕ̾V^F*h+6B u;BkOm{pN/i$nzs#Zc@LO!塡ˢ*yeqn؝axFlX&{k5Ɯ;{U2ȉ!Opꖇ"岜{\ @ -x!$P cv c]k -&0Rhf3m&pe_Yk؅>icr^#Z.8rG5fB긋\1ܯs nz$;}Ado4JG$ ?Q<!V;-]娫GXȁ!,q*LNj -0}Hj( -,7*xbH'+BgX -jDvc@^xGOg;PVLW&22wѰqsb/`tzHL>Ѷgٌ+ém,D `\/i%NE+0[3 N<%rh;ѽ9_t~'GN&Tn*E`%St;% )HJX Feo__lH3zAfc|N[5 2n]ֳG5t)gȒE]G6tyr92^O#.ܴPtt  -l@ԜAh' mHl@}ٰd_$}o k+{a ?jm`}\7Zo?5lr ']$LgLسGĠ`Z'rP9݇|o z<}6Ɇ; -$3'):ぜ8ydiyE|U{kGt)L=.)J, 2 Kx=kڕhh/MI -uh궻o;ՖՍqw_CIr2h^tB1Þ3K2/D瘌Y+zꭟdyA}=H=x $ê p17<F7KJ)Zd+$Ψy}<,!X. ->[E H=HmSc{%$z>rSRt yŀ|-^|NEZ'RO\6 @:arϐ_잿{~R7Q˗"7Ӵv(бBLz.k8H R+/dh%(Zm82P-`0ԫaLcw9&wu޸2Y}u Fk\e=2s9@\w1 ), SfT39VuzFZ˪碚1`eU)j 6匍J:U&G&AG6o>Dd -a>UpQtjY1ɢVkKd{́BqUW-K . pɝ/ m&fY A&=1QٽxQxFstd:GzIIHL(ɟ2J6;KKa0;rjH*R$~pDcc7BmQtGBݱ8dZۉsf|e( -DvR䅬r -Soz՜/:h2~cX*.ÒQًM&@ !e'y@!Q@ć#ð@v(x'"\hQX47'"U'F,Yg2քw=*7<9kg:º~avyF3=c'0hK?]bV郐crMڵyQa8* 0jW5>џ0޽{ gC1M]tP5Wur"}"Xwd5 -DeBNذzCq{@ h<^;Y>~> + 5_IDH'Gz-073҉@~NG)>K *=P -H%H"m{4;K/@aocz  up{Aׂ =rf୻ɼu E%*:~THF4;VpӦ(u/m|e,Ū*Bcc o*zƱ6B[lbϔW+=lΣ9+[<&vV^i֪Ry0X脠$ x^~&r2@mP_C41|>H{oKALm|2 5+"cM-4NAn~hMWQ̄}q/eYꞪUW]!_/V'zt|+0=UZ fthM9WKtAR]^O5lOۉ7cPOk./R|XGVص`́%È~Cs?,H܌VznHXΙVk.Y0ZAN(4' Ko}T> <3I7ݘEߙԢGٽj/f8ŁEa|"oe!#>Kq:k3?l$?u}ގW46R()EbFN*L~VTR^!@OfL3JE"WAhu3 sxWʎ"Gz$]H{boD8xG֬^^ʦW~*ׁ8 -v,<}}ͮEb٘0tYU=Mg|)ЫIYEz'pb+]۟91&e}Z'bifyq9SY75۩վ }&bL7r.m[?|OnqZL:ϽcFgnվb?st,{2g -+5<(+ Y5&7X:f -s1uT.Ά52 ,0J5k!Ⱥ.gUjXk#qMҦfp4 -HI|lKٔ`I.TcBC^.&RfQ7u9Dcpp:1$:F21gVj{-7WBpy8}UTE". X-c5#eAIצh9aC W cu'n+#MEM0c9yf֋ -&F3 /9:w?nFذ3fo1eN -1ϮsQS$B[woSW(]♳gܓ᤯~<MC[mNPW*`ۡ="zniA BC'`qd+M*ٝwvN<_G}!i R3^7y~6RE(?9֑}3ؼlOxx3Ԝ+ cYqɸLF&{ Zs?Xdiu{G^bnH9Q Cx44^/jZSUR@rsn~2L?b/jY 0e -_WSm:||Hv(uJ ۱a !օ޻ -;ru4s彎q Xs)+H&󛗥MHP["9XkXv>d R<{{H%bEuc=)E Z9wy}f6`"НJ -ǬޱjT1x'O3gފԳރ`| JF}DL}wcfv4ؿh4} pR,!/X+U)êbLVٔef:`ѧމLiHgx&l\X SzVEaf=emEAdH{~j\;6zvߠ;+ΞwsƗ' .*/Xg5WXa֧e'lz_/k(.//_u$$Yb,G<β tj/UM1?uދp^;6dBF?_ rZޢz!U]H%(10QI]i9`މ{Bc. B$6@.1:P= -xa>ԘC߸P\qqOG"ǟ޻-0:ecXj|WKh#Y'Sdzcee4(h{;TQq%<8#ﲴ/ -4eR-*R?ߛȎniFoz?L֎B3@\\TM} F mD OA3*Ŋ!wq`B`˼bM^,gw2M/.%WTa_AԾ>yaya'w Dk_Ղ -mv'l*=* YĆCr3⇿9kgDxH\V8<#dt\+_u\(!u <$•};e214[Vw%w\raHD`X -db/6r*DD%_T - }d8' !cʡbÜDxL6fmHl%Ƶؿsl$]$يQH0q5@b`KJKOtΑiеɩFA]@CNLPg` - ,KzU mk+HxbjfmTo' ->arn=*(0K\d_-GYMMoK˼&_/y;ՠM)M U| -PH#[ -X[QmʢzĶW ۺ~`:ndgg+5( xiY+1~א~-:tig #{ªMW ]];)JSǎi1 ЁdG2\2smi{J܂ȫ%DK`5T o$~3t3c1|;U md$7y͂öj9!7?O-)üyuw,@/ErSI'P)@9Rzr0r=Ubp 5ҧUm|Ր *A0T6Fh{X kF1Xg_,Ӑ>;6Rlǘ:p Eʎsĸ6FEC/,6J֕0)Zhps=LQ[;b'e_cЩ_Q/y Qτżibڒu#72`qAv/׿Tj[Am"37SclS)eXJVTkRߤ.+ -^gT v'1Qda0XL"Ӹ+$a棛2?eJ|z}#GQ]\_\rfAGH?qzPA$'.zͤf`k!AgpIP̑h'&&mb8 is:DaVkD9o0. |bk7 3uj{Զ|1gO&u&,A"_;J[c4+Yɮmwf k1 iڅ0{zG-#\MX簨{c[Th\[DSjPU]PA>#8ΰlo$˅[Dqo<{0Kbw%qrfqQT3֑ -Ɓ3Pl]_&O&_yƕ GBi|# + z=p+APAEZf,WL(ƙ}/ȓOomrr }'$^V7Ny -uIQSsϐVvbo)1*7 JƬȂBFY(F +6ܚxz)rҠmi?0AEUs\ϥ'_xhM(3 v$ڨQꘝLlqʋ8'S5``JR@C[̊~ÓgC@igaÜޞ1U4[a8/I?Z3geJ -:J:$ B}BXR -K -2< d7<}16CmJA#?L.m Ĝʣ۾ΆBș['pOI/BT\O-+/Oþ K(_do/N#+zFɕ3ˁ@}w'35X idWZB{>9蜌4J2::ULOaQTE:/&j#+Fid>;{i'Q 䂜`r]|^ĩ@IDAT:>:;W}AZQɶYu)M<͓V#KV$w2 E! L E '18B[JPst|y~՜gԤm=l% ~7}ω;}͠SG91Q [xb[ [0ϧ?ZZMi>AP7&QqT+Mo/f! xUȽHg}Qڳ7RuAN;}|7qͬb#]}? .km 3a8N-˦5k -->ub(ëc9Щ쟓uWNv TrOw(%l#zCخ4 Y E Q@ -4 &0OIbI t+йRVḄcثbK! @.|R) Ɋfp{镸x"x;?oQ:goМ)#MtiF\}$?.]WÙSCbSOfj=f#ִ/X lGyfO8C'A4 Q 2k)$6.m{&=9 pPѹM8U\ o65t^'{;,1[{!4`9zƥ@ Q5~1EQ6uKJ&e1Ha(n euP?@o\a},cax:Ax7id[Z% ݍKʔ1@}N7H7ks ͘P| -XfnZǫCgGb镀7}x6j'j {S3HB&lݎny$5?nַ:h?]{ACeHPe J_ǒhAL~ol #Id;xN47%JAf-b™taxDAO I$T`*fN4!;pw1HkNBGSt݄I2wuVgg"%y<€4/^ %[0o'Ц/RPFE+&E! -b ߅_AH(&sŃ|S<+T59֕xR҇._2m\d~s!2/B"Uh.&L\ V, OֺQ|''ԓ:cY>}M^[㹫yh^"F݂yYDx)BNrE<BhgdbxTK.T.g9|P4\`TNnvL,+@>;JEvM+" b?X'EtîbL -:&!v»ݡK5?S x#/mGIp@}vܹRmGn<*!kd$CURO[nc\nL &|Pun=/=sn_gÈ%K}5T>:;5gs)kJ8݇x-4KK`"׿dIװ`ቆ)ԋkރ2 0wQMf&~V4-K,@ k؉暚h9֚&ࠝ|G<'xƉnd?8Z|wyWWϭխf0A/2}ES5P\o0hGa5%?Z o0 mB5#&"o8V mi?ډ`3ڐd|#sӶ(+/Ys&_Bx!*.v{AKmۈ!^D|J_+?raUQ/==VJ>)};IhMq\@@~83H D0^CFShgIwrYokEQ!!WZ6u54kL6B'TnzV:[DVZDŽo9H\E`bĦ?GmߕG av iT -N/3'Yq>J HI&oC} 9h?m*&#(Jo$UK?Y7~c^{vk0: %tzKO<7:;k0Y!m!|P?ڢodTIH ]).vEt<ȟ.nh;dEA;>lۮhDxߠAˢwun}EKV霒g|TCޣ 3Y%0?dʦ+V9A295K#@ Xr-9ŲpdQ<|EzAID rm/BWw kG?͒&V#?6N1=P|')셷O-K1R]"@ .igӨjٟ{'g-L -<&T$|x]b.F e 21Uci@(rԛW2z1+|Zt*uWؘ+tqu,%*%f{hfZǀg3sn&I/V nP\0֯Z~=o4 iUh9K <Ǩ9$TXͬǽdwe7t12dw( .Q700~#ܭ1ΰ˵%ǯL[׀wG0jAތq"'drHۑIk~!4DP2po3!*_1#b6u=fMF߃'<~ (ؠEj\ƒB3]|1T7~r܈eY9Jj~ƶ7O -͙G{wRi9P&c1~@vERziiV6y;8JS;@Gҵ¢4~~ %HUX.D2+N܆; ЁpɠLxC/?5PhA$5Is֗T˥ETw5%৺TpvRIO~Șl ,>#x4Ts+ +UΟHhQYwx$ØƄ`#Ʃx7bq -ӝRkwVBj7=eao88>ȍ0׵Qv:TCT*Gmz*'mz+Hozxg  ѠbPYOaTׅ--}˚@p^pwk<^]&Խ=yẖ C9T%J]]]z>λS6o6 ]п[Ho_TG%Ȭ - [J*KAش%>+|lzC#L3rN]mx`(!jЬz@ IkN25/(jYVѼ_zK=d]%wKgPA-aD UbU{XD0:JR'zc _/YJ ƁVڧeg&0tX <%E<փֵ8k8](Z"{gfضn]#J0v! $*a -Z%4i#z%2b҄W[Qq1Tb'8]Zҥ-8G>Ms//:q -͜BзoINtɒЉp)%=OuS،Q +(n&D -t $e(I]H -9Z6:Nae}(MҌS,\jȾc/{K#DqLM!dlPXCvܴ6C$}&5ل)֗,GZZ+lBYU_2F8@/;6:]犌8kG:Ձ|;q9+,1L$|13aȇ:e -LjjBԙcf&R6tzTѶ@]A@?+whZ(v4NiPs =p2Yl@|Nڴ߇',͡2zo9EX}O B"*Gk -( -0͘lohj2ZvB6k;Ũlg|r ؁ /٪Lܫ@ Qv%,$vn_5TVP.7\ڙthgXnG9d׭s 9x H 9 Gr; -DTMg'mPAVҋu6zψ[nҟKwRx HY !] ,Ӿ -c>:,~1VBBTRHhm+hs(2YNIlg^ eʼ2riS˛f| ^.Ͱ/q34)fI(X}!^]zcNxb!QG'XZb^\T|44V=`7$;t54%  81J!Ivpzy/ kAPC/p;>b?pZ<'nUʂl>r-n./}kRQ6,#qٯZr[~n -҂m+r{\@2G9LDY! BGRO'N .d.N[_ վǹaIt!KgžO;fexߪ4cakgxx@03`&ӟCIK(òsXw#yiSC8EFpUE#<)Gp34et -˱ݮ!e*cYha/[*0_-`\U=[Pp==~Bg0Bu|8Sfyo3@'Bhb o3<"L)t>CՔ!N /9_LBs{GK*ɱ>1uN{e` 9[yp)۶^6M,RI)ęDp%j!-Je|P$tH ׿wʀ]Ŋ 蜏|:='YHPZf 0/!/W~#Nٝ/-c9d g?t Pz&. yGz8V[[l%t@cX|b=K#I}K)SFDmPVՁ&+@DBh_m-l̇Ⱦ]8D(He`sYt+^B'^dKPKE!A&xDžV+r.[} H]3-4yYB=xq'`ɱ(Cvxɳ/]8ZSeHJæp/63uscY=!xW$.vzFcKh2oW *tFxܓ P<ܙщeЕ>-WAQx2Tڙwk"c{Y+ZITW;G=>rD2Ş}󗾴.1]$hZ%ýmΝ݉Yn)Ѽ'=X ㇀XEǹ5k\F6_LJ@J pt"m*Ҭ$Q-`ڽwWMMM~2 WϺ+ՄX*ys늋QwPbDU_R;az<:+ e [/{ӟN@h9.6 /Ĵ-e:pA AAV yYuV4~>8HwUB^ڨxJ_j^MUgp ɯ,g5#V| Ag#Urڋ&n2I9M0by -bdc! :YKcc([ao%4@b)3￿5WȕX0K`B`r||QL/+o+dl_ևG:s -|ul:~@?ލ FBy{QigVZ.ْ%wi&@$BBB -I%w!G: %jLrjWwm9]$b;W2H;1hUsZ_&[g0.lnl4B>l^6j)gU R^φC#Ea%(}cǂ4}oh'=QJJP 1g>*ٯT -f (ry_$RᲳã>c<-ZZ.QֶnQo )-L_1~BazLgă!'QRQTŕ^[t‘C-SLc2J<ģ5K(AׇPPgI ѽvI( ðjzn󪪀4lZ!Zg,0 -̨pw,: '8&_Gr\sg*l >EUѷ'bkݥȓ]TjXkU q J?;bsr#Nk^Ѕ@`<O"{fz7tpCaS$Q M;b\,5 oͣ'& m~>Oʋ+b]\$a<*X"k)Yps"|aPamlt>$nA)ɖqNjTP Lp K.JL8Fє+@ߑHrr(~|5l1]ˌ!GG\ -PN{Ԕ<FٕHs54ǫldBm,a`BP⭟tW&6c[D -$]#vQՌX%!\7t"#ȏFY^ȁA)dAM@cM950LZ=1Br3 uE߁f*??2V/Z% * $c}a72z[i1dp&o"oD#6ʝu`=y㍎c.&2 $*lTϝ*=ݸȏmA%5D0LZV_,դ6+IGZ$VCќ)0u88I@YJLP\h^GX:Qy -5!pⷁd'E ! ʉOD}E]"wrvGL*% ba@;͕r0C*_*Àqʪ0!dBAdgsH$R2gТjiхCp'tU&`lD'< 뻂/0+Lz&\Kc<"5c;o΃! أ7\JuE;hRE_BbNq_Y޼dO4;v ZV_Ntݎ= 18bVq6FĀ x)v9e-x5Kݧ,>M ɑi~h,Uޓ,xg#/FF58V m v'~M()8mܡḲ:T>`3/f"<مS{+WI$^׌LZS~ksTi) =5"!z'8倞 6Ȏ2m*4*a? KZ&Z ISy8]N7I&G1@b gK1#A n -t#$!PQ¼ %Wߡ?I|إ'm*;%S( Ks>18 '⁨!Jj`,Lx+eC(!R0j,=3|6@'ɼ"{wkU V(^~~׾AR99}3['[{6Q{.wu#g5\ގq%"ϯC9Ҫ~Gd `j*>~&74OULIɆOX:bL>$lZZvKzVUUo0_lV>0PpϞы/8E1ҙE烈< L-]TXVZ*⡐ uuᚘIgOS ps%3܇*3znZZ!M1*>ɤ+yoZr}-`'?7 Aނ*rmrI.k#Ӻ(5E=c@a!Q1f 16d/kG^3%T!\Ydxg^T5s5J M(_dTOvOBY0έ HD0nɤX' t;#|qGI SHYCX70 -ڀWJJXF'#rXѼѪ+8/J\Xz8Рl0H>G }vQ.%%pMbsjaAaNc";D'ف%~88bQ}2ͽc\*=}a/LNEcQ^pBjhg x__;-yXm m`Ir Bx}A$Q/ڷ-GXn֢}C:UD(hvmT sTEGS9=n.c umn=>2b la`7I34ªZx,TaF;O K?uK,27r%(n9`9Hl<2wn: d\`]^x GYpg&'Lx넕Ũ]☠~?y+x -k>xl}},O邴Q 15! D`n&p;4b2lpE}lg54`HnFbJhŐ==ɰ^FiO7\/&b .#os >aBXT݉~A|w=ӾR\,@7ikM)IaÑ>0r!?dd;,D1F%`ô1P?S V2G_ *VNO|6&]Ȝã{F3 S>2)L`5FZ<sz򊖘BPIu텆n=lCF*gg -QU7>77 -M-]BW"[JM+F "To:xvQ7>M nXqp944χ ~c_c(,Ro7?{X HhϻxYBr/VeR}]` vqZ*|`LfK0|#F&+F(߹J9x+;(ʇ %dߍ_pi[t<.bgy[NXKgp0H*TaŰ~ -:(с?޲n]#$ ntǙ;Nx7V3nԁbB%.hL[{|I-iDž>gI bsx`>vy6@"GB UN_SX2r'?N«i0P 4Gz7X FW{}LuƠjn{)Y;>\4gN -A:$'$%mm?F -B$%|Ŧ<xZ ڼ4_ w$7K^i6>zpD cqZg#h=2{ 69|iv>ԘMdsTMٝ|BsГc -d?U+¢Cu xCs$[j19H"k)~\#z@u3V2d$ kN+zHh֍/GWBA=}vwcuӊމ(03x\E0o$BW6orQQ ܨ,J]M1pË%X|uopM5?e*pf'L}x9a(B,™Գ/Ru?hEkf<'ˌB7 -pP.TY6]?Xv\ITGZ͖;./u(@k"O> b ָcv*>w^dTU| A7y67xo(r*nTѶc'7?RMϭ}.čBL*mL۞|S{_dh&XȽtY -ZlO2#wxq1L -5M38ag0gyƧwFQYu`f -9$v>V Y*RVxERJNPv#ҁV1ݾa8TR8w5n&]Eu&PD ԛSZ4[ ܔ 3۴A EuCYRڼ|ߺ\w *5N&n#lW_uƔG_׾N=WoLRH 3 or&U; ;b.xj`8?|m+g:̬D5TT V3gQvVjKÄ#'ϛY" CBY4H Qy2v<*JF9i@y(c3ǿ\E V8&+apYg 9.~鲲H_ϸIL/O.'c[aTuy~T͑g2}L |q[wk, "δL.g?v,O%9j@R^HSeAU\w~&67N%^~𨙯򱉡L{ڝXB(]b0An/6:|`ák#IDgtF+YԐF%={g%cqم^IVPG-*49Q j^&Z8!?)$zCWE%S"7}ӗ1iz-=b|ceN}`lH׏_ ]=0&}>if.g -LKm#$qvd3a;$-w C=+Ҫh,q$'}@?z0h3Qhd͏ap^),B{ -'xyx| 59.<%IBa@, Eon56ߍϜZŵ!Y gS)2+Z/χ7()o; Xwgq4" "}22 sq pKuM]]^Bgy>r%fX_^QېCG$ѫ+w%<` <m=7.4ecN;|>:J |e 92evLқ߸=99` +:uNQ8P+d\ @hX) -ST6Gg +jE(Ul`i`<3`]`c'iBӃ6add2AII?圥'|D&`p;Uv,@IDAT0 $n[ V38e\aS敨SPD~Ry}hhϙuՌe*3Ծ7cO&A!P"4%WIXSKJ]@/I01! 3 -LJdzTu%TCFOXv/g_h~dS R%!cP&9pJJnۥGSU j)Ԅ[/`X*.ڜK؝v`FAi@⸓WP[v@EX=UXVE>AyE@$9F!':wwAYPn. hZ무r?׾Յ2Ӈ,Fbc>$1ud(dt{$5%9{ 6orUӉ].GTa:H6n QE]DA @U9aUµ4N8\NMӂbTzSM'Sj>/<@I}Zh=.aIB 4gp\::^LZdzA QպQX{Z _荛9}6`:ȆSbg0  /7 `6XN ܔ:8F@O$ѧD^BHvz=\dciCLCtܙyrOk9D;ܩ`l6-UUD1LyM|儗`Mo - |Iw"sS1Fn&3q/K؁8:;&ߌjI?@PX0հZyo,9(z' +++@CbPϾ 0J`YUs񖦱"i3SoV|7^4qŬ -?QĜ$2q@ʎgrTΒti}qJ_]Y,fbg/P֔u*,nDX-=luX"w6^~/*Q.FYrpԪ aKeGd$Ԍ,}RYc[Yf@H:klD58~sv3<7/&d ]\QߓJJtpy|مX(ZkMbζ~Ѕ]v uv=SUIf3 (`p;C[c -hjZμ_^&6Ն[!iY i?^4 ϲ0eg8U EJӑg|->ؑϨEp0C BuT%5Ȍ{AnOebC=لW_YV -Y_z==zVhdGJt%xBrJQ;d_y.9kE%W^*K30dRdZMs TeK379ARpf䴢-* O>~B_PTZq@Q N~|"{jժro>Zӟ{dޭJEYE!mK:YnpT' y/Lo d!SI3 W*Az`} Xj${6*qP5 ZpݞƅC8@83ubF0eXc1e;so--џ<I+llW]iŠ:U0Ev?'egUVsGGLc@39 B NCHۢ}+/)gߓѩD>;(r4UWSЭ&^K`%_k:_H4o50?z\o_Rj<~ͷ*yq-h@)P'{%(P [ .* _UH㋟ZQԢ7}=bY  #”| -/H^c-kX4,aIF2z4=2Z|.= q p_Ԍ,a2r@1),1/8›.P# /hXd2幒Ch#(5k t_|T^yQ7YͶ7PQ߯#0Z¡aé?{\=Zy W:ߖprNIZeb3Q2ϜK ^並ioWe4jƓųա%A;C? u3-SF$DF!B$,Y>t? |F~wͬVI5}KkGT3Y9s4^#;.]Zf{jO0vDb?Q TZgbO@i1rz# -Vi#sC+vS^[z+f,-:$A9()x6N7n B?N]'kZ}O'$ -R ϡNl b!C)ҫ2㮓|@K(Od&IOFFWƘAl?9?Fw7ᩌY:@Mx.x=i5> MTLR&Gv4$k?|\U-T7?VC I6 ? =D zZD8>t{N>׃X#A:aq@ڬԧ좾O*NPº:۠4j˒SS@ ujÀ<]Xe%qq'aSۋ#+0eoy |!{XJH,F\Ǻ',|(;n2g6ܺѲHi4!, X…E*ey榄I,-,H~OLFNӠ ~2m Ivw\i}EdA6),^Xb+qf#%Bh"zBə3"?ԗ/c" -F*1yk&p`g^:fn\h@G nR5 -oC -ɐo}==QCx0p x!^w<\ZɔQm~8,d͸ leT)s;zj 1/t5\c䠴I}qo:zł7֐5 ^oķNhưsl֭|/fRڛ -x+pf`o;ޜ~ -!QހυJb z=Pn(I&"y dj@>qWpG_a~|ޟ ? C. 8>]b[z5I`v$[O[t6A`p9*}Ql_oxCYm<FJ'>3-ᆞю[T| -,~} H?g'CPO}v7¬׳K[_U藬a}9 - sl뛳9zt('QYl@`EۍDji^K|ij7 c>ePUׁERBhݔ̧:2QtN?ȡ -Z'S'(a;d~*ym]{Z[V CN@lk?@Qw:s%֮c`<,RF!Gq1`dupzݟ?l瑽J/3',f{!vRr"-&WRgPnTQEX}Kˋ5u zAV R.V}ou Rv!-g -[QuNCA*79,d;1Ti0{:c\YZ2?Ño%}Xpu61=rem`5,?qKKzQ.N_,RXlX0f77\Om;{g@(i^^,mYQΛ]GUsMݯz IT EX,j75G4 qaI"v'3 u[ȳ cXM9EW0sXunY~Gn/ZK%K~(oឞ55=)rySqx&r1/.;JEaV߳[:n)/w[,iu̶4Yñ,(Jn~ `?.a-W1cI"DMFTM=nl<߉L ZQT -nk}(:MaR$MA_1R Uo -On#&):Mo};h6iܧ@ႉ3b*|lϠ>K+I@.HĦSr)sZ)MrM23o\|R LStlkխ/?9l9(#72mbREKυnmӞŷY '_31a-A}r9P8P2XU77Nz(p{ۗ-kPtuV"DŽ z;]{y~޸dx(ߕh~פ")g o_rF^{[LE[`P4)T]Y0wrza3rJTp__ϱY:/&doѓLQ{*Y$ھp=3@р!k'Tm+sof  ڣ}E3TZ?:03םI q_#A`Oʨً|R\͋-iQp~Q ޓH)Y8`sCjzw6}%F] dz9A|)mf"OX40,ρ@zbiEQv6K,}4yVcJ[ fpI[6 u!xԫ(2s!s \xf`T GI`;9TA>Ǥc&KfTHq٠wa>O;z=KrNqK%Xn<)Dpܱ/6 R{>ǷQ6H;K1J R-H1$ ''K^h -iO t A_n01(cI#mp!u o -1̌}}}b`eݟ8O)5[÷X^liJ9E9ekd hGF*yќwa ucCIgc"Locub"Mٌx㽈o̽rɚ 7!f}8Ɂ@1|/@5}9was -~4N!Qp._N^ 89nFGfzDFA.BLp%/|>osW>X伻6m͠ʟ}(=4@iQU \MeÇ;/m R& - lPQMgZyO(-Z*c]Y% =ٴXi/t90#'ngOY~Y -бd,ݺS eAe]LUToـKߠ𓚬|W%;FB2gXgCadFr.r?7vuŧ{3 \ux BZøCκJeRg,#`AI;m$(d@~e`t>Id^^cS.EӠ; w$x~#Hf?ϬO"#3թ 'p pO(Xڔi$1>A`9\IʨFdNziеNx}_r -yT3&Ou:r7@1vRI) VjygSvv"\j !J"ocF5a&A3׿8(SʽDGRK`'.EvbAz - -ip -l[6KzWgP`:nb26#MU# =7VϽ !;CԽT╘)X6'QiuHFsC(Dh"nNmQr!$2 3('m5r鎏C;0E\y}aaJ'ϑM2.C)Cb|dwv Vypb0[B O)SDGi^nSZn1ab??=uw]WyrYׅSK>]8Ө4}n>ot'ҿϛY^5>/ c,\xt徉";p+UXt 07'Lz,V,)q=Y(YeAYUU)`~CeFH3AbD%. 8xafH2 `'[#^{s߅IRP^:k늻NLDIs)hޞ]<5l]=bJg#zTz(8bHPPJ Bd/6~SτwzˈEO>wAvdomx w#1u3,+ LL,342p.uݍjWcQ#K"Siʼ`z5=Xo|ǹUZ_3{~+(\ -5Z5sk*y @@٭TwZh4 C!Xʯ{⬏Y*wQ-y'\tD㜊% -e6h2c]"/}Ay -ʍ)M+ Io/;ﲳF~lEn}"VWNF7brD9 * 3=홷C̕i[7Iה.ʇHnJJ!IR Bt@lvI՘cؼ둇zTP%tE>8ݖ;oX|QaQ<: .]5C?SNή)dR*sԒlbѝ [M I%Ι~}_cӍI,(3cC}lD5jg[[.J"Zc=;8`į&ܶ=Tl.b,4oKfS\vW:@>sp7*Ϣ><"M@E Ce/u'FgBCf6Mz{nă5-9dw䬒*h}}ݙh':SM'R}viU#L&7Y ͚l(0ӽ,cef&A[^s -[w⾲lc/FE; /7\ZE^O+ym}{#@9~9ae@hiv4} < lf,(XEA B{1xn[?R;"HOp:#X /:ïfF(wo n2}gn@Ά,#d9M`?shl̠k$#M610=6d%{"ݳXK"J.M*0^#bNk-z RDKG;X N/ |[[P%:N|υ*69g7*o齆b۹avx[Yހ'v`׆{YZaq~Y.?bM} RPjop͕ىOX[c v_ )}=rbIZ/z/448M ,H:kӎH乲n GEn Ќ6CIK ԉaOCalEWiSkZ,=X)Ͷ_[o2JDqGٌVS _Z ߻}BM6 l嵍(y(  0 ȡ@@wՌD0FX3ڼV}8e8 xo?V.TILTRX5#Il.᪪(:_MQM}}}9g!|IvF:fsr;;L5sCѼ|]뮟1|+vY$mYfl!i׹>k& /GQ8;77s,:ЁA?ZXWЅx}5. (BzXnVرLd9;S&Ut{T=yHhumav$IoN[ }]#{ף"=[]8{ߜx8x~oËCAA8 نKU-X06tu]@$n0+uմ9\:V&CA!-ҡgalRot@+ųW?AgנBӴݮg̥; -4- ۳/ysKQUYxwveΚÈ u-c#J_F3ɵVq^ 1ߢTw6AJMI0gPp% | amQ-!}Sʗ .Z #f55uUjj14XaV>=]%ݜT*|`/kJ2# ѵEbyA913scS|_xâx12xMrTPCKqj8e'3'I/ۏB_,uS$̣\<ݯ8BS Pl̒$~R:~ID  Pef>wAAaʸFu瓬?$˼<+&e yh; ?:~MԏZ<_f$v6Ag黰Wzz4GCYNhoӬYQxZ!SypGdcvLDw@`OHlL!|!6 -T-nf6|*P}`_jCFd<@;rl+ 8sLHt@COE{tdӚ9M^E^"C}~$} >_p.Ԛ t`49O!GH%KvJ##2[:s}yJ盂>4ΌZΚu|:p -DaQ,U ZJ{&6]X[H'ּ2Qd D胢ϰl8PzμOjf5ge(cdMx/ wM' 8>O:YrN͢*ix?D -i yl /ëƧC4qP amF87TFڷ~`s#j]!a[vog!I',sx]'r~M M૪=3s@ EYb[֡ýzW`oZmlj( -a&@B|3O{uINk]σG? -pm1Md[~ ~XWRMኆP6V*X5+$n*$h*Y #roXT\:-c+-J_oN}h:)'>`U͍:TִָE͚к(U>t8лbM;s*}NC lLLP6<}b>bu{@,2RU$'j82`ǡfuްCBPЖ#$3}LۺO铏)ZaC:AEp&!^F9%k{׽|{~%SQ>vd dm/>`yP7o/˜OR(bN9)O򔞷/ꉸ/^bϙSko_s|_cĶjDXDu RioqC`zIW -Oa+zd?^@riz Pێzpj^iRXlʲkn -8v>}<%NTFVڦ[({a?:<~?4jwr %z͓F- -% }Ƈ3cʅ#CCVfY sO2tY:Gm)f4VN>=y,7aQ.ee*[P^x Y%wCZ4 ]' Nl=J+mBD=z6ubm3"H2qVqp?xR"%'X,1us%g+v({&[ҐL\tC5 !cwɲ̱`,QF՘GRV'uG6wJ P|IlNT4GךK [6R Iɶ l,<s$i4FmQBz㖒U@}tfqK&S, -k ,;\c@\GUr}FE;;sW%Vzۇ%9~gJc4Գ7PӐ9r<]& ^ -Uz7݄sKƪN xJ'f[V݌">SjJo($7HZ pH!T7*>KNqҽI~ Esizfa,,jGamcQQAgێmbU<ہ6a.-|pb/%R2ryͥ=BP75UZ)16JkBmLB=q$4.*pu. 2l0 u=Kl4;5k=b5^a3DNloG|~wojca2ha ,AHLxmlC{L:Zabf, sbY!zUbGyjiP:N#hwֿsbňb&L xq 8vj_VC;)d -YkO㈷; 9&zꜸO[9?!ͩ&>Fl箷WMD5;cЊOn"9 -2z.TW TIPdеUs/YP_C/3*>shiӇ]m=43m`VӁχ=]磰,}}V}x*H';c -*"sp@|b7\K7,.t׷x/1r0o f#obbnLs~/X $Tv1[EyyÙJ#,v£UQGӻ$4sV-|16޼D`3yF[fL\fR?3`^Wl<ns;TE RgAď[j- Mӵ"G.1"aJrbp!53dk8HeBρvp7 tYTՁ`7V#7-u) \SK12=EOATA | (\jX7 6SKI-B-0I'΁KJ3{ dѣ:儷e `Mq~hocϢxʗhH_2c0# @t#GHQ,ab9ė4z7m} !nJ䌢ca_9wYnNh* =-hcYS$g& Obx٪!o~fwNn -Pݾ ̺PյRq-@IDAT?ܙ$>.sێeoy D^ocp ,d+??>R}do#w辴c=]YroZUE,s+AJݰkz*bʙʨTJ^4Nc ~WϜ )'g7:}0ۄ(0{tǩ݁d}ԫ.-HT%<9-;4 ?F/E:7}kVq:ə~g=),^0ғ*3QfTU0dm4+LX|σ7"n}ڰ✕d]3A8 ,Af -ť֢߿:KM(c=rkŇoOn8IJ^s\lʣb}{XT] 84.+ ->lt{Oް<k75;#(0.a5W"%u{ZpW 's9z)u#7bxeE =m).&oh充G.yD,5T$>UVu A6R@PlL%b< ^%7#DQe b^BDeͱ#M]w?! #{7ku %+& f];uݺ|ȳ qwswIrs,j3$ 3&' cd\b^6Dv/L]!rþc\G#JFYtБ2eqj -J'rob:j3OE8| =4$":@9= %ؗu1I%REAVTaUsRLgh} ™EoJ3$x '~{v{^ʜ@nGB+y3N).#n :'H -\~"MZ~Km<Buy,80uiOϵϽ]WkUG^'1>'0ݑ-hOQ9b'ø]h:1*5! a0S<{/xS]Ț5kzq,4V%Oʱڔ .$Q.'3 BHMPE~.<{ `GwΙ鐓R=zń s O r[}QEGi*+ TIʺc,3'}vxXPfka'@{{#(dՁcZV6hYS ( ozЎh*piý7xM߁݉ܠ:2i`bĬDQ١~yCS{t55Q8g\%Ww/Vob-{Ӯ'3m%|24o4@m,Uk'Sj[f֑?c썛Jl662K4d`c0m)㌪2H׀=L.oS(UiD0 C%^֘va%,ginE1翫K҇V#Ȋ$ubLYm (0i~*jw4x= 2 _f~L6aʊƲҎޖ4*0t ^7dYo ʘ -ʜuFT<(ѥCGu<%کiD%ߎxKQcpxfyMCz#$н#ٴl+=)2@ jT\|Z+so' I Vr(Ca2]Rҩ~܄(IԫEEZ Fy>B IjшǔN?AoSr7&G,%:wR؞kb8z׆N魋˳Q|sj%?3"sVh/ΉXt؇:ckrcEQO:3?*[K&&UWEXa5f#I )UX_j&8 ]hSdз['>0?EnAaF$j)d ,i1~:T]g5n G[-􌢂9vT["s':C8&w7< XjOds%V'"sj X>rbAArW)O#T7Eǹ:PZKscێ!,o"K} .CSa܎H9uPLE6Q:\hxk0 F^,>Fldr*l}s\~=* 'W=oڻcE :|燦58$ڦŠа4ڑDZߵ{IDXi&2x;)ď6")GQI^iUSN'OӀ2hc8)8)Xu8vO=fz+5.##10]]"|{PoYvh>zZ7&'ދWS$TJ1r41Ϭb10= -cW вUP?n׹<0 Ə#z_ $V4!iDdIYU=`x-GІTER')ifLo{v_uJTO,KpSKI#8Wi -= Nang$BzpP,( *[zBـM|ybgrc]e9. - 3K k槓^^_i!o$hT ގXUɂGڃzooJ+-;<:V`J,bo{I̭ иFgƒc!ˣ1JgcAaJ&XcD'yg·;K0 I# -'8j u/pS祆Ι33`d]ta?9EM(puOZk0)Y -U[ Hvo$'lK<=dq,UZhQ $_`0I2=hOo7 eb:$_),'C%G݈CqQD`F8;n`hW&ω狸 hBKZq3F㋛ p />UW/'"-,/Suq-)-G7N.-O} ^|(MxdAN6ⷥqjfy~|#p|YKNI)]l'+0AXq<UYwڠ5j2Q`,'ǵdCwV6e?V.&HlkxT6FziSowΩ`E1%SA{WQU ?4ș -G!o:1 =m>e(D()m:߶:O<W{ϊ*@)kN]ٔ6J?llP9JOFnDHAlǴu+Q붊5nuD8ngֱCˆ(s_65YĂyΌCkGZ=8KW/[V+Rlm; G7ob<#L'Uw̠=* QZPRCT)4Jzj]#4B87?~aa=}iO<2Of4<4fpl3>&إHo -Y6ĐE0ed?ysj%qH o'B$$QT9K9F#o;;j'VF0\X]mn1os 00< 'm/Y"~BT5C H -7-344Yݚ|#x9ꜾTY11E -ʹ 0.0&$#h4g[PmFoxꏼ5y[رɞUydF^zK(N;_nRSR@s"Ln=)4iҊA/[##=$?FO-#KZ+u:P)+p-o1babfF7 ONxٗl$wˌ5JDACD$ Tu.!c4%!=t7^wJ}I3  %`pMTSX G9*ݔxDuRyi:dkPER] -Ri/џDv|F-P>_T *iΚ Zo9PRE{71l̊ -p|zo͑;߇ Z_zCtE2$(z(퓨y][xZ<TP!,LɄ?͎<_KJ-ԓmhL'#lˉG9%^xo!}yIJ8 -DO<ˑ_6[ b BVU=6S{p_fڒF| &Tiz* PvH՛sLܩ1Op&fڷ"Xaw}$Մ~rMbG0":@Ar:k-9O s >i/9 :INy#/ ky{X;VCnFkmV3܏Q !&c(e]b0Vyxo@aC^0,|{N/iH\N;%e㟍M;NȐjx;LcB!gLU!ɰtug9%bϱP1t W9ˠW:^PBTĈGG8°U197]{vS=;JǭY2+((7&{/vӃ$+f=*3D6E뀯8Ds29F\;e -U8wfʹT1UNRǿ.9!6> j#!jtQOO*S 1 3э]e-kˣ,x$>>gu'awv4dJ4VٗucRWPR ;c)>h)tP!^̹Hh&b3/5lpb)2*۞@6 Fϳ57n}XiIM?1 Mw$$[KBD؀OkGfyHRGoXƸ6u}4-<.ϙ3'(jD-LMlUWG{Hv1ߴuIbL.㓆<%H6M˯^:E9Q1} -fR 3Q-? n(kU}3U1Yf)CI@~>dAfu7 Ț->:0VXoMHhs AM(M>C5[d7k|9 -9f'c6n$NI}~4&=8E~dz-/2|[xSUCv%gKT*| q/X&l&f=6LC5r#a"C-F.*vORt @VS dB5?q+R= Œxk:fM*1SUK1t1xDėD}b ]P>I? ȐH/m_@%%W.< Bh% XdE=WQ?ukq2&`&.pB@;L?KgQMv'_w>ZXt^iu#.\}S3fRN$4{ڵEK]3LY chsD_g,i"r .Gs|y p.L:͕ES w2"y?WgR -X_/<ӮA&nxr ZF1MS8B{GBIw{SO"߂2'y}ƿI&Oc{oѰLد' -4K)=M4*/  -+"$&~ oZz7'c_=t..$IdcR\d1<+IL;At@'0J`ʢQ ]A@0>J<@H✟Y߭ÑCD΀T|%:&pIR~}|G.d+K-=V̹eUG:ʭXI`ҩ_|1u=%4ťL1! ᥡ w1T4rߠ~֯bqm՘84"C8k¤n=oN}v}kd/xbtS.h`̱Rs#=R~6AOpb#/w p]H9v?W؏oiOmp2zS,P ȱN'3Pn~7ȭPٝ@@ (%JKO1v=E'm96Q镒r,U9uN5K(]-ꤌHY~(eƼ#X2n }hd%V2& MZOQ֑|?3"Z#OKPY  -[ׅB &<=)j9~ -c|&R^Yzo ! ]P$iFYoJy͙lYׯ!NJ+Vԩ 1`\q@ڶi> -Ka3u=kjy%cc?o]xDUeEs󃌮^.t4֝B7p[*ĥ-KV#E.Gr}at6ϝ+&x?9w=s>Uī CCP8镒XQ`r#|:@Ķ ̵yڶ݉0m,{[Y9V@nqN7@\쪗k"zB4^clm5Yn#X?ޖ,dPD}/j.ƀ1o-l|Ly(bwCјpC46r#-&8!'Qx['ˇGv@^vP͚ ms ^` qHDU{viu)g8GIx- -+ Da"wc N J&l1^虧NQ2rƙM쿂2))o癡NM];*m6zXCME;|-on6tL\Lؔ!ӯy"GvT*JS]0.]ƯE93,rhIn4k8ח=K[fwE)f:\=|/?r!yaGNa=n30'xM0u;@,yBC4=R @8xߵQ ry(y<(*/ޟYpW`e,A0*U DzdszvU5`^Y߅Re@ nZI`8#*u5#bQِo]x[x1`K~ҡE|s_$%XŋF0yۺsa)BkA)I#F>3]`M@{A]z#4ޘꡀLzC !?+8;͡x61n'L#;?3K)ɧ,M]X()Vy_}wtb&הjΥBPzјbI`>VRo'|2W,EԦK1͵eʾP,B$Be mG\|N^_ 6ktZ'<'7jnyH+Z3=:߉R[6.p_H5#EwFKP5ST f};0gM@ooA;8 QO> -A˟ZwngS|>?8;TrN46_=2? >r텨凣l -BM"k xU4?rJ MB,TBc$Gv@fWKYP:!0pQ[̒tw/i#鯑cX47s -+j{l-}/70]6_&8YG (3G-ֹaIAseH\BN>*?2c*bmr}*vo}z33q^M I~=xg"2&uZyrXR8DiܫԮ̪'WI[q 4):طk ~ҞUyR2Qt:-տ?f &hz*6āaze*ovcY4h% z/(H&觑yEPgvPG {6'5;3]ִ[O hO`^r<VIs7&\+7iVS-ݘV?y(J*uR!2F,& S @=ѥ3}9B?}qpJBM+2y!_^?x~=> W}]\gt(cE}Gq꿙*fWU8}8c'"(1xʷ~vdB9z&+u;DQj":v5?IƑF6֢z -_#CF! !+ 3y' I(\g֘$hҶ1L'cfm6}lb{X+[_<AgpbA3e۟N_D"'Qq H/(NG6eJ}` .W%o.3LÝ;<z@M9&!EQ!mT5%O<qX}I15b2x' ǢJ/5^P]㲂a4>ͣ @HHq`. >EWFII#VCiD2[cn}z];EخP"@1v7 UI*iPXR@ Mb NkQUn)]1fF2o `PK8<0O,op -_8ߟ +V CXFhMжnũۘ$'2fo0YZa*2#~6VP%1;ci.~υ ?mT^Ul8GkW8ܻ{@$BXG*fs_N뷯_d*3\c-, -쑚,Isn8zCO.jb*e|vPQ] _yʋTnEE}3JF#v4 -%$%FU4.pz<8IJ,qZ QSsUyHdA\ejFIu<0T)56/~$}-+=YP01@r<̧7C -|Eu6ңGDu3Rto܍T60H AI\NSF Q*MS'}fúʋONR4h,ܮXfaÉyS\7ǑZd Νz7 իUSqi1@u4c7eʅ֊b즟ys&<~b?:‘B8CmĎoڷNIʏkԳp6ε -ix znw 5K{w2BW24Uqk5pbYhV{k*{ǗCĸI@ -zqhNC:јt/m3u#do:ϦU-yHQ5F#Y~vIX\ 6W?Gx-c\t?¯ǿ+ 7Awx,ܮ&evil~fۅiQ0p+6CAF3l,ʫv*v˥‰|Z"HxBҢJ.IX=(7q6wP>{)|&p bs4 2+-"8V"!eX=ųOvizU@ /@@ lm5CN|Q,nD vtc"^oͪQUxY~ͱhl֟-%"!T"-C-]hx`ewh +뗹Az:_~0!i7UgG[k׮D1&\ -EUËa@/P~ Ykl%cWt;tg -~iC}rzoރԔMk SzYAj f#"c7q_¡Lz[ 3>g}m\>%Ra(!}*)T@nY^- â$%>g~n޸#/W%LKgRTCJ12{~E&5bv"bXu{Pe'U?-՜q{i<Iu$|iMq~SToQ{[ -s77UퟛTַ.W?^\{:8,ǴFT~};cN(?$<_ClbQտ Q -hkyx7{Ewqa M@T3d o W<#='?Y_#]kQ}PAZ7# -ZfpmDqvAG^|Ԭ[5#~ `g3cCxZ^4f4L0YIR#"k[ 5jϙ -;™36rύNr8t%~{D}Z֕"1B%;ҋR#!A -ghw*+zoS9-6jm7g߉!ȏA"K`,奶c3!+A˶9 ]QF2tAV٧vwA iNV[HlRwc<4CnfZ -L?J/QKsF7Px^D0H$B"*XȎW^C{9/1+ZĆ4XLώRƱ(2 +j],.%(.k'& T<Ck|^?xoi#Y@x>3R0UD s*KgӂH@Hk4s7)kCe֬9y&sCmh&jv'/huCo_d%?`K`9H^ن  j}fO|'?p__b $"6F95h{WyB5k -?nxfa7}"A2$[}A;9-a1/E&x!ۛ!}ӎ+w~{=fUUȭfYmtrKrs`v@~u\25ozs7ւVA YnYM:!*tP MTq-iwm o3{6=#SOک׼ʮ8 dB( soj٬ѹ["gՕt]QQI>ހѵ.@20Y񛮄c9 j3~E4rEȟ,A.'W[Ul}+ՏąU񢽾еZ<.Ex< -%&˞3< Wܸж<.ۂb`\9Si܂AC}hف 8;orlIvL^P_Y?1psqF4$ G < aEC>뻇~}5q?vްQS#z?Lnn.&jyP4%6 $"+]{1iunD!`Pc×J~P+ŵ}M"kO1K%zڔOʹt=(37A*?үRr(J)ObL/f]yPe>>ֻ4:*2+%i0qpjH^:Np7JC'bX~o( -g|`4y3qT%w]{`_GhƊoTOuv9d9_̏(쫘Ƙ& UcթmՒ&p:ƞugg[s N(/Ϟ;#./!Z'~a[Dh)X -whi&v[gޓԒyv -^uQei;R5XJơ||E GWP: HͶ{.kyFg0XWlNF p9<һ@>Q &6~=s,xNo3M(5e[ `d޿Q mfbR,i^}8scZdƘ*+'2hC&iHO:Fy< gq=¿;Yv3:{%B*o ʯ>M( ϜU|Ytt_l/נI.4VSX/.,Č0bWn8KRyD~< H5 -;W-[zSKݾlU<[kHpx^b 6E --,'ܵ'1u?{ -ѯC@8ҨE!HBעjY]پ -z@;ۗ=_d6}hnbI IlLX=] -/JV - Qԓ_3ָ7ixk<1q} -N),4"  nw2 JOŎJ>w(ihRX);2=5K/GQutQz2IN玘H &qʺU&4L}uGYno Vbs_& ͦ}yT\!^gRI&%{nŽ]~G7BU&@^ ˘7*nQzǓ鍾} $p9oV-Jcvy("I[]1M%}w_B1yU4 FU.3еcb Ib+IKTAqqȳՌ|A@ \&1)H}@lNZUCj `9' -#ξoV:iqQ"~]yK623G{t@n)cցʾ8y({Na:4R.Zg@ 6dc4{fͷa:+0kp X[UbJv>&"@xy(C#!+ -{ 1;qZd2Gt[;U{;d)1>DQEؽ -Odr - 5`Z7[& rD{_zQ6uWIyT@Q꤈|b)9r=mug$)?!%]ӌU inVA2 &O@m#nS -j5EaHn͆7k(p:WyR&U#Ze6AQt#$_ﵽvɫQO#wuRhM?D7s'-p n<ڽPG){-ZH=6Fڦ0<&j9<5AO=[_FX5Z'.|iuؒj`g Ϣ- dFй)//; P6 IFn `RWzn@{99Q~@^tr4XzWׇw=_r$w hɊRFVϟ8r19sA׀8TޱvF0$ij48W,; -"=FղjMY2 42`УyԎ򥇦G3Px_H/A끨.#A*Dxy<}twWL$40`jA[z\^Sc$ -Tq05eJ^6 q}KXUbJkh|z'ګ߃a)7$2F21yO19h~2y!#w~&!Ɨbn jص.CWZ.4A ꦒZyĠHvpԖ~iT`%z.fS?gA9abB6ŵBޫPv6ܷb!!Eq#`]hф -1Ƅ>V czHR/GxibWftYc -y9&|kWdx7 uG" Q1;ZYܨJmx`] -c8E;"nXy;*"V#R ®^6Io&csSs]PQqzG,;fU)rb>Pdė0Paow "Z1ѠRzymp;AJeYj@ -ҷuSf"vuǍXXF( 8#zZkҧ/Pv9>#P ,`6KEp,f GFtc%QZKY/H%B45Sr2|Au *O@|?m.ˮKM3:l\fx9x/ь]4ΏYzWgdY6>]ĻS)鏯uhSٷ[Ί# )F 0u&y(3mBXl+8xf#-|<ԁby]HAzE'ÙظhQO> 8SǼ4tIJbIWwDA]ӞꤣqA!Đ1\g6E%Bk=ɶʝN|Ch$(.d?-mή:+<*Hݘpb>߳ K}B?j}`7s0ߜMP]1hV:T'u?"tq-g5,w/ixIibQenR8S1aLaԠ,ƇҥqXZ2moloEx `omPvaiW hW>0NP${~PcE.1<$_:TlD[K" ^}9 xQ`L&2UԙوryhofMWLh+<}.\ -w`VvsݼobR颼DUM- /1>BFneY#:5*݄(9Uv@+X| Eh޹yQET :&:DvX )&Х)jz_!a;AQ?'8DLN44ؓ$\ ڄZvWoZQ*OD h~Gd8.5 'mɿqI;FFCžn:IЁY.%#{+o~Č#]=,iWqx/Bvb xǴ6v:4@ -v& w79 gf4 Bk3֢.YϡրpNj?n*@fY :dm$g K1} 1{Bۯfi(> - xm]?׀)UiP>`!, FBK.YF-74[7WO5{Q9#NSŪsZRZj5>UfP1zqDi)|@Ќws1E!(>xHvE(H 3~9cX9ުä3n5RQHwekFHzL 7˰Kv!F9h]( dAHSAX~o㨢<̞KK 6ׄ -ۈ3UӔ}]ҬG!-r:BP@j*ka`PiOȾNԥ>cB1,5 ( " 9Xu&9e"[,}㸂JQ1KFi'Pj.od-k70퇼U}=Z)-w7^)??AR2Dd,{SQz6_=!y$w * fDbA*C -1YpMr,=pIӽ/v4d'+mz2ȱS7\Y//[lj8AxuKF"]0c{Df,ɲ -ţ!;s%,={6Y ugkZ?ox#EE AmvnoC]&e3$M=!U{ҞXm2gXgV˃.Ӗ,"rwo)OPŠ gF46l1~@4C} .QK#Ek`it} ߠ,)~!3z[@@Pv[?)O]21UwttW&y P}aDr*J_BHb 0n@͠g@2N:cbm9 %I10 g  K7뜿8'J9G!*tS:"֧Y֔f>c"W C\ҝO<`lkцmA k4|I31c<;6@:Co%R6uL-bz+x OOMugX?b!n J伐kL 0<-Ck|ee.;k<4!+ a -{ᵨ]%Hڻ'C'p2/ [4X3|RXG</LHwibW[0_iO\ỏQ7aS5lg})i]8z\ -n.0Nbi:Nnpgɬ:XԘ\vhe#=u;)1Z4FZ dC{DŒ`Ȃ^QPh`wN"L ?TpM1 -.YqE'XYUV"QҞx4Tosf[歏W .*2 g{wGw4Ey 7n)`8,̷1&׌m0%]l3Cx5ix~fFy0Ѽ[`\:ti(Ό*r8&X}  t-+yQ'x_8;^=r"BEE0"t,>\ݴ[o5Qr OCMO Nr-azW9ϛvI[ݡPnˠ| ]>t<ʽ'mStK*Fg hp>;oz#i-/I|?tPE+bc΂y~^e"]sFɺ#A&y/~H|_A~f !%,EUn?T$Q6 -Nb#1QR 'Cn8%Um|CD}1hH6{¯,lƣ3Y(%>-iY I[:(m}=HEj!Iešk*$ -lƆ}ʢtr?x@~TbFxZvW -)z%t5_4qC'g&g`:y#w ڊ@&Gaҡ7da 7&0rY $z1 ZQ'Bs-o_Ӭknn#YvjFmD/TǷ]Vxv}"Rٍd$^Ac_UP#<0 n=i5iw_RN ww7D-]vǸ~'2v*jdEal U]}O ǛVﯣ6BO&g]+2&wFc&> |AH*gw~׈(/Ҩt~H -<u΂ͦ}oTiZ3tId%duu -EG"iy:4bzўֆr]ȪTŔ9HGRKRk?@Hb`\#9ޯVz5\&H%hlD{)8o*LZ3DϾ>`L0p\&C4B9N5x)^#Wr U`+*7ˏԅL1j>Ic2]0j+ͱz>BHȖf[hZPy7#6"֎3ִˑ -`MyG`;Qr5wQ(+gfjڼn<ñ?Lg kIN- "i(@4Tե;`4Rk *wkrm#MP遣oprFG{T` 30$}+F籌L>G:!{}!qE7eDl1p&^)vBƌ{s֢hYIc}%Zwb;L**D=Zyt𢡄sѨOOnv J+ȡi9.I?)z0{C$,s%E<J= G"8qM@G(ׄu -)Ӟ Zc")'ާM͵}~1h WS},\`A[4L&gX9or@;%2 /g!̄w<^ݫދ\ O}řE3WI~Ohn%T='% RP+$2'ՍU_;c?{/ 6=Bg@]̂/yz3 -4stQ匍 -o ɏ[," - }:&|&I8)!.,)z)u3w!:4sذC)&=ޗf1%oO"4!ካ!߇|'N$=`z\3?<Uf - - Q(|ô<퐅xdB!TrX)p [ƃ u*o䙀J/zcwԅوz0.$}0'62n(p:{7GfW <Ԅ0C I@ -$LHIK-5LJָۛ,<d<P .?TQa 0iaZ!zcB5aɤ=] nBj`zr 16њ Aٷ*Gu@kUB"矰̑yo XL[#s F-!cC ^;QI&0혈3hJQ{88v$ nR`H)Yx*}k2+p=vwc?8 +Br ː@zZ>.vqYݝu᫽|W6U6a=v:$ʰcly txB8Obh913;BHg 4n }GTU0r6ȃWD0x؁/V% /G 3(Zrn@F<~: hVIfھ9ͬ5b Fi:Tmgʤ+);>|c'c8khKv[~湬"ߋ\?]-`;\O\ =.E>Y}Hl)%(''L2a^Mx3&RG.l{h(Cu`~3I9bnw𜣱~?ܶDIYZtN 6{7>a0*P -A')7{; q # L{-f_nmF|a}>4y!*Fؽ{؄޷j1^"h)Qx-Sc;]'KW$6 .'ƀ{"8 y0ݒM ~Cr#:rpv9NY*p*(*Hn^j5\0_~1/m]/bv7kFK7vhjN7 zPhSYe9q3E |haQ1?8iP >;j3 :E''jNiZc>oB1ghzgByv:r/Nq"q |*~=Js<' 'D7t ڠ+ GzS<ϰmxy 8nX 5jfK R[/"mDmvҏv%/4!A}\$ Y?l!آjY9nnWCް1H DK"R4$`QRh:l O]䭧_eJ Jݸq؝I?C -"[T 6QCG{P9xNq%#E1餸NQӯq_!EFW@qك# Z u~SPǂ4n$C1#nEcb4cEuX_Z)QdcҴ}QY6}MNC[?9&c"RH<<5c+iox`ƍA _,b%P+2 dX ',+?.MWd]&fwo~&'ƿ0T6R?fX,L 1{3­PȊ}$$1 ^쬬&eߟ(pt%fL22RseڙR䦦<Z `R\WE1I)EԀgF(" 5?';F9~T dv<%v#9xZGt;(}=(;F&~SO)ȼq10:XALWoFӸ~iBڱ1V@h+Aђ<8SvO]@<\G{Mĉq3(&BNr8ZBqJr\%iMq{g[%Ԇ/8P9:bSZRf XZ)4=/P|{%EP-&xȴ+UvYZg+M[3vˆzĪgOH 8v1|&yZUWo M/ቔOsϺ;v`@/Pٟ!=е[êݮ5ٶ$ z[Z/+(|-o/c{{%F~"nt:weJL,h!꽀e@)-n4pt7le4u."5 -a-t=CrOng!_A)0tAPT2 _=rKGyF+hl~Նerz%mg> c%7'g 5w67H& kk4򅮫_yM{'kFqzW196KR)ZCCL-خ aLIGi_8bŁH ]!N]ҿ!8AI)BjPHLO"JCou ځȭgEx_};z5HrpNs8h;r '7ZoUPH}_O>[4c *ۻif#|VhGw%@ _֙(n0 -vOv7;űp:X ̙I1håCK S.L7v!Z_%#9C]n>CsFUwkqz%Y=cb7;XWHD'˂*u@yE=wz",y!o=&O]BIFBXH7 :̯PhTRO̼ш<~gӉ X=3% s%k 6 u<"s{)f4:\qiL6ڻ*4ob&IckJOO7 (EїER3usƓrM&D?D=mrm$Ҹ)O)c6pfZcZ'B:;O?DH5blY??abM>^9a.k RlXVX -MrtD~w-SyH^bg,k63s TRn=I&?`j-Z5!A{ BZ8׶޵_( ?h68^ ^xZJ􍤺SN=2A3d,tE@:gbwmqkְL-YP<0⎇e;՘4sywFe7~?g2jSQ75p --QڊԦB m)'1:@|]l3z+ߓ![B)"!Co _.BBUP<(VSjjjRv[)XDvFk1V;Qp4!:!knѐ?%m|>$< WE3HT]lO19|!WcD<@Sm4vZoO4<`ӿT6B~ѪryŪ&[gx~op,JFe|Ҫ]R{dy -e 4nJ#sf]k?H;hEtC}"#KmBx<مi+ںv=EN9q>GZĽFIff`z\/هBʥƵ'&!9%wm!t;7e<Ӏ2#DjٛZ[С5j ɡ< c&GyZV園_o%R6!a {}NTS'>f0#n(?1rEL*L03Wc{<|?  dFK*NFoVu~Rm;efFbQ2 _p3nڋ1 I.na ā:Qg(MHuL(%+_`&,En^.DߦZr}Fhs(B8 r<}Ֆ -X؄TߺںAu^9J͵ڳQ3ƪ_~ќ'-b~pJ|^`5$~oy*F/:j.7˯FẂc{93 nș;(.(/IR̳Yq=rƌ~j0C -4?0),~`.Hʹ(W x4^hn^7!Yn#dw#:Y{^?`g'G m/M'#ܿmGw -67J{**=CT|]>19z ȆaXV cu6ɣȵkiy!pKOO)mRk^ÓCbYZϝ |d8T,ff ?K!S:6A۬__wHdO42}I}KQ8Ӱxe W{s{mۦzZ;1?UT>_yL{TH ? ~ޯ^"(&vFA&/ -k趓륅, *7yh߇%#C>}\(%I#}DS^Ήh5{;bo) -l*f1ԱN7 ^؉@yɰܬf4B$]Ct]YŅ)RhQxִ1G8#R+ YyW:L)B bDž$Tt]_d=߭EoaZ@@hna/G --N3ϰ -:UكL,JoyU=;ý 9=A1m1.v8]uoEޭpQ/"XdLTwk# %ۢ吜MdKG֠FtC]QB>FZgi,l/̴쌏;B)lڰ羐Fܹ~PnnZ%db -j,Aq},aXi<#6]h/q=VJ2U3DZh$[ FMr̀7 W/Q/x0ݾcڊ+Ϟޥcn?zLnFԙFRڵ^90G)hn&V\: g,W,ھ΢ڲncL~?zTUW'ٽSFk{#Y~֔wz=cdAUkj- h3&o:Qƅ;-X+H0 vU%W&汞iM 6&C㌠bF&ȫwN "4/gyxߑ=oZ>?Ϲtf! FƓUdmoMSDGa>"~!p'!Y! * LƯ7sLQj;~|S,xN8v7|pKc juȪs -o^yTȶ VSea7g9ĖF YwAuk?;[FzdKn 8@`ӟ"4V@(tׂ>Va0j|Xh*5^&4׽(Du 14(VIҙvJC TUpTD[EQ,c frb1o JD'¾^zIvի-ل٠t7==R;,!iݶA5]J,*G;d]I~BSZt,ul}^(9N$ \j*Ǻ 4 01 iQ 0"DlGgIoa fT"(|3͏~,ACϢ߆fY9HڣHd#:`!}h_WOgX텂qSO!Q&Ih4oA)#zxO"3bz\9,+@2'+(f>dmMMϞޚ-ܣƦ@{2,mӚpYGkX5h^XӚYCmoME|%0muKU#'D]!d珱*+/3a!đH"A oԁՇJ~+JN(utI+.^z&b ́kqN$҆SAOpq$A0vЩ+Ѵ}ӑJ|;݊[Q -W2a ؉'HmO( CHO^yŋ6[+outCGzH]Gvcf|״hb bok n&:LEfD?<?z2JDqL&ٵ!LS!VkJɑp ;qDF mmP κuYۺ'GjEd@|4`kSܼ x_}1.׹8JpZemM"heiF0MK*x RTmfKǷJ@5 -ߩTre怶I*Ww _ -1Ђy3Þ*Ia!А55):=d)^ԣ*XRUnНHu 7v}&N>^UEr>~"V1TH%iOY{5ʛ_llv!-9B[\ MB_39Q9&{]tz=1Ükn4ivk$fdICh4M*>J݁˲^`7@1a -0JQoZ;P0BNW#g""92gb~;tzO1m@TۈRߺ#,"1[ąȂhe\d˲vV63ǾR~C>gX2>~y$޵?Q̯ }FJ N }R",gNXn3`˹:_ь!Dƈ -O 4ۗRXA^*Ji0B VHL_ zuXW Ri`1bO…/!NEi4lhfzD.-({Ԯw@@T[ oDo/@ɂFҷt66GV]MWGC9kSshD$+~-=]?[~:p]a֤,[#o oG2C :mߓ{aVGQ2!Y5.2Y$Tԭ^piz%G)IIZZBf$EUy);hf. -6=!ɘ @yo" J)ē+"˂'M!̎SckIꤥ,`F -,m?62^=a#=1Z;Y~*8!-K+u0QƱeD*) _[99H n>%\h+>x;V@>L:Gӟ9fJ[Jh822 ;\b=?;EG@H hړ.A?},gMT k;w'7l)pJAS@ ,`䕸Qzmoeg%Sg L-P}ͧ'|h2T.Д|P.?>__Ua%0T59Lyt+<(ؚw"Ԕ9EY6i{Af@IJ.w=o"HW6u{c,2ԶH!3pޕ7a¼;'Cy9^/N /s45SKr_/H;U;Iɷ&j$PɆKxd4; (CS?ѡӵ}2!I2☻Qml"ԅ3‰"Ћ0P`9\l) tɢr`(KkEs<{dm2]~n@]a6B]fGMU]|IWV(ZNexo߼oMc{ d=0nuP{u10/(ƑID&Nd{ 9SÓ@2ZjLl=ͫ`Tj%(1eA:]sdh#5^o#m^Tl6Y'16/Z׭l!s1Ǐ l^~Nk^R#^FޑN]GU };eZ /1+gˆ؏5Cf) 'lm -)=39 e *fGդOTN,XDq(>vcTo8QgAƔ(?\u Aep~4.ʮDZ -`>lr TlK"~#Hq(5 Iw4S xqٿ_,|_nfCaINg]Ӳu(gk[BgY6@ɐ&oF)r0`n{j4A@ Ԇ+5 -x^ rdhźUX)RMN lH{(J};-HoKGMT@ /MsI8m:sQNȍ:l),>6x݆야eeh~T[Z}ZA؃eY6-eyie^ - Ҫ1:m3,,hvʤ:4O(=m<;TPZu`q-ङB@edd3 GO^>ܪJ¡*ECPx[Cc&/˄\+aFDçp*UD$gO^V1"3&R0z28Cp#0k> &QfѼ|'1jlB㾭O;͠tE)~-|k)}Q.[FfdB!eF2qKq߻oW||z8A𒤋0:\&ő,X)()`1-m5({n\/:40}`9䂤=an -|%xɵ3}7+ -']Kb#$6³;x3x212_,)G~R\XL/rT0 ӳeZMQ7|l'Qq=a۽J|޿?1 B[۸ϋFhϕN?uA&ڳu6Os;Zk(e9n -Ђ%?̓$Ly(- [)y23[rИ~O2m+5x/y'1–c8-:5Fh@M'px9蝲{38TL 8x{FV\lurL]ַO0ftפ6 AŸ +|^ލXݺ6L>[ \+zX}dhO -<3 MSތŒQ3PM~ߦ`)䜃E>1c'I (lWN_Oqy]<\C ߻hN2KegrЖ`/Vڋᯄu`]U>Ɋj5qQv0k1nk,; eƀowa mebp$"JٌrOtR}#^&v//_QcHolVD6xdFI̗DO֎t\ ` J p8TTSrXMVhp3u"$Ҟhe*\3VJ!9ݱzJ(AY??'jgPzH2ISXeT鶌OqSG$Oΐ,}|@3() NZc/<:ysjJV% -ZkT0S641km_Rrf!pnn%⴪Swk Y}J.k i|##3^ۭQF[Xb|LOf edw~sR~q2]&¥ -nM{P( Q),kz(r=[MTNsP%9Wj]v1HB휬>mXl,)Z Vbz -DZ=i NMCa -,WRӊCbb6ƃSw[o9!an ,3P-yF:dʁ >=՛,Ub<ٮNhT'UqēJ<ǞJng[ss{57E8K\3~IV9Rvf.Ouk `p1B70\ч6Ҟ-u"}^~1Ec!ՐQ;8Pr1R\)v$@rh)Lyh8EZ -^DH)$YtLYmqd^),Tɦё:]~fWؒ/y!5f"DH3Lnhg} -=n'v8;|x%5ˢfO74nH-܌*ΟUvN@?ʀ^SpaB|@Oa H;-EޑhC =mhɋ"XCXE XR):ASxDhda:N? s@<ޱ` '`H],(1&Q%fCF,-`Pz xtn[s<>?p!&Li0J ]půwZ`jOnnUqAϬ݄@&+o* 9.7|9g{`8jVɉ%IAL- HJ[AW8dDhm| #gGfy[;uwb6tS2tc4ؿ0~'c9˜"}.œ|5ӢOA@3aP< -U0[W=Oc6&ą8*A^^.[x+@ޮj-փ:Ov{sBB"(ka{M.4&Yuqy4Y܋R Ȍz'] gMdNgؤ -~MC2* ۹GIXzB˔au _lq[I‹[hǼ e9 $Ǣ''foTl98><궋0^Ҋ1”x7\..8 ZA4T`X#e.xw*(#G,2CB)7AO稊Z+)A  J~{kDD\4nDP0qb:, 'PJhE&>/cYI=.-OAQ'5+a ?b3LnLY -d4jCTKaFY˸k[{;.-OG'D࡚uEqWΫgJ8SEv3iḰalkdehऍ,f B\Dkz|UU(1B>9{v][4;"S˨>|a8v" Gm @R uOGNiTv.i'A R9Q[nA.T -NoT5ȲIC \]9Ճ# cy=uMPKBZhYP-k+$@[lЄp_ulOA<el>,Dэ? +Ҡ́0g9j$ -2kzRTtGl`a0Զ׷$ \["F昬jC)EȖNq#^"tƋgBv FP*Sw!#ꔒ!&(kЏ(&Ă.x_a&*{ 7x*<W>#?fw'W2F!E -i:ۦHLюN)qk^gDW E'`_u1->ʀA? -~s3+'1/ߋbR8aÏbqI?YY}_F_D7B8~X:A$0gq{9~`+O@= -Hwq 5ځ3<W f/ 35m !r!P|R?x^ ٙx1O?,$Tfmu` s4EM{{L\j/×hףXCqhhjڝ5zƵuw*/Dljy;AR yC"oNϳ eo;Vgi1f -cM6ǓEW 6e}[eJtv$4Oج dSOfMk@V%0 -O?Z]w8 ?a5v#=A",™ԫ --m4o0L&K&4E'勂^yM =Ugsf tfA+5i';)k> ~wӽ2tᄁaMS 8S{NŠCLߌ.5fL{շMB +0NMfV0Z*c ]@Qa5ݶפVbvg˖ QQ!#&~#KtdN֑JNiOʔR+PI`A>`D.j9Ś/I.+()&yw2|t1TCbDdj{E.++&!Pfz ڿPaa65A# -S\'! wuek6!XR 4QhLh\IN8`{gƳh:|G`SϘ-v{B[[JB`cY - UQ\ 6>6 -yB\ -Q\fMqx$Rde*J} -Z/?/SS-"}LV'[:j#|'rz}܉É`7$'P6$Fc }?QhrX&c-~Yl1CP닆_ :_o qy8yo,\"gUxz))`LXHAd|'Q-vպm=Ѷο"l8A#$h9gW DLDE97Ce3śv#tw7 aSC äe-Yeu'wՁ!T_QdaX-(<$j0(Fe= 0Zh!UHZ,2 MzXx̬n'`l쵲f'W"&u_˶{BUgc6P񒮤W…Ao^`´Ƞ#̾IMt 802[APyUʬxy"j?˕b؅A_S Ʒ0L@IDATv|nCS UTd5u 0rC{ϖP~K֘  j]FR<=)#6 FhV4u-տAf@:80dOդ/JKa)g~c&xp#F珲W=&Ȃ^uS$T⨣mEewu! x!LaY~/,t5kА6A)0 T N}N;I7ä΅rzhI kc-D ``(W -+M [a>=(͵8g!˺Ϻee&ˏK%u{iyqav:5q_,O1hƘCI&m)Uv]Y Sqܵ0S WmYQ.0K(Ԃ 9tWgE0ކ"/[ۓ$zɵ7JdF SV F0:QQըfCJcgz÷ --%ZfڿK%IiNoUʡEɁIr L೽(SY*{E_VMŮsqHW#T>8Vݮm"%\lAG6ynV8t}K` -|EVb!*٤sq?Ցqi }bYpReִxOÌ K[BϘ̙P~`4 f:PtIȢ}H74ֆuɹfݻybƔ)pʥcWK1DD>Ea@2yT܎Uszڗc{B}FW@{g; $M`, _& nXuDu ;{Qj4O=셺QOoϵ!prN?%&틪=U716 0?8XN0^GmrHyRpXl8!2 U$w\ kEC9A*eH[Bp$+/1gkLdeyvv"V0%=А+MBT dq(]> sBap}/uuYrƜ7G6̅%qC{Z&SUۼM}yZVV*S CxY:`D,큅eT|Ҝmssm u6I#{bYW }!i{ՙl{IPa) }%;;PBI7.d 5;7aźB%qmqGLm ҭtc< -\;'*='qyU:[QT1٠ߛB%ƗkٱgՙX`Ϸ`k73p@| ȨhH"hͽKr|7,VX/4u7Op݋\H,Рn#_^uad$V Dx < mߛ -G4AJe-y,K=E:.s[mB|OkXݒ/qT a YdDHϟ3z 3c;YP9OAY `ɢUD4ҮO|*z#/r'#d=t,j}FN/##i;aZ򙴓{?tSl05,,oVXsM,W2%B.I< Ʊ6˔/Ր}BЫ?@-~[@ HQA=@ ALWO.ܙ/xK -m&37 YCGɜ#'qlB"9Pw0{ep g?2q wN&kM7B+~2PƉ'1OVa0xs32Bk|#ӦUEE -u {Is%FKGp?$=Q2OZ'< 82*v |@>S3zۻTF}`[*8#TcA1;r\48LBţ#vEPX$IH#8=vxz4x 8Ĕ;PUYP4ziOi ͕$"6ţ0QG]`ܸ7:-{9)9c/>r -YRN-^3I>#5gSE6 -MZ'x*K[`B=5pi84z۵X `y"4_G~9#@ea>d;sM*(8 jkJhFa]gt߶zi~ Yo'|WEd&t"h3ïF4~d>b -{ P89^YSA?F€EBн!v3v*SEYc~o7=EA,gt16j,c UnEA^UyGVD]2-hE|p13bTiɱoamv}6g@J ) *Q&N:}(ބ94!PTKp;ڰ1#[ko)UVfߪls^ ?2Y>EuvJSOh%cO ]ss.hzYM@vbJxF2`H?f Mut] L8!9ZDa\^Z\t^oSmdLPs &viݏM|> 0s,倿5nkk&c}/z 8Q]8h ndlq;q^b _?3j"6~EWdSv^Vuh]'*r%N'#L`tl(;8Pu{khA H.~,. H -!->B%T({qj6c؈dp )as>,Z -mVd$ypI,+6SXaA0heg/ᶁƑ~:#m`dD*JTf0s@۶m-SQ}Dc7,[aZqѡF ՝nMVıdJ|&wy&#` }92źu*RY -kPu[jCʏo!'ϥ+) {{E|yCV#:W= L5%% Ǔ^!2ׂGcv3߄?:7ʼnOvYg8"1o; ~4ΫzŌn-? -|JXauT2[v񗫼w37[J&D -@E# I+֪p w wҷtCw^ s(?近>A.S<; O&H{}I6(aN32&'i O hg|3_>7)SI$ͼoP3+m87 ̹ ž tYwCGvh#{&Qg .wcLD჆mE67fGmG1Ex-X ?0l=oaH?CA?EAtSPF޷nT  ??tLGMAg,33{6ך_d!Ruu UT3S& e+ˋVPz󶴇']rhR;>)I҄JN-+A|1,S7Z(2o=@$ڗ6nPjC[#]`ۥX 0[E*:x\%' N@`rHvST5ֈlצKRcI\b%qoXMFBaKKmkn4UE+P~(a'w1K:<DvT"Ssc,,zp۶989PZwaP<{_űՓ]y0نZ.a [Aa2c$Aý ;4TuY2rY%` -3OIJT`uٳVh| ~A`p6, z{| ۃ=~l'˗gK9&ordy' q/ySȔu>) NZ/,&?P +i5J -0CϸR[hZqE@wS6,Ή:8?nRɅhZ-e1S@gtdy *KEIs]/ϽGة`,A A _D+Cx)]=,eNAbJB"K]("H,u%f@ Yk3x.Ol"?p3PQ5C 0[ T(.0?& ՔY,GwH"K{`44'NjzG7\2Kk'5Ґn_X V","]G:ep*X}Ɲ4MlbP) 7Ji\oy)7\{ۙN:w-iXXݖ[F\0.EVprivW;DC -kImo+?ۮZM ǼaRlI*}AP˺ؿM룀?էX-+#Xk@T٦:2=lEX'yz: A+* ΑSVYaP gpvk~ Jwfyݱ7+m`/4E*CgiQ*1[!<0?}NrU˞|U.) o>8 ԉ" TNm[\6ۚ+=OPⶕ;H Ӓw}Z WMS]QM9F'?i>-#]3L,e=e_?^؉'{cG"$EjyV v>AיhYęSf̯o&" @2Teʳ5j3,RLj\hʉ `0US3?2]"8nnyt2"x)X D˹o`#1Ixh^fu/&Y\VnrdiUK"!-h>Ns!-yf2/qIT3 J~xdN3CgV̛CQ"`u~8-pvBDgKku鲞Vǂ9OW&&v-QF74q Ya"G%)6&pƿ@4YDTȸi|핝Jxr#H8Quo,qL6Z -^(yyA*qeH6RÙHlgiiJ΄TM͏Oy'-AQѣKHq?0!27'hs{]X9%vA| YwE`%Lw2ڊ6m j\0}NnsA~#B8SlG&o=\ 솆X(uj@ʻsϼibGgfl=Z h6wn"j0P(A&3s'vIIDϞ=dj _E g1E8%NFo ^jgӏ52N&Ra"̀Pܕ6~'$]X~LmXKI,wt+JJO!1%q= Hs%DZdRU3Or$D9Q: ˉᑊŞr44a~ZdkTU?>6>w_J4̗L7Vq i*ṋ@~l3@=%:mN -{I0hCKYLVhجxp*⨌`lCPBqĵ'2׹}o #Oϒj4aHO!@9th-AFncZO;YΜwu5[1ީfP|yLSnJ]4/p*EODcKA @A8/IXi;,ϽSk݁{׸M'-ߵ"4g׷G} h]ǀ7&R#榯9W|k >Ψ.( 4`;[Su5{94m -Wr2o0 ofc;|IKmOoA⢫?V!fUR} -~T2ɑw߿Hr 솵*0I~c]a/;߇5UwtJȠ(m. [U| ;1_U5KAyGiĢ Q2~vYW8*i'*1*BE= Y]ᘮc``Q/!/!v$)p+siB0{ >.K5Q "bc9};qChckNC vhi.ǕhQ9jeC{q( }V'{lͰX~$͚q]7D0m\R9`5>&z6l&~ߤ̤7펲Z_h0^ -[s#3=d1gike~h IN ʼn/}!/(h -mɂ{g&Bо6 Iϴ~4FPV[0ܵ e L3kRr{u(YHj-^R4 -Qhtb#"/z \1f̘KXnn"uXwߓBJkkl lczkyu6=ȋɀB$[qzȽ4x[Y^dhdG ͘SKlqPvRCSt7^4r$8rc{$k[K,~N!<'0c |ܽ-Z gvȳ{ qp,4]&)۵Җ0ҥ鐴ZdDQHJ{fw\,p+ʢ Zk>Skv{'%oz];:F]R 勎&N(̪xqUC ;>23>Pu揌m - kdϺɨq%60bh;@^WVV\P} F (,ͱ>1821a{!b/4S .?MϤ'$BҤ!(`bA׾ {A#v]EDRׄH/L2}n`bvq&3o޻{=;|G7N)>G5 h+AP>`ϠJ:,0_w8KD -.S4f8$&diPZ ӂ& 46i=xZ{\ hk#Cfg[%Mq#\ЏAGᠼt/ nwes,"ÞĊ%~a``=gjQhwLaƌ MkA%6 - ! #yOKStY,G@wmIf~YNhS:-2A՝5WDR PxJ#'sB- &wTQ᭞S ZgWS&毧p]` -N1ܣ=K$;ĉNV 9+,>8ě6NRQd.PEu+(KBN0 O7Ŋ! Ϙ1>5s0@8h2އyi%/#^tB:!A kRa0&ࣝ*(޵>*(poN٩5b3I2C{81QcM `Hp.jӐX/<<xau54'+Cm n DlqnH |=YI\PĠ,;e؇,&y 0F"Q)8.Qh&`(BA(΅꫗PMcCxBzhGG3u"rxS]6Uj Os6{Xm9p>kLsHIR{>>75j`kaɅQt-I`CwǏo;tiM.c%nĸƑ0"!vQi ->AY՟i -+ c]7F; 3rTޙ‘I\dPXGXvpgwG0QCԣW>/ y_2fD7.xZeUCTկQ\f ], e-2$mHEÚ2 ~9,#- KW|L3w8aRMmv`C'1"fnaQ3Zw!Io'nWS܅@2-RU;7N;DLİނ`sXhhe-gaO^.dJ\~T0k2/+=ܦ`߂dM@'m%t{5q~DxChx{p0JKb?Qm{+ˆǀF{ (ٌ"ezc[ -5U}NI8̉.9 zIcc:$w6ՅѬ+k6+ TO&E+JaӮ#;}yBg&upG(i32p=sG_$kSP4 sSul[mm3 HAsaNHRV_RrL 7-K89өxΘQCY_݇Q;݄/ץ(&"$ݱ"3=);T'=LMirȒ&%Uf:@Dw*t(&rzǛc7F8Wu;r!c7}gY]5͋fl+,q {esM#SPr6vWl'c};c1 &|ӡ``i*Xm.qGDL~b_ۍtpARe zW]IDݗaAy2Q"nJEHGB>}aD򛵨qƱ:͌Fsym3_znq2r -ȖB<{7"t'(O`S.zD傻aAuiIa܅R]X،Uڥ"?蠾}z].YN8]p=gCAΞE0Gxb!UMO%8^e~=]. (oz;I8Cꪲ%6>XYpmXvC?p#`c]n4hkR3=}6vo8JydnR !YY)P䳋aա4yn8,"fPl:4 7X\".-VK:<8n?B+e XIU[xh´t; -0pQkeE&8ܷD@ᕙkPYQY^ ~ -4(D"W`*D+A,.I tL -4#`y/E*4l^zQX`7vcQ)# ! 䕄軸d'ttFKi|-8̻tU{7KN`o-7rFuŘZ:ߑΜ:| 5G~zQL'.U7As <(L̔_FYpBM)0{ŗB[?_Yq|rΓXA -]Ȑބ8zZ0a*ްtųB3-t8?? P{LG/,grF34Ϯ=,>1V8*y.kҗCcEy9VlFƂ6FH"s3˾aP!f]<_=eʔ2{5ws%ͳ#u%Ͷ-Nvȳ'Y®h|gê&0ٲqҦ/Ej4C MzϋXGЉ{|fS'hh!C_9}a~kʳD..k")ksDOH=6ٝS#ݱC`Dc%Syi۱W$1,^l)Fݕ)R/Xw6mC#;=fjkL ;az0i'ߏמ'ِH  f-PS?sݰЏh .fY?#6be<ԺfDtwR,߱H#=S3FM2E/BzuX wtU\7Lnm~Jsٓ4#x7eZx'E3l 1 Ua*W-p_bT%i9'K{`ckC$"tCn(A6S+aƲP.fWº/0!C[0%ll=/@j>jDo6.u旙,;풾GZL௼ Yj#[NE_cgPݷX7uCfg^p| wʒ9S !`͊J?BPt֠4ͳ;y• j/2g~8!i=qOti;r_66nlqC>NCѹŨ{H2arrfaZ_ 尥VD:W"$?pM偼[È/!o2FD=YH:鏶4"#y[iHHu)x(`s&ߘˣ/P(o^%΂QN-yQcew1iV//yf[pL}sE0{p ,;F9]?lLcY /)4L)N ı -UR0oiƾ^D6 tQN|0(k>UPcH^w65 c(Q>gX&6kF $8qB?wJ}}`L/-D{mOUՠ^D${^OKxAev KeiRBb05h#sN{3w~ -lD`ўL17FrH&4s =MXb{&--"35kǬǹ#zydϘaZ9vL蝆>j/IP̡OB@Z}$P{ސhɟ6"^lqrzSE}؋ce/|'4f3p/v'@@:in G_s!w6u.ǚ> - *lk;p]aot_/AhM[Ln[LZT0V1XY3vGka$::kH~뇗.(j 8V0 ټ>Qe?V@grIH-oRDNlFݒJL.9*\M0%M=>&1g;Fs<\᫇ hڅJ|$E;^|0 6W5֬i[l*H_+Os|Q!o0h)l-(6Q'1GV@w8flhr.6P2ONxR_Hym#求}g xL~J9Z#;A[c*Rc;Lpp2)KRR r2򩼠OZ8$* MD菪&+XeI<`;>oY2'+q={R<(i \4]5Ydqˤ΁Lw -=SoOF }Ku{ vN".B6nW5Qj"R$UT\#JܷWҮM &CdhH`\lT$56ƱIp/R̋e5djr~J*X#v/bgQw3H6Ӑ*"Nk\rٲJ+Ou4i6uߗ?! H";j!) -ʥKaݺY$:/hl"Ƚvƞ+) &ӯ6o2Ygn eaVoӮ`УQY =+%i吵RƓ -HdQ7l!&4sRцխ]b~w ,'(\,E S[,Oc'z@IDATVW$ZVlT0M;L{!FW>F*2Ġ&@np>@.@#%E*KJׯq1I*@a*Ջۺs-vI0lqdYغh4|Y(WLJt$}jĀ !j&3۹W 1vR8Yu{[ -Y#2bT1C4cdrE { hH}o ?gT"HJ;W^~kV]\p7#7US/}A_T -]d}#jsG߼|R@WqaI;A9`f0.@i >I5[O8^ϴr…K,SeUxzo:7caa7ьEJ S ΁ҴkBYX -<9/P0\ nTwŸp{\p /( %[!`wt~ ǂT% U}w 2s;h_BӢڻM$2`SYC&?x.J `EE}Yz͇lfjNy-WIQKMmۏ=MaP<U[ŢJM -m}R%,T$}TK)5L_ -3V`Dݦ&od;[ݝy8f6Qqp{2ο'HaՙEqAGe}4\Oq-(|Wj|!_Pw.kjb6#ͧ5|jZ3rpRQM3%(fZqHڅjvݟȆQ?;>޹FIOLDephnoKE9܇]NNVa zV s4Aћ#rpW!zOAwk\r愔_UHbDB;6XvW%yK(#zeX);oDh\JSo'Y<cBE>n2gf'JrpW^4adlҦo$)1#!ߢtK22) -e<<"/e?oMm-[ -Ά5z)pړ^; #g;l+%wJNsMon;}=R (qUYRp(L_,feύ̌95ۯWe'j߻LcY1*54'UY(0+YCUX | x37WtrSABgPIBb} ^&"W>@ -,T@PnTS1ʢfG=8s|@1w -o%k~9lN(wp8RjvNٺ6Fb:mz%*ސ{k} 1h뛀zB^q7 +WyyyF^( 8ffWdBYZRcr7 `vWjAb¯WǞ"ݰk -nh!bUڡ;2>*LkZ՘824 g*Yn,+S)d,@sUn-#AL}< t锶h@Zg1kISG̠?`/'Aė xk8>By6~)wʴ lfW&`ýuK#zS]/>,.h'2$O#H3鷯zx09ykCV?IjY/*qذ)g/q hb``IL"QAfæ7<mʯ -^r]bqH2 C{nNd g\ [c(<Ս[pl࿳YH "|X@]sd0Ml,T;=YXMQ \ 48n t0 |-0(49VWݠ'KĝM7- ;iE2X -VĂ1]@:j"tUԫз9|Ҩ78\YF,0-껲NOBjL7ԝmQ1Č0VI> lղ]"e -cznpAZ"ƒ[[46h@2:W~}BW\}ڜ"$"!׸ :8dտi0p$66^#+6Gl&YM%b@ˆ/k^D{? -"ql[WV#mz RO6?ݚ/iYO9҄K- ; ͡k‘=9CRݐ0c? |_Og^V(xYuL^("_ -M{dc\`F'[H٣W^I]wgW?~oS+%m "@cÔ~W$PBàaHF|ɲ3];}\SuCى3 h >u[`K\yWaL@PLHut%_ _]9 pnFĄ-'@Fu°\iΚ0돲WLuI(XhZmI+/}ʖi"fDc=MH -Ќ"0,`#+}UU}2eEh|ZO|Gӏ}mEJ2qCeHpUUa(uR]JiG"9sc;H;~'3$H#\y!/7yƶ,qbExf bezq,ljTb^ga~j̻`Scl*xN/Ѽ"k gPļ#BðbℋJ` |yY­Y _ MsN1N?`*2Y"'CHGφ?,*_as9 VaTpF mnF -G1BoqPbg1G}I`BQ_ Ue׏kS-EGhK@s]`lB "4i>FgQ5uqL#*=@x$W՛aEǀ@#eYgrbC0 -tITѪxkM '!jVve$s6jEN!Ɂݻә 6ĵ+ g <{Ǔv6x22Er_͞yqSQvԘt@ǀ1vCPZ3' - yg8oF5/$r>v)fZ%"n/ {$f@OovLu~h Bٗ6$Ք70xTz셽3lx|}<0M_;Ɏp,߄r7*&`bQ`hi,;4Ayp¶1wz#'Ѣw xgcqÜu&C rr܏52@5ij% |ӑ;OVS9?"iH&<VBܽ_.$hp[=B0oC^ ~u >,JXQz5cGd='T&:F lyjih(V @k+vUONd羡CƷC g93Xne <=;АL5xrv3gBF߸*'U2[ϊEzZ8$Y] >= u+& $cnuU`JԹ%U9r<y&k6'i4„J֯6:<9%6c}|M\]S6Zm#^uaGΜ\{hoB{5&$G#"erUQiե%H`au6v“/cB{# -=@QY{%0Ej!iqVZD1Y>iQGSÞ 2 iI9}{pϬ>f((Hw3P,6^ծ/@)x7rME5s%%'dMv)1$%n 34b fl_d ,I,E"yxT6oKw>-fK,fb9bG$/5XA_J1i-@=yR~wQDȇ#>$7`7|IΈ@n^xq{da_Mcy?TOX'!U?#p=i]^\aI -eAp~:xd ItSقk $܃%[\vȺ$Y٣GJ<PBqWun%ϨCv-]=qn붶~OFzϞ"RvyDy+oZS -<ŒAdĖ^3gCtQBI* -$Lm;Ymq"ߟpK] AusM]][mXE;Q1iU`+h7| 9X0 <2磄OJתf,Dn9h5ѤTvb0F5kbڃZL8̖VY]_H|UG9L-19|C cGyތ!q8Dі[JqQ hAHmy={z44iiiϠPq=SE];e RɽBysE_ &)pQPR{'Q0L>[[+/i -D&|{A8/[kZdsu.z@sH.DYѯ9%띍K,<ƂäΟX_?ຩb{J!s443hRioW4Iv3P]fḁMºeD5RYL{J!N  -qpȆYk>%Lԓ#cHf='B&<, #z?9x㏄vK5ȇ\<}&dNRwEFA.)X{Jk}{C&؃۲)? - -\,<2IL5}f!d(GԽDnI?뀿6y K;p6K" -Ev!j-˜fdfCN-PguQיWGD۸ kuFMjk!sE˂J$xo J 5-_KJ{XqX(GT`(|}lnTŌRnY`|n|v%u@ Qx-Âv,|gmzVVCI}S3 e&8 "n"`pBMn{NCM -*pVk33~I9tTO!0ܴcw4+wq'ZtTM>cG] Mzl<1L H?"; 2'CNTYUFrFŮ){?(3y( Gb %/G}.=\|G4p9n e3􃑸eBC&;|1.k { 8|Kka F7Eu[8_L'ɌV(Ďv].'{Tνk\w *Ѯ&KYD~/ 5͌?+]z"sbF^X,OJE;ɡ -P.C{#&ԃh*#+fV)ȲS+gd4+oF5iC٬9Z` 7MbKtq -x` -?^֟w8 A+:5D!x.oXNB -8T8[7 -.vڳivkmDꈟV|*z;TዅB,6*-Mw,>tcG}B/ 8SZy)BOЗmr:rw!U'bC~-cl:վ+h_$5~~w#{HC,i(1@ر=C4~X}Dn)}4hr)('m(Ba?;Uۏ7N'XS88b2 DM=EC#~JX_\O²62O/i(1 Ëdnn-|[8TeĤ#_NY6:NoHu6CоddA݀mTTik#HͬՁ~dnm춻 ")!F36~ J7Ce:XLd qxYxxO]LK* 7.ٵur~'Yn3euX$FC>sW[w3COҒ^0 #;ϵ*p2p w1,7YzȠ"WŗaڬY_u 9p„/ =ԇ9bpr Y -Ե+S1W獪h.uVg!f#Zz6WЀ%ONv nX 8g4?82!|;翄"VE6﵊iiQ%ܜ9 -hTy鷑>,݁EQONb.X~hV3'1Y01ɪO`j ;![_Bpl"$[}vՇ &}}GPptǞ Z^Ng(Y;ŒƲG~#T?mH5/n '$H 6\V,X1;@4N39EG]'oB+cL08A -MYOIur`9ွXh2WR.-Zo<'Kߛ8pȿ^yF5SYUd#A*7mUSc&@L{S]:]5@0\UZxOeE3ݿ.t!m+f1@wGXU3Q<;Qk8(G_DȠD|fCb<|Rw9S8Ȇ 2 -N̂ aEuͿ>ykHH3/'LVja_:jEBzޏDɅ-@hU+i!eg{tJ98#?=0)B mE'h~}~oLk90&p` g " n;' gAb9B3a'yBL&3AA}WtPWB_bIhL"\e[AD~ej/ylE{<J!pn= z9FH;XbbeM(zۘ*0 G] pU?s 4@y -jdɬӮn.ڝu;ltmeUjuSug -Bl$D!R!\Inr}Or `'6gnrs9~;?)Bw -g;+{Ӗ3^z;A]Lیzjۊ++r܄` GQ6^ŋ^ xTpȮlA#@xne0vK8E$ZCIgU)k2޴CYӒ"Z󇼒$S#:]ߟFKvaDs ~XW .eرg>zB^˗*od1>h:ӻyt0̀<ƍ -/`Kܚy -rDzCw"C ^E'7;)l}E?6P3*.Yf:"AnҦ啞n@ntn#h|u-ΑaP̋҅?2R# hAʛT,ESN6 ?~.d~lIY-N+E9X*tHRs9)q$ =Qʥ4PvΉ RW;bu\Aފ]jn_if__*)Opd엨=KAǜ 2˴c&oll=`Xa;znX!ha -=dJcԟ+u€މkߏ%WN7AEWnsb GT^vʌ7ܟZm~f o;)™jN'NCR_֓+݆k=4 ͏7ڣ!n o .m  eFdsc}R|O+0gAhB2%]HC@Z (4]=b[0ǹM",xs}тĿ̀<; -lVp#a)j@g>T{NZS[)h̽TG1CLO>oφw$,ȳ:,Z!"2Ώ+܎7C9o,"@‡knq-^'җFYM!9}D4J/}_p&J|b˜D Ͽ 6%*e!ǻ` j__W/ t[ D&G?g Y;gMArʕ@g\vh0%SQ::8HscHODwgdb6f^8XJI`ZF;ERFY3KOOq,`t K[M) *KQrs#wk1WR{S_[2AU -\B -J=[ ~E%n^AhrYXfuPhL<үu\iq#cA[sN1ib0ϼ>xflhF ?Ǿȥ߇kcbBTy><؞Htk h+)Lp)eK2`v/ |IDAT:Eہ]s&gXrZn3 &4i r TjAԛ샢Ø©w(yHKEjÃoEk$[cntDJ'Xr5y ^Vۧ[~ΏGǖ\pP SF9/ SvȹB^TJMkZh- -]ӮәVRcζǎeɈt %3ɾ]ɂ)E \/"H5'>{9ykb|w t0\(hf#+ҙ|Vr&g̅>4B9FJ-{NZ17$ϫRev-, DxOn_J},?0v>d>S//'ڵ!S0γۥW04~8;7CYrO_)ɮ>:2 PVeAkW*94OMޟ? -rėdg#MHVBwLp浊EE!7MՊ)Uvp/Ptl s2Y0dԀCxՊŊ\ZW4D5VRr R@*ք̘x)bk!UGG[XpzZ[C yeZݎKf w Puȷ\!'?oC.1+XG[Q@@y^,R}o<&+k2CR|l_X-]Zz~n61Aӝ7 qCKuIߏrs+oۨ@B Dh(0r̈́hY"Ghs B%5bjGxTK gr}(j;2*K*Sf FŊoCehF{u"i}>l)4ʤZEd?M#7tbFRtłm6ٸqǨ!Z|kV:H -$afvZS IOc"81ޡΓ#*]Pos=ߧI{=ߝkN^^.y%$:a?9`tƳ%ŕ5﷋j#=فH,TnżNDĈ5+i6p1UHL{&ӃPtڦvw;I5vJI?-:sQ*=f(tF>͊45^x9ܛXY3v\My$-h=wK;u|=dPe -`Wljt}VZż>;Q\iɽGϱ??Z -rӗM5TT=/sH<ݱi'G`r&dFr?1=IENDB` \ No newline at end of file diff --git a/core/vendor/guzzlehttp/guzzle/docs/_templates/nav_links.html b/core/vendor/guzzlehttp/guzzle/docs/_templates/nav_links.html deleted file mode 100644 index 7950a0f..0000000 --- a/core/vendor/guzzlehttp/guzzle/docs/_templates/nav_links.html +++ /dev/null @@ -1,3 +0,0 @@ -

  • GitHub
  • -
  • Forum
  • -
  • IRC
  • diff --git a/core/vendor/guzzlehttp/guzzle/docs/clients.rst b/core/vendor/guzzlehttp/guzzle/docs/clients.rst deleted file mode 100644 index 0614a25..0000000 --- a/core/vendor/guzzlehttp/guzzle/docs/clients.rst +++ /dev/null @@ -1,1315 +0,0 @@ -======= -Clients -======= - -Clients are used to create requests, create transactions, send requests -through an HTTP handler, and return a response. You can add default request -options to a client that are applied to every request (e.g., default headers, -default query string parameters, etc.), and you can add event listeners and -subscribers to every request created by a client. - -Creating a client -================= - -The constructor of a client accepts an associative array of configuration -options. - -base_url - Configures a base URL for the client so that requests created - using a relative URL are combined with the ``base_url`` of the client - according to section `5.2 of RFC 3986 `_. - - .. code-block:: php - - // Create a client with a base URL - $client = new GuzzleHttp\Client(['base_url' => 'https://github.com']); - // Send a request to https://github.com/notifications - $response = $client->get('/notifications'); - - `Absolute URLs `_ sent - through a client will not use the base URL of the client. - -handler - Configures the `RingPHP handler `_ - used to transfer the HTTP requests of a client. Guzzle will, by default, - utilize a stacked handlers that chooses the best handler to use based on the - provided request options and based on the extensions available in the - environment. - -message_factory - Specifies the factory used to create HTTP requests and responses - (``GuzzleHttp\Message\MessageFactoryInterface``). - -defaults - Associative array of :ref:`request-options` that are applied to every - request created by the client. This allows you to specify things like - default headers (e.g., User-Agent), default query string parameters, SSL - configurations, and any other supported request options. - -emitter - Specifies an event emitter (``GuzzleHttp\Event\EmitterInterface``) instance - to be used by the client to emit request events. This option is useful if - you need to inject an emitter with listeners/subscribers already attached. - -Here's an example of creating a client with various options. - -.. code-block:: php - - use GuzzleHttp\Client; - - $client = new Client([ - 'base_url' => ['https://api.twitter.com/{version}/', ['version' => 'v1.1']], - 'defaults' => [ - 'headers' => ['Foo' => 'Bar'], - 'query' => ['testing' => '123'], - 'auth' => ['username', 'password'], - 'proxy' => 'tcp://localhost:80' - ] - ]); - -Sending Requests -================ - -Requests can be created using various methods of a client. You can create -**and** send requests using one of the following methods: - -- ``GuzzleHttp\Client::get``: Sends a GET request. -- ``GuzzleHttp\Client::head``: Sends a HEAD request -- ``GuzzleHttp\Client::post``: Sends a POST request -- ``GuzzleHttp\Client::put``: Sends a PUT request -- ``GuzzleHttp\Client::delete``: Sends a DELETE request -- ``GuzzleHttp\Client::options``: Sends an OPTIONS request - -Each of the above methods accepts a URL as the first argument and an optional -associative array of :ref:`request-options` as the second argument. - -Synchronous Requests --------------------- - -Guzzle sends synchronous (blocking) requests when the ``future`` request option -is not specified. This means that the request will complete immediately, and if -an error is encountered, a ``GuzzleHttp\Exception\RequestException`` will be -thrown. - -.. code-block:: php - - $client = new GuzzleHttp\Client(); - - $client->put('http://httpbin.org', [ - 'headers' => ['X-Foo' => 'Bar'], - 'body' => 'this is the body!', - 'save_to' => '/path/to/local/file', - 'allow_redirects' => false, - 'timeout' => 5 - ]); - -Synchronous Error Handling -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -When a recoverable error is encountered while calling the ``send()`` method of -a client, a ``GuzzleHttp\Exception\RequestException`` is thrown. - -.. code-block:: php - - use GuzzleHttp\Client; - use GuzzleHttp\Exception\RequestException; - - $client = new Client(); - - try { - $client->get('http://httpbin.org'); - } catch (RequestException $e) { - echo $e->getRequest() . "\n"; - if ($e->hasResponse()) { - echo $e->getResponse() . "\n"; - } - } - -``GuzzleHttp\Exception\RequestException`` always contains a -``GuzzleHttp\Message\RequestInterface`` object that can be accessed using the -exception's ``getRequest()`` method. - -A response might be present in the exception. In the event of a networking -error, no response will be received. You can check if a ``RequestException`` -has a response using the ``hasResponse()`` method. If the exception has a -response, then you can access the associated -``GuzzleHttp\Message\ResponseInterface`` using the ``getResponse()`` method of -the exception. - -Asynchronous Requests ---------------------- - -You can send asynchronous requests by setting the ``future`` request option -to ``true`` (or a string that your handler understands). This creates a -``GuzzleHttp\Message\FutureResponse`` object that has not yet completed. Once -you have a future response, you can use a promise object obtained by calling -the ``then`` method of the response to take an action when the response has -completed or encounters an error. - -.. code-block:: php - - $response = $client->put('http://httpbin.org/get', ['future' => true]); - - // Call the function when the response completes - $response->then(function ($response) { - echo $response->getStatusCode(); - }); - -You can call the ``wait()`` method of a future response to block until it has -completed. You also use a future response object just like a normal response -object by accessing the methods of the response. Using a future response like a -normal response object, also known as *dereferencing*, will block until the -response has completed. - -.. code-block:: php - - $response = $client->put('http://httpbin.org/get', ['future' => true]); - - // Block until the response has completed - echo $response->getStatusCode(); - -.. important:: - - If an exception occurred while transferring the future response, then the - exception encountered will be thrown when dereferencing. - -.. note:: - - It depends on the RingPHP handler used by a client, but you typically need - to use the same RingPHP handler in order to utilize asynchronous requests - across multiple clients. - -Asynchronous Error Handling -~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Handling errors with future response object promises is a bit different. When -using a promise, exceptions are forwarded to the ``$onError`` function provided -to the second argument of the ``then()`` function. - -.. code-block:: php - - $response = $client->put('http://httpbin.org/get', ['future' => true]); - - $response - ->then( - function ($response) { - // This is called when the request succeeded - echo 'Success: ' . $response->getStatusCode(); - // Returning a value will forward the value to the next promise - // in the chain. - return $response; - }, - function ($error) { - // This is called when the exception failed. - echo 'Exception: ' . $error->getMessage(); - // Throwing will "forward" the exception to the next promise - // in the chain. - throw $error; - } - ) - ->then( - function($response) { - // This is called after the first promise in the chain. It - // receives the value returned from the first promise. - echo $response->getReasonPhrase(); - }, - function ($error) { - // This is called if the first promise error handler in the - // chain rethrows the exception. - echo 'Error: ' . $error->getMessage(); - } - ); - -Please see the `React/Promises project documentation `_ -for more information on how promise resolution and rejection forwarding works. - -HTTP Errors ------------ - -If the ``exceptions`` request option is not set to ``false``, then exceptions -are thrown for HTTP protocol errors as well: -``GuzzleHttp\Exception\ClientErrorResponseException`` for 4xx level HTTP -responses and ``GuzzleHttp\Exception\ServerException`` for 5xx level responses, -both of which extend from ``GuzzleHttp\Exception\BadResponseException``. - -Creating Requests ------------------ - -You can create a request without sending it. This is useful for building up -requests over time or sending requests in concurrently. - -.. code-block:: php - - $request = $client->createRequest('GET', 'http://httpbin.org', [ - 'headers' => ['X-Foo' => 'Bar'] - ]); - - // Modify the request as needed - $request->setHeader('Baz', 'bar'); - -After creating a request, you can send it with the client's ``send()`` method. - -.. code-block:: php - - $response = $client->send($request); - -Sending Requests With a Pool -============================ - -You can send requests concurrently using a fixed size pool via the -``GuzzleHttp\Pool`` class. The Pool class is an implementation of -``GuzzleHttp\Ring\Future\FutureInterface``, meaning it can be dereferenced at a -later time or cancelled before sending. The Pool constructor accepts a client -object, iterator or array that yields ``GuzzleHttp\Message\RequestInterface`` -objects, and an optional associative array of options that can be used to -affect the transfer. - -.. code-block:: php - - use GuzzleHttp\Pool; - - $requests = [ - $client->createRequest('GET', 'http://httpbin.org'), - $client->createRequest('DELETE', 'http://httpbin.org/delete'), - $client->createRequest('PUT', 'http://httpbin.org/put', ['body' => 'test']) - ]; - - $options = []; - - // Create a pool. Note: the options array is optional. - $pool = new Pool($client, $requests, $options); - - // Send the requests - $pool->wait(); - -The Pool constructor accepts the following associative array of options: - -- **pool_size**: Integer representing the maximum number of requests that are - allowed to be sent concurrently. -- **before**: Callable or array representing the event listeners to add to - each request's :ref:`before_event` event. -- **complete**: Callable or array representing the event listeners to add to - each request's :ref:`complete_event` event. -- **error**: Callable or array representing the event listeners to add to - each request's :ref:`error_event` event. -- **end**: Callable or array representing the event listeners to add to - each request's :ref:`end_event` event. - -The "before", "complete", "error", and "end" event options accept a callable or -an array of associative arrays where each associative array contains a "fn" key -with a callable value, an optional "priority" key representing the event -priority (with a default value of 0), and an optional "once" key that can be -set to true so that the event listener will be removed from the request after -it is first triggered. - -.. code-block:: php - - use GuzzleHttp\Pool; - use GuzzleHttp\Event\CompleteEvent; - - // Add a single event listener using a callable. - Pool::send($client, $requests, [ - 'complete' => function (CompleteEvent $event) { - echo 'Completed request to ' . $event->getRequest()->getUrl() . "\n"; - echo 'Response: ' . $event->getResponse()->getBody() . "\n\n"; - } - ]); - - // The above is equivalent to the following, but the following structure - // allows you to add multiple event listeners to the same event name. - Pool::send($client, $requests, [ - 'complete' => [ - [ - 'fn' => function (CompleteEvent $event) { /* ... */ }, - 'priority' => 0, // Optional - 'once' => false // Optional - ] - ] - ]); - -Asynchronous Response Handling ------------------------------- - -When sending requests concurrently using a pool, the request/response/error -lifecycle must be handled asynchronously. This means that you give the Pool -multiple requests and handle the response or errors that is associated with the -request using event callbacks. - -.. code-block:: php - - use GuzzleHttp\Pool; - use GuzzleHttp\Event\ErrorEvent; - - Pool::send($client, $requests, [ - 'complete' => function (CompleteEvent $event) { - echo 'Completed request to ' . $event->getRequest()->getUrl() . "\n"; - echo 'Response: ' . $event->getResponse()->getBody() . "\n\n"; - // Do something with the completion of the request... - }, - 'error' => function (ErrorEvent $event) { - echo 'Request failed: ' . $event->getRequest()->getUrl() . "\n"; - echo $event->getException(); - // Do something to handle the error... - } - ]); - -The ``GuzzleHttp\Event\ErrorEvent`` event object is emitted when an error -occurs during a transfer. With this event, you have access to the request that -was sent, the response that was received (if one was received), access to -transfer statistics, and the ability to intercept the exception with a -different ``GuzzleHttp\Message\ResponseInterface`` object. See :doc:`events` -for more information. - -Handling Errors After Transferring -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -It sometimes might be easier to handle all of the errors that occurred during a -transfer after all of the requests have been sent. Here we are adding each -failed request to an array that we can use to process errors later. - -.. code-block:: php - - use GuzzleHttp\Pool; - use GuzzleHttp\Event\ErrorEvent; - - $errors = []; - Pool::send($client, $requests, [ - 'error' => function (ErrorEvent $event) use (&$errors) { - $errors[] = $event; - } - ]); - - foreach ($errors as $error) { - // Handle the error... - } - -.. _batch-requests: - -Batching Requests ------------------ - -Sometimes you just want to send a few requests concurrently and then process -the results all at once after they've been sent. Guzzle provides a convenience -function ``GuzzleHttp\Pool::batch()`` that makes this very simple: - -.. code-block:: php - - use GuzzleHttp\Pool; - use GuzzleHttp\Client; - - $client = new Client(); - - $requests = [ - $client->createRequest('GET', 'http://httpbin.org/get'), - $client->createRequest('HEAD', 'http://httpbin.org/get'), - $client->createRequest('PUT', 'http://httpbin.org/put'), - ]; - - // Results is a GuzzleHttp\BatchResults object. - $results = Pool::batch($client, $requests); - - // Can be accessed by index. - echo $results[0]->getStatusCode(); - - // Can be accessed by request. - echo $results->getResult($requests[0])->getStatusCode(); - - // Retrieve all successful responses - foreach ($results->getSuccessful() as $response) { - echo $response->getStatusCode() . "\n"; - } - - // Retrieve all failures. - foreach ($results->getFailures() as $requestException) { - echo $requestException->getMessage() . "\n"; - } - -``GuzzleHttp\Pool::batch()`` accepts an optional associative array of options -in the third argument that allows you to specify the 'before', 'complete', -'error', and 'end' events as well as specify the maximum number of requests to -send concurrently using the 'pool_size' option key. - -.. _request-options: - -Request Options -=============== - -You can customize requests created by a client using **request options**. -Request options control various aspects of a request including, headers, -query string parameters, timeout settings, the body of a request, and much -more. - -All of the following examples use the following client: - -.. code-block:: php - - $client = new GuzzleHttp\Client(['base_url' => 'http://httpbin.org']); - -headers -------- - -:Summary: Associative array of headers to add to the request. Each key is the - name of a header, and each value is a string or array of strings - representing the header field values. -:Types: array -:Defaults: None - -.. code-block:: php - - // Set various headers on a request - $client->get('/get', [ - 'headers' => [ - 'User-Agent' => 'testing/1.0', - 'Accept' => 'application/json', - 'X-Foo' => ['Bar', 'Baz'] - ] - ]); - -body ----- - -:Summary: The ``body`` option is used to control the body of an entity - enclosing request (e.g., PUT, POST, PATCH). -:Types: - - string - - ``fopen()`` resource - - ``GuzzleHttp\Stream\StreamInterface`` - - ``GuzzleHttp\Post\PostBodyInterface`` -:Default: None - -This setting can be set to any of the following types: - -- string - - .. code-block:: php - - // You can send requests that use a string as the message body. - $client->put('/put', ['body' => 'foo']); - -- resource returned from ``fopen()`` - - .. code-block:: php - - // You can send requests that use a stream resource as the body. - $resource = fopen('http://httpbin.org', 'r'); - $client->put('/put', ['body' => $resource]); - -- Array - - Use an array to send POST style requests that use a - ``GuzzleHttp\Post\PostBodyInterface`` object as the body. - - .. code-block:: php - - // You can send requests that use a POST body containing fields & files. - $client->post('/post', [ - 'body' => [ - 'field' => 'abc', - 'other_field' => '123', - 'file_name' => fopen('/path/to/file', 'r') - ] - ]); - -- ``GuzzleHttp\Stream\StreamInterface`` - - .. code-block:: php - - // You can send requests that use a Guzzle stream object as the body - $stream = GuzzleHttp\Stream\Stream::factory('contents...'); - $client->post('/post', ['body' => $stream]); - -json ----- - -:Summary: The ``json`` option is used to easily upload JSON encoded data as the - body of a request. A Content-Type header of ``application/json`` will be - added if no Content-Type header is already present on the message. -:Types: - Any PHP type that can be operated on by PHP's ``json_encode()`` function. -:Default: None - -.. code-block:: php - - $request = $client->createRequest('PUT', '/put', ['json' => ['foo' => 'bar']]); - echo $request->getHeader('Content-Type'); - // application/json - echo $request->getBody(); - // {"foo":"bar"} - -.. note:: - - This request option does not support customizing the Content-Type header - or any of the options from PHP's `json_encode() `_ - function. If you need to customize these settings, then you must pass the - JSON encoded data into the request yourself using the ``body`` request - option and you must specify the correct Content-Type header using the - ``headers`` request option. - -query ------ - -:Summary: Associative array of query string values to add to the request. -:Types: - - array - - ``GuzzleHttp\Query`` -:Default: None - -.. code-block:: php - - // Send a GET request to /get?foo=bar - $client->get('/get', ['query' => ['foo' => 'bar']]); - -Query strings specified in the ``query`` option are combined with any query -string values that are parsed from the URL. - -.. code-block:: php - - // Send a GET request to /get?abc=123&foo=bar - $client->get('/get?abc=123', ['query' => ['foo' => 'bar']]); - -auth ----- - -:Summary: Pass an array of HTTP authentication parameters to use with the - request. The array must contain the username in index [0], the password in - index [1], and you can optionally provide a built-in authentication type in - index [2]. Pass ``null`` to disable authentication for a request. -:Types: - - array - - string - - null -:Default: None - -The built-in authentication types are as follows: - -basic - Use `basic HTTP authentication `_ in - the ``Authorization`` header (the default setting used if none is - specified). - - .. code-block:: php - - $client->get('/get', ['auth' => ['username', 'password']]); - -digest - Use `digest authentication `_ (must be - supported by the HTTP handler). - - .. code-block:: php - - $client->get('/get', ['auth' => ['username', 'password', 'digest']]); - - *This is currently only supported when using the cURL handler, but creating - a replacement that can be used with any HTTP handler is planned.* - -.. important:: - - The authentication type (whether it's provided as a string or as the third - option in an array) is always converted to a lowercase string. Take this - into account when implementing custom authentication types and when - implementing custom message factories. - -Custom Authentication Schemes -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also provide a string representing a custom authentication type name. -When using a custom authentication type string, you will need to implement -the authentication method in an event listener that checks the ``auth`` request -option of a request before it is sent. Authentication listeners that require -a request is not modified after they are signed should have a very low priority -to ensure that they are fired last or near last in the event chain. - -.. code-block:: php - - use GuzzleHttp\Event\BeforeEvent; - use GuzzleHttp\Event\RequestEvents; - - /** - * Custom authentication listener that handles the "foo" auth type. - * - * Listens to the "before" event of a request and only modifies the request - * when the "auth" config setting of the request is "foo". - */ - class FooAuth implements GuzzleHttp\Event\SubscriberInterface - { - private $password; - - public function __construct($password) - { - $this->password = $password; - } - - public function getEvents() - { - return ['before' => ['sign', RequestEvents::SIGN_REQUEST]]; - } - - public function sign(BeforeEvent $e) - { - if ($e->getRequest()->getConfig()['auth'] == 'foo') { - $e->getRequest()->setHeader('X-Foo', 'Foo ' . $this->password); - } - } - } - - $client->getEmitter()->attach(new FooAuth('password')); - $client->get('/', ['auth' => 'foo']); - -Adapter Specific Authentication Schemes -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -If you need to use authentication methods provided by cURL (e.g., NTLM, GSS, -etc.), then you need to specify a curl handler option in the ``options`` -request option array. See :ref:`config-option` for more information. - -.. _cookies-option: - -cookies -------- - -:Summary: Specifies whether or not cookies are used in a request or what cookie - jar to use or what cookies to send. -:Types: - - bool - - array - - ``GuzzleHttp\Cookie\CookieJarInterface`` -:Default: None - -Set to ``true`` to use a shared cookie session associated with the client. - -.. code-block:: php - - // Enable cookies using the shared cookie jar of the client. - $client->get('/get', ['cookies' => true]); - -Pass an associative array containing cookies to send in the request and start a -new cookie session. - -.. code-block:: php - - // Enable cookies and send specific cookies - $client->get('/get', ['cookies' => ['foo' => 'bar']]); - -Set to a ``GuzzleHttp\Cookie\CookieJarInterface`` object to use an existing -cookie jar. - -.. code-block:: php - - $jar = new GuzzleHttp\Cookie\CookieJar(); - $client->get('/get', ['cookies' => $jar]); - -.. _allow_redirects-option: - -allow_redirects ---------------- - -:Summary: Describes the redirect behavior of a request -:Types: - - bool - - array -:Default: - :: - - [ - 'max' => 5, - 'strict' => false, - 'referer' => true, - 'protocols' => ['http', 'https'] - ] - -Set to ``false`` to disable redirects. - -.. code-block:: php - - $res = $client->get('/redirect/3', ['allow_redirects' => false]); - echo $res->getStatusCode(); - // 302 - -Set to ``true`` (the default setting) to enable normal redirects with a maximum -number of 5 redirects. - -.. code-block:: php - - $res = $client->get('/redirect/3'); - echo $res->getStatusCode(); - // 200 - -Pass an associative array containing the 'max' key to specify the maximum -number of redirects, provide a 'strict' key value to specify whether or not to -use strict RFC compliant redirects (meaning redirect POST requests with POST -requests vs. doing what most browsers do which is redirect POST requests with -GET requests), provide a 'referer' key to specify whether or not the "Referer" -header should be added when redirecting, and provide a 'protocols' array that -specifies which protocols are supported for redirects (defaults to -``['http', 'https']``). - -.. code-block:: php - - $res = $client->get('/redirect/3', [ - 'allow_redirects' => [ - 'max' => 10, // allow at most 10 redirects. - 'strict' => true, // use "strict" RFC compliant redirects. - 'referer' => true, // add a Referer header - 'protocols' => ['https'] // only allow https URLs - ] - ]); - echo $res->getStatusCode(); - // 200 - -decode_content --------------- - -:Summary: Specify whether or not ``Content-Encoding`` responses (gzip, - deflate, etc.) are automatically decoded. -:Types: - - string - - bool -:Default: ``true`` - -This option can be used to control how content-encoded response bodies are -handled. By default, ``decode_content`` is set to true, meaning any gzipped -or deflated response will be decoded by Guzzle. - -When set to ``false``, the body of a response is never decoded, meaning the -bytes pass through the handler unchanged. - -.. code-block:: php - - // Request gzipped data, but do not decode it while downloading - $client->get('/foo.js', [ - 'headers' => ['Accept-Encoding' => 'gzip'], - 'decode_content' => false - ]); - -When set to a string, the bytes of a response are decoded and the string value -provided to the ``decode_content`` option is passed as the ``Accept-Encoding`` -header of the request. - -.. code-block:: php - - // Pass "gzip" as the Accept-Encoding header. - $client->get('/foo.js', ['decode_content' => 'gzip']); - -.. _save_to-option: - -save_to -------- - -:Summary: Specify where the body of a response will be saved. -:Types: - - string - - ``fopen()`` resource - - ``GuzzleHttp\Stream\StreamInterface`` -:Default: PHP temp stream - -Pass a string to specify the path to a file that will store the contents of the -response body: - -.. code-block:: php - - $client->get('/stream/20', ['save_to' => '/path/to/file']); - -Pass a resource returned from ``fopen()`` to write the response to a PHP stream: - -.. code-block:: php - - $resource = fopen('/path/to/file', 'w'); - $client->get('/stream/20', ['save_to' => $resource]); - -Pass a ``GuzzleHttp\Stream\StreamInterface`` object to stream the response body -to an open Guzzle stream: - -.. code-block:: php - - $resource = fopen('/path/to/file', 'w'); - $stream = GuzzleHttp\Stream\Stream::factory($resource); - $client->get('/stream/20', ['save_to' => $stream]); - -.. _events-option: - -events ------- - -:Summary: An associative array mapping event names to a callable. Or an - associative array containing the 'fn' key that maps to a callable, an - optional 'priority' key used to specify the event priority, and an optional - 'once' key used to specify if the event should remove itself the first time - it is triggered. -:Types: array -:Default: None - -.. code-block:: php - - use GuzzleHttp\Event\BeforeEvent; - use GuzzleHttp\Event\HeadersEvent; - use GuzzleHttp\Event\CompleteEvent; - use GuzzleHttp\Event\ErrorEvent; - - $client->get('/', [ - 'events' => [ - 'before' => function (BeforeEvent $e) { echo 'Before'; }, - 'complete' => function (CompleteEvent $e) { echo 'Complete'; }, - 'error' => function (ErrorEvent $e) { echo 'Error'; }, - ] - ]); - -Here's an example of using the associative array format for control over the -priority and whether or not an event should be triggered more than once. - -.. code-block:: php - - $client->get('/', [ - 'events' => [ - 'before' => [ - 'fn' => function (BeforeEvent $e) { echo 'Before'; }, - 'priority' => 100, - 'once' => true - ] - ] - ]); - -.. _subscribers-option: - -subscribers ------------ - -:Summary: Array of event subscribers to add to the request. Each value in the - array must be an instance of ``GuzzleHttp\Event\SubscriberInterface``. -:Types: array -:Default: None - -.. code-block:: php - - use GuzzleHttp\Subscriber\History; - use GuzzleHttp\Subscriber\Mock; - use GuzzleHttp\Message\Response; - - $history = new History(); - $mock = new Mock([new Response(200)]); - $client->get('/', ['subscribers' => [$history, $mock]]); - - echo $history; - // Outputs the request and response history - -.. _exceptions-option: - -exceptions ----------- - -:Summary: Set to ``false`` to disable throwing exceptions on an HTTP protocol - errors (i.e., 4xx and 5xx responses). Exceptions are thrown by default when - HTTP protocol errors are encountered. -:Types: bool -:Default: ``true`` - -.. code-block:: php - - $client->get('/status/500'); - // Throws a GuzzleHttp\Exception\ServerException - - $res = $client->get('/status/500', ['exceptions' => false]); - echo $res->getStatusCode(); - // 500 - -.. _timeout-option: - -timeout -------- - -:Summary: Float describing the timeout of the request in seconds. Use ``0`` - to wait indefinitely (the default behavior). -:Types: float -:Default: ``0`` - -.. code-block:: php - - // Timeout if a server does not return a response in 3.14 seconds. - $client->get('/delay/5', ['timeout' => 3.14]); - // PHP Fatal error: Uncaught exception 'GuzzleHttp\Exception\RequestException' - -.. _connect_timeout-option: - -connect_timeout ---------------- - -:Summary: Float describing the number of seconds to wait while trying to connect - to a server. Use ``0`` to wait indefinitely (the default behavior). -:Types: float -:Default: ``0`` - -.. code-block:: php - - // Timeout if the client fails to connect to the server in 3.14 seconds. - $client->get('/delay/5', ['connect_timeout' => 3.14]); - -.. note:: - - This setting must be supported by the HTTP handler used to send a request. - ``connect_timeout`` is currently only supported by the built-in cURL - handler. - -.. _verify-option: - -verify ------- - -:Summary: Describes the SSL certificate verification behavior of a request. - - - Set to ``true`` to enable SSL certificate verification and use the default - CA bundle provided by operating system. - - Set to ``false`` to disable certificate verification (this is insecure!). - - Set to a string to provide the path to a CA bundle to enable verification - using a custom certificate. -:Types: - - bool - - string -:Default: ``true`` - -.. code-block:: php - - // Use the system's CA bundle (this is the default setting) - $client->get('/', ['verify' => true]); - - // Use a custom SSL certificate on disk. - $client->get('/', ['verify' => '/path/to/cert.pem']); - - // Disable validation entirely (don't do this!). - $client->get('/', ['verify' => false]); - -Not all system's have a known CA bundle on disk. For example, Windows and -OS X do not have a single common location for CA bundles. When setting -"verify" to ``true``, Guzzle will do its best to find the most appropriate -CA bundle on your system. When using cURL or the PHP stream wrapper on PHP -versions >= 5.6, this happens by default. When using the PHP stream -wrapper on versions < 5.6, Guzzle tries to find your CA bundle in the -following order: - -1. Check if ``openssl.cafile`` is set in your php.ini file. -2. Check if ``curl.cainfo`` is set in your php.ini file. -3. Check if ``/etc/pki/tls/certs/ca-bundle.crt`` exists (Red Hat, CentOS, - Fedora; provided by the ca-certificates package) -4. Check if ``/etc/ssl/certs/ca-certificates.crt`` exists (Ubuntu, Debian; - provided by the ca-certificates package) -5. Check if ``/usr/local/share/certs/ca-root-nss.crt`` exists (FreeBSD; - provided by the ca_root_nss package) -6. Check if ``/usr/local/etc/openssl/cert.pem`` (OS X; provided by homebrew) -7. Check if ``C:\windows\system32\curl-ca-bundle.crt`` exists (Windows) -8. Check if ``C:\windows\curl-ca-bundle.crt`` exists (Windows) - -The result of this lookup is cached in memory so that subsequent calls -in the same process will return very quickly. However, when sending only -a single request per-process in something like Apache, you should consider -setting the ``openssl.cafile`` environment variable to the path on disk -to the file so that this entire process is skipped. - -If you do not need a specific certificate bundle, then Mozilla provides a -commonly used CA bundle which can be downloaded -`here `_ -(provided by the maintainer of cURL). Once you have a CA bundle available on -disk, you can set the "openssl.cafile" PHP ini setting to point to the path to -the file, allowing you to omit the "verify" request option. Much more detail on -SSL certificates can be found on the -`cURL website `_. - -.. _cert-option: - -cert ----- - -:Summary: Set to a string to specify the path to a file containing a PEM - formatted client side certificate. If a password is required, then set to - an array containing the path to the PEM file in the first array element - followed by the password required for the certificate in the second array - element. -:Types: - - string - - array -:Default: None - -.. code-block:: php - - $client->get('/', ['cert' => ['/path/server.pem', 'password']]); - -.. _ssl_key-option: - -ssl_key -------- - -:Summary: Specify the path to a file containing a private SSL key in PEM - format. If a password is required, then set to an array containing the path - to the SSL key in the first array element followed by the password required - for the certificate in the second element. -:Types: - - string - - array -:Default: None - -.. note:: - - ``ssl_key`` is implemented by HTTP handlers. This is currently only - supported by the cURL handler, but might be supported by other third-part - handlers. - -.. _proxy-option: - -proxy ------ - -:Summary: Pass a string to specify an HTTP proxy, or an array to specify - different proxies for different protocols. -:Types: - - string - - array -:Default: None - -Pass a string to specify a proxy for all protocols. - -.. code-block:: php - - $client->get('/', ['proxy' => 'tcp://localhost:8125']); - -Pass an associative array to specify HTTP proxies for specific URI schemes -(i.e., "http", "https"). - -.. code-block:: php - - $client->get('/', [ - 'proxy' => [ - 'http' => 'tcp://localhost:8125', // Use this proxy with "http" - 'https' => 'tcp://localhost:9124' // Use this proxy with "https" - ] - ]); - -.. note:: - - You can provide proxy URLs that contain a scheme, username, and password. - For example, ``"http://username:password@192.168.16.1:10"``. - -.. _debug-option: - -debug ------ - -:Summary: Set to ``true`` or set to a PHP stream returned by ``fopen()`` to - enable debug output with the handler used to send a request. For example, - when using cURL to transfer requests, cURL's verbose of ``CURLOPT_VERBOSE`` - will be emitted. When using the PHP stream wrapper, stream wrapper - notifications will be emitted. If set to true, the output is written to - PHP's STDOUT. If a PHP stream is provided, output is written to the stream. -:Types: - - bool - - ``fopen()`` resource -:Default: None - -.. code-block:: php - - $client->get('/get', ['debug' => true]); - -Running the above example would output something like the following: - -:: - - * About to connect() to httpbin.org port 80 (#0) - * Trying 107.21.213.98... * Connected to httpbin.org (107.21.213.98) port 80 (#0) - > GET /get HTTP/1.1 - Host: httpbin.org - User-Agent: Guzzle/4.0 curl/7.21.4 PHP/5.5.7 - - < HTTP/1.1 200 OK - < Access-Control-Allow-Origin: * - < Content-Type: application/json - < Date: Sun, 16 Feb 2014 06:50:09 GMT - < Server: gunicorn/0.17.4 - < Content-Length: 335 - < Connection: keep-alive - < - * Connection #0 to host httpbin.org left intact - -.. _stream-option: - -stream ------- - -:Summary: Set to ``true`` to stream a response rather than download it all - up-front. -:Types: bool -:Default: ``false`` - -.. code-block:: php - - $response = $client->get('/stream/20', ['stream' => true]); - // Read bytes off of the stream until the end of the stream is reached - $body = $response->getBody(); - while (!$body->eof()) { - echo $body->read(1024); - } - -.. note:: - - Streaming response support must be implemented by the HTTP handler used by - a client. This option might not be supported by every HTTP handler, but the - interface of the response object remains the same regardless of whether or - not it is supported by the handler. - -.. _expect-option: - -expect ------- - -:Summary: Controls the behavior of the "Expect: 100-Continue" header. -:Types: - - bool - - integer -:Default: ``1048576`` - -Set to ``true`` to enable the "Expect: 100-Continue" header for all requests -that sends a body. Set to ``false`` to disable the "Expect: 100-Continue" -header for all requests. Set to a number so that the size of the payload must -be greater than the number in order to send the Expect header. Setting to a -number will send the Expect header for all requests in which the size of the -payload cannot be determined or where the body is not rewindable. - -By default, Guzzle will add the "Expect: 100-Continue" header when the size of -the body of a request is greater than 1 MB and a request is using HTTP/1.1. - -.. note:: - - This option only takes effect when using HTTP/1.1. The HTTP/1.0 and - HTTP/2.0 protocols do not support the "Expect: 100-Continue" header. - Support for handling the "Expect: 100-Continue" workflow must be - implemented by Guzzle HTTP handlers used by a client. - -.. _version-option: - -version -------- - -:Summary: Protocol version to use with the request. -:Types: string, float -:Default: ``1.1`` - -.. code-block:: php - - // Force HTTP/1.0 - $request = $client->createRequest('GET', '/get', ['version' => 1.0]); - echo $request->getProtocolVersion(); - // 1.0 - -.. _config-option: - -config ------- - -:Summary: Associative array of config options that are forwarded to a request's - configuration collection. These values are used as configuration options - that can be consumed by plugins and handlers. -:Types: array -:Default: None - -.. code-block:: php - - $request = $client->createRequest('GET', '/get', ['config' => ['foo' => 'bar']]); - echo $request->getConfig('foo'); - // 'bar' - -Some HTTP handlers allow you to specify custom handler-specific settings. For -example, you can pass custom cURL options to requests by passing an associative -array in the ``config`` request option under the ``curl`` key. - -.. code-block:: php - - // Use custom cURL options with the request. This example uses NTLM auth - // to authenticate with a server. - $client->get('/', [ - 'config' => [ - 'curl' => [ - CURLOPT_HTTPAUTH => CURLAUTH_NTLM, - CURLOPT_USERPWD => 'username:password' - ] - ] - ]); - -future ------- - -:Summary: Specifies whether or not a response SHOULD be an instance of a - ``GuzzleHttp\Message\FutureResponse`` object. -:Types: - - bool - - string -:Default: ``false`` - -By default, Guzzle requests should be synchronous. You can create asynchronous -future responses by passing the ``future`` request option as ``true``. The -response will only be executed when it is used like a normal response, the -``wait()`` method of the response is called, or the corresponding handler that -created the response is destructing and there are futures that have not been -resolved. - -.. important:: - - This option only has an effect if your handler can create and return future - responses. However, even if a response is completed synchronously, Guzzle - will ensure that a FutureResponse object is returned for API consistency. - -.. code-block:: php - - $response = $client->get('/foo', ['future' => true]) - ->then(function ($response) { - echo 'I got a response! ' . $response; - }); - -Event Subscribers -================= - -Requests emit lifecycle events when they are transferred. A client object has a -``GuzzleHttp\Common\EventEmitter`` object that can be used to add event -*listeners* and event *subscribers* to all requests created by the client. - -.. important:: - - **Every** event listener or subscriber added to a client will be added to - every request created by the client. - -.. code-block:: php - - use GuzzleHttp\Client; - use GuzzleHttp\Event\BeforeEvent; - - $client = new Client(); - - // Add a listener that will echo out requests before they are sent - $client->getEmitter()->on('before', function (BeforeEvent $e) { - echo 'About to send request: ' . $e->getRequest(); - }); - - $client->get('http://httpbin.org/get'); - // Outputs the request as a string because of the event - -See :doc:`events` for more information on the event system used in Guzzle. - -Environment Variables -===================== - -Guzzle exposes a few environment variables that can be used to customize the -behavior of the library. - -``GUZZLE_CURL_SELECT_TIMEOUT`` - Controls the duration in seconds that a curl_multi_* handler will use when - selecting on curl handles using ``curl_multi_select()``. Some systems - have issues with PHP's implementation of ``curl_multi_select()`` where - calling this function always results in waiting for the maximum duration of - the timeout. -``HTTP_PROXY`` - Defines the proxy to use when sending requests using the "http" protocol. -``HTTPS_PROXY`` - Defines the proxy to use when sending requests using the "https" protocol. - -Relevant ini Settings ---------------------- - -Guzzle can utilize PHP ini settings when configuring clients. - -``openssl.cafile`` - Specifies the path on disk to a CA file in PEM format to use when sending - requests over "https". See: https://wiki.php.net/rfc/tls-peer-verification#phpini_defaults diff --git a/core/vendor/guzzlehttp/guzzle/docs/conf.py b/core/vendor/guzzlehttp/guzzle/docs/conf.py deleted file mode 100644 index 917bdf4..0000000 --- a/core/vendor/guzzlehttp/guzzle/docs/conf.py +++ /dev/null @@ -1,28 +0,0 @@ -import sys, os -from sphinx.highlighting import lexers -from pygments.lexers.web import PhpLexer - - -lexers['php'] = PhpLexer(startinline=True, linenos=1) -lexers['php-annotations'] = PhpLexer(startinline=True, linenos=1) -primary_domain = 'php' - -extensions = [] -templates_path = ['_templates'] -source_suffix = '.rst' -master_doc = 'index' -project = u'Guzzle' -copyright = u'2014, Michael Dowling' -version = '5.0.0' -html_title = "Guzzle Documentation" -html_short_title = "Guzzle" - -exclude_patterns = ['_build'] -html_static_path = ['_static'] - -on_rtd = os.environ.get('READTHEDOCS', None) == 'True' - -if not on_rtd: # only import and set the theme if we're building docs locally - import sphinx_rtd_theme - html_theme = 'sphinx_rtd_theme' - html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] diff --git a/core/vendor/guzzlehttp/guzzle/docs/events.rst b/core/vendor/guzzlehttp/guzzle/docs/events.rst deleted file mode 100644 index 647dcd0..0000000 --- a/core/vendor/guzzlehttp/guzzle/docs/events.rst +++ /dev/null @@ -1,520 +0,0 @@ -============ -Event System -============ - -Guzzle uses an event emitter to allow you to easily extend the behavior of a -request, change the response associated with a request, and implement custom -error handling. All events in Guzzle are managed and emitted by an -**event emitter**. - -Event Emitters -============== - -Clients, requests, and any other class that implements the -``GuzzleHttp\Event\HasEmitterInterface`` interface have a -``GuzzleHttp\Event\Emitter`` object. You can add event *listeners* and -event *subscribers* to an event *emitter*. - -emitter - An object that implements ``GuzzleHttp\Event\EmitterInterface``. This - object emits named events to event listeners. You may register event - listeners on subscribers on an emitter. - -event listeners - Callable functions that are registered on an event emitter for specific - events. Event listeners are registered on an emitter with a *priority* - setting. If no priority is provided, ``0`` is used by default. - -event subscribers - Classes that tell an event emitter what methods to listen to and what - functions on the class to invoke when the event is triggered. Event - subscribers subscribe event listeners to an event emitter. They should be - used when creating more complex event based logic in applications (i.e., - cookie handling is implemented using an event subscriber because it's - easier to share a subscriber than an anonymous function and because - handling cookies is a complex process). - -priority - Describes the order in which event listeners are invoked when an event is - emitted. The higher a priority value, the earlier the event listener will - be invoked (a higher priority means the listener is more important). If - no priority is provided, the priority is assumed to be ``0``. - - When specifying an event priority, you can pass ``"first"`` or ``"last"`` to - dynamically specify the priority based on the current event priorities - associated with the given event name in the emitter. Use ``"first"`` to set - the priority to the current highest priority plus one. Use ``"last"`` to - set the priority to the current lowest event priority minus one. It is - important to remember that these dynamic priorities are calculated only at - the point of insertion into the emitter and they are not rearranged after - subsequent listeners are added to an emitter. - -propagation - Describes whether or not other event listeners are triggered. Event - emitters will trigger every event listener registered to a specific event - in priority order until all of the listeners have been triggered **or** - until the propagation of an event is stopped. - -Getting an EventEmitter ------------------------ - -You can get the event emitter of ``GuzzleHttp\Event\HasEmitterInterface`` -object using the the ``getEmitter()`` method. Here's an example of getting a -client object's event emitter. - -.. code-block:: php - - $client = new GuzzleHttp\Client(); - $emitter = $client->getEmitter(); - -.. note:: - - You'll notice that the event emitter used in Guzzle is very similar to the - `Symfony2 EventDispatcher component `_. - This is because the Guzzle event system is based on the Symfony2 event - system with several changes. Guzzle uses its own event emitter to improve - performance, isolate Guzzle from changes to the Symfony, and provide a few - improvements that make it easier to use for an HTTP client (e.g., the - addition of the ``once()`` method). - -Adding Event Listeners ----------------------- - -After you have the emitter, you can register event listeners that listen to -specific events using the ``on()`` method. When registering an event listener, -you must tell the emitter what event to listen to (e.g., "before", "after", -"progress", "complete", "error", etc.), what callable to invoke when the -event is triggered, and optionally provide a priority. - -.. code-block:: php - - use GuzzleHttp\Event\BeforeEvent; - - $emitter->on('before', function (BeforeEvent $event) { - echo $event->getRequest(); - }); - -When a listener is triggered, it is passed an event that implements the -``GuzzleHttp\Event\EventInterface`` interface, the name of the event, and the -event emitter itself. The above example could more verbosely be written as -follows: - -.. code-block:: php - - use GuzzleHttp\Event\BeforeEvent; - - $emitter->on('before', function ( - BeforeEvent $event, - $name, - EmitterInterface $emitter - ) { - echo $event->getRequest(); - }); - -You can add an event listener that automatically removes itself after it is -triggered using the ``once()`` method of an event emitter. - -.. code-block:: php - - $client = new GuzzleHttp\Client(); - $client->getEmitter()->once('before', function () { - echo 'This will only happen once... per request!'; - }); - -Event Propagation ------------------ - -Event listeners can prevent other event listeners from being triggered by -stopping an event's propagation. - -Stopping event propagation can be useful, for example, if an event listener has -changed the state of the subject to such an extent that allowing subsequent -event listeners to be triggered could place the subject in an inconsistent -state. This technique is used in Guzzle extensively when intercepting error -events with responses. - -You can stop the propagation of an event using the ``stopPropagation()`` method -of a ``GuzzleHttp\Event\EventInterface`` object: - -.. code-block:: php - - use GuzzleHttp\Event\ErrorEvent; - - $emitter->on('error', function (ErrorEvent $event) { - $event->stopPropagation(); - }); - -After stopping the propagation of an event, any subsequent event listeners that -have not yet been triggered will not be triggered. You can check to see if the -propagation of an event was stopped using the ``isPropagationStopped()`` method -of the event. - -.. code-block:: php - - $client = new GuzzleHttp\Client(); - $emitter = $client->getEmitter(); - // Note: assume that the $errorEvent was created - if ($emitter->emit('error', $errorEvent)->isPropagationStopped()) { - echo 'It was stopped!'; - } - -.. hint:: - - When emitting events, the event that was emitted is returned from the - emitter. This allows you to easily chain calls as shown in the above - example. - -Event Subscribers ------------------ - -Event subscribers are classes that implement the -``GuzzleHttp\Event\SubscriberInterface`` object. They are used to register -one or more event listeners to methods of the class. Event subscribers tell -event emitters exactly which events to listen to and what method to invoke on -the class when the event is triggered by called the ``getEvents()`` method of -a subscriber. - -The following example registers event listeners to the ``before`` and -``complete`` event of a request. When the ``before`` event is emitted, the -``onBefore`` instance method of the subscriber is invoked. When the -``complete`` event is emitted, the ``onComplete`` event of the subscriber is -invoked. Each array value in the ``getEvents()`` return value MUST -contain the name of the method to invoke and can optionally contain the -priority of the listener (as shown in the ``before`` listener in the example). - -.. code-block:: php - - use GuzzleHttp\Event\EmitterInterface; - use GuzzleHttp\Event\SubscriberInterface; - use GuzzleHttp\Event\BeforeEvent; - use GuzzleHttp\Event\CompleteEvent; - - class SimpleSubscriber implements SubscriberInterface - { - public function getEvents() - { - return [ - // Provide name and optional priority - 'before' => ['onBefore', 100], - 'complete' => ['onComplete'], - // You can pass a list of listeners with different priorities - 'error' => [['beforeError', 'first'], ['afterError', 'last']] - ]; - } - - public function onBefore(BeforeEvent $event, $name) - { - echo 'Before!'; - } - - public function onComplete(CompleteEvent $event, $name) - { - echo 'Complete!'; - } - } - -To register the listeners the subscriber needs to be attached to the emitter: - -.. code-block:: php - - $client = new GuzzleHttp\Client(); - $emitter = $client->getEmitter(); - $subscriber = new SimpleSubscriber(); - $emitter->attach($subscriber); - - //to remove the listeners - $emitter->detach($subscriber); - -.. note:: - - You can specify event priorities using integers or ``"first"`` and - ``"last"`` to dynamically determine the priority. - -Event Priorities -================ - -When adding event listeners or subscribers, you can provide an optional event -priority. This priority is used to determine how early or late a listener is -triggered. Specifying the correct priority is an important aspect of ensuring -a listener behaves as expected. For example, if you wanted to ensure that -cookies associated with a redirect were added to a cookie jar, you'd need to -make sure that the listener that collects the cookies is triggered before the -listener that performs the redirect. - -In order to help make the process of determining the correct event priority of -a listener easier, Guzzle provides several pre-determined named event -priorities. These priorities are exposed as constants on the -``GuzzleHttp\Event\RequestEvents`` object. - -last - Use ``"last"`` as an event priority to set the priority to the current - lowest event priority minus one. - -first - Use ``"first"`` as an event priority to set the priority to the current - highest priority plus one. - -``GuzzleHttp\Event\RequestEvents::EARLY`` - Used when you want a listener to be triggered as early as possible in the - event chain. - -``GuzzleHttp\Event\RequestEvents::LATE`` - Used when you want a listener to be to be triggered as late as possible in - the event chain. - -``GuzzleHttp\Event\RequestEvents::PREPARE_REQUEST`` - Used when you want a listener to be trigger while a request is being - prepared during the ``before`` event. This event priority is used by the - ``GuzzleHttp\Subscriber\Prepare`` event subscriber which is responsible for - guessing a Content-Type, Content-Length, and Expect header of a request. - You should subscribe after this event is triggered if you want to ensure - that this subscriber has already been triggered. - -``GuzzleHttp\Event\RequestEvents::SIGN_REQUEST`` - Used when you want a listener to be triggered when a request is about to be - signed. Any listener triggered at this point should expect that the request - object will no longer be mutated. If you are implementing a custom - signature subscriber, then you should use this event priority to sign - requests. - -``GuzzleHttp\Event\RequestEvents::VERIFY_RESPONSE`` - Used when you want a listener to be triggered when a response is being - validated during the ``complete`` event. The - ``GuzzleHttp\Subscriber\HttpError`` event subscriber uses this event - priority to check if an exception should be thrown due to a 4xx or 5xx - level response status code. If you are doing any kind of verification of a - response during the complete event, it should happen at this priority. - -``GuzzleHttp\Event\RequestEvents::REDIRECT_RESPONSE`` - Used when you want a listener to be triggered when a response is being - redirected during the ``complete`` event. The - ``GuzzleHttp\Subscriber\Redirect`` event subscriber uses this event - priority when performing redirects. - -You can use the above event priorities as a guideline for determining the -priority of you event listeners. You can use these constants and add to or -subtract from them to ensure that a listener happens before or after the named -priority. - -.. note:: - - "first" and "last" priorities are not adjusted after they added to an - emitter. For example, if you add a listener with a priority of "first", - you can still add subsequent listeners with a higher priority which would - be triggered before the listener added with a priority of "first". - -Working With Request Events -=========================== - -Requests emit lifecycle events when they are transferred. - -.. important:: - - Excluding the ``end`` event, request lifecycle events may be triggered - multiple times due to redirects, retries, or reusing a request multiple - times. Use the ``once()`` method want the event to be triggered once. You - can also remove an event listener from an emitter by using the emitter which - is provided to the listener. - -.. _before_event: - -before ------- - -The ``before`` event is emitted before a request is sent. The event emitted is -a ``GuzzleHttp\Event\BeforeEvent``. - -.. code-block:: php - - use GuzzleHttp\Client; - use GuzzleHttp\Event\EmitterInterface; - use GuzzleHttp\Event\BeforeEvent; - - $client = new Client(['base_url' => 'http://httpbin.org']); - $request = $client->createRequest('GET', '/'); - $request->getEmitter()->on( - 'before', - function (BeforeEvent $e, $name, EmitterInterface $emitter) { - echo $name . "\n"; - // "before" - echo $e->getRequest()->getMethod() . "\n"; - // "GET" / "POST" / "PUT" / etc. - echo get_class($e->getClient()); - // "GuzzleHttp\Client" - } - ); - -You can intercept a request with a response before the request is sent over the -wire. The ``intercept()`` method of the ``BeforeEvent`` accepts a -``GuzzleHttp\Message\ResponseInterface``. Intercepting the event will prevent -the request from being sent over the wire and stops the propagation of the -``before`` event, preventing subsequent event listeners from being invoked. - -.. code-block:: php - - use GuzzleHttp\Client; - use GuzzleHttp\Event\BeforeEvent; - use GuzzleHttp\Message\Response; - - $client = new Client(['base_url' => 'http://httpbin.org']); - $request = $client->createRequest('GET', '/status/500'); - $request->getEmitter()->on('before', function (BeforeEvent $e) { - $response = new Response(200); - $e->intercept($response); - }); - - $response = $client->send($request); - echo $response->getStatusCode(); - // 200 - -.. attention:: - - Any exception encountered while executing the ``before`` event will trigger - the ``error`` event of a request. - -.. _complete_event: - -complete --------- - -The ``complete`` event is emitted after a transaction completes and an entire -response has been received. The event is a ``GuzzleHttp\Event\CompleteEvent``. - -You can intercept the ``complete`` event with a different response if needed -using the ``intercept()`` method of the event. This can be useful, for example, -for changing the response for caching. - -.. code-block:: php - - use GuzzleHttp\Client; - use GuzzleHttp\Event\CompleteEvent; - use GuzzleHttp\Message\Response; - - $client = new Client(['base_url' => 'http://httpbin.org']); - $request = $client->createRequest('GET', '/status/302'); - $cachedResponse = new Response(200); - - $request->getEmitter()->on( - 'complete', - function (CompleteEvent $e) use ($cachedResponse) { - if ($e->getResponse()->getStatusCode() == 302) { - // Intercept the original transaction with the new response - $e->intercept($cachedResponse); - } - } - ); - - $response = $client->send($request); - echo $response->getStatusCode(); - // 200 - -.. attention:: - - Any ``GuzzleHttp\Exception\RequestException`` encountered while executing - the ``complete`` event will trigger the ``error`` event of a request. - -.. _error_event: - -error ------ - -The ``error`` event is emitted when a request fails (whether it's from a -networking error or an HTTP protocol error). The event emitted is a -``GuzzleHttp\Event\ErrorEvent``. - -This event is useful for retrying failed requests. Here's an example of -retrying failed basic auth requests by re-sending the original request with -a username and password. - -.. code-block:: php - - use GuzzleHttp\Client; - use GuzzleHttp\Event\ErrorEvent; - - $client = new Client(['base_url' => 'http://httpbin.org']); - $request = $client->createRequest('GET', '/basic-auth/foo/bar'); - $request->getEmitter()->on('error', function (ErrorEvent $e) { - if ($e->getResponse()->getStatusCode() == 401) { - // Add authentication stuff as needed and retry the request - $e->getRequest()->setHeader('Authorization', 'Basic ' . base64_encode('foo:bar')); - // Get the client of the event and retry the request - $newResponse = $e->getClient()->send($e->getRequest()); - // Intercept the original transaction with the new response - $e->intercept($newResponse); - } - }); - -.. attention:: - - If an ``error`` event is intercepted with a response, then the ``complete`` - event of a request is triggered. If the ``complete`` event fails, then the - ``error`` event is triggered once again. - -.. _progress_event: - -progress --------- - -The ``progress`` event is emitted when data is uploaded or downloaded. The -event emitted is a ``GuzzleHttp\Event\ProgressEvent``. - -You can access the emitted progress values using the corresponding public -properties of the event object: - -- ``$downloadSize``: The number of bytes that will be downloaded (if known) -- ``$downloaded``: The number of bytes that have been downloaded -- ``$uploadSize``: The number of bytes that will be uploaded (if known) -- ``$uploaded``: The number of bytes that have been uploaded - -This event cannot be intercepted. - -.. code-block:: php - - use GuzzleHttp\Client; - use GuzzleHttp\Event\ProgressEvent; - - $client = new Client(['base_url' => 'http://httpbin.org']); - $request = $client->createRequest('PUT', '/put', [ - 'body' => str_repeat('.', 100000) - ]); - - $request->getEmitter()->on('progress', function (ProgressEvent $e) { - echo 'Downloaded ' . $e->downloaded . ' of ' . $e->downloadSize . ' ' - . 'Uploaded ' . $e->uploaded . ' of ' . $e->uploadSize . "\r"; - }); - - $client->send($request); - echo "\n"; - -.. _end_event: - -end ---- - -The ``end`` event is a terminal event, emitted once per request, that provides -access to the response that was received or the exception that was encountered. -The event emitted is a ``GuzzleHttp\Event\EndEvent``. - -This event can be intercepted, but keep in mind that the ``complete`` event -will not fire after intercepting this event. - -.. code-block:: php - - use GuzzleHttp\Client; - use GuzzleHttp\Event\EndEvent; - - $client = new Client(['base_url' => 'http://httpbin.org']); - $request = $client->createRequest('PUT', '/put', [ - 'body' => str_repeat('.', 100000) - ]); - - $request->getEmitter()->on('end', function (EndEvent $e) { - if ($e->getException()) { - echo 'Error: ' . $e->getException()->getMessage(); - } else { - echo 'Response: ' . $e->getResponse(); - } - }); - - $client->send($request); - echo "\n"; diff --git a/core/vendor/guzzlehttp/guzzle/docs/faq.rst b/core/vendor/guzzlehttp/guzzle/docs/faq.rst deleted file mode 100644 index a8e9ad0..0000000 --- a/core/vendor/guzzlehttp/guzzle/docs/faq.rst +++ /dev/null @@ -1,199 +0,0 @@ -=== -FAQ -=== - -Why should I use Guzzle? -======================== - -Guzzle makes it easy to send HTTP requests and super simple to integrate with -web services. Guzzle manages things like persistent connections, represents -query strings as collections, makes it simple to send streaming POST requests -with fields and files, and abstracts away the underlying HTTP transport layer. -By providing an object oriented interface for HTTP clients, requests, responses, -headers, and message bodies, Guzzle makes it so that you no longer need to fool -around with cURL options, stream contexts, or sockets. - -**Asynchronous and Synchronous Requests** - -Guzzle allows you to send both asynchronous and synchronous requests using the -same interface and no direct dependency on an event loop. This flexibility -allows Guzzle to send an HTTP request using the most appropriate HTTP handler -based on the request being sent. For example, when sending synchronous -requests, Guzzle will by default send requests using cURL easy handles to -ensure you're using the fastest possible method for serially transferring HTTP -requests. When sending asynchronous requests, Guzzle might use cURL's multi -interface or any other asynchronous handler you configure. When you request -streaming data, Guzzle will by default use PHP's stream wrapper. - -**Streams** - -Request and response message bodies use :doc:`Guzzle Streams `, -allowing you to stream data without needing to load it all into memory. -Guzzle's stream layer provides a large suite of functionality: - -- You can modify streams at runtime using custom or a number of - pre-made decorators. -- You can emit progress events as data is read from a stream. -- You can validate the integrity of a stream using a rolling hash as data is - read from a stream. - -**Event System and Plugins** - -Guzzle's event system allows you to completely modify the behavior of a client -or request at runtime to cater them for any API. You can send a request with a -client, and the client can do things like automatically retry your request if -it fails, automatically redirect, log HTTP messages that are sent over the -wire, emit progress events as data is uploaded and downloaded, sign requests -using OAuth 1.0, verify the integrity of messages before and after they are -sent over the wire, and anything else you might need. - -**Testable** - -Another important aspect of Guzzle is that it's really -:doc:`easy to test clients `. You can mock HTTP responses and when -testing an handler implementation, Guzzle provides a mock node.js web server. - -**Ecosystem** - -Guzzle has a large `ecosystem of plugins `_, -including `service descriptions `_ -which allows you to abstract web services using service descriptions. These -service descriptions define how to serialize an HTTP request and how to parse -an HTTP response into a more meaningful model object. - -- `Guzzle Command `_: Provides the building - blocks for service description abstraction. -- `Guzzle Services `_: Provides an - implementation of "Guzzle Command" that utilizes Guzzle's service description - format. - -Does Guzzle require cURL? -========================= - -No. Guzzle can use any HTTP handler to send requests. This means that Guzzle -can be used with cURL, PHP's stream wrapper, sockets, and non-blocking libraries -like `React `_. You just need to configure a -`RingPHP `_ handler to use a -different method of sending requests. - -.. note:: - - Guzzle has historically only utilized cURL to send HTTP requests. cURL is - an amazing HTTP client (arguably the best), and Guzzle will continue to use - it by default when it is available. It is rare, but some developers don't - have cURL installed on their systems or run into version specific issues. - By allowing swappable HTTP handlers, Guzzle is now much more customizable - and able to adapt to fit the needs of more developers. - -Can Guzzle send asynchronous requests? -====================================== - -Yes. Pass the ``future`` true request option to a request to send it -asynchronously. Guzzle will then return a ``GuzzleHttp\Message\FutureResponse`` -object that can be used synchronously by accessing the response object like a -normal response, and it can be used asynchronously using a promise that is -notified when the response is resolved with a real response or rejected with an -exception. - -.. code-block:: php - - $request = $client->createRequest('GET', ['future' => true]); - $client->send($request)->then(function ($response) { - echo 'Got a response! ' . $response; - }); - -You can force an asynchronous response to complete using the ``wait()`` method -of a response. - -.. code-block:: php - - $request = $client->createRequest('GET', ['future' => true]); - $futureResponse = $client->send($request); - $futureResponse->wait(); - -How can I add custom cURL options? -================================== - -cURL offer a huge number of `customizable options `_. -While Guzzle normalizes many of these options across different handlers, there -are times when you need to set custom cURL options. This can be accomplished -by passing an associative array of cURL settings in the **curl** key of the -**config** request option. - -For example, let's say you need to customize the outgoing network interface -used with a client. - -.. code-block:: php - - $client->get('/', [ - 'config' => [ - 'curl' => [ - CURLOPT_INTERFACE => 'xxx.xxx.xxx.xxx' - ] - ] - ]); - -How can I add custom stream context options? -============================================ - -You can pass custom `stream context options `_ -using the **stream_context** key of the **config** request option. The -**stream_context** array is an associative array where each key is a PHP -transport, and each value is an associative array of transport options. - -For example, let's say you need to customize the outgoing network interface -used with a client and allow self-signed certificates. - -.. code-block:: php - - $client->get('/', [ - 'stream' => true, - 'config' => [ - 'stream_context' => [ - 'ssl' => [ - 'allow_self_signed' => true - ], - 'socket' => [ - 'bindto' => 'xxx.xxx.xxx.xxx' - ] - ] - ] - ]); - -Why am I getting an SSL verification error? -=========================================== - -You need to specify the path on disk to the CA bundle used by Guzzle for -verifying the peer certificate. See :ref:`verify-option`. - -What is this Maximum function nesting error? -============================================ - - Maximum function nesting level of '100' reached, aborting - -You could run into this error if you have the XDebug extension installed and -you execute a lot of requests in callbacks. This error message comes -specifically from the XDebug extension. PHP itself does not have a function -nesting limit. Change this setting in your php.ini to increase the limit:: - - xdebug.max_nesting_level = 1000 - -Why am I getting a 417 error response? -====================================== - -This can occur for a number of reasons, but if you are sending PUT, POST, or -PATCH requests with an ``Expect: 100-Continue`` header, a server that does not -support this header will return a 417 response. You can work around this by -setting the ``expect`` request option to ``false``: - -.. code-block:: php - - $client = new GuzzleHttp\Client(); - - // Disable the expect header on a single request - $response = $client->put('/', [], 'the body', [ - 'expect' => false - ]); - - // Disable the expect header on all client requests - $client->setDefaultOption('expect', false) diff --git a/core/vendor/guzzlehttp/guzzle/docs/handlers.rst b/core/vendor/guzzlehttp/guzzle/docs/handlers.rst deleted file mode 100644 index d452003..0000000 --- a/core/vendor/guzzlehttp/guzzle/docs/handlers.rst +++ /dev/null @@ -1,43 +0,0 @@ -================ -RingPHP Handlers -================ - -Guzzle uses RingPHP handlers to send HTTP requests over the wire. -RingPHP provides a low-level library that can be used to "glue" Guzzle with -any transport method you choose. By default, Guzzle utilizes cURL and PHP's -stream wrappers to send HTTP requests. - -RingPHP handlers makes it extremely simple to integrate Guzzle with any -HTTP transport. For example, you could quite easily bridge Guzzle and React -to use Guzzle in React's event loop. - -Using a handler ---------------- - -You can change the handler used by a client using the ``handler`` option in the -``GuzzleHttp\Client`` constructor. - -.. code-block:: php - - use GuzzleHttp\Client; - use GuzzleHttp\Ring\Client\MockHandler; - - // Create a mock handler that always returns a 200 response. - $handler = new MockHandler(['status' => 200]); - - // Configure to client to use the mock handler. - $client = new Client(['handler' => $handler]); - -At its core, handlers are simply PHP callables that accept a request array -and return a ``GuzzleHttp\Ring\Future\FutureArrayInterface``. This future array -can be used just like a normal PHP array, causing it to block, or you can use -the promise interface using the ``then()`` method of the future. Guzzle hooks -up to the RingPHP project using a very simple bridge class -(``GuzzleHttp\RingBridge``). - -Creating a handler ------------------- - -See the `RingPHP `_ project -documentation for more information on creating custom handlers that can be -used with Guzzle clients. diff --git a/core/vendor/guzzlehttp/guzzle/docs/http-messages.rst b/core/vendor/guzzlehttp/guzzle/docs/http-messages.rst deleted file mode 100644 index 0c6527a..0000000 --- a/core/vendor/guzzlehttp/guzzle/docs/http-messages.rst +++ /dev/null @@ -1,483 +0,0 @@ -============================= -Request and Response Messages -============================= - -Guzzle is an HTTP client that sends HTTP requests to a server and receives HTTP -responses. Both requests and responses are referred to as messages. - -Headers -======= - -Both request and response messages contain HTTP headers. - -Complex Headers ---------------- - -Some headers contain additional key value pair information. For example, Link -headers contain a link and several key value pairs: - -:: - - ; rel="thing"; type="image/jpeg" - -Guzzle provides a convenience feature that can be used to parse these types of -headers: - -.. code-block:: php - - use GuzzleHttp\Message\Request; - - $request = new Request('GET', '/', [ - 'Link' => '; rel="front"; type="image/jpeg"' - ]); - - $parsed = Request::parseHeader($request, 'Link'); - var_export($parsed); - -Will output: - -.. code-block:: php - - array ( - 0 => - array ( - 0 => '', - 'rel' => 'front', - 'type' => 'image/jpeg', - ), - ) - -The result contains a hash of key value pairs. Header values that have no key -(i.e., the link) are indexed numerically while headers parts that form a key -value pair are added as a key value pair. - -See :ref:`headers` for information on how the headers of a request and response -can be accessed and modified. - -Body -==== - -Both request and response messages can contain a body. - -You can check to see if a request or response has a body using the -``getBody()`` method: - -.. code-block:: php - - $response = GuzzleHttp\get('http://httpbin.org/get'); - if ($response->getBody()) { - echo $response->getBody(); - // JSON string: { ... } - } - -The body used in request and response objects is a -``GuzzleHttp\Stream\StreamInterface``. This stream is used for both uploading -data and downloading data. Guzzle will, by default, store the body of a message -in a stream that uses PHP temp streams. When the size of the body exceeds -2 MB, the stream will automatically switch to storing data on disk rather than -in memory (protecting your application from memory exhaustion). - -You can change the body used in a request or response using the ``setBody()`` -method: - -.. code-block:: php - - use GuzzleHttp\Stream\Stream; - $request = $client->createRequest('PUT', 'http://httpbin.org/put'); - $request->setBody(Stream::factory('foo')); - -The easiest way to create a body for a request is using the static -``GuzzleHttp\Stream\Stream::factory()`` method. This method accepts various -inputs like strings, resources returned from ``fopen()``, and other -``GuzzleHttp\Stream\StreamInterface`` objects. - -The body of a request or response can be cast to a string or you can read and -write bytes off of the stream as needed. - -.. code-block:: php - - use GuzzleHttp\Stream\Stream; - $request = $client->createRequest('PUT', 'http://httpbin.org/put', ['body' => 'testing...']); - - echo $request->getBody()->read(4); - // test - echo $request->getBody()->read(4); - // ing. - echo $request->getBody()->read(1024); - // .. - var_export($request->eof()); - // true - -You can find out more about Guzzle stream objects in :doc:`streams`. - -Requests -======== - -Requests are sent from a client to a server. Requests include the method to -be applied to a resource, the identifier of the resource, and the protocol -version to use. - -Clients are used to create request messages. More precisely, clients use -a ``GuzzleHttp\Message\MessageFactoryInterface`` to create request messages. -You create requests with a client using the ``createRequest()`` method. - -.. code-block:: php - - // Create a request but don't send it immediately - $request = $client->createRequest('GET', 'http://httpbin.org/get'); - -Request Methods ---------------- - -When creating a request, you are expected to provide the HTTP method you wish -to perform. You can specify any method you'd like, including a custom method -that might not be part of RFC 7231 (like "MOVE"). - -.. code-block:: php - - // Create a request using a completely custom HTTP method - $request = $client->createRequest('MOVE', 'http://httpbin.org/move', ['exceptions' => false]); - - echo $request->getMethod(); - // MOVE - - $response = $client->send($request); - echo $response->getStatusCode(); - // 405 - -You can create and send a request using methods on a client that map to the -HTTP method you wish to use. - -:GET: ``$client->get('http://httpbin.org/get', [/** options **/])`` -:POST: ``$client->post('http://httpbin.org/post', [/** options **/])`` -:HEAD: ``$client->head('http://httpbin.org/get', [/** options **/])`` -:PUT: ``$client->put('http://httpbin.org/put', [/** options **/])`` -:DELETE: ``$client->delete('http://httpbin.org/delete', [/** options **/])`` -:OPTIONS: ``$client->options('http://httpbin.org/get', [/** options **/])`` -:PATCH: ``$client->patch('http://httpbin.org/put', [/** options **/])`` - -.. code-block:: php - - $response = $client->patch('http://httpbin.org/patch', ['body' => 'content']); - -Request URI ------------ - -The resource you are requesting with an HTTP request is identified by the -path of the request, the query string, and the "Host" header of the request. - -When creating a request, you can provide the entire resource URI as a URL. - -.. code-block:: php - - $response = $client->get('http://httbin.org/get?q=foo'); - -Using the above code, you will send a request that uses ``httpbin.org`` as -the Host header, sends the request over port 80, uses ``/get`` as the path, -and sends ``?q=foo`` as the query string. All of this is parsed automatically -from the provided URI. - -Sometimes you don't know what the entire request will be when it is created. -In these cases, you can modify the request as needed before sending it using -the ``createRequest()`` method of the client and methods on the request that -allow you to change it. - -.. code-block:: php - - $request = $client->createRequest('GET', 'http://httbin.org'); - -You can change the path of the request using ``setPath()``: - -.. code-block:: php - - $request->setPath('/get'); - echo $request->getPath(); - // /get - echo $request->getUrl(); - // http://httpbin.com/get - -Scheme -~~~~~~ - -The `scheme `_ of a request -specifies the protocol to use when sending the request. When using Guzzle, the -scheme can be set to "http" or "https". - -You can change the scheme of the request using the ``setScheme()`` method: - -.. code-block:: php - - $request = $client->createRequest('GET', 'http://httbin.org'); - $request->setScheme('https'); - echo $request->getScheme(); - // https - echo $request->getUrl(); - // https://httpbin.com/get - -Port -~~~~ - -No port is necessary when using the "http" or "https" schemes, but you can -override the port using ``setPort()``. If you need to modify the port used with -the specified scheme from the default setting, then you must use the -``setPort()`` method. - -.. code-block:: php - - $request = $client->createRequest('GET', 'http://httbin.org'); - $request->setPort(8080); - echo $request->getPort(); - // 8080 - echo $request->getUrl(); - // https://httpbin.com:8080/get - - // Set the port back to the default value for the scheme - $request->setPort(443); - echo $request->getUrl(); - // https://httpbin.com/get - -Query string -~~~~~~~~~~~~ - -You can get the query string of the request using the ``getQuery()`` method. -This method returns a ``GuzzleHttp\Query`` object. A Query object can be -accessed like a PHP array, iterated in a foreach statement like a PHP array, -and cast to a string. - -.. code-block:: php - - $request = $client->createRequest('GET', 'http://httbin.org'); - $query = $request->getQuery(); - $query['foo'] = 'bar'; - $query['baz'] = 'bam'; - $query['bam'] = ['test' => 'abc']; - - echo $request->getQuery(); - // foo=bar&baz=bam&bam%5Btest%5D=abc - - echo $request->getQuery()['foo']; - // bar - echo $request->getQuery()->get('foo'); - // bar - echo $request->getQuery()->get('foo'); - // bar - - var_export($request->getQuery()['bam']); - // array('test' => 'abc') - - foreach ($query as $key => $value) { - var_export($value); - } - - echo $request->getUrl(); - // https://httpbin.com/get?foo=bar&baz=bam&bam%5Btest%5D=abc - -Query Aggregators -^^^^^^^^^^^^^^^^^ - -Query objects can store scalar values or arrays of values. When an array of -values is added to a query object, the query object uses a query aggregator to -convert the complex structure into a string. Query objects will use -`PHP style query strings `_ when complex -query string parameters are converted to a string. You can customize how -complex query string parameters are aggregated using the ``setAggregator()`` -method of a query string object. - -.. code-block:: php - - $query->setAggregator($query::duplicateAggregator()); - -In the above example, we've changed the query object to use the -"duplicateAggregator". This aggregator will allow duplicate entries to appear -in a query string rather than appending "[n]" to each value. So if you had a -query string with ``['a' => ['b', 'c']]``, the duplicate aggregator would -convert this to "a=b&a=c" while the default aggregator would convert this to -"a[0]=b&a[1]=c" (with urlencoded brackets). - -The ``setAggregator()`` method accepts a ``callable`` which is used to convert -a deeply nested array of query string variables into a flattened array of key -value pairs. The callable accepts an array of query data and returns a -flattened array of key value pairs where each value is an array of strings. -You can use the ``GuzzleHttp\Query::walkQuery()`` static function to easily -create custom query aggregators. - -Host -~~~~ - -You can change the host header of the request in a predictable way using the -``setHost()`` method of a request: - -.. code-block:: php - - $request->setHost('www.google.com'); - echo $request->getHost(); - // www.google.com - echo $request->getUrl(); - // https://www.google.com/get?foo=bar&baz=bam - -.. note:: - - The Host header can also be changed by modifying the Host header of a - request directly, but modifying the Host header directly could result in - sending a request to a different Host than what is specified in the Host - header (sometimes this is actually the desired behavior). - -Resource -~~~~~~~~ - -You can use the ``getResource()`` method of a request to return the path and -query string of a request in a single string. - -.. code-block:: php - - $request = $client->createRequest('GET', 'http://httpbin.org/get?baz=bar'); - echo $request->getResource(); - // /get?baz=bar - -Request Config --------------- - -Request messages contain a configuration collection that can be used by -event listeners and HTTP handlers to modify how a request behaves or is -transferred over the wire. For example, many of the request options that are -specified when creating a request are actually set as config options that are -only acted upon by handlers and listeners when the request is sent. - -You can get access to the request's config object using the ``getConfig()`` -method of a request. - -.. code-block:: php - - $request = $client->createRequest('GET', '/'); - $config = $request->getConfig(); - -The config object is a ``GuzzleHttp\Collection`` object that acts like -an associative array. You can grab values from the collection using array like -access. You can also modify and remove values using array like access. - -.. code-block:: php - - $config['foo'] = 'bar'; - echo $config['foo']; - // bar - - var_export(isset($config['foo'])); - // true - - unset($config['foo']); - var_export(isset($config['foo'])); - // false - - var_export($config['foo']); - // NULL - -HTTP handlers and event listeners can expose additional customization options -through request config settings. For example, in order to specify custom cURL -options to the cURL handler, you need to specify an associative array in the -``curl`` ``config`` request option. - -.. code-block:: php - - $client->get('/', [ - 'config' => [ - 'curl' => [ - CURLOPT_HTTPAUTH => CURLAUTH_NTLM, - CURLOPT_USERPWD => 'username:password' - ] - ] - ]); - -Consult the HTTP handlers and event listeners you are using to see if they -allow customization through request configuration options. - -Event Emitter -------------- - -Request objects implement ``GuzzleHttp\Event\HasEmitterInterface``, so they -have a method called ``getEmitter()`` that can be used to get an event emitter -used by the request. Any listener or subscriber attached to a request will only -be triggered for the lifecycle events of a specific request. Conversely, adding -an event listener or subscriber to a client will listen to all lifecycle events -of all requests created by the client. - -See :doc:`events` for more information. - -Responses -========= - -Responses are the HTTP messages a client receives from a server after sending -an HTTP request message. - -Start-Line ----------- - -The start-line of a response contains the protocol and protocol version, -status code, and reason phrase. - -.. code-block:: php - - $response = GuzzleHttp\get('http://httpbin.org/get'); - echo $response->getStatusCode(); - // 200 - echo $response->getReasonPhrase(); - // OK - echo $response->getProtocolVersion(); - // 1.1 - -Body ----- - -As described earlier, you can get the body of a response using the -``getBody()`` method. - -.. code-block:: php - - if ($body = $response->getBody()) { - echo $body; - // Cast to a string: { ... } - $body->seek(0); - // Rewind the body - $body->read(1024); - // Read bytes of the body - } - -When working with JSON responses, you can use the ``json()`` method of a -response: - -.. code-block:: php - - $json = $response->json(); - -.. note:: - - Guzzle uses the ``json_decode()`` method of PHP and uses arrays rather than - ``stdClass`` objects for objects. - -You can use the ``xml()`` method when working with XML data. - -.. code-block:: php - - $xml = $response->xml(); - -.. note:: - - Guzzle uses the ``SimpleXMLElement`` objects when converting response - bodies to XML. - -Effective URL -------------- - -The URL that was ultimately accessed that returned a response can be accessed -using the ``getEffectiveUrl()`` method of a response. This method will return -the URL of a request or the URL of the last redirected URL if any redirects -occurred while transferring a request. - -.. code-block:: php - - $response = GuzzleHttp\get('http://httpbin.org/get'); - echo $response->getEffectiveUrl(); - // http://httpbin.org/get - - $response = GuzzleHttp\get('http://httpbin.org/redirect-to?url=http://www.google.com'); - echo $response->getEffectiveUrl(); - // http://www.google.com diff --git a/core/vendor/guzzlehttp/guzzle/docs/index.rst b/core/vendor/guzzlehttp/guzzle/docs/index.rst deleted file mode 100644 index d456a5f..0000000 --- a/core/vendor/guzzlehttp/guzzle/docs/index.rst +++ /dev/null @@ -1,98 +0,0 @@ -.. title:: Guzzle | PHP HTTP client and framework for consuming RESTful web services - -====== -Guzzle -====== - -Guzzle is a PHP HTTP client that makes it easy to send HTTP requests and -trivial to integrate with web services. - -- Manages things like persistent connections, represents query strings as - collections, simplifies sending streaming POST requests with fields and - files, and abstracts away the underlying HTTP transport layer. -- Can send both synchronous and asynchronous requests using the same interface - without requiring a dependency on a specific event loop. -- Pluggable HTTP handlers allows Guzzle to integrate with any method you choose - for sending HTTP requests over the wire (e.g., cURL, sockets, PHP's stream - wrapper, non-blocking event loops like `React `_, etc.). -- Guzzle makes it so that you no longer need to fool around with cURL options, - stream contexts, or sockets. - -.. code-block:: php - - $client = new GuzzleHttp\Client(); - $response = $client->get('http://guzzlephp.org'); - $res = $client->get('https://api.github.com/user', ['auth' => ['user', 'pass']]); - echo $res->getStatusCode(); - // "200" - echo $res->getHeader('content-type'); - // 'application/json; charset=utf8' - echo $res->getBody(); - // {"type":"User"...' - var_export($res->json()); - // Outputs the JSON decoded data - - // Send an asynchronous request. - $req = $client->createRequest('GET', 'http://httpbin.org', ['future' => true]); - $client->send($req)->then(function ($response) { - echo 'I completed! ' . $response; - }); - -User guide ----------- - -.. toctree:: - :maxdepth: 2 - - overview - quickstart - clients - http-messages - events - streams - handlers - testing - faq - -HTTP Components ---------------- - -There are a number of optional libraries you can use along with Guzzle's HTTP -layer to add capabilities to the client. - -`Log Subscriber `_ - Logs HTTP requests and responses sent over the wire using customizable - log message templates. - -`OAuth Subscriber `_ - Signs requests using OAuth 1.0. - -`Cache Subscriber `_ - Implements a private transparent proxy cache that caches HTTP responses. - -`Retry Subscriber `_ - Retries failed requests using customizable retry strategies (e.g., retry - based on response status code, cURL error codes, etc.) - -`Message Integrity Subscriber `_ - Verifies the message integrity of HTTP responses using customizable - validators. This plugin can be used, for example, to verify the Content-MD5 - headers of responses. - -Service Description Commands ----------------------------- - -You can use the **Guzzle Command** library to encapsulate interaction with a -web service using command objects. Building on top of Guzzle's command -abstraction allows you to easily implement things like service description that -can be used to serialize requests and parse responses using a meta-description -of a web service. - -`Guzzle Command `_ - Provides the foundational elements used to build high-level, command based, - web service clients with Guzzle. - -`Guzzle Services `_ - Provides an implementation of the *Guzzle Command* library that uses - Guzzle service descriptions to describe web services, serialize requests, - and parse responses into easy to use model structures. diff --git a/core/vendor/guzzlehttp/guzzle/docs/overview.rst b/core/vendor/guzzlehttp/guzzle/docs/overview.rst deleted file mode 100644 index 1355afa..0000000 --- a/core/vendor/guzzlehttp/guzzle/docs/overview.rst +++ /dev/null @@ -1,150 +0,0 @@ -======== -Overview -======== - -Requirements -============ - -#. PHP 5.4.0 -#. To use the PHP stream handler, ``allow_url_fopen`` must be enabled in your - system's php.ini. -#. To use the cURL handler, you must have a recent version of cURL >= 7.16.2 - compiled with OpenSSL and zlib. - -.. note:: - - Guzzle no longer requires cURL in order to send HTTP requests. Guzzle will - use the PHP stream wrapper to send HTTP requests if cURL is not installed. - Alternatively, you can provide your own HTTP handler used to send requests. - -.. _installation: - -Installation -============ - -The recommended way to install Guzzle is with `Composer `_. Composer is a dependency -management tool for PHP that allows you to declare the dependencies your project needs and installs them into your -project. - -.. code-block:: bash - - # Install Composer - curl -sS https://getcomposer.org/installer | php - -You can add Guzzle as a dependency using the composer.phar CLI: - -.. code-block:: bash - - php composer.phar require guzzlehttp/guzzle:~5.0 - -Alternatively, you can specify Guzzle as a dependency in your project's -existing composer.json file: - -.. code-block:: js - - { - "require": { - "guzzlehttp/guzzle": "~5.0" - } - } - -After installing, you need to require Composer's autoloader: - -.. code-block:: php - - require 'vendor/autoload.php'; - -You can find out more on how to install Composer, configure autoloading, and -other best-practices for defining dependencies at `getcomposer.org `_. - -Bleeding edge -------------- - -During your development, you can keep up with the latest changes on the master -branch by setting the version requirement for Guzzle to ``~5.0@dev``. - -.. code-block:: js - - { - "require": { - "guzzlehttp/guzzle": "~5.0@dev" - } - } - -License -======= - -Licensed using the `MIT license `_. - - Copyright (c) 2014 Michael Dowling - - 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. - -Contributing -============ - -Guidelines ----------- - -1. Guzzle follows PSR-0, PSR-1, and PSR-2. -2. Guzzle is meant to be lean and fast with very few dependencies. -3. Guzzle has a minimum PHP version requirement of PHP 5.4. Pull requests must - not require a PHP version greater than PHP 5.4. -4. All pull requests must include unit tests to ensure the change works as - expected and to prevent regressions. - -Running the tests ------------------ - -In order to contribute, you'll need to checkout the source from GitHub and -install Guzzle's dependencies using Composer: - -.. code-block:: bash - - git clone https://github.com/guzzle/guzzle.git - cd guzzle && curl -s http://getcomposer.org/installer | php && ./composer.phar install --dev - -Guzzle is unit tested with PHPUnit. Run the tests using the vendored PHPUnit -binary: - -.. code-block:: bash - - vendor/bin/phpunit - -.. note:: - - You'll need to install node.js v0.5.0 or newer in order to perform - integration tests on Guzzle's HTTP handlers. - -Reporting a security vulnerability -================================== - -We want to ensure that Guzzle is a secure HTTP client library for everyone. If -you've discovered a security vulnerability in Guzzle, we appreciate your help -in disclosing it to us in a `responsible manner `_. - -Publicly disclosing a vulnerability can put the entire community at risk. If -you've discovered a security concern, please email us at -security@guzzlephp.org. We'll work with you to make sure that we understand the -scope of the issue, and that we fully address your concern. We consider -correspondence sent to security@guzzlephp.org our highest priority, and work to -address any issues that arise as quickly as possible. - -After a security vulnerability has been corrected, a security hotfix release will -be deployed as soon as possible. diff --git a/core/vendor/guzzlehttp/guzzle/docs/quickstart.rst b/core/vendor/guzzlehttp/guzzle/docs/quickstart.rst deleted file mode 100644 index 65a70ed..0000000 --- a/core/vendor/guzzlehttp/guzzle/docs/quickstart.rst +++ /dev/null @@ -1,448 +0,0 @@ -========== -Quickstart -========== - -This page provides a quick introduction to Guzzle and introductory examples. -If you have not already installed, Guzzle, head over to the :ref:`installation` -page. - -Make a Request -============== - -You can send requests with Guzzle using a ``GuzzleHttp\ClientInterface`` -object. - -Creating a Client ------------------ - -The procedural API is simple but not very testable; it's best left for quick -prototyping. If you want to use Guzzle in a more flexible and testable way, -then you'll need to use a ``GuzzleHttp\ClientInterface`` object. - -.. code-block:: php - - use GuzzleHttp\Client; - - $client = new Client(); - $response = $client->get('http://httpbin.org/get'); - - // You can use the same methods you saw in the procedural API - $response = $client->delete('http://httpbin.org/delete'); - $response = $client->head('http://httpbin.org/get'); - $response = $client->options('http://httpbin.org/get'); - $response = $client->patch('http://httpbin.org/patch'); - $response = $client->post('http://httpbin.org/post'); - $response = $client->put('http://httpbin.org/put'); - -You can create a request with a client and then send the request with the -client when you're ready. - -.. code-block:: php - - $request = $client->createRequest('GET', 'http://www.foo.com'); - $response = $client->send($request); - -Client objects provide a great deal of flexibility in how request are -transferred including default request options, subscribers that are attached -to each request, and a base URL that allows you to send requests with relative -URLs. You can find out all about clients in the :doc:`clients` page of the -documentation. - -Using Responses -=============== - -In the previous examples, we retrieved a ``$response`` variable. This value is -actually a ``GuzzleHttp\Message\ResponseInterface`` object and contains lots -of helpful information. - -You can get the status code and reason phrase of the response. - -.. code-block:: php - - $code = $response->getStatusCode(); - // 200 - - $reason = $response->getReasonPhrase(); - // OK - -By providing the ``future`` request option to a request, you can send requests -asynchronously using the promise interface of a future response. - -.. code-block:: php - - $client->get('http://httpbin.org', ['future' => true]) - ->then(function ($response) { - echo $response->getStatusCode(); - }); - -Response Body -------------- - -The body of a response can be retrieved and cast to a string. - -.. code-block:: php - - $body = $response->getBody(); - echo $body; - // { "some_json_data" ...} - -You can also read read bytes from body of a response like a stream. - -.. code-block:: php - - $body = $response->getBody(); - - while (!$body->eof()) { - echo $body->read(1024); - } - -JSON Responses -~~~~~~~~~~~~~~ - -You can more easily work with JSON responses using the ``json()`` method of a -response. - -.. code-block:: php - - $response = $client->get('http://httpbin.org/get'); - $json = $response->json(); - var_dump($json[0]['origin']); - -Guzzle internally uses PHP's ``json_decode()`` function to parse responses. If -Guzzle is unable to parse the JSON response body, then a -``GuzzleHttp\Exception\ParseException`` is thrown. - -XML Responses -~~~~~~~~~~~~~ - -You can use a response's ``xml()`` method to more easily work with responses -that contain XML data. - -.. code-block:: php - - $response = $client->get('https://github.com/mtdowling.atom'); - $xml = $response->xml(); - echo $xml->id; - // tag:github.com,2008:/mtdowling - -Guzzle internally uses a ``SimpleXMLElement`` object to parse responses. If -Guzzle is unable to parse the XML response body, then a -``GuzzleHttp\Exception\ParseException`` is thrown. - -Query String Parameters -======================= - -Sending query string parameters with a request is easy. You can set query -string parameters in the request's URL. - -.. code-block:: php - - $response = $client->get('http://httpbin.org?foo=bar'); - -You can also specify the query string parameters using the ``query`` request -option. - -.. code-block:: php - - $client->get('http://httpbin.org', [ - 'query' => ['foo' => 'bar'] - ]); - -And finally, you can build up the query string of a request as needed by -calling the ``getQuery()`` method of a request and modifying the request's -``GuzzleHttp\Query`` object as needed. - -.. code-block:: php - - $request = $client->createRequest('GET', 'http://httpbin.org'); - $query = $request->getQuery(); - $query->set('foo', 'bar'); - - // You can use the query string object like an array - $query['baz'] = 'bam'; - - // The query object can be cast to a string - echo $query; - // foo=bar&baz=bam - - // Setting a value to false or null will cause the "=" sign to be omitted - $query['empty'] = null; - echo $query; - // foo=bar&baz=bam&empty - - // Use an empty string to include the "=" sign with an empty value - $query['empty'] = ''; - echo $query; - // foo=bar&baz=bam&empty= - -.. _headers: - -Request and Response Headers ----------------------------- - -You can specify request headers when sending or creating requests with a -client. In the following example, we send the ``X-Foo-Header`` with a value of -``value`` by setting the ``headers`` request option. - -.. code-block:: php - - $response = $client->get('http://httpbin.org/get', [ - 'headers' => ['X-Foo-Header' => 'value'] - ]); - -You can view the headers of a response using header specific methods of a -response class. Headers work exactly the same way for request and response -object. - -You can retrieve a header from a request or response using the ``getHeader()`` -method of the object. This method is case-insensitive and by default will -return a string containing the header field value. - -.. code-block:: php - - $response = $client->get('http://www.yahoo.com'); - $length = $response->getHeader('Content-Length'); - -Header fields that contain multiple values can be retrieved as a string or as -an array. Retrieving the field values as a string will naively concatenate all -of the header values together with a comma. Because not all header fields -should be represented this way (e.g., ``Set-Cookie``), you can pass an optional -flag to the ``getHeader()`` method to retrieve the header values as an array. - -.. code-block:: php - - $values = $response->getHeader('Set-Cookie', true); - foreach ($values as $value) { - echo $value; - } - -You can test if a request or response has a specific header using the -``hasHeader()`` method. This method accepts a case-insensitive string and -returns true if the header is present or false if it is not. - -You can retrieve all of the headers of a message using the ``getHeaders()`` -method of a request or response. The return value is an associative array where -the keys represent the header name as it will be sent over the wire, and each -value is an array of strings associated with the header. - -.. code-block:: php - - $headers = $response->getHeaders(); - foreach ($message->getHeaders() as $name => $values) { - echo $name . ": " . implode(", ", $values); - } - -Modifying headers ------------------ - -The headers of a message can be modified using the ``setHeader()``, -``addHeader()``, ``setHeaders()``, and ``removeHeader()`` methods of a request -or response object. - -.. code-block:: php - - $request = $client->createRequest('GET', 'http://httpbin.org/get'); - - // Set a single value for a header - $request->setHeader('User-Agent', 'Testing!'); - - // Set multiple values for a header in one call - $request->setHeader('X-Foo', ['Baz', 'Bar']); - - // Add a header to the message - $request->addHeader('X-Foo', 'Bam'); - - echo $request->getHeader('X-Foo'); - // Baz, Bar, Bam - - // Remove a specific header using a case-insensitive name - $request->removeHeader('x-foo'); - echo $request->getHeader('X-Foo'); - // Echoes an empty string: '' - -Uploading Data -============== - -Guzzle provides several methods of uploading data. - -You can send requests that contain a stream of data by passing a string, -resource returned from ``fopen``, or a ``GuzzleHttp\Stream\StreamInterface`` -object to the ``body`` request option. - -.. code-block:: php - - $r = $client->post('http://httpbin.org/post', ['body' => 'raw data']); - -You can easily upload JSON data using the ``json`` request option. - -.. code-block:: php - - $r = $client->put('http://httpbin.org/put', ['json' => ['foo' => 'bar']]); - -POST Requests -------------- - -In addition to specifying the raw data of a request using the ``body`` request -option, Guzzle provides helpful abstractions over sending POST data. - -Sending POST Fields -~~~~~~~~~~~~~~~~~~~ - -Sending ``application/x-www-form-urlencoded`` POST requests requires that you -specify the body of a POST request as an array. - -.. code-block:: php - - $response = $client->post('http://httpbin.org/post', [ - 'body' => [ - 'field_name' => 'abc', - 'other_field' => '123' - ] - ]); - -You can also build up POST requests before sending them. - -.. code-block:: php - - $request = $client->createRequest('POST', 'http://httpbin.org/post'); - $postBody = $request->getBody(); - - // $postBody is an instance of GuzzleHttp\Post\PostBodyInterface - $postBody->setField('foo', 'bar'); - echo $postBody->getField('foo'); - // 'bar' - - echo json_encode($postBody->getFields()); - // {"foo": "bar"} - - // Send the POST request - $response = $client->send($request); - -Sending POST Files -~~~~~~~~~~~~~~~~~~ - -Sending ``multipart/form-data`` POST requests (POST requests that contain -files) is the same as sending ``application/x-www-form-urlencoded``, except -some of the array values of the POST fields map to PHP ``fopen`` resources, or -``GuzzleHttp\Stream\StreamInterface``, or -``GuzzleHttp\Post\PostFileInterface`` objects. - -.. code-block:: php - - use GuzzleHttp\Post\PostFile; - - $response = $client->post('http://httpbin.org/post', [ - 'body' => [ - 'field_name' => 'abc', - 'file_filed' => fopen('/path/to/file', 'r'), - 'other_file' => new PostFile('other_file', 'this is the content') - ] - ]); - -Just like when sending POST fields, you can also build up POST requests with -files before sending them. - -.. code-block:: php - - use GuzzleHttp\Post\PostFile; - - $request = $client->createRequest('POST', 'http://httpbin.org/post'); - $postBody = $request->getBody(); - $postBody->setField('foo', 'bar'); - $postBody->addFile(new PostFile('test', fopen('/path/to/file', 'r'))); - $response = $client->send($request); - -Cookies -======= - -Guzzle can maintain a cookie session for you if instructed using the -``cookies`` request option. - -- Set to ``true`` to use a shared cookie session associated with the client. -- Pass an associative array containing cookies to send in the request and start - a new cookie session. -- Set to a ``GuzzleHttp\Subscriber\CookieJar\CookieJarInterface`` object to use - an existing cookie jar. - -Redirects -========= - -Guzzle will automatically follow redirects unless you tell it not to. You can -customize the redirect behavior using the ``allow_redirects`` request option. - -- Set to true to enable normal redirects with a maximum number of 5 redirects. - This is the default setting. -- Set to false to disable redirects. -- Pass an associative array containing the 'max' key to specify the maximum - number of redirects and optionally provide a 'strict' key value to specify - whether or not to use strict RFC compliant redirects (meaning redirect POST - requests with POST requests vs. doing what most browsers do which is - redirect POST requests with GET requests). - -.. code-block:: php - - $response = $client->get('http://github.com'); - echo $response->getStatusCode(); - // 200 - echo $response->getEffectiveUrl(); - // 'https://github.com/' - -The following example shows that redirects can be disabled. - -.. code-block:: php - - $response = $client->get('http://github.com', ['allow_redirects' => false]); - echo $response->getStatusCode(); - // 301 - echo $response->getEffectiveUrl(); - // 'http://github.com/' - -Exceptions -========== - -Guzzle throws exceptions for errors that occur during a transfer. - -- In the event of a networking error (connection timeout, DNS errors, etc.), - a ``GuzzleHttp\Exception\RequestException`` is thrown. This exception - extends from ``GuzzleHttp\Exception\TransferException``. Catching this - exception will catch any exception that can be thrown while transferring - (non-parallel) requests. - - .. code-block:: php - - use GuzzleHttp\Exception\RequestException; - - try { - $client->get('https://github.com/_abc_123_404'); - } catch (RequestException $e) { - echo $e->getRequest(); - if ($e->hasResponse()) { - echo $e->getResponse(); - } - } - -- A ``GuzzleHttp\Exception\ClientException`` is thrown for 400 - level errors if the ``exceptions`` request option is set to true. This - exception extends from ``GuzzleHttp\Exception\BadResponseException`` and - ``GuzzleHttp\Exception\BadResponseException`` extends from - ``GuzzleHttp\Exception\RequestException``. - - .. code-block:: php - - use GuzzleHttp\Exception\ClientException; - - try { - $client->get('https://github.com/_abc_123_404'); - } catch (ClientException $e) { - echo $e->getRequest(); - echo $e->getResponse(); - } - -- A ``GuzzleHttp\Exception\ServerException`` is thrown for 500 level - errors if the ``exceptions`` request option is set to true. This - exception extends from ``GuzzleHttp\Exception\BadResponseException``. -- A ``GuzzleHttp\Exception\TooManyRedirectsException`` is thrown when too - many redirects are followed. This exception extends from ``GuzzleHttp\Exception\RequestException``. - -All of the above exceptions extend from -``GuzzleHttp\Exception\TransferException``. diff --git a/core/vendor/guzzlehttp/guzzle/docs/requirements.txt b/core/vendor/guzzlehttp/guzzle/docs/requirements.txt deleted file mode 100644 index fe7a4ea..0000000 --- a/core/vendor/guzzlehttp/guzzle/docs/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -Sphinx>=1.2b1 -guzzle_sphinx_theme>=0.6.0 diff --git a/core/vendor/guzzlehttp/guzzle/docs/streams.rst b/core/vendor/guzzlehttp/guzzle/docs/streams.rst deleted file mode 100644 index 8fe9a69..0000000 --- a/core/vendor/guzzlehttp/guzzle/docs/streams.rst +++ /dev/null @@ -1,213 +0,0 @@ -======= -Streams -======= - -Guzzle uses stream objects to represent request and response message bodies. -These stream objects allow you to work with various types of data all using a -common interface. - -HTTP messages consist of a start-line, headers, and a body. The body of an HTTP -message can be very small or extremely large. Attempting to represent the body -of a message as a string can easily consume more memory than intended because -the body must be stored completely in memory. Attempting to store the body of a -request or response in memory would preclude the use of that implementation from -being able to work with large message bodies. The StreamInterface is used in -order to hide the implementation details of where a stream of data is read from -or written to. - -Guzzle's StreamInterface exposes several methods that enable streams to be read -from, written to, and traversed effectively. - -Streams expose their capabilities using three methods: ``isReadable()``, -``isWritable()``, and ``isSeekable()``. These methods can be used by stream -collaborators to determine if a stream is capable of their requirements. - -Each stream instance has various capabilities: they can be read-only, -write-only, read-write, allow arbitrary random access (seeking forwards or -backwards to any location), or only allow sequential access (for example in the -case of a socket or pipe). - -Creating Streams -================ - -The best way to create a stream is using the static factory method, -``GuzzleHttp\Stream\Stream::factory()``. This factory accepts strings, -resources returned from ``fopen()``, an object that implements -``__toString()``, and an object that implements -``GuzzleHttp\Stream\StreamInterface``. - -.. code-block:: php - - use GuzzleHttp\Stream\Stream; - - $stream = Stream::factory('string data'); - echo $stream; - // string data - echo $stream->read(3); - // str - echo $stream->getContents(); - // ing data - var_export($stream->eof()); - // true - var_export($stream->tell()); - // 11 - -Metadata -======== - -Guzzle streams expose stream metadata through the ``getMetadata()`` method. -This method provides the data you would retrieve when calling PHP's -`stream_get_meta_data() function `_, -and can optionally expose other custom data. - -.. code-block:: php - - use GuzzleHttp\Stream\Stream; - - $resource = fopen('/path/to/file', 'r'); - $stream = Stream::factory($resource); - echo $stream->getMetadata('uri'); - // /path/to/file - var_export($stream->isReadable()); - // true - var_export($stream->isWritable()); - // false - var_export($stream->isSeekable()); - // true - -Stream Decorators -================= - -With the small and focused interface, add custom functionality to streams is -very simple with stream decorators. Guzzle provides several built-in decorators -that provide additional stream functionality. - -CachingStream -------------- - -The CachingStream is used to allow seeking over previously read bytes on -non-seekable streams. This can be useful when transferring a non-seekable -entity body fails due to needing to rewind the stream (for example, resulting -from a redirect). Data that is read from the remote stream will be buffered in -a PHP temp stream so that previously read bytes are cached first in memory, -then on disk. - -.. code-block:: php - - use GuzzleHttp\Stream\Stream; - use GuzzleHttp\Stream\CachingStream; - - $original = Stream::factory(fopen('http://www.google.com', 'r')); - $stream = new CachingStream($original); - - $stream->read(1024); - echo $stream->tell(); - // 1024 - - $stream->seek(0); - echo $stream->tell(); - // 0 - -LimitStream ------------ - -LimitStream can be used to read a subset or slice of an existing stream object. -This can be useful for breaking a large file into smaller pieces to be sent in -chunks (e.g. Amazon S3's multipart upload API). - -.. code-block:: php - - use GuzzleHttp\Stream\Stream; - use GuzzleHttp\Stream\LimitStream; - - $original = Stream::factory(fopen('/tmp/test.txt', 'r+')); - echo $original->getSize(); - // >>> 1048576 - - // Limit the size of the body to 1024 bytes and start reading from byte 2048 - $stream = new LimitStream($original, 1024, 2048); - echo $stream->getSize(); - // >>> 1024 - echo $stream->tell(); - // >>> 0 - -NoSeekStream ------------- - -NoSeekStream wraps a stream and does not allow seeking. - -.. code-block:: php - - use GuzzleHttp\Stream\Stream; - use GuzzleHttp\Stream\LimitStream; - - $original = Stream::factory('foo'); - $noSeek = new NoSeekStream($original); - - echo $noSeek->read(3); - // foo - var_export($noSeek->isSeekable()); - // false - $noSeek->seek(0); - var_export($noSeek->read(3)); - // NULL - -Creating Custom Decorators --------------------------- - -Creating a stream decorator is very easy thanks to the -``GuzzleHttp\Stream\StreamDecoratorTrait``. This trait provides methods that -implement ``GuzzleHttp\Stream\StreamInterface`` by proxying to an underlying -stream. Just ``use`` the ``StreamDecoratorTrait`` and implement your custom -methods. - -For example, let's say we wanted to call a specific function each time the last -byte is read from a stream. This could be implemented by overriding the -``read()`` method. - -.. code-block:: php - - use GuzzleHttp\Stream\StreamDecoratorTrait; - - class EofCallbackStream implements StreamInterface - { - use StreamDecoratorTrait; - - private $callback; - - public function __construct(StreamInterface $stream, callable $callback) - { - $this->stream = $stream; - $this->callback = $callback; - } - - public function read($length) - { - $result = $this->stream->read($length); - - // Invoke the callback when EOF is hit. - if ($this->eof()) { - call_user_func($this->callback); - } - - return $result; - } - } - -This decorator could be added to any existing stream and used like so: - -.. code-block:: php - - use GuzzleHttp\Stream\Stream; - - $original = Stream::factory('foo'); - $eofStream = new EofCallbackStream($original, function () { - echo 'EOF!'; - }); - - $eofStream->read(2); - $eofStream->read(1); - // echoes "EOF!" - $eofStream->seek(0); - $eofStream->read(3); - // echoes "EOF!" diff --git a/core/vendor/guzzlehttp/guzzle/docs/testing.rst b/core/vendor/guzzlehttp/guzzle/docs/testing.rst deleted file mode 100644 index e7098be..0000000 --- a/core/vendor/guzzlehttp/guzzle/docs/testing.rst +++ /dev/null @@ -1,232 +0,0 @@ -====================== -Testing Guzzle Clients -====================== - -Guzzle provides several tools that will enable you to easily mock the HTTP -layer without needing to send requests over the internet. - -* Mock subscriber -* Mock handler -* Node.js web server for integration testing - -Mock Subscriber -=============== - -When testing HTTP clients, you often need to simulate specific scenarios like -returning a successful response, returning an error, or returning specific -responses in a certain order. Because unit tests need to be predictable, easy -to bootstrap, and fast, hitting an actual remote API is a test smell. - -Guzzle provides a mock subscriber that can be attached to clients or requests -that allows you to queue up a list of responses to use rather than hitting a -remote API. - -.. code-block:: php - - use GuzzleHttp\Client; - use GuzzleHttp\Subscriber\Mock; - use GuzzleHttp\Message\Response; - - $client = new Client(); - - // Create a mock subscriber and queue two responses. - $mock = new Mock([ - new Response(200, ['X-Foo' => 'Bar']), // Use response object - "HTTP/1.1 202 OK\r\nContent-Length: 0\r\n\r\n" // Use a response string - ]); - - // Add the mock subscriber to the client. - $client->getEmitter()->attach($mock); - // The first request is intercepted with the first response. - echo $client->get('/')->getStatusCode(); - //> 200 - // The second request is intercepted with the second response. - echo $client->get('/')->getStatusCode(); - //> 202 - -When no more responses are in the queue and a request is sent, an -``OutOfBoundsException`` is thrown. - -History Subscriber -================== - -When using things like the ``Mock`` subscriber, you often need to know if the -requests you expected to send were sent exactly as you intended. While the mock -subscriber responds with mocked responses, the ``GuzzleHttp\Subscriber\History`` -subscriber maintains a history of the requests that were sent by a client. - -.. code-block:: php - - use GuzzleHttp\Client; - use GuzzleHttp\Subscriber\History; - - $client = new Client(); - $history = new History(); - - // Add the history subscriber to the client. - $client->getEmitter()->attach($history); - - $client->get('http://httpbin.org/get'); - $client->head('http://httpbin.org/get'); - - // Count the number of transactions - echo count($history); - //> 2 - // Get the last request - $lastRequest = $history->getLastRequest(); - // Get the last response - $lastRequest = $history->getLastResponse(); - - // Iterate over the transactions that were sent - foreach ($history as $transaction) { - echo $transaction['request']->getMethod(); - //> GET, HEAD - echo $transaction['response']->getStatusCode(); - //> 200, 200 - } - -The history subscriber can also be printed, revealing the requests and -responses that were sent as a string, in order. - -.. code-block:: php - - echo $history; - -:: - - > GET /get HTTP/1.1 - Host: httpbin.org - User-Agent: Guzzle/4.0-dev curl/7.21.4 PHP/5.5.8 - - < HTTP/1.1 200 OK - Access-Control-Allow-Origin: * - Content-Type: application/json - Date: Tue, 25 Mar 2014 03:53:27 GMT - Server: gunicorn/0.17.4 - Content-Length: 270 - Connection: keep-alive - - { - "headers": { - "Connection": "close", - "X-Request-Id": "3d0f7d5c-c937-4394-8248-2b8e03fcccdb", - "User-Agent": "Guzzle/4.0-dev curl/7.21.4 PHP/5.5.8", - "Host": "httpbin.org" - }, - "origin": "76.104.247.1", - "args": {}, - "url": "http://httpbin.org/get" - } - - > HEAD /get HTTP/1.1 - Host: httpbin.org - User-Agent: Guzzle/4.0-dev curl/7.21.4 PHP/5.5.8 - - < HTTP/1.1 200 OK - Access-Control-Allow-Origin: * - Content-length: 270 - Content-Type: application/json - Date: Tue, 25 Mar 2014 03:53:27 GMT - Server: gunicorn/0.17.4 - Connection: keep-alive - -Mock Adapter -============ - -In addition to using the Mock subscriber, you can use the -``GuzzleHttp\Ring\Client\MockAdapter`` as the handler of a client to return the -same response over and over or return the result of a callable function. - -Test Web Server -=============== - -Using mock responses is almost always enough when testing a web service client. -When implementing custom :doc:`HTTP handlers `, you'll need to send -actual HTTP requests in order to sufficiently test the handler. However, a -best practice is to contact a local web server rather than a server over the -internet. - -- Tests are more reliable -- Tests do not require a network connection -- Tests have no external dependencies - -Using the test server ---------------------- - -.. warning:: - - The following functionality is provided to help developers of Guzzle - develop HTTP handlers. There is no promise of backwards compatibility - when it comes to the node.js test server or the ``GuzzleHttp\Tests\Server`` - class. If you are using the test server or ``Server`` class outside of - guzzlehttp/guzzle, then you will need to configure autoloading and - ensure the web server is started manually. - -.. hint:: - - You almost never need to use this test web server. You should only ever - consider using it when developing HTTP handlers. The test web server - is not necessary for mocking requests. For that, please use the - Mock subcribers and History subscriber. - -Guzzle ships with a node.js test server that receives requests and returns -responses from a queue. The test server exposes a simple API that is used to -enqueue responses and inspect the requests that it has received. - -Any operation on the ``Server`` object will ensure that -the server is running and wait until it is able to receive requests before -returning. - -.. code-block:: php - - use GuzzleHttp\Client; - use GuzzleHttp\Tests\Server; - - // Start the server and queue a response - Server::enqueue("HTTP/1.1 200 OK\r\n\Content-Length: 0r\n\r\n"); - - $client = new Client(['base_url' => Server::$url]); - echo $client->get('/foo')->getStatusCode(); - // 200 - -``GuzzleHttp\Tests\Server`` provides a static interface to the test server. You -can queue an HTTP response or an array of responses by calling -``Server::enqueue()``. This method accepts a string representing an HTTP -response message, a ``GuzzleHttp\Message\ResponseInterface``, or an array of -HTTP message strings / ``GuzzleHttp\Message\ResponseInterface`` objects. - -.. code-block:: php - - // Queue single response - Server::enqueue("HTTP/1.1 200 OK\r\n\Content-Length: 0r\n\r\n"); - - // Clear the queue and queue an array of responses - Server::enqueue([ - "HTTP/1.1 200 OK\r\n\Content-Length: 0r\n\r\n", - "HTTP/1.1 404 Not Found\r\n\Content-Length: 0r\n\r\n" - ]); - -When a response is queued on the test server, the test server will remove any -previously queued responses. As the server receives requests, queued responses -are dequeued and returned to the request. When the queue is empty, the server -will return a 500 response. - -You can inspect the requests that the server has retrieved by calling -``Server::received()``. This method accepts an optional ``$hydrate`` parameter -that specifies if you are retrieving an array of HTTP requests as strings or an -array of ``GuzzleHttp\Message\RequestInterface`` objects. - -.. code-block:: php - - foreach (Server::received() as $response) { - echo $response; - } - -You can clear the list of received requests from the web server using the -``Server::flush()`` method. - -.. code-block:: php - - Server::flush(); - echo count(Server::received()); - // 0 diff --git a/core/vendor/guzzlehttp/guzzle/phpunit.xml.dist b/core/vendor/guzzlehttp/guzzle/phpunit.xml.dist deleted file mode 100644 index 500cd53..0000000 --- a/core/vendor/guzzlehttp/guzzle/phpunit.xml.dist +++ /dev/null @@ -1,17 +0,0 @@ - - - - - tests - - - - - src - - src/ - - - - diff --git a/core/vendor/guzzlehttp/guzzle/src/BatchResults.php b/core/vendor/guzzlehttp/guzzle/src/BatchResults.php deleted file mode 100644 index e5af433..0000000 --- a/core/vendor/guzzlehttp/guzzle/src/BatchResults.php +++ /dev/null @@ -1,148 +0,0 @@ -hash = $hash; - } - - /** - * Get the keys that are available on the batch result. - * - * @return array - */ - public function getKeys() - { - return iterator_to_array($this->hash); - } - - /** - * Gets a result from the container for the given object. When getting - * results for a batch of requests, provide the request object. - * - * @param object $forObject Object to retrieve the result for. - * - * @return mixed|null - */ - public function getResult($forObject) - { - return isset($this->hash[$forObject]) ? $this->hash[$forObject] : null; - } - - /** - * Get an array of successful results. - * - * @return array - */ - public function getSuccessful() - { - $results = []; - foreach ($this->hash as $key) { - if (!($this->hash[$key] instanceof \Exception)) { - $results[] = $this->hash[$key]; - } - } - - return $results; - } - - /** - * Get an array of failed results. - * - * @return array - */ - public function getFailures() - { - $results = []; - foreach ($this->hash as $key) { - if ($this->hash[$key] instanceof \Exception) { - $results[] = $this->hash[$key]; - } - } - - return $results; - } - - /** - * Allows iteration over all batch result values. - * - * @return \ArrayIterator - */ - public function getIterator() - { - $results = []; - foreach ($this->hash as $key) { - $results[] = $this->hash[$key]; - } - - return new \ArrayIterator($results); - } - - /** - * Counts the number of elements in the batch result. - * - * @return int - */ - public function count() - { - return count($this->hash); - } - - /** - * Checks if the batch contains a specific numerical array index. - * - * @param int $key Index to access - * - * @return bool - */ - public function offsetExists($key) - { - return $key < count($this->hash); - } - - /** - * Allows access of the batch using a numerical array index. - * - * @param int $key Index to access. - * - * @return mixed|null - */ - public function offsetGet($key) - { - $i = -1; - foreach ($this->hash as $obj) { - if ($key === ++$i) { - return $this->hash[$obj]; - } - } - - return null; - } - - public function offsetUnset($key) - { - throw new \RuntimeException('Not implemented'); - } - - public function offsetSet($key, $value) - { - throw new \RuntimeException('Not implemented'); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/src/Client.php b/core/vendor/guzzlehttp/guzzle/src/Client.php deleted file mode 100644 index f1779eb..0000000 --- a/core/vendor/guzzlehttp/guzzle/src/Client.php +++ /dev/null @@ -1,403 +0,0 @@ - [ - * 'http://www.foo.com/{version}/', - * ['version' => '123'] - * ], - * 'defaults' => [ - * 'timeout' => 10, - * 'allow_redirects' => false, - * 'proxy' => '192.168.16.1:10' - * ] - * ]); - * - * @param array $config Client configuration settings - * - base_url: Base URL of the client that is merged into relative URLs. - * Can be a string or an array that contains a URI template followed - * by an associative array of expansion variables to inject into the - * URI template. - * - handler: callable RingPHP handler used to transfer requests - * - message_factory: Factory used to create request and response object - * - defaults: Default request options to apply to each request - * - emitter: Event emitter used for request events - * - fsm: (internal use only) The request finite state machine. A - * function that accepts a transaction and optional final state. The - * function is responsible for transitioning a request through its - * lifecycle events. - */ - public function __construct(array $config = []) - { - $this->configureBaseUrl($config); - $this->configureDefaults($config); - - if (isset($config['emitter'])) { - $this->emitter = $config['emitter']; - } - - $this->messageFactory = isset($config['message_factory']) - ? $config['message_factory'] - : new MessageFactory(); - - if (isset($config['fsm'])) { - $this->fsm = $config['fsm']; - } else { - if (isset($config['handler'])) { - $handler = $config['handler']; - } elseif (isset($config['adapter'])) { - $handler = $config['adapter']; - } else { - $handler = static::getDefaultHandler(); - } - $this->fsm = new RequestFsm($handler, $this->messageFactory); - } - } - - /** - * Create a default handler to use based on the environment - * - * @throws \RuntimeException if no viable Handler is available. - */ - public static function getDefaultHandler() - { - $default = $future = $streaming = null; - - if (extension_loaded('curl')) { - $config = [ - 'select_timeout' => getenv('GUZZLE_CURL_SELECT_TIMEOUT') ?: 1 - ]; - if ($maxHandles = getenv('GUZZLE_CURL_MAX_HANDLES')) { - $config['max_handles'] = $maxHandles; - } - $future = new CurlMultiHandler($config); - if (function_exists('curl_reset')) { - $default = new CurlHandler(); - } - } - - if (ini_get('allow_url_fopen')) { - $streaming = new StreamHandler(); - } - - if (!($default = ($default ?: $future) ?: $streaming)) { - throw new \RuntimeException('Guzzle requires cURL, the ' - . 'allow_url_fopen ini setting, or a custom HTTP handler.'); - } - - $handler = $default; - - if ($streaming && $streaming !== $default) { - $handler = Middleware::wrapStreaming($default, $streaming); - } - - if ($future) { - $handler = Middleware::wrapFuture($handler, $future); - } - - return $handler; - } - - /** - * Get the default User-Agent string to use with Guzzle - * - * @return string - */ - public static function getDefaultUserAgent() - { - static $defaultAgent = ''; - if (!$defaultAgent) { - $defaultAgent = 'Guzzle/' . self::VERSION; - if (extension_loaded('curl')) { - $defaultAgent .= ' curl/' . curl_version()['version']; - } - $defaultAgent .= ' PHP/' . PHP_VERSION; - } - - return $defaultAgent; - } - - public function getDefaultOption($keyOrPath = null) - { - return $keyOrPath === null - ? $this->defaults - : Utils::getPath($this->defaults, $keyOrPath); - } - - public function setDefaultOption($keyOrPath, $value) - { - Utils::setPath($this->defaults, $keyOrPath, $value); - } - - public function getBaseUrl() - { - return (string) $this->baseUrl; - } - - public function createRequest($method, $url = null, array $options = []) - { - $options = $this->mergeDefaults($options); - // Use a clone of the client's emitter - $options['config']['emitter'] = clone $this->getEmitter(); - $url = $url || (is_string($url) && strlen($url)) - ? $this->buildUrl($url) - : (string) $this->baseUrl; - - return $this->messageFactory->createRequest($method, $url, $options); - } - - public function get($url = null, $options = []) - { - return $this->send($this->createRequest('GET', $url, $options)); - } - - public function head($url = null, array $options = []) - { - return $this->send($this->createRequest('HEAD', $url, $options)); - } - - public function delete($url = null, array $options = []) - { - return $this->send($this->createRequest('DELETE', $url, $options)); - } - - public function put($url = null, array $options = []) - { - return $this->send($this->createRequest('PUT', $url, $options)); - } - - public function patch($url = null, array $options = []) - { - return $this->send($this->createRequest('PATCH', $url, $options)); - } - - public function post($url = null, array $options = []) - { - return $this->send($this->createRequest('POST', $url, $options)); - } - - public function options($url = null, array $options = []) - { - return $this->send($this->createRequest('OPTIONS', $url, $options)); - } - - public function send(RequestInterface $request) - { - $isFuture = $request->getConfig()->get('future'); - $trans = new Transaction($this, $request, $isFuture); - $fn = $this->fsm; - - try { - $fn($trans); - if ($isFuture) { - // Turn the normal response into a future if needed. - return $trans->response instanceof FutureInterface - ? $trans->response - : new FutureResponse(new FulfilledPromise($trans->response)); - } - // Resolve deep futures if this is not a future - // transaction. This accounts for things like retries - // that do not have an immediate side-effect. - while ($trans->response instanceof FutureInterface) { - $trans->response = $trans->response->wait(); - } - return $trans->response; - } catch (\Exception $e) { - if ($isFuture) { - // Wrap the exception in a promise - return new FutureResponse(new RejectedPromise($e)); - } - throw RequestException::wrapException($trans->request, $e); - } - } - - /** - * Get an array of default options to apply to the client - * - * @return array - */ - protected function getDefaultOptions() - { - $settings = [ - 'allow_redirects' => true, - 'exceptions' => true, - 'decode_content' => true, - 'verify' => true - ]; - - // Use the standard Linux HTTP_PROXY and HTTPS_PROXY if set - if ($proxy = getenv('HTTP_PROXY')) { - $settings['proxy']['http'] = $proxy; - } - - if ($proxy = getenv('HTTPS_PROXY')) { - $settings['proxy']['https'] = $proxy; - } - - return $settings; - } - - /** - * Expand a URI template and inherit from the base URL if it's relative - * - * @param string|array $url URL or an array of the URI template to expand - * followed by a hash of template varnames. - * @return string - * @throws \InvalidArgumentException - */ - private function buildUrl($url) - { - // URI template (absolute or relative) - if (!is_array($url)) { - return strpos($url, '://') - ? (string) $url - : (string) $this->baseUrl->combine($url); - } - - if (!isset($url[1])) { - throw new \InvalidArgumentException('You must provide a hash of ' - . 'varname options in the second element of a URL array.'); - } - - // Absolute URL - if (strpos($url[0], '://')) { - return Utils::uriTemplate($url[0], $url[1]); - } - - // Combine the relative URL with the base URL - return (string) $this->baseUrl->combine( - Utils::uriTemplate($url[0], $url[1]) - ); - } - - private function configureBaseUrl(&$config) - { - if (!isset($config['base_url'])) { - $this->baseUrl = new Url('', ''); - } elseif (!is_array($config['base_url'])) { - $this->baseUrl = Url::fromString($config['base_url']); - } elseif (count($config['base_url']) < 2) { - throw new \InvalidArgumentException('You must provide a hash of ' - . 'varname options in the second element of a base_url array.'); - } else { - $this->baseUrl = Url::fromString( - Utils::uriTemplate( - $config['base_url'][0], - $config['base_url'][1] - ) - ); - $config['base_url'] = (string) $this->baseUrl; - } - } - - private function configureDefaults($config) - { - if (!isset($config['defaults'])) { - $this->defaults = $this->getDefaultOptions(); - } else { - $this->defaults = array_replace( - $this->getDefaultOptions(), - $config['defaults'] - ); - } - - // Add the default user-agent header - if (!isset($this->defaults['headers'])) { - $this->defaults['headers'] = [ - 'User-Agent' => static::getDefaultUserAgent() - ]; - } elseif (!Core::hasHeader($this->defaults, 'User-Agent')) { - // Add the User-Agent header if one was not already set - $this->defaults['headers']['User-Agent'] = static::getDefaultUserAgent(); - } - } - - /** - * Merges default options into the array passed by reference. - * - * @param array $options Options to modify by reference - * - * @return array - */ - private function mergeDefaults($options) - { - $defaults = $this->defaults; - - // Case-insensitively merge in default headers if both defaults and - // options have headers specified. - if (!empty($defaults['headers']) && !empty($options['headers'])) { - // Create a set of lowercased keys that are present. - $lkeys = []; - foreach (array_keys($options['headers']) as $k) { - $lkeys[strtolower($k)] = true; - } - // Merge in lowercase default keys when not present in above set. - foreach ($defaults['headers'] as $key => $value) { - if (!isset($lkeys[strtolower($key)])) { - $options['headers'][$key] = $value; - } - } - // No longer need to merge in headers. - unset($defaults['headers']); - } - - $result = array_replace_recursive($defaults, $options); - foreach ($options as $k => $v) { - if ($v === null) { - unset($result[$k]); - } - } - - return $result; - } - - /** - * @deprecated Use {@see GuzzleHttp\Pool} instead. - * @see GuzzleHttp\Pool - */ - public function sendAll($requests, array $options = []) - { - Pool::send($this, $requests, $options); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/src/ClientInterface.php b/core/vendor/guzzlehttp/guzzle/src/ClientInterface.php deleted file mode 100644 index fac8864..0000000 --- a/core/vendor/guzzlehttp/guzzle/src/ClientInterface.php +++ /dev/null @@ -1,150 +0,0 @@ -data = $data; - } - - /** - * Create a new collection from an array, validate the keys, and add default - * values where missing - * - * @param array $config Configuration values to apply. - * @param array $defaults Default parameters - * @param array $required Required parameter names - * - * @return self - * @throws \InvalidArgumentException if a parameter is missing - */ - public static function fromConfig( - array $config = [], - array $defaults = [], - array $required = [] - ) { - $data = $config + $defaults; - - if ($missing = array_diff($required, array_keys($data))) { - throw new \InvalidArgumentException( - 'Config is missing the following keys: ' . - implode(', ', $missing)); - } - - return new self($data); - } - - /** - * Removes all key value pairs - */ - public function clear() - { - $this->data = []; - } - - /** - * Get a specific key value. - * - * @param string $key Key to retrieve. - * - * @return mixed|null Value of the key or NULL - */ - public function get($key) - { - return isset($this->data[$key]) ? $this->data[$key] : null; - } - - /** - * Set a key value pair - * - * @param string $key Key to set - * @param mixed $value Value to set - */ - public function set($key, $value) - { - $this->data[$key] = $value; - } - - /** - * Add a value to a key. If a key of the same name has already been added, - * the key value will be converted into an array and the new value will be - * pushed to the end of the array. - * - * @param string $key Key to add - * @param mixed $value Value to add to the key - */ - public function add($key, $value) - { - if (!array_key_exists($key, $this->data)) { - $this->data[$key] = $value; - } elseif (is_array($this->data[$key])) { - $this->data[$key][] = $value; - } else { - $this->data[$key] = array($this->data[$key], $value); - } - } - - /** - * Remove a specific key value pair - * - * @param string $key A key to remove - */ - public function remove($key) - { - unset($this->data[$key]); - } - - /** - * Get all keys in the collection - * - * @return array - */ - public function getKeys() - { - return array_keys($this->data); - } - - /** - * Returns whether or not the specified key is present. - * - * @param string $key The key for which to check the existence. - * - * @return bool - */ - public function hasKey($key) - { - return array_key_exists($key, $this->data); - } - - /** - * Checks if any keys contains a certain value - * - * @param string $value Value to search for - * - * @return mixed Returns the key if the value was found FALSE if the value - * was not found. - */ - public function hasValue($value) - { - return array_search($value, $this->data, true); - } - - /** - * Replace the data of the object with the value of an array - * - * @param array $data Associative array of data - */ - public function replace(array $data) - { - $this->data = $data; - } - - /** - * Add and merge in a Collection or array of key value pair data. - * - * @param Collection|array $data Associative array of key value pair data - */ - public function merge($data) - { - foreach ($data as $key => $value) { - $this->add($key, $value); - } - } - - /** - * Overwrite key value pairs in this collection with all of the data from - * an array or collection. - * - * @param array|\Traversable $data Values to override over this config - */ - public function overwriteWith($data) - { - if (is_array($data)) { - $this->data = $data + $this->data; - } elseif ($data instanceof Collection) { - $this->data = $data->toArray() + $this->data; - } else { - foreach ($data as $key => $value) { - $this->data[$key] = $value; - } - } - } - - /** - * Returns a Collection containing all the elements of the collection after - * applying the callback function to each one. - * - * The callable should accept three arguments: - * - (string) $key - * - (string) $value - * - (array) $context - * - * The callable must return a the altered or unaltered value. - * - * @param callable $closure Map function to apply - * @param array $context Context to pass to the callable - * - * @return Collection - */ - public function map(callable $closure, array $context = []) - { - $collection = new static(); - foreach ($this as $key => $value) { - $collection[$key] = $closure($key, $value, $context); - } - - return $collection; - } - - /** - * Iterates over each key value pair in the collection passing them to the - * callable. If the callable returns true, the current value from input is - * returned into the result Collection. - * - * The callable must accept two arguments: - * - (string) $key - * - (string) $value - * - * @param callable $closure Evaluation function - * - * @return Collection - */ - public function filter(callable $closure) - { - $collection = new static(); - foreach ($this->data as $key => $value) { - if ($closure($key, $value)) { - $collection[$key] = $value; - } - } - - return $collection; - } -} diff --git a/core/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php b/core/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php deleted file mode 100644 index f8ac7dd..0000000 --- a/core/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php +++ /dev/null @@ -1,248 +0,0 @@ -strictMode = $strictMode; - - foreach ($cookieArray as $cookie) { - if (!($cookie instanceof SetCookie)) { - $cookie = new SetCookie($cookie); - } - $this->setCookie($cookie); - } - } - - /** - * Create a new Cookie jar from an associative array and domain. - * - * @param array $cookies Cookies to create the jar from - * @param string $domain Domain to set the cookies to - * - * @return self - */ - public static function fromArray(array $cookies, $domain) - { - $cookieJar = new self(); - foreach ($cookies as $name => $value) { - $cookieJar->setCookie(new SetCookie([ - 'Domain' => $domain, - 'Name' => $name, - 'Value' => $value, - 'Discard' => true - ])); - } - - return $cookieJar; - } - - /** - * Quote the cookie value if it is not already quoted and it contains - * problematic characters. - * - * @param string $value Value that may or may not need to be quoted - * - * @return string - */ - public static function getCookieValue($value) - { - if (substr($value, 0, 1) !== '"' && - substr($value, -1, 1) !== '"' && - strpbrk($value, ';,') - ) { - $value = '"' . $value . '"'; - } - - return $value; - } - - public function toArray() - { - return array_map(function (SetCookie $cookie) { - return $cookie->toArray(); - }, $this->getIterator()->getArrayCopy()); - } - - public function clear($domain = null, $path = null, $name = null) - { - if (!$domain) { - $this->cookies = []; - return; - } elseif (!$path) { - $this->cookies = array_filter( - $this->cookies, - function (SetCookie $cookie) use ($path, $domain) { - return !$cookie->matchesDomain($domain); - } - ); - } elseif (!$name) { - $this->cookies = array_filter( - $this->cookies, - function (SetCookie $cookie) use ($path, $domain) { - return !($cookie->matchesPath($path) && - $cookie->matchesDomain($domain)); - } - ); - } else { - $this->cookies = array_filter( - $this->cookies, - function (SetCookie $cookie) use ($path, $domain, $name) { - return !($cookie->getName() == $name && - $cookie->matchesPath($path) && - $cookie->matchesDomain($domain)); - } - ); - } - } - - public function clearSessionCookies() - { - $this->cookies = array_filter( - $this->cookies, - function (SetCookie $cookie) { - return !$cookie->getDiscard() && $cookie->getExpires(); - } - ); - } - - public function setCookie(SetCookie $cookie) - { - // Only allow cookies with set and valid domain, name, value - $result = $cookie->validate(); - if ($result !== true) { - if ($this->strictMode) { - throw new \RuntimeException('Invalid cookie: ' . $result); - } else { - $this->removeCookieIfEmpty($cookie); - return false; - } - } - - // Resolve conflicts with previously set cookies - foreach ($this->cookies as $i => $c) { - - // Two cookies are identical, when their path, and domain are - // identical. - if ($c->getPath() != $cookie->getPath() || - $c->getDomain() != $cookie->getDomain() || - $c->getName() != $cookie->getName() - ) { - continue; - } - - // The previously set cookie is a discard cookie and this one is - // not so allow the new cookie to be set - if (!$cookie->getDiscard() && $c->getDiscard()) { - unset($this->cookies[$i]); - continue; - } - - // If the new cookie's expiration is further into the future, then - // replace the old cookie - if ($cookie->getExpires() > $c->getExpires()) { - unset($this->cookies[$i]); - continue; - } - - // If the value has changed, we better change it - if ($cookie->getValue() !== $c->getValue()) { - unset($this->cookies[$i]); - continue; - } - - // The cookie exists, so no need to continue - return false; - } - - $this->cookies[] = $cookie; - - return true; - } - - public function count() - { - return count($this->cookies); - } - - public function getIterator() - { - return new \ArrayIterator(array_values($this->cookies)); - } - - public function extractCookies( - RequestInterface $request, - ResponseInterface $response - ) { - if ($cookieHeader = $response->getHeaderAsArray('Set-Cookie')) { - foreach ($cookieHeader as $cookie) { - $sc = SetCookie::fromString($cookie); - if (!$sc->getDomain()) { - $sc->setDomain($request->getHost()); - } - $this->setCookie($sc); - } - } - } - - public function addCookieHeader(RequestInterface $request) - { - $values = []; - $scheme = $request->getScheme(); - $host = $request->getHost(); - $path = $request->getPath(); - - foreach ($this->cookies as $cookie) { - if ($cookie->matchesPath($path) && - $cookie->matchesDomain($host) && - !$cookie->isExpired() && - (!$cookie->getSecure() || $scheme == 'https') - ) { - $values[] = $cookie->getName() . '=' - . self::getCookieValue($cookie->getValue()); - } - } - - if ($values) { - $request->setHeader('Cookie', implode('; ', $values)); - } - } - - /** - * If a cookie already exists and the server asks to set it again with a - * null value, the cookie must be deleted. - * - * @param SetCookie $cookie - */ - private function removeCookieIfEmpty(SetCookie $cookie) - { - $cookieValue = $cookie->getValue(); - if ($cookieValue === null || $cookieValue === '') { - $this->clear( - $cookie->getDomain(), - $cookie->getPath(), - $cookie->getName() - ); - } - } -} diff --git a/core/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php b/core/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php deleted file mode 100644 index 4ea8567..0000000 --- a/core/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php +++ /dev/null @@ -1,75 +0,0 @@ -filename = $cookieFile; - - if (file_exists($cookieFile)) { - $this->load($cookieFile); - } - } - - /** - * Saves the file when shutting down - */ - public function __destruct() - { - $this->save($this->filename); - } - - /** - * Saves the cookies to a file. - * - * @param string $filename File to save - * @throws \RuntimeException if the file cannot be found or created - */ - public function save($filename) - { - $json = []; - foreach ($this as $cookie) { - if ($cookie->getExpires() && !$cookie->getDiscard()) { - $json[] = $cookie->toArray(); - } - } - - if (false === file_put_contents($filename, json_encode($json))) { - // @codeCoverageIgnoreStart - throw new \RuntimeException("Unable to save file {$filename}"); - // @codeCoverageIgnoreEnd - } - } - - /** - * Load cookies from a JSON formatted file. - * - * Old cookies are kept unless overwritten by newly loaded ones. - * - * @param string $filename Cookie file to load. - * @throws \RuntimeException if the file cannot be loaded. - */ - public function load($filename) - { - $json = file_get_contents($filename); - if (false === $json) { - // @codeCoverageIgnoreStart - throw new \RuntimeException("Unable to load file {$filename}"); - // @codeCoverageIgnoreEnd - } - - $data = Utils::jsonDecode($json, true); - if (is_array($data)) { - foreach (Utils::jsonDecode($json, true) as $cookie) { - $this->setCookie(new SetCookie($cookie)); - } - } elseif (strlen($data)) { - throw new \RuntimeException("Invalid cookie file: {$filename}"); - } - } -} diff --git a/core/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php b/core/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php deleted file mode 100644 index 71a02d5..0000000 --- a/core/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php +++ /dev/null @@ -1,66 +0,0 @@ -sessionKey = $sessionKey; - $this->load(); - } - - /** - * Saves cookies to session when shutting down - */ - public function __destruct() - { - $this->save(); - } - - /** - * Save cookies to the client session - */ - public function save() - { - $json = []; - foreach ($this as $cookie) { - if ($cookie->getExpires() && !$cookie->getDiscard()) { - $json[] = $cookie->toArray(); - } - } - - $_SESSION[$this->sessionKey] = json_encode($json); - } - - /** - * Load the contents of the client session into the data array - */ - protected function load() - { - $cookieJar = isset($_SESSION[$this->sessionKey]) - ? $_SESSION[$this->sessionKey] - : null; - - $data = Utils::jsonDecode($cookieJar, true); - if (is_array($data)) { - foreach ($data as $cookie) { - $this->setCookie(new SetCookie($cookie)); - } - } elseif (strlen($data)) { - throw new \RuntimeException("Invalid cookie data"); - } - } -} diff --git a/core/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php b/core/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php deleted file mode 100644 index ac9a890..0000000 --- a/core/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php +++ /dev/null @@ -1,373 +0,0 @@ - null, - 'Value' => null, - 'Domain' => null, - 'Path' => '/', - 'Max-Age' => null, - 'Expires' => null, - 'Secure' => false, - 'Discard' => false, - 'HttpOnly' => false - ]; - - /** @var array Cookie data */ - private $data; - - /** - * Create a new SetCookie object from a string - * - * @param string $cookie Set-Cookie header string - * - * @return self - */ - public static function fromString($cookie) - { - // Create the default return array - $data = self::$defaults; - // Explode the cookie string using a series of semicolons - $pieces = array_filter(array_map('trim', explode(';', $cookie))); - // The name of the cookie (first kvp) must include an equal sign. - if (empty($pieces) || !strpos($pieces[0], '=')) { - return new self($data); - } - - // Add the cookie pieces into the parsed data array - foreach ($pieces as $part) { - - $cookieParts = explode('=', $part, 2); - $key = trim($cookieParts[0]); - $value = isset($cookieParts[1]) - ? trim($cookieParts[1], " \n\r\t\0\x0B\"") - : true; - - // Only check for non-cookies when cookies have been found - if (empty($data['Name'])) { - $data['Name'] = $key; - $data['Value'] = $value; - } else { - foreach (array_keys(self::$defaults) as $search) { - if (!strcasecmp($search, $key)) { - $data[$search] = $value; - continue 2; - } - } - $data[$key] = $value; - } - } - - return new self($data); - } - - /** - * @param array $data Array of cookie data provided by a Cookie parser - */ - public function __construct(array $data = []) - { - $this->data = array_replace(self::$defaults, $data); - // Extract the Expires value and turn it into a UNIX timestamp if needed - if (!$this->getExpires() && $this->getMaxAge()) { - // Calculate the Expires date - $this->setExpires(time() + $this->getMaxAge()); - } elseif ($this->getExpires() && !is_numeric($this->getExpires())) { - $this->setExpires($this->getExpires()); - } - } - - public function __toString() - { - $str = $this->data['Name'] . '=' . $this->data['Value'] . '; '; - foreach ($this->data as $k => $v) { - if ($k != 'Name' && $k != 'Value' && $v !== null && $v !== false) { - if ($k == 'Expires') { - $str .= 'Expires=' . gmdate('D, d M Y H:i:s \G\M\T', $v) . '; '; - } else { - $str .= ($v === true ? $k : "{$k}={$v}") . '; '; - } - } - } - - return rtrim($str, '; '); - } - - public function toArray() - { - return $this->data; - } - - /** - * Get the cookie name - * - * @return string - */ - public function getName() - { - return $this->data['Name']; - } - - /** - * Set the cookie name - * - * @param string $name Cookie name - */ - public function setName($name) - { - $this->data['Name'] = $name; - } - - /** - * Get the cookie value - * - * @return string - */ - public function getValue() - { - return $this->data['Value']; - } - - /** - * Set the cookie value - * - * @param string $value Cookie value - */ - public function setValue($value) - { - $this->data['Value'] = $value; - } - - /** - * Get the domain - * - * @return string|null - */ - public function getDomain() - { - return $this->data['Domain']; - } - - /** - * Set the domain of the cookie - * - * @param string $domain - */ - public function setDomain($domain) - { - $this->data['Domain'] = $domain; - } - - /** - * Get the path - * - * @return string - */ - public function getPath() - { - return $this->data['Path']; - } - - /** - * Set the path of the cookie - * - * @param string $path Path of the cookie - */ - public function setPath($path) - { - $this->data['Path'] = $path; - } - - /** - * Maximum lifetime of the cookie in seconds - * - * @return int|null - */ - public function getMaxAge() - { - return $this->data['Max-Age']; - } - - /** - * Set the max-age of the cookie - * - * @param int $maxAge Max age of the cookie in seconds - */ - public function setMaxAge($maxAge) - { - $this->data['Max-Age'] = $maxAge; - } - - /** - * The UNIX timestamp when the cookie Expires - * - * @return mixed - */ - public function getExpires() - { - return $this->data['Expires']; - } - - /** - * Set the unix timestamp for which the cookie will expire - * - * @param int $timestamp Unix timestamp - */ - public function setExpires($timestamp) - { - $this->data['Expires'] = is_numeric($timestamp) - ? (int) $timestamp - : strtotime($timestamp); - } - - /** - * Get whether or not this is a secure cookie - * - * @return null|bool - */ - public function getSecure() - { - return $this->data['Secure']; - } - - /** - * Set whether or not the cookie is secure - * - * @param bool $secure Set to true or false if secure - */ - public function setSecure($secure) - { - $this->data['Secure'] = $secure; - } - - /** - * Get whether or not this is a session cookie - * - * @return null|bool - */ - public function getDiscard() - { - return $this->data['Discard']; - } - - /** - * Set whether or not this is a session cookie - * - * @param bool $discard Set to true or false if this is a session cookie - */ - public function setDiscard($discard) - { - $this->data['Discard'] = $discard; - } - - /** - * Get whether or not this is an HTTP only cookie - * - * @return bool - */ - public function getHttpOnly() - { - return $this->data['HttpOnly']; - } - - /** - * Set whether or not this is an HTTP only cookie - * - * @param bool $httpOnly Set to true or false if this is HTTP only - */ - public function setHttpOnly($httpOnly) - { - $this->data['HttpOnly'] = $httpOnly; - } - - /** - * Check if the cookie matches a path value - * - * @param string $path Path to check against - * - * @return bool - */ - public function matchesPath($path) - { - return !$this->getPath() || 0 === stripos($path, $this->getPath()); - } - - /** - * Check if the cookie matches a domain value - * - * @param string $domain Domain to check against - * - * @return bool - */ - public function matchesDomain($domain) - { - // Remove the leading '.' as per spec in RFC 6265. - // http://tools.ietf.org/html/rfc6265#section-5.2.3 - $cookieDomain = ltrim($this->getDomain(), '.'); - - // Domain not set or exact match. - if (!$cookieDomain || !strcasecmp($domain, $cookieDomain)) { - return true; - } - - // Matching the subdomain according to RFC 6265. - // http://tools.ietf.org/html/rfc6265#section-5.1.3 - if (filter_var($domain, FILTER_VALIDATE_IP)) { - return false; - } - - return (bool) preg_match('/\.' . preg_quote($cookieDomain) . '$/i', $domain); - } - - /** - * Check if the cookie is expired - * - * @return bool - */ - public function isExpired() - { - return $this->getExpires() && time() > $this->getExpires(); - } - - /** - * Check if the cookie is valid according to RFC 6265 - * - * @return bool|string Returns true if valid or an error message if invalid - */ - public function validate() - { - // Names must not be empty, but can be 0 - $name = $this->getName(); - if (empty($name) && !is_numeric($name)) { - return 'The cookie name must not be empty'; - } - - // Check if any of the invalid characters are present in the cookie name - if (preg_match("/[=,; \t\r\n\013\014]/", $name)) { - return "Cookie name must not cannot invalid characters: =,; \\t\\r\\n\\013\\014"; - } - - // Value must not be empty, but can be 0 - $value = $this->getValue(); - if (empty($value) && !is_numeric($value)) { - return 'The cookie value must not be empty'; - } - - // Domains must not be empty, but can be 0 - // A "0" is not a valid internet domain, but may be used as server name - // in a private network. - $domain = $this->getDomain(); - if (empty($domain) && !is_numeric($domain)) { - return 'The cookie domain must not be empty'; - } - - return true; - } -} diff --git a/core/vendor/guzzlehttp/guzzle/src/Event/AbstractEvent.php b/core/vendor/guzzlehttp/guzzle/src/Event/AbstractEvent.php deleted file mode 100644 index 0d2f4db..0000000 --- a/core/vendor/guzzlehttp/guzzle/src/Event/AbstractEvent.php +++ /dev/null @@ -1,20 +0,0 @@ -propagationStopped; - } - - public function stopPropagation() - { - $this->propagationStopped = true; - } -} diff --git a/core/vendor/guzzlehttp/guzzle/src/Event/AbstractRequestEvent.php b/core/vendor/guzzlehttp/guzzle/src/Event/AbstractRequestEvent.php deleted file mode 100644 index 8c8fbc9..0000000 --- a/core/vendor/guzzlehttp/guzzle/src/Event/AbstractRequestEvent.php +++ /dev/null @@ -1,61 +0,0 @@ -transaction = $transaction; - } - - /** - * Get the HTTP client associated with the event. - * - * @return ClientInterface - */ - public function getClient() - { - return $this->transaction->client; - } - - /** - * Get the request object - * - * @return RequestInterface - */ - public function getRequest() - { - return $this->transaction->request; - } - - /** - * Get the number of transaction retries. - * - * @return int - */ - public function getRetryCount() - { - return $this->transaction->retries; - } - - /** - * @return Transaction - */ - protected function getTransaction() - { - return $this->transaction; - } -} diff --git a/core/vendor/guzzlehttp/guzzle/src/Event/AbstractRetryableEvent.php b/core/vendor/guzzlehttp/guzzle/src/Event/AbstractRetryableEvent.php deleted file mode 100644 index bbbdfaf..0000000 --- a/core/vendor/guzzlehttp/guzzle/src/Event/AbstractRetryableEvent.php +++ /dev/null @@ -1,40 +0,0 @@ -transaction->state = 'retry'; - - if ($afterDelay) { - $this->transaction->request->getConfig()->set('delay', $afterDelay); - } - - $this->stopPropagation(); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/src/Event/AbstractTransferEvent.php b/core/vendor/guzzlehttp/guzzle/src/Event/AbstractTransferEvent.php deleted file mode 100644 index 3b106df..0000000 --- a/core/vendor/guzzlehttp/guzzle/src/Event/AbstractTransferEvent.php +++ /dev/null @@ -1,63 +0,0 @@ -transaction->transferInfo; - } - - return isset($this->transaction->transferInfo[$name]) - ? $this->transaction->transferInfo[$name] - : null; - } - - /** - * Returns true/false if a response is available. - * - * @return bool - */ - public function hasResponse() - { - return !($this->transaction->response instanceof FutureInterface); - } - - /** - * Get the response. - * - * @return ResponseInterface|null - */ - public function getResponse() - { - return $this->hasResponse() ? $this->transaction->response : null; - } - - /** - * Intercept the request and associate a response - * - * @param ResponseInterface $response Response to set - */ - public function intercept(ResponseInterface $response) - { - $this->transaction->response = $response; - $this->transaction->exception = null; - $this->stopPropagation(); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/src/Event/BeforeEvent.php b/core/vendor/guzzlehttp/guzzle/src/Event/BeforeEvent.php deleted file mode 100644 index f313c37..0000000 --- a/core/vendor/guzzlehttp/guzzle/src/Event/BeforeEvent.php +++ /dev/null @@ -1,26 +0,0 @@ -transaction->response = $response; - $this->transaction->exception = null; - $this->stopPropagation(); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/src/Event/CompleteEvent.php b/core/vendor/guzzlehttp/guzzle/src/Event/CompleteEvent.php deleted file mode 100644 index 56cc557..0000000 --- a/core/vendor/guzzlehttp/guzzle/src/Event/CompleteEvent.php +++ /dev/null @@ -1,14 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - * - * @link https://github.com/symfony/symfony/tree/master/src/Symfony/Component/EventDispatcher - */ -class Emitter implements EmitterInterface -{ - /** @var array */ - private $listeners = []; - - /** @var array */ - private $sorted = []; - - public function on($eventName, callable $listener, $priority = 0) - { - if ($priority === 'first') { - $priority = isset($this->listeners[$eventName]) - ? max(array_keys($this->listeners[$eventName])) + 1 - : 1; - } elseif ($priority === 'last') { - $priority = isset($this->listeners[$eventName]) - ? min(array_keys($this->listeners[$eventName])) - 1 - : -1; - } - - $this->listeners[$eventName][$priority][] = $listener; - unset($this->sorted[$eventName]); - } - - public function once($eventName, callable $listener, $priority = 0) - { - $onceListener = function ( - EventInterface $event, - $eventName - ) use (&$onceListener, $eventName, $listener, $priority) { - $this->removeListener($eventName, $onceListener); - $listener($event, $eventName, $this); - }; - - $this->on($eventName, $onceListener, $priority); - } - - public function removeListener($eventName, callable $listener) - { - if (empty($this->listeners[$eventName])) { - return; - } - - foreach ($this->listeners[$eventName] as $priority => $listeners) { - if (false !== ($key = array_search($listener, $listeners, true))) { - unset( - $this->listeners[$eventName][$priority][$key], - $this->sorted[$eventName] - ); - } - } - } - - public function listeners($eventName = null) - { - // Return all events in a sorted priority order - if ($eventName === null) { - foreach (array_keys($this->listeners) as $eventName) { - if (empty($this->sorted[$eventName])) { - $this->listeners($eventName); - } - } - return $this->sorted; - } - - // Return the listeners for a specific event, sorted in priority order - if (empty($this->sorted[$eventName])) { - $this->sorted[$eventName] = []; - if (isset($this->listeners[$eventName])) { - krsort($this->listeners[$eventName], SORT_NUMERIC); - foreach ($this->listeners[$eventName] as $listeners) { - foreach ($listeners as $listener) { - $this->sorted[$eventName][] = $listener; - } - } - } - } - - return $this->sorted[$eventName]; - } - - public function hasListeners($eventName) - { - return !empty($this->listeners[$eventName]); - } - - public function emit($eventName, EventInterface $event) - { - if (isset($this->listeners[$eventName])) { - foreach ($this->listeners($eventName) as $listener) { - $listener($event, $eventName); - if ($event->isPropagationStopped()) { - break; - } - } - } - - return $event; - } - - public function attach(SubscriberInterface $subscriber) - { - foreach ($subscriber->getEvents() as $eventName => $listeners) { - if (is_array($listeners[0])) { - foreach ($listeners as $listener) { - $this->on( - $eventName, - [$subscriber, $listener[0]], - isset($listener[1]) ? $listener[1] : 0 - ); - } - } else { - $this->on( - $eventName, - [$subscriber, $listeners[0]], - isset($listeners[1]) ? $listeners[1] : 0 - ); - } - } - } - - public function detach(SubscriberInterface $subscriber) - { - foreach ($subscriber->getEvents() as $eventName => $listener) { - $this->removeListener($eventName, [$subscriber, $listener[0]]); - } - } -} diff --git a/core/vendor/guzzlehttp/guzzle/src/Event/EmitterInterface.php b/core/vendor/guzzlehttp/guzzle/src/Event/EmitterInterface.php deleted file mode 100644 index 9783efd..0000000 --- a/core/vendor/guzzlehttp/guzzle/src/Event/EmitterInterface.php +++ /dev/null @@ -1,96 +0,0 @@ -transaction->exception; - } -} diff --git a/core/vendor/guzzlehttp/guzzle/src/Event/ErrorEvent.php b/core/vendor/guzzlehttp/guzzle/src/Event/ErrorEvent.php deleted file mode 100644 index 7432134..0000000 --- a/core/vendor/guzzlehttp/guzzle/src/Event/ErrorEvent.php +++ /dev/null @@ -1,27 +0,0 @@ -transaction->exception; - } -} diff --git a/core/vendor/guzzlehttp/guzzle/src/Event/EventInterface.php b/core/vendor/guzzlehttp/guzzle/src/Event/EventInterface.php deleted file mode 100644 index 97247e8..0000000 --- a/core/vendor/guzzlehttp/guzzle/src/Event/EventInterface.php +++ /dev/null @@ -1,23 +0,0 @@ -emitter) { - $this->emitter = new Emitter(); - } - - return $this->emitter; - } -} diff --git a/core/vendor/guzzlehttp/guzzle/src/Event/ListenerAttacherTrait.php b/core/vendor/guzzlehttp/guzzle/src/Event/ListenerAttacherTrait.php deleted file mode 100644 index 407dc92..0000000 --- a/core/vendor/guzzlehttp/guzzle/src/Event/ListenerAttacherTrait.php +++ /dev/null @@ -1,88 +0,0 @@ -getEmitter(); - foreach ($listeners as $el) { - if ($el['once']) { - $emitter->once($el['name'], $el['fn'], $el['priority']); - } else { - $emitter->on($el['name'], $el['fn'], $el['priority']); - } - } - } - - /** - * Extracts the allowed events from the provided array, and ignores anything - * else in the array. The event listener must be specified as a callable or - * as an array of event listener data ("name", "fn", "priority", "once"). - * - * @param array $source Array containing callables or hashes of data to be - * prepared as event listeners. - * @param array $events Names of events to look for in the provided $source - * array. Other keys are ignored. - * @return array - */ - private function prepareListeners(array $source, array $events) - { - $listeners = []; - foreach ($events as $name) { - if (isset($source[$name])) { - $this->buildListener($name, $source[$name], $listeners); - } - } - - return $listeners; - } - - /** - * Creates a complete event listener definition from the provided array of - * listener data. Also works recursively if more than one listeners are - * contained in the provided array. - * - * @param string $name Name of the event the listener is for. - * @param array|callable $data Event listener data to prepare. - * @param array $listeners Array of listeners, passed by reference. - * - * @throws \InvalidArgumentException if the event data is malformed. - */ - private function buildListener($name, $data, &$listeners) - { - static $defaults = ['priority' => 0, 'once' => false]; - - // If a callable is provided, normalize it to the array format. - if (is_callable($data)) { - $data = ['fn' => $data]; - } - - // Prepare the listener and add it to the array, recursively. - if (isset($data['fn'])) { - $data['name'] = $name; - $listeners[] = $data + $defaults; - } elseif (is_array($data)) { - foreach ($data as $listenerData) { - $this->buildListener($name, $listenerData, $listeners); - } - } else { - throw new \InvalidArgumentException('Each event listener must be a ' - . 'callable or an associative array containing a "fn" key.'); - } - } -} diff --git a/core/vendor/guzzlehttp/guzzle/src/Event/ProgressEvent.php b/core/vendor/guzzlehttp/guzzle/src/Event/ProgressEvent.php deleted file mode 100644 index 3fd0de4..0000000 --- a/core/vendor/guzzlehttp/guzzle/src/Event/ProgressEvent.php +++ /dev/null @@ -1,51 +0,0 @@ -downloadSize = $downloadSize; - $this->downloaded = $downloaded; - $this->uploadSize = $uploadSize; - $this->uploaded = $uploaded; - } -} diff --git a/core/vendor/guzzlehttp/guzzle/src/Event/RequestEvents.php b/core/vendor/guzzlehttp/guzzle/src/Event/RequestEvents.php deleted file mode 100644 index f51d420..0000000 --- a/core/vendor/guzzlehttp/guzzle/src/Event/RequestEvents.php +++ /dev/null @@ -1,56 +0,0 @@ - ['methodName']] - * - ['eventName' => ['methodName', $priority]] - * - ['eventName' => [['methodName'], ['otherMethod']] - * - ['eventName' => [['methodName'], ['otherMethod', $priority]] - * - ['eventName' => [['methodName', $priority], ['otherMethod', $priority]] - * - * @return array - */ - public function getEvents(); -} diff --git a/core/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php b/core/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php deleted file mode 100644 index fd78431..0000000 --- a/core/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php +++ /dev/null @@ -1,7 +0,0 @@ -response = $response; - } - /** - * Get the associated response - * - * @return ResponseInterface|null - */ - public function getResponse() - { - return $this->response; - } -} diff --git a/core/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php b/core/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php deleted file mode 100644 index f81d248..0000000 --- a/core/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php +++ /dev/null @@ -1,121 +0,0 @@ -getStatusCode() - : 0; - parent::__construct($message, $code, $previous); - $this->request = $request; - $this->response = $response; - } - - /** - * Wrap non-RequesExceptions with a RequestException - * - * @param RequestInterface $request - * @param \Exception $e - * - * @return RequestException - */ - public static function wrapException(RequestInterface $request, \Exception $e) - { - if ($e instanceof RequestException) { - return $e; - } elseif ($e instanceof ConnectException) { - return new HttpConnectException($e->getMessage(), $request, null, $e); - } else { - return new RequestException($e->getMessage(), $request, null, $e); - } - } - - /** - * Factory method to create a new exception with a normalized error message - * - * @param RequestInterface $request Request - * @param ResponseInterface $response Response received - * @param \Exception $previous Previous exception - * - * @return self - */ - public static function create( - RequestInterface $request, - ResponseInterface $response = null, - \Exception $previous = null - ) { - if (!$response) { - return new self('Error completing request', $request, null, $previous); - } - - $level = floor($response->getStatusCode() / 100); - if ($level == '4') { - $label = 'Client error response'; - $className = __NAMESPACE__ . '\\ClientException'; - } elseif ($level == '5') { - $label = 'Server error response'; - $className = __NAMESPACE__ . '\\ServerException'; - } else { - $label = 'Unsuccessful response'; - $className = __CLASS__; - } - - $message = $label . ' [url] ' . $request->getUrl() - . ' [status code] ' . $response->getStatusCode() - . ' [reason phrase] ' . $response->getReasonPhrase(); - - return new $className($message, $request, $response, $previous); - } - - /** - * Get the request that caused the exception - * - * @return RequestInterface - */ - public function getRequest() - { - return $this->request; - } - - /** - * Get the associated response - * - * @return ResponseInterface|null - */ - public function getResponse() - { - return $this->response; - } - - /** - * Check if a response was received - * - * @return bool - */ - public function hasResponse() - { - return $this->response !== null; - } -} diff --git a/core/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php b/core/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php deleted file mode 100644 index 7cdd340..0000000 --- a/core/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php +++ /dev/null @@ -1,7 +0,0 @@ -error = $error; - } - - /** - * Get the associated error - * - * @return \LibXMLError|null - */ - public function getError() - { - return $this->error; - } -} diff --git a/core/vendor/guzzlehttp/guzzle/src/HasDataTrait.php b/core/vendor/guzzlehttp/guzzle/src/HasDataTrait.php deleted file mode 100644 index 020dfc9..0000000 --- a/core/vendor/guzzlehttp/guzzle/src/HasDataTrait.php +++ /dev/null @@ -1,75 +0,0 @@ -data); - } - - public function offsetGet($offset) - { - return isset($this->data[$offset]) ? $this->data[$offset] : null; - } - - public function offsetSet($offset, $value) - { - $this->data[$offset] = $value; - } - - public function offsetExists($offset) - { - return isset($this->data[$offset]); - } - - public function offsetUnset($offset) - { - unset($this->data[$offset]); - } - - public function toArray() - { - return $this->data; - } - - public function count() - { - return count($this->data); - } - - /** - * Get a value from the collection using a path syntax to retrieve nested - * data. - * - * @param string $path Path to traverse and retrieve a value from - * - * @return mixed|null - */ - public function getPath($path) - { - return Utils::getPath($this->data, $path); - } - - /** - * Set a value into a nested array key. Keys will be created as needed to - * set the value. - * - * @param string $path Path to set - * @param mixed $value Value to set at the key - * - * @throws \RuntimeException when trying to setPath using a nested path - * that travels through a scalar value - */ - public function setPath($path, $value) - { - Utils::setPath($this->data, $path, $value); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/src/Message/AbstractMessage.php b/core/vendor/guzzlehttp/guzzle/src/Message/AbstractMessage.php deleted file mode 100644 index 0c67575..0000000 --- a/core/vendor/guzzlehttp/guzzle/src/Message/AbstractMessage.php +++ /dev/null @@ -1,253 +0,0 @@ -getBody(); - } - - public function getProtocolVersion() - { - return $this->protocolVersion; - } - - public function getBody() - { - return $this->body; - } - - public function setBody(StreamInterface $body = null) - { - if ($body === null) { - // Setting a null body will remove the body of the request - $this->removeHeader('Content-Length'); - $this->removeHeader('Transfer-Encoding'); - } - - $this->body = $body; - } - - public function addHeader($header, $value) - { - if (is_array($value)) { - $current = array_merge($this->getHeaderAsArray($header), $value); - } else { - $current = $this->getHeaderAsArray($header); - $current[] = (string) $value; - } - - $this->setHeader($header, $current); - } - - public function addHeaders(array $headers) - { - foreach ($headers as $name => $header) { - $this->addHeader($name, $header); - } - } - - public function getHeader($header) - { - $name = strtolower($header); - return isset($this->headers[$name]) - ? implode(', ', $this->headers[$name]) - : ''; - } - - public function getHeaderAsArray($header) - { - $name = strtolower($header); - return isset($this->headers[$name]) ? $this->headers[$name] : []; - } - - public function getHeaders() - { - $headers = []; - foreach ($this->headers as $name => $values) { - $headers[$this->headerNames[$name]] = $values; - } - - return $headers; - } - - public function setHeader($header, $value) - { - $header = trim($header); - $name = strtolower($header); - $this->headerNames[$name] = $header; - - if (is_array($value)) { - foreach ($value as &$v) { - $v = trim($v); - } - $this->headers[$name] = $value; - } else { - $this->headers[$name] = [trim($value)]; - } - } - - public function setHeaders(array $headers) - { - $this->headers = $this->headerNames = []; - foreach ($headers as $key => $value) { - $this->setHeader($key, $value); - } - } - - public function hasHeader($header) - { - return isset($this->headers[strtolower($header)]); - } - - public function removeHeader($header) - { - $name = strtolower($header); - unset($this->headers[$name], $this->headerNames[$name]); - } - - /** - * Parse an array of header values containing ";" separated data into an - * array of associative arrays representing the header key value pair - * data of the header. When a parameter does not contain a value, but just - * contains a key, this function will inject a key with a '' string value. - * - * @param MessageInterface $message That contains the header - * @param string $header Header to retrieve from the message - * - * @return array Returns the parsed header values. - */ - public static function parseHeader(MessageInterface $message, $header) - { - static $trimmed = "\"' \n\t\r"; - $params = $matches = []; - - foreach (self::normalizeHeader($message, $header) as $val) { - $part = []; - foreach (preg_split('/;(?=([^"]*"[^"]*")*[^"]*$)/', $val) as $kvp) { - if (preg_match_all('/<[^>]+>|[^=]+/', $kvp, $matches)) { - $m = $matches[0]; - if (isset($m[1])) { - $part[trim($m[0], $trimmed)] = trim($m[1], $trimmed); - } else { - $part[] = trim($m[0], $trimmed); - } - } - } - if ($part) { - $params[] = $part; - } - } - - return $params; - } - - /** - * Converts an array of header values that may contain comma separated - * headers into an array of headers with no comma separated values. - * - * @param MessageInterface $message That contains the header - * @param string $header Header to retrieve from the message - * - * @return array Returns the normalized header field values. - */ - public static function normalizeHeader(MessageInterface $message, $header) - { - $h = $message->getHeaderAsArray($header); - for ($i = 0, $total = count($h); $i < $total; $i++) { - if (strpos($h[$i], ',') === false) { - continue; - } - foreach (preg_split('/,(?=([^"]*"[^"]*")*[^"]*$)/', $h[$i]) as $v) { - $h[] = trim($v); - } - unset($h[$i]); - } - - return $h; - } - - /** - * Gets the start-line and headers of a message as a string - * - * @param MessageInterface $message - * - * @return string - */ - public static function getStartLineAndHeaders(MessageInterface $message) - { - return static::getStartLine($message) - . self::getHeadersAsString($message); - } - - /** - * Gets the headers of a message as a string - * - * @param MessageInterface $message - * - * @return string - */ - public static function getHeadersAsString(MessageInterface $message) - { - $result = ''; - foreach ($message->getHeaders() as $name => $values) { - $result .= "\r\n{$name}: " . implode(', ', $values); - } - - return $result; - } - - /** - * Gets the start line of a message - * - * @param MessageInterface $message - * - * @return string - * @throws \InvalidArgumentException - */ - public static function getStartLine(MessageInterface $message) - { - if ($message instanceof RequestInterface) { - return trim($message->getMethod() . ' ' - . $message->getResource()) - . ' HTTP/' . $message->getProtocolVersion(); - } elseif ($message instanceof ResponseInterface) { - return 'HTTP/' . $message->getProtocolVersion() . ' ' - . $message->getStatusCode() . ' ' - . $message->getReasonPhrase(); - } else { - throw new \InvalidArgumentException('Unknown message type'); - } - } - - /** - * Accepts and modifies the options provided to the message in the - * constructor. - * - * Can be overridden in subclasses as necessary. - * - * @param array $options Options array passed by reference. - */ - protected function handleOptions(array &$options) - { - if (isset($options['protocol_version'])) { - $this->protocolVersion = $options['protocol_version']; - } - } -} diff --git a/core/vendor/guzzlehttp/guzzle/src/Message/AppliesHeadersInterface.php b/core/vendor/guzzlehttp/guzzle/src/Message/AppliesHeadersInterface.php deleted file mode 100644 index ca42f20..0000000 --- a/core/vendor/guzzlehttp/guzzle/src/Message/AppliesHeadersInterface.php +++ /dev/null @@ -1,24 +0,0 @@ -then($onFulfilled, $onRejected, $onProgress), - [$future, 'wait'], - [$future, 'cancel'] - ); - } - - public function getStatusCode() - { - return $this->_value->getStatusCode(); - } - - public function setStatusCode($code) - { - $this->_value->setStatusCode($code); - } - - public function getReasonPhrase() - { - return $this->_value->getReasonPhrase(); - } - - public function setReasonPhrase($phrase) - { - $this->_value->setReasonPhrase($phrase); - } - - public function getEffectiveUrl() - { - return $this->_value->getEffectiveUrl(); - } - - public function setEffectiveUrl($url) - { - $this->_value->setEffectiveUrl($url); - } - - public function json(array $config = []) - { - return $this->_value->json($config); - } - - public function xml(array $config = []) - { - return $this->_value->xml($config); - } - - public function __toString() - { - try { - return $this->_value->__toString(); - } catch (\Exception $e) { - trigger_error($e->getMessage(), E_USER_WARNING); - return ''; - } - } - - public function getProtocolVersion() - { - return $this->_value->getProtocolVersion(); - } - - public function setBody(StreamInterface $body = null) - { - $this->_value->setBody($body); - } - - public function getBody() - { - return $this->_value->getBody(); - } - - public function getHeaders() - { - return $this->_value->getHeaders(); - } - - public function getHeader($header) - { - return $this->_value->getHeader($header); - } - - public function getHeaderAsArray($header) - { - return $this->_value->getHeaderAsArray($header); - } - - public function hasHeader($header) - { - return $this->_value->hasHeader($header); - } - - public function removeHeader($header) - { - $this->_value->removeHeader($header); - } - - public function addHeader($header, $value) - { - $this->_value->addHeader($header, $value); - } - - public function addHeaders(array $headers) - { - $this->_value->addHeaders($headers); - } - - public function setHeader($header, $value) - { - $this->_value->setHeader($header, $value); - } - - public function setHeaders(array $headers) - { - $this->_value->setHeaders($headers); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php b/core/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php deleted file mode 100644 index 85984e2..0000000 --- a/core/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php +++ /dev/null @@ -1,364 +0,0 @@ - 1, 'timeout' => 1, 'verify' => 1, 'ssl_key' => 1, - 'cert' => 1, 'proxy' => 1, 'debug' => 1, 'save_to' => 1, 'stream' => 1, - 'expect' => 1, 'future' => 1 - ]; - - /** @var array Default allow_redirects request option settings */ - private static $defaultRedirect = [ - 'max' => 5, - 'strict' => false, - 'referer' => false, - 'protocols' => ['http', 'https'] - ]; - - /** - * @param array $customOptions Associative array of custom request option - * names mapping to functions used to apply - * the option. The function accepts the request - * and the option value to apply. - */ - public function __construct(array $customOptions = []) - { - $this->errorPlugin = new HttpError(); - $this->redirectPlugin = new Redirect(); - $this->customOptions = $customOptions; - } - - public function createResponse( - $statusCode, - array $headers = [], - $body = null, - array $options = [] - ) { - if (null !== $body) { - $body = Stream::factory($body); - } - - return new Response($statusCode, $headers, $body, $options); - } - - public function createRequest($method, $url, array $options = []) - { - // Handle the request protocol version option that needs to be - // specified in the request constructor. - if (isset($options['version'])) { - $options['config']['protocol_version'] = $options['version']; - unset($options['version']); - } - - $request = new Request($method, $url, [], null, - isset($options['config']) ? $options['config'] : []); - - unset($options['config']); - - // Use a POST body by default - if ($method == 'POST' - && !isset($options['body']) - && !isset($options['json']) - ) { - $options['body'] = []; - } - - if ($options) { - $this->applyOptions($request, $options); - } - - return $request; - } - - /** - * Create a request or response object from an HTTP message string - * - * @param string $message Message to parse - * - * @return RequestInterface|ResponseInterface - * @throws \InvalidArgumentException if unable to parse a message - */ - public function fromMessage($message) - { - static $parser; - if (!$parser) { - $parser = new MessageParser(); - } - - // Parse a response - if (strtoupper(substr($message, 0, 4)) == 'HTTP') { - $data = $parser->parseResponse($message); - return $this->createResponse( - $data['code'], - $data['headers'], - $data['body'] === '' ? null : $data['body'], - $data - ); - } - - // Parse a request - if (!($data = ($parser->parseRequest($message)))) { - throw new \InvalidArgumentException('Unable to parse request'); - } - - return $this->createRequest( - $data['method'], - Url::buildUrl($data['request_url']), - [ - 'headers' => $data['headers'], - 'body' => $data['body'] === '' ? null : $data['body'], - 'config' => [ - 'protocol_version' => $data['protocol_version'] - ] - ] - ); - } - - /** - * Apply POST fields and files to a request to attempt to give an accurate - * representation. - * - * @param RequestInterface $request Request to update - * @param array $body Body to apply - */ - protected function addPostData(RequestInterface $request, array $body) - { - static $fields = ['string' => true, 'array' => true, 'NULL' => true, - 'boolean' => true, 'double' => true, 'integer' => true]; - - $post = new PostBody(); - foreach ($body as $key => $value) { - if (isset($fields[gettype($value)])) { - $post->setField($key, $value); - } elseif ($value instanceof PostFileInterface) { - $post->addFile($value); - } else { - $post->addFile(new PostFile($key, $value)); - } - } - - if ($request->getHeader('Content-Type') == 'multipart/form-data') { - $post->forceMultipartUpload(true); - } - - $request->setBody($post); - } - - protected function applyOptions( - RequestInterface $request, - array $options = [] - ) { - $config = $request->getConfig(); - $emitter = $request->getEmitter(); - - foreach ($options as $key => $value) { - - if (isset(self::$configMap[$key])) { - $config[$key] = $value; - continue; - } - - switch ($key) { - - case 'allow_redirects': - - if ($value === false) { - continue; - } - - if ($value === true) { - $value = self::$defaultRedirect; - } elseif (!is_array($value)) { - throw new Iae('allow_redirects must be true, false, or array'); - } else { - // Merge the default settings with the provided settings - $value += self::$defaultRedirect; - } - - $config['redirect'] = $value; - $emitter->attach($this->redirectPlugin); - break; - - case 'decode_content': - - if ($value === false) { - continue; - } - - $config['decode_content'] = true; - if ($value !== true) { - $request->setHeader('Accept-Encoding', $value); - } - break; - - case 'headers': - - if (!is_array($value)) { - throw new Iae('header value must be an array'); - } - foreach ($value as $k => $v) { - $request->setHeader($k, $v); - } - break; - - case 'exceptions': - - if ($value === true) { - $emitter->attach($this->errorPlugin); - } - break; - - case 'body': - - if (is_array($value)) { - $this->addPostData($request, $value); - } elseif ($value !== null) { - $request->setBody(Stream::factory($value)); - } - break; - - case 'auth': - - if (!$value) { - continue; - } - - if (is_array($value)) { - $type = isset($value[2]) ? strtolower($value[2]) : 'basic'; - } else { - $type = strtolower($value); - } - - $config['auth'] = $value; - - if ($type == 'basic') { - $request->setHeader( - 'Authorization', - 'Basic ' . base64_encode("$value[0]:$value[1]") - ); - } elseif ($type == 'digest') { - // @todo: Do not rely on curl - $config->setPath('curl/' . CURLOPT_HTTPAUTH, CURLAUTH_DIGEST); - $config->setPath('curl/' . CURLOPT_USERPWD, "$value[0]:$value[1]"); - } - break; - - case 'query': - - if ($value instanceof Query) { - $original = $request->getQuery(); - // Do not overwrite existing query string variables by - // overwriting the object with the query string data passed - // in the URL - $value->overwriteWith($original->toArray()); - $request->setQuery($value); - } elseif (is_array($value)) { - // Do not overwrite existing query string variables - $query = $request->getQuery(); - foreach ($value as $k => $v) { - if (!isset($query[$k])) { - $query[$k] = $v; - } - } - } else { - throw new Iae('query must be an array or Query object'); - } - break; - - case 'cookies': - - if ($value === true) { - static $cookie = null; - if (!$cookie) { - $cookie = new Cookie(); - } - $emitter->attach($cookie); - } elseif (is_array($value)) { - $emitter->attach( - new Cookie(CookieJar::fromArray($value, $request->getHost())) - ); - } elseif ($value instanceof CookieJarInterface) { - $emitter->attach(new Cookie($value)); - } elseif ($value !== false) { - throw new Iae('cookies must be an array, true, or CookieJarInterface'); - } - break; - - case 'events': - - if (!is_array($value)) { - throw new Iae('events must be an array'); - } - - $this->attachListeners($request, - $this->prepareListeners( - $value, - ['before', 'complete', 'error', 'progress', 'end'] - ) - ); - break; - - case 'subscribers': - - if (!is_array($value)) { - throw new Iae('subscribers must be an array'); - } - - foreach ($value as $subscribers) { - $emitter->attach($subscribers); - } - break; - - case 'json': - - $request->setBody(Stream::factory(json_encode($value))); - if (!$request->hasHeader('Content-Type')) { - $request->setHeader('Content-Type', 'application/json'); - } - break; - - default: - - // Check for custom handler functions. - if (isset($this->customOptions[$key])) { - $fn = $this->customOptions[$key]; - $fn($request, $value); - continue; - } - - throw new Iae("No method can handle the {$key} config key"); - } - } - } -} diff --git a/core/vendor/guzzlehttp/guzzle/src/Message/MessageFactoryInterface.php b/core/vendor/guzzlehttp/guzzle/src/Message/MessageFactoryInterface.php deleted file mode 100644 index 57c43e5..0000000 --- a/core/vendor/guzzlehttp/guzzle/src/Message/MessageFactoryInterface.php +++ /dev/null @@ -1,71 +0,0 @@ -getHeaders() as $name => $values) { - * echo $name . ": " . implode(", ", $values); - * } - * - * @return array Returns an associative array of the message's headers. - */ - public function getHeaders(); - - /** - * Retrieve a header by the given case-insensitive name. - * - * @param string $header Case-insensitive header name. - * - * @return string - */ - public function getHeader($header); - - /** - * Retrieves a header by the given case-insensitive name as an array of strings. - * - * @param string $header Case-insensitive header name. - * - * @return string[] - */ - public function getHeaderAsArray($header); - - /** - * Checks if a header exists by the given case-insensitive name. - * - * @param string $header Case-insensitive header name. - * - * @return bool Returns true if any header names match the given header - * name using a case-insensitive string comparison. Returns false if - * no matching header name is found in the message. - */ - public function hasHeader($header); - - /** - * Remove a specific header by case-insensitive name. - * - * @param string $header Case-insensitive header name. - */ - public function removeHeader($header); - - /** - * Appends a header value to any existing values associated with the - * given header name. - * - * @param string $header Header name to add - * @param string $value Value of the header - */ - public function addHeader($header, $value); - - /** - * Merges in an associative array of headers. - * - * Each array key MUST be a string representing the case-insensitive name - * of a header. Each value MUST be either a string or an array of strings. - * For each value, the value is appended to any existing header of the same - * name, or, if a header does not already exist by the given name, then the - * header is added. - * - * @param array $headers Associative array of headers to add to the message - */ - public function addHeaders(array $headers); - - /** - * Sets a header, replacing any existing values of any headers with the - * same case-insensitive name. - * - * The header values MUST be a string or an array of strings. - * - * @param string $header Header name - * @param string|array $value Header value(s) - */ - public function setHeader($header, $value); - - /** - * Sets headers, replacing any headers that have already been set on the - * message. - * - * The array keys MUST be a string. The array values must be either a - * string or an array of strings. - * - * @param array $headers Headers to set. - */ - public function setHeaders(array $headers); -} diff --git a/core/vendor/guzzlehttp/guzzle/src/Message/MessageParser.php b/core/vendor/guzzlehttp/guzzle/src/Message/MessageParser.php deleted file mode 100644 index c3cc195..0000000 --- a/core/vendor/guzzlehttp/guzzle/src/Message/MessageParser.php +++ /dev/null @@ -1,171 +0,0 @@ -parseMessage($message))) { - return false; - } - - // Parse the protocol and protocol version - if (isset($parts['start_line'][2])) { - $startParts = explode('/', $parts['start_line'][2]); - $protocol = strtoupper($startParts[0]); - $version = isset($startParts[1]) ? $startParts[1] : '1.1'; - } else { - $protocol = 'HTTP'; - $version = '1.1'; - } - - $parsed = [ - 'method' => strtoupper($parts['start_line'][0]), - 'protocol' => $protocol, - 'protocol_version' => $version, - 'headers' => $parts['headers'], - 'body' => $parts['body'] - ]; - - $parsed['request_url'] = $this->getUrlPartsFromMessage( - (isset($parts['start_line'][1]) ? $parts['start_line'][1] : ''), $parsed); - - return $parsed; - } - - /** - * Parse an HTTP response message into an associative array of parts. - * - * @param string $message HTTP response to parse - * - * @return array|bool Returns false if the message is invalid - */ - public function parseResponse($message) - { - if (!($parts = $this->parseMessage($message))) { - return false; - } - - list($protocol, $version) = explode('/', trim($parts['start_line'][0])); - - return [ - 'protocol' => $protocol, - 'protocol_version' => $version, - 'code' => $parts['start_line'][1], - 'reason_phrase' => isset($parts['start_line'][2]) ? $parts['start_line'][2] : '', - 'headers' => $parts['headers'], - 'body' => $parts['body'] - ]; - } - - /** - * Parse a message into parts - * - * @param string $message Message to parse - * - * @return array|bool - */ - private function parseMessage($message) - { - if (!$message) { - return false; - } - - $startLine = null; - $headers = []; - $body = ''; - - // Iterate over each line in the message, accounting for line endings - $lines = preg_split('/(\\r?\\n)/', $message, -1, PREG_SPLIT_DELIM_CAPTURE); - for ($i = 0, $totalLines = count($lines); $i < $totalLines; $i += 2) { - - $line = $lines[$i]; - - // If two line breaks were encountered, then this is the end of body - if (empty($line)) { - if ($i < $totalLines - 1) { - $body = implode('', array_slice($lines, $i + 2)); - } - break; - } - - // Parse message headers - if (!$startLine) { - $startLine = explode(' ', $line, 3); - } elseif (strpos($line, ':')) { - $parts = explode(':', $line, 2); - $key = trim($parts[0]); - $value = isset($parts[1]) ? trim($parts[1]) : ''; - if (!isset($headers[$key])) { - $headers[$key] = $value; - } elseif (!is_array($headers[$key])) { - $headers[$key] = [$headers[$key], $value]; - } else { - $headers[$key][] = $value; - } - } - } - - return [ - 'start_line' => $startLine, - 'headers' => $headers, - 'body' => $body - ]; - } - - /** - * Create URL parts from HTTP message parts - * - * @param string $requestUrl Associated URL - * @param array $parts HTTP message parts - * - * @return array - */ - private function getUrlPartsFromMessage($requestUrl, array $parts) - { - // Parse the URL information from the message - $urlParts = ['path' => $requestUrl, 'scheme' => 'http']; - - // Check for the Host header - if (isset($parts['headers']['Host'])) { - $urlParts['host'] = $parts['headers']['Host']; - } elseif (isset($parts['headers']['host'])) { - $urlParts['host'] = $parts['headers']['host']; - } else { - $urlParts['host'] = null; - } - - if (false === strpos($urlParts['host'], ':')) { - $urlParts['port'] = ''; - } else { - $hostParts = explode(':', $urlParts['host']); - $urlParts['host'] = trim($hostParts[0]); - $urlParts['port'] = (int) trim($hostParts[1]); - if ($urlParts['port'] == 443) { - $urlParts['scheme'] = 'https'; - } - } - - // Check if a query is present - $path = $urlParts['path']; - $qpos = strpos($path, '?'); - if ($qpos) { - $urlParts['query'] = substr($path, $qpos + 1); - $urlParts['path'] = substr($path, 0, $qpos); - } else { - $urlParts['query'] = ''; - } - - return $urlParts; - } -} diff --git a/core/vendor/guzzlehttp/guzzle/src/Message/Request.php b/core/vendor/guzzlehttp/guzzle/src/Message/Request.php deleted file mode 100644 index 4dbe32e..0000000 --- a/core/vendor/guzzlehttp/guzzle/src/Message/Request.php +++ /dev/null @@ -1,195 +0,0 @@ -setUrl($url); - $this->method = strtoupper($method); - $this->handleOptions($options); - $this->transferOptions = new Collection($options); - $this->addPrepareEvent(); - - if ($body !== null) { - $this->setBody($body); - } - - if ($headers) { - foreach ($headers as $key => $value) { - $this->setHeader($key, $value); - } - } - } - - public function __clone() - { - if ($this->emitter) { - $this->emitter = clone $this->emitter; - } - $this->transferOptions = clone $this->transferOptions; - $this->url = clone $this->url; - } - - public function setUrl($url) - { - $this->url = $url instanceof Url ? $url : Url::fromString($url); - $this->updateHostHeaderFromUrl(); - } - - public function getUrl() - { - return (string) $this->url; - } - - public function setQuery($query) - { - $this->url->setQuery($query); - } - - public function getQuery() - { - return $this->url->getQuery(); - } - - public function setMethod($method) - { - $this->method = strtoupper($method); - } - - public function getMethod() - { - return $this->method; - } - - public function getScheme() - { - return $this->url->getScheme(); - } - - public function setScheme($scheme) - { - $this->url->setScheme($scheme); - } - - public function getPort() - { - return $this->url->getPort(); - } - - public function setPort($port) - { - $this->url->setPort($port); - $this->updateHostHeaderFromUrl(); - } - - public function getHost() - { - return $this->url->getHost(); - } - - public function setHost($host) - { - $this->url->setHost($host); - $this->updateHostHeaderFromUrl(); - } - - public function getPath() - { - return '/' . ltrim($this->url->getPath(), '/'); - } - - public function setPath($path) - { - $this->url->setPath($path); - } - - public function getResource() - { - $resource = $this->getPath(); - if ($query = (string) $this->url->getQuery()) { - $resource .= '?' . $query; - } - - return $resource; - } - - public function getConfig() - { - return $this->transferOptions; - } - - protected function handleOptions(array &$options) - { - parent::handleOptions($options); - // Use a custom emitter if one is specified, and remove it from - // options that are exposed through getConfig() - if (isset($options['emitter'])) { - $this->emitter = $options['emitter']; - unset($options['emitter']); - } - } - - /** - * Adds a subscriber that ensures a request's body is prepared before - * sending. - */ - private function addPrepareEvent() - { - static $subscriber; - if (!$subscriber) { - $subscriber = new Prepare(); - } - - $this->getEmitter()->attach($subscriber); - } - - private function updateHostHeaderFromUrl() - { - $port = $this->url->getPort(); - $scheme = $this->url->getScheme(); - if ($host = $this->url->getHost()) { - if (($port == 80 && $scheme == 'http') || - ($port == 443 && $scheme == 'https') - ) { - $this->setHeader('Host', $host); - } else { - $this->setHeader('Host', "{$host}:{$port}"); - } - } - } -} diff --git a/core/vendor/guzzlehttp/guzzle/src/Message/RequestInterface.php b/core/vendor/guzzlehttp/guzzle/src/Message/RequestInterface.php deleted file mode 100644 index f6a69d1..0000000 --- a/core/vendor/guzzlehttp/guzzle/src/Message/RequestInterface.php +++ /dev/null @@ -1,136 +0,0 @@ - '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 string The reason phrase of the response (human readable code) */ - private $reasonPhrase; - - /** @var string The status code of the response */ - private $statusCode; - - /** @var string The effective URL that returned this response */ - private $effectiveUrl; - - /** - * @param int|string $statusCode The response status code (e.g. 200) - * @param array $headers The response headers - * @param StreamInterface $body The body of the response - * @param array $options Response message options - * - reason_phrase: Set a custom reason phrase - * - protocol_version: Set a custom protocol version - */ - public function __construct( - $statusCode, - array $headers = [], - StreamInterface $body = null, - array $options = [] - ) { - $this->statusCode = (int) $statusCode; - $this->handleOptions($options); - - // Assume a reason phrase if one was not applied as an option - if (!$this->reasonPhrase && - isset(self::$statusTexts[$this->statusCode]) - ) { - $this->reasonPhrase = self::$statusTexts[$this->statusCode]; - } - - if ($headers) { - $this->setHeaders($headers); - } - - if ($body) { - $this->setBody($body); - } - } - - public function getStatusCode() - { - return $this->statusCode; - } - - public function setStatusCode($code) - { - return $this->statusCode = (int) $code; - } - - public function getReasonPhrase() - { - return $this->reasonPhrase; - } - - public function setReasonPhrase($phrase) - { - return $this->reasonPhrase = $phrase; - } - - public function json(array $config = []) - { - try { - return Utils::jsonDecode( - (string) $this->getBody(), - isset($config['object']) ? !$config['object'] : true, - 512, - isset($config['big_int_strings']) ? JSON_BIGINT_AS_STRING : 0 - ); - } catch (\InvalidArgumentException $e) { - throw new ParseException( - $e->getMessage(), - $this - ); - } - } - - public function xml(array $config = []) - { - $disableEntities = libxml_disable_entity_loader(true); - $internalErrors = libxml_use_internal_errors(true); - - try { - // Allow XML to be retrieved even if there is no response body - $xml = new \SimpleXMLElement( - (string) $this->getBody() ?: '', - isset($config['libxml_options']) ? $config['libxml_options'] : LIBXML_NONET, - false, - isset($config['ns']) ? $config['ns'] : '', - isset($config['ns_is_prefix']) ? $config['ns_is_prefix'] : false - ); - libxml_disable_entity_loader($disableEntities); - libxml_use_internal_errors($internalErrors); - } catch (\Exception $e) { - libxml_disable_entity_loader($disableEntities); - libxml_use_internal_errors($internalErrors); - throw new XmlParseException( - 'Unable to parse response body into XML: ' . $e->getMessage(), - $this, - $e, - (libxml_get_last_error()) ?: null - ); - } - - return $xml; - } - - public function getEffectiveUrl() - { - return $this->effectiveUrl; - } - - public function setEffectiveUrl($url) - { - $this->effectiveUrl = $url; - } - - /** - * Accepts and modifies the options provided to the response in the - * constructor. - * - * @param array $options Options array passed by reference. - */ - protected function handleOptions(array &$options = []) - { - parent::handleOptions($options); - if (isset($options['reason_phrase'])) { - $this->reasonPhrase = $options['reason_phrase']; - } - } -} diff --git a/core/vendor/guzzlehttp/guzzle/src/Message/ResponseInterface.php b/core/vendor/guzzlehttp/guzzle/src/Message/ResponseInterface.php deleted file mode 100644 index c0ae9be..0000000 --- a/core/vendor/guzzlehttp/guzzle/src/Message/ResponseInterface.php +++ /dev/null @@ -1,111 +0,0 @@ - 'text/vnd.in3d.3dml', - '3g2' => 'video/3gpp2', - '3gp' => 'video/3gpp', - '7z' => 'application/x-7z-compressed', - 'aab' => 'application/x-authorware-bin', - 'aac' => 'audio/x-aac', - 'aam' => 'application/x-authorware-map', - 'aas' => 'application/x-authorware-seg', - 'abw' => 'application/x-abiword', - 'ac' => 'application/pkix-attr-cert', - 'acc' => 'application/vnd.americandynamics.acc', - 'ace' => 'application/x-ace-compressed', - 'acu' => 'application/vnd.acucobol', - 'acutc' => 'application/vnd.acucorp', - 'adp' => 'audio/adpcm', - 'aep' => 'application/vnd.audiograph', - 'afm' => 'application/x-font-type1', - 'afp' => 'application/vnd.ibm.modcap', - 'ahead' => 'application/vnd.ahead.space', - 'ai' => 'application/postscript', - 'aif' => 'audio/x-aiff', - 'aifc' => 'audio/x-aiff', - 'aiff' => 'audio/x-aiff', - 'air' => 'application/vnd.adobe.air-application-installer-package+zip', - 'ait' => 'application/vnd.dvb.ait', - 'ami' => 'application/vnd.amiga.ami', - 'apk' => 'application/vnd.android.package-archive', - 'application' => 'application/x-ms-application', - 'apr' => 'application/vnd.lotus-approach', - 'asa' => 'text/plain', - 'asax' => 'application/octet-stream', - 'asc' => 'application/pgp-signature', - 'ascx' => 'text/plain', - 'asf' => 'video/x-ms-asf', - 'ashx' => 'text/plain', - 'asm' => 'text/x-asm', - 'asmx' => 'text/plain', - 'aso' => 'application/vnd.accpac.simply.aso', - 'asp' => 'text/plain', - 'aspx' => 'text/plain', - 'asx' => 'video/x-ms-asf', - 'atc' => 'application/vnd.acucorp', - 'atom' => 'application/atom+xml', - 'atomcat' => 'application/atomcat+xml', - 'atomsvc' => 'application/atomsvc+xml', - 'atx' => 'application/vnd.antix.game-component', - 'au' => 'audio/basic', - 'avi' => 'video/x-msvideo', - 'aw' => 'application/applixware', - 'axd' => 'text/plain', - 'azf' => 'application/vnd.airzip.filesecure.azf', - 'azs' => 'application/vnd.airzip.filesecure.azs', - 'azw' => 'application/vnd.amazon.ebook', - 'bat' => 'application/x-msdownload', - 'bcpio' => 'application/x-bcpio', - 'bdf' => 'application/x-font-bdf', - 'bdm' => 'application/vnd.syncml.dm+wbxml', - 'bed' => 'application/vnd.realvnc.bed', - 'bh2' => 'application/vnd.fujitsu.oasysprs', - 'bin' => 'application/octet-stream', - 'bmi' => 'application/vnd.bmi', - 'bmp' => 'image/bmp', - 'book' => 'application/vnd.framemaker', - 'box' => 'application/vnd.previewsystems.box', - 'boz' => 'application/x-bzip2', - 'bpk' => 'application/octet-stream', - 'btif' => 'image/prs.btif', - 'bz' => 'application/x-bzip', - 'bz2' => 'application/x-bzip2', - 'c' => 'text/x-c', - 'c11amc' => 'application/vnd.cluetrust.cartomobile-config', - 'c11amz' => 'application/vnd.cluetrust.cartomobile-config-pkg', - 'c4d' => 'application/vnd.clonk.c4group', - 'c4f' => 'application/vnd.clonk.c4group', - 'c4g' => 'application/vnd.clonk.c4group', - 'c4p' => 'application/vnd.clonk.c4group', - 'c4u' => 'application/vnd.clonk.c4group', - 'cab' => 'application/vnd.ms-cab-compressed', - 'car' => 'application/vnd.curl.car', - 'cat' => 'application/vnd.ms-pki.seccat', - 'cc' => 'text/x-c', - 'cct' => 'application/x-director', - 'ccxml' => 'application/ccxml+xml', - 'cdbcmsg' => 'application/vnd.contact.cmsg', - 'cdf' => 'application/x-netcdf', - 'cdkey' => 'application/vnd.mediastation.cdkey', - 'cdmia' => 'application/cdmi-capability', - 'cdmic' => 'application/cdmi-container', - 'cdmid' => 'application/cdmi-domain', - 'cdmio' => 'application/cdmi-object', - 'cdmiq' => 'application/cdmi-queue', - 'cdx' => 'chemical/x-cdx', - 'cdxml' => 'application/vnd.chemdraw+xml', - 'cdy' => 'application/vnd.cinderella', - 'cer' => 'application/pkix-cert', - 'cfc' => 'application/x-coldfusion', - 'cfm' => 'application/x-coldfusion', - 'cgm' => 'image/cgm', - 'chat' => 'application/x-chat', - 'chm' => 'application/vnd.ms-htmlhelp', - 'chrt' => 'application/vnd.kde.kchart', - 'cif' => 'chemical/x-cif', - 'cii' => 'application/vnd.anser-web-certificate-issue-initiation', - 'cil' => 'application/vnd.ms-artgalry', - 'cla' => 'application/vnd.claymore', - 'class' => 'application/java-vm', - 'clkk' => 'application/vnd.crick.clicker.keyboard', - 'clkp' => 'application/vnd.crick.clicker.palette', - 'clkt' => 'application/vnd.crick.clicker.template', - 'clkw' => 'application/vnd.crick.clicker.wordbank', - 'clkx' => 'application/vnd.crick.clicker', - 'clp' => 'application/x-msclip', - 'cmc' => 'application/vnd.cosmocaller', - 'cmdf' => 'chemical/x-cmdf', - 'cml' => 'chemical/x-cml', - 'cmp' => 'application/vnd.yellowriver-custom-menu', - 'cmx' => 'image/x-cmx', - 'cod' => 'application/vnd.rim.cod', - 'com' => 'application/x-msdownload', - 'conf' => 'text/plain', - 'cpio' => 'application/x-cpio', - 'cpp' => 'text/x-c', - 'cpt' => 'application/mac-compactpro', - 'crd' => 'application/x-mscardfile', - 'crl' => 'application/pkix-crl', - 'crt' => 'application/x-x509-ca-cert', - 'cryptonote' => 'application/vnd.rig.cryptonote', - 'cs' => 'text/plain', - 'csh' => 'application/x-csh', - 'csml' => 'chemical/x-csml', - 'csp' => 'application/vnd.commonspace', - 'css' => 'text/css', - 'cst' => 'application/x-director', - 'csv' => 'text/csv', - 'cu' => 'application/cu-seeme', - 'curl' => 'text/vnd.curl', - 'cww' => 'application/prs.cww', - 'cxt' => 'application/x-director', - 'cxx' => 'text/x-c', - 'dae' => 'model/vnd.collada+xml', - 'daf' => 'application/vnd.mobius.daf', - 'dataless' => 'application/vnd.fdsn.seed', - 'davmount' => 'application/davmount+xml', - 'dcr' => 'application/x-director', - 'dcurl' => 'text/vnd.curl.dcurl', - 'dd2' => 'application/vnd.oma.dd2+xml', - 'ddd' => 'application/vnd.fujixerox.ddd', - 'deb' => 'application/x-debian-package', - 'def' => 'text/plain', - 'deploy' => 'application/octet-stream', - 'der' => 'application/x-x509-ca-cert', - 'dfac' => 'application/vnd.dreamfactory', - 'dic' => 'text/x-c', - 'dir' => 'application/x-director', - 'dis' => 'application/vnd.mobius.dis', - 'dist' => 'application/octet-stream', - 'distz' => 'application/octet-stream', - 'djv' => 'image/vnd.djvu', - 'djvu' => 'image/vnd.djvu', - 'dll' => 'application/x-msdownload', - 'dmg' => 'application/octet-stream', - 'dms' => 'application/octet-stream', - 'dna' => 'application/vnd.dna', - 'doc' => 'application/msword', - 'docm' => 'application/vnd.ms-word.document.macroenabled.12', - 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', - 'dot' => 'application/msword', - 'dotm' => 'application/vnd.ms-word.template.macroenabled.12', - 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', - 'dp' => 'application/vnd.osgi.dp', - 'dpg' => 'application/vnd.dpgraph', - 'dra' => 'audio/vnd.dra', - 'dsc' => 'text/prs.lines.tag', - 'dssc' => 'application/dssc+der', - 'dtb' => 'application/x-dtbook+xml', - 'dtd' => 'application/xml-dtd', - 'dts' => 'audio/vnd.dts', - 'dtshd' => 'audio/vnd.dts.hd', - 'dump' => 'application/octet-stream', - 'dvi' => 'application/x-dvi', - 'dwf' => 'model/vnd.dwf', - 'dwg' => 'image/vnd.dwg', - 'dxf' => 'image/vnd.dxf', - 'dxp' => 'application/vnd.spotfire.dxp', - 'dxr' => 'application/x-director', - 'ecelp4800' => 'audio/vnd.nuera.ecelp4800', - 'ecelp7470' => 'audio/vnd.nuera.ecelp7470', - 'ecelp9600' => 'audio/vnd.nuera.ecelp9600', - 'ecma' => 'application/ecmascript', - 'edm' => 'application/vnd.novadigm.edm', - 'edx' => 'application/vnd.novadigm.edx', - 'efif' => 'application/vnd.picsel', - 'ei6' => 'application/vnd.pg.osasli', - 'elc' => 'application/octet-stream', - 'eml' => 'message/rfc822', - 'emma' => 'application/emma+xml', - 'eol' => 'audio/vnd.digital-winds', - 'eot' => 'application/vnd.ms-fontobject', - 'eps' => 'application/postscript', - 'epub' => 'application/epub+zip', - 'es3' => 'application/vnd.eszigno3+xml', - 'esf' => 'application/vnd.epson.esf', - 'et3' => 'application/vnd.eszigno3+xml', - 'etx' => 'text/x-setext', - 'exe' => 'application/x-msdownload', - 'exi' => 'application/exi', - 'ext' => 'application/vnd.novadigm.ext', - 'ez' => 'application/andrew-inset', - 'ez2' => 'application/vnd.ezpix-album', - 'ez3' => 'application/vnd.ezpix-package', - 'f' => 'text/x-fortran', - 'f4v' => 'video/x-f4v', - 'f77' => 'text/x-fortran', - 'f90' => 'text/x-fortran', - 'fbs' => 'image/vnd.fastbidsheet', - 'fcs' => 'application/vnd.isac.fcs', - 'fdf' => 'application/vnd.fdf', - 'fe_launch' => 'application/vnd.denovo.fcselayout-link', - 'fg5' => 'application/vnd.fujitsu.oasysgp', - 'fgd' => 'application/x-director', - 'fh' => 'image/x-freehand', - 'fh4' => 'image/x-freehand', - 'fh5' => 'image/x-freehand', - 'fh7' => 'image/x-freehand', - 'fhc' => 'image/x-freehand', - 'fig' => 'application/x-xfig', - 'fli' => 'video/x-fli', - 'flo' => 'application/vnd.micrografx.flo', - 'flv' => 'video/x-flv', - 'flw' => 'application/vnd.kde.kivio', - 'flx' => 'text/vnd.fmi.flexstor', - 'fly' => 'text/vnd.fly', - 'fm' => 'application/vnd.framemaker', - 'fnc' => 'application/vnd.frogans.fnc', - 'for' => 'text/x-fortran', - 'fpx' => 'image/vnd.fpx', - 'frame' => 'application/vnd.framemaker', - 'fsc' => 'application/vnd.fsc.weblaunch', - 'fst' => 'image/vnd.fst', - 'ftc' => 'application/vnd.fluxtime.clip', - 'fti' => 'application/vnd.anser-web-funds-transfer-initiation', - 'fvt' => 'video/vnd.fvt', - 'fxp' => 'application/vnd.adobe.fxp', - 'fxpl' => 'application/vnd.adobe.fxp', - 'fzs' => 'application/vnd.fuzzysheet', - 'g2w' => 'application/vnd.geoplan', - 'g3' => 'image/g3fax', - 'g3w' => 'application/vnd.geospace', - 'gac' => 'application/vnd.groove-account', - 'gdl' => 'model/vnd.gdl', - 'geo' => 'application/vnd.dynageo', - 'gex' => 'application/vnd.geometry-explorer', - 'ggb' => 'application/vnd.geogebra.file', - 'ggt' => 'application/vnd.geogebra.tool', - 'ghf' => 'application/vnd.groove-help', - 'gif' => 'image/gif', - 'gim' => 'application/vnd.groove-identity-message', - 'gmx' => 'application/vnd.gmx', - 'gnumeric' => 'application/x-gnumeric', - 'gph' => 'application/vnd.flographit', - 'gqf' => 'application/vnd.grafeq', - 'gqs' => 'application/vnd.grafeq', - 'gram' => 'application/srgs', - 'gre' => 'application/vnd.geometry-explorer', - 'grv' => 'application/vnd.groove-injector', - 'grxml' => 'application/srgs+xml', - 'gsf' => 'application/x-font-ghostscript', - 'gtar' => 'application/x-gtar', - 'gtm' => 'application/vnd.groove-tool-message', - 'gtw' => 'model/vnd.gtw', - 'gv' => 'text/vnd.graphviz', - 'gxt' => 'application/vnd.geonext', - 'h' => 'text/x-c', - 'h261' => 'video/h261', - 'h263' => 'video/h263', - 'h264' => 'video/h264', - 'hal' => 'application/vnd.hal+xml', - 'hbci' => 'application/vnd.hbci', - 'hdf' => 'application/x-hdf', - 'hh' => 'text/x-c', - 'hlp' => 'application/winhlp', - 'hpgl' => 'application/vnd.hp-hpgl', - 'hpid' => 'application/vnd.hp-hpid', - 'hps' => 'application/vnd.hp-hps', - 'hqx' => 'application/mac-binhex40', - 'hta' => 'application/octet-stream', - 'htc' => 'text/html', - 'htke' => 'application/vnd.kenameaapp', - 'htm' => 'text/html', - 'html' => 'text/html', - 'hvd' => 'application/vnd.yamaha.hv-dic', - 'hvp' => 'application/vnd.yamaha.hv-voice', - 'hvs' => 'application/vnd.yamaha.hv-script', - 'i2g' => 'application/vnd.intergeo', - 'icc' => 'application/vnd.iccprofile', - 'ice' => 'x-conference/x-cooltalk', - 'icm' => 'application/vnd.iccprofile', - 'ico' => 'image/x-icon', - 'ics' => 'text/calendar', - 'ief' => 'image/ief', - 'ifb' => 'text/calendar', - 'ifm' => 'application/vnd.shana.informed.formdata', - 'iges' => 'model/iges', - 'igl' => 'application/vnd.igloader', - 'igm' => 'application/vnd.insors.igm', - 'igs' => 'model/iges', - 'igx' => 'application/vnd.micrografx.igx', - 'iif' => 'application/vnd.shana.informed.interchange', - 'imp' => 'application/vnd.accpac.simply.imp', - 'ims' => 'application/vnd.ms-ims', - 'in' => 'text/plain', - 'ini' => 'text/plain', - 'ipfix' => 'application/ipfix', - 'ipk' => 'application/vnd.shana.informed.package', - 'irm' => 'application/vnd.ibm.rights-management', - 'irp' => 'application/vnd.irepository.package+xml', - 'iso' => 'application/octet-stream', - 'itp' => 'application/vnd.shana.informed.formtemplate', - 'ivp' => 'application/vnd.immervision-ivp', - 'ivu' => 'application/vnd.immervision-ivu', - 'jad' => 'text/vnd.sun.j2me.app-descriptor', - 'jam' => 'application/vnd.jam', - 'jar' => 'application/java-archive', - 'java' => 'text/x-java-source', - 'jisp' => 'application/vnd.jisp', - 'jlt' => 'application/vnd.hp-jlyt', - 'jnlp' => 'application/x-java-jnlp-file', - 'joda' => 'application/vnd.joost.joda-archive', - 'jpe' => 'image/jpeg', - 'jpeg' => 'image/jpeg', - 'jpg' => 'image/jpeg', - 'jpgm' => 'video/jpm', - 'jpgv' => 'video/jpeg', - 'jpm' => 'video/jpm', - 'js' => 'text/javascript', - 'json' => 'application/json', - 'kar' => 'audio/midi', - 'karbon' => 'application/vnd.kde.karbon', - 'kfo' => 'application/vnd.kde.kformula', - 'kia' => 'application/vnd.kidspiration', - 'kml' => 'application/vnd.google-earth.kml+xml', - 'kmz' => 'application/vnd.google-earth.kmz', - 'kne' => 'application/vnd.kinar', - 'knp' => 'application/vnd.kinar', - 'kon' => 'application/vnd.kde.kontour', - 'kpr' => 'application/vnd.kde.kpresenter', - 'kpt' => 'application/vnd.kde.kpresenter', - 'ksp' => 'application/vnd.kde.kspread', - 'ktr' => 'application/vnd.kahootz', - 'ktx' => 'image/ktx', - 'ktz' => 'application/vnd.kahootz', - 'kwd' => 'application/vnd.kde.kword', - 'kwt' => 'application/vnd.kde.kword', - 'lasxml' => 'application/vnd.las.las+xml', - 'latex' => 'application/x-latex', - 'lbd' => 'application/vnd.llamagraphics.life-balance.desktop', - 'lbe' => 'application/vnd.llamagraphics.life-balance.exchange+xml', - 'les' => 'application/vnd.hhe.lesson-player', - 'lha' => 'application/octet-stream', - 'link66' => 'application/vnd.route66.link66+xml', - 'list' => 'text/plain', - 'list3820' => 'application/vnd.ibm.modcap', - 'listafp' => 'application/vnd.ibm.modcap', - 'log' => 'text/plain', - 'lostxml' => 'application/lost+xml', - 'lrf' => 'application/octet-stream', - 'lrm' => 'application/vnd.ms-lrm', - 'ltf' => 'application/vnd.frogans.ltf', - 'lvp' => 'audio/vnd.lucent.voice', - 'lwp' => 'application/vnd.lotus-wordpro', - 'lzh' => 'application/octet-stream', - 'm13' => 'application/x-msmediaview', - 'm14' => 'application/x-msmediaview', - 'm1v' => 'video/mpeg', - 'm21' => 'application/mp21', - 'm2a' => 'audio/mpeg', - 'm2v' => 'video/mpeg', - 'm3a' => 'audio/mpeg', - 'm3u' => 'audio/x-mpegurl', - 'm3u8' => 'application/vnd.apple.mpegurl', - 'm4a' => 'audio/mp4', - 'm4u' => 'video/vnd.mpegurl', - 'm4v' => 'video/mp4', - 'ma' => 'application/mathematica', - 'mads' => 'application/mads+xml', - 'mag' => 'application/vnd.ecowin.chart', - 'maker' => 'application/vnd.framemaker', - 'man' => 'text/troff', - 'mathml' => 'application/mathml+xml', - 'mb' => 'application/mathematica', - 'mbk' => 'application/vnd.mobius.mbk', - 'mbox' => 'application/mbox', - 'mc1' => 'application/vnd.medcalcdata', - 'mcd' => 'application/vnd.mcd', - 'mcurl' => 'text/vnd.curl.mcurl', - 'mdb' => 'application/x-msaccess', - 'mdi' => 'image/vnd.ms-modi', - 'me' => 'text/troff', - 'mesh' => 'model/mesh', - 'meta4' => 'application/metalink4+xml', - 'mets' => 'application/mets+xml', - 'mfm' => 'application/vnd.mfmp', - 'mgp' => 'application/vnd.osgeo.mapguide.package', - 'mgz' => 'application/vnd.proteus.magazine', - 'mid' => 'audio/midi', - 'midi' => 'audio/midi', - 'mif' => 'application/vnd.mif', - 'mime' => 'message/rfc822', - 'mj2' => 'video/mj2', - 'mjp2' => 'video/mj2', - 'mlp' => 'application/vnd.dolby.mlp', - 'mmd' => 'application/vnd.chipnuts.karaoke-mmd', - 'mmf' => 'application/vnd.smaf', - 'mmr' => 'image/vnd.fujixerox.edmics-mmr', - 'mny' => 'application/x-msmoney', - 'mobi' => 'application/x-mobipocket-ebook', - 'mods' => 'application/mods+xml', - 'mov' => 'video/quicktime', - 'movie' => 'video/x-sgi-movie', - 'mp2' => 'audio/mpeg', - 'mp21' => 'application/mp21', - 'mp2a' => 'audio/mpeg', - 'mp3' => 'audio/mpeg', - 'mp4' => 'video/mp4', - 'mp4a' => 'audio/mp4', - 'mp4s' => 'application/mp4', - 'mp4v' => 'video/mp4', - 'mpc' => 'application/vnd.mophun.certificate', - 'mpe' => 'video/mpeg', - 'mpeg' => 'video/mpeg', - 'mpg' => 'video/mpeg', - 'mpg4' => 'video/mp4', - 'mpga' => 'audio/mpeg', - 'mpkg' => 'application/vnd.apple.installer+xml', - 'mpm' => 'application/vnd.blueice.multipass', - 'mpn' => 'application/vnd.mophun.application', - 'mpp' => 'application/vnd.ms-project', - 'mpt' => 'application/vnd.ms-project', - 'mpy' => 'application/vnd.ibm.minipay', - 'mqy' => 'application/vnd.mobius.mqy', - 'mrc' => 'application/marc', - 'mrcx' => 'application/marcxml+xml', - 'ms' => 'text/troff', - 'mscml' => 'application/mediaservercontrol+xml', - 'mseed' => 'application/vnd.fdsn.mseed', - 'mseq' => 'application/vnd.mseq', - 'msf' => 'application/vnd.epson.msf', - 'msh' => 'model/mesh', - 'msi' => 'application/x-msdownload', - 'msl' => 'application/vnd.mobius.msl', - 'msty' => 'application/vnd.muvee.style', - 'mts' => 'model/vnd.mts', - 'mus' => 'application/vnd.musician', - 'musicxml' => 'application/vnd.recordare.musicxml+xml', - 'mvb' => 'application/x-msmediaview', - 'mwf' => 'application/vnd.mfer', - 'mxf' => 'application/mxf', - 'mxl' => 'application/vnd.recordare.musicxml', - 'mxml' => 'application/xv+xml', - 'mxs' => 'application/vnd.triscape.mxs', - 'mxu' => 'video/vnd.mpegurl', - 'n-gage' => 'application/vnd.nokia.n-gage.symbian.install', - 'n3' => 'text/n3', - 'nb' => 'application/mathematica', - 'nbp' => 'application/vnd.wolfram.player', - 'nc' => 'application/x-netcdf', - 'ncx' => 'application/x-dtbncx+xml', - 'ngdat' => 'application/vnd.nokia.n-gage.data', - 'nlu' => 'application/vnd.neurolanguage.nlu', - 'nml' => 'application/vnd.enliven', - 'nnd' => 'application/vnd.noblenet-directory', - 'nns' => 'application/vnd.noblenet-sealer', - 'nnw' => 'application/vnd.noblenet-web', - 'npx' => 'image/vnd.net-fpx', - 'nsf' => 'application/vnd.lotus-notes', - 'oa2' => 'application/vnd.fujitsu.oasys2', - 'oa3' => 'application/vnd.fujitsu.oasys3', - 'oas' => 'application/vnd.fujitsu.oasys', - 'obd' => 'application/x-msbinder', - 'oda' => 'application/oda', - 'odb' => 'application/vnd.oasis.opendocument.database', - 'odc' => 'application/vnd.oasis.opendocument.chart', - 'odf' => 'application/vnd.oasis.opendocument.formula', - 'odft' => 'application/vnd.oasis.opendocument.formula-template', - 'odg' => 'application/vnd.oasis.opendocument.graphics', - 'odi' => 'application/vnd.oasis.opendocument.image', - 'odm' => 'application/vnd.oasis.opendocument.text-master', - 'odp' => 'application/vnd.oasis.opendocument.presentation', - 'ods' => 'application/vnd.oasis.opendocument.spreadsheet', - 'odt' => 'application/vnd.oasis.opendocument.text', - 'oga' => 'audio/ogg', - 'ogg' => 'audio/ogg', - 'ogv' => 'video/ogg', - 'ogx' => 'application/ogg', - 'onepkg' => 'application/onenote', - 'onetmp' => 'application/onenote', - 'onetoc' => 'application/onenote', - 'onetoc2' => 'application/onenote', - 'opf' => 'application/oebps-package+xml', - 'oprc' => 'application/vnd.palm', - 'org' => 'application/vnd.lotus-organizer', - 'osf' => 'application/vnd.yamaha.openscoreformat', - 'osfpvg' => 'application/vnd.yamaha.openscoreformat.osfpvg+xml', - 'otc' => 'application/vnd.oasis.opendocument.chart-template', - 'otf' => 'application/x-font-otf', - 'otg' => 'application/vnd.oasis.opendocument.graphics-template', - 'oth' => 'application/vnd.oasis.opendocument.text-web', - 'oti' => 'application/vnd.oasis.opendocument.image-template', - 'otp' => 'application/vnd.oasis.opendocument.presentation-template', - 'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template', - 'ott' => 'application/vnd.oasis.opendocument.text-template', - 'oxt' => 'application/vnd.openofficeorg.extension', - 'p' => 'text/x-pascal', - 'p10' => 'application/pkcs10', - 'p12' => 'application/x-pkcs12', - 'p7b' => 'application/x-pkcs7-certificates', - 'p7c' => 'application/pkcs7-mime', - 'p7m' => 'application/pkcs7-mime', - 'p7r' => 'application/x-pkcs7-certreqresp', - 'p7s' => 'application/pkcs7-signature', - 'p8' => 'application/pkcs8', - 'pas' => 'text/x-pascal', - 'paw' => 'application/vnd.pawaafile', - 'pbd' => 'application/vnd.powerbuilder6', - 'pbm' => 'image/x-portable-bitmap', - 'pcf' => 'application/x-font-pcf', - 'pcl' => 'application/vnd.hp-pcl', - 'pclxl' => 'application/vnd.hp-pclxl', - 'pct' => 'image/x-pict', - 'pcurl' => 'application/vnd.curl.pcurl', - 'pcx' => 'image/x-pcx', - 'pdb' => 'application/vnd.palm', - 'pdf' => 'application/pdf', - 'pfa' => 'application/x-font-type1', - 'pfb' => 'application/x-font-type1', - 'pfm' => 'application/x-font-type1', - 'pfr' => 'application/font-tdpfr', - 'pfx' => 'application/x-pkcs12', - 'pgm' => 'image/x-portable-graymap', - 'pgn' => 'application/x-chess-pgn', - 'pgp' => 'application/pgp-encrypted', - 'php' => 'text/x-php', - 'phps' => 'application/x-httpd-phps', - 'pic' => 'image/x-pict', - 'pkg' => 'application/octet-stream', - 'pki' => 'application/pkixcmp', - 'pkipath' => 'application/pkix-pkipath', - 'plb' => 'application/vnd.3gpp.pic-bw-large', - 'plc' => 'application/vnd.mobius.plc', - 'plf' => 'application/vnd.pocketlearn', - 'pls' => 'application/pls+xml', - 'pml' => 'application/vnd.ctc-posml', - 'png' => 'image/png', - 'pnm' => 'image/x-portable-anymap', - 'portpkg' => 'application/vnd.macports.portpkg', - 'pot' => 'application/vnd.ms-powerpoint', - 'potm' => 'application/vnd.ms-powerpoint.template.macroenabled.12', - 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template', - 'ppam' => 'application/vnd.ms-powerpoint.addin.macroenabled.12', - 'ppd' => 'application/vnd.cups-ppd', - 'ppm' => 'image/x-portable-pixmap', - 'pps' => 'application/vnd.ms-powerpoint', - 'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroenabled.12', - 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', - 'ppt' => 'application/vnd.ms-powerpoint', - 'pptm' => 'application/vnd.ms-powerpoint.presentation.macroenabled.12', - 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', - 'pqa' => 'application/vnd.palm', - 'prc' => 'application/x-mobipocket-ebook', - 'pre' => 'application/vnd.lotus-freelance', - 'prf' => 'application/pics-rules', - 'ps' => 'application/postscript', - 'psb' => 'application/vnd.3gpp.pic-bw-small', - 'psd' => 'image/vnd.adobe.photoshop', - 'psf' => 'application/x-font-linux-psf', - 'pskcxml' => 'application/pskc+xml', - 'ptid' => 'application/vnd.pvi.ptid1', - 'pub' => 'application/x-mspublisher', - 'pvb' => 'application/vnd.3gpp.pic-bw-var', - 'pwn' => 'application/vnd.3m.post-it-notes', - 'pya' => 'audio/vnd.ms-playready.media.pya', - 'pyv' => 'video/vnd.ms-playready.media.pyv', - 'qam' => 'application/vnd.epson.quickanime', - 'qbo' => 'application/vnd.intu.qbo', - 'qfx' => 'application/vnd.intu.qfx', - 'qps' => 'application/vnd.publishare-delta-tree', - 'qt' => 'video/quicktime', - 'qwd' => 'application/vnd.quark.quarkxpress', - 'qwt' => 'application/vnd.quark.quarkxpress', - 'qxb' => 'application/vnd.quark.quarkxpress', - 'qxd' => 'application/vnd.quark.quarkxpress', - 'qxl' => 'application/vnd.quark.quarkxpress', - 'qxt' => 'application/vnd.quark.quarkxpress', - 'ra' => 'audio/x-pn-realaudio', - 'ram' => 'audio/x-pn-realaudio', - 'rar' => 'application/x-rar-compressed', - 'ras' => 'image/x-cmu-raster', - 'rb' => 'text/plain', - 'rcprofile' => 'application/vnd.ipunplugged.rcprofile', - 'rdf' => 'application/rdf+xml', - 'rdz' => 'application/vnd.data-vision.rdz', - 'rep' => 'application/vnd.businessobjects', - 'res' => 'application/x-dtbresource+xml', - 'resx' => 'text/xml', - 'rgb' => 'image/x-rgb', - 'rif' => 'application/reginfo+xml', - 'rip' => 'audio/vnd.rip', - 'rl' => 'application/resource-lists+xml', - 'rlc' => 'image/vnd.fujixerox.edmics-rlc', - 'rld' => 'application/resource-lists-diff+xml', - 'rm' => 'application/vnd.rn-realmedia', - 'rmi' => 'audio/midi', - 'rmp' => 'audio/x-pn-realaudio-plugin', - 'rms' => 'application/vnd.jcp.javame.midlet-rms', - 'rnc' => 'application/relax-ng-compact-syntax', - 'roff' => 'text/troff', - 'rp9' => 'application/vnd.cloanto.rp9', - 'rpss' => 'application/vnd.nokia.radio-presets', - 'rpst' => 'application/vnd.nokia.radio-preset', - 'rq' => 'application/sparql-query', - 'rs' => 'application/rls-services+xml', - 'rsd' => 'application/rsd+xml', - 'rss' => 'application/rss+xml', - 'rtf' => 'application/rtf', - 'rtx' => 'text/richtext', - 's' => 'text/x-asm', - 'saf' => 'application/vnd.yamaha.smaf-audio', - 'sbml' => 'application/sbml+xml', - 'sc' => 'application/vnd.ibm.secure-container', - 'scd' => 'application/x-msschedule', - 'scm' => 'application/vnd.lotus-screencam', - 'scq' => 'application/scvp-cv-request', - 'scs' => 'application/scvp-cv-response', - 'scurl' => 'text/vnd.curl.scurl', - 'sda' => 'application/vnd.stardivision.draw', - 'sdc' => 'application/vnd.stardivision.calc', - 'sdd' => 'application/vnd.stardivision.impress', - 'sdkd' => 'application/vnd.solent.sdkm+xml', - 'sdkm' => 'application/vnd.solent.sdkm+xml', - 'sdp' => 'application/sdp', - 'sdw' => 'application/vnd.stardivision.writer', - 'see' => 'application/vnd.seemail', - 'seed' => 'application/vnd.fdsn.seed', - 'sema' => 'application/vnd.sema', - 'semd' => 'application/vnd.semd', - 'semf' => 'application/vnd.semf', - 'ser' => 'application/java-serialized-object', - 'setpay' => 'application/set-payment-initiation', - 'setreg' => 'application/set-registration-initiation', - 'sfd-hdstx' => 'application/vnd.hydrostatix.sof-data', - 'sfs' => 'application/vnd.spotfire.sfs', - 'sgl' => 'application/vnd.stardivision.writer-global', - 'sgm' => 'text/sgml', - 'sgml' => 'text/sgml', - 'sh' => 'application/x-sh', - 'shar' => 'application/x-shar', - 'shf' => 'application/shf+xml', - 'sig' => 'application/pgp-signature', - 'silo' => 'model/mesh', - 'sis' => 'application/vnd.symbian.install', - 'sisx' => 'application/vnd.symbian.install', - 'sit' => 'application/x-stuffit', - 'sitx' => 'application/x-stuffitx', - 'skd' => 'application/vnd.koan', - 'skm' => 'application/vnd.koan', - 'skp' => 'application/vnd.koan', - 'skt' => 'application/vnd.koan', - 'sldm' => 'application/vnd.ms-powerpoint.slide.macroenabled.12', - 'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide', - 'slt' => 'application/vnd.epson.salt', - 'sm' => 'application/vnd.stepmania.stepchart', - 'smf' => 'application/vnd.stardivision.math', - 'smi' => 'application/smil+xml', - 'smil' => 'application/smil+xml', - 'snd' => 'audio/basic', - 'snf' => 'application/x-font-snf', - 'so' => 'application/octet-stream', - 'spc' => 'application/x-pkcs7-certificates', - 'spf' => 'application/vnd.yamaha.smaf-phrase', - 'spl' => 'application/x-futuresplash', - 'spot' => 'text/vnd.in3d.spot', - 'spp' => 'application/scvp-vp-response', - 'spq' => 'application/scvp-vp-request', - 'spx' => 'audio/ogg', - 'src' => 'application/x-wais-source', - 'sru' => 'application/sru+xml', - 'srx' => 'application/sparql-results+xml', - 'sse' => 'application/vnd.kodak-descriptor', - 'ssf' => 'application/vnd.epson.ssf', - 'ssml' => 'application/ssml+xml', - 'st' => 'application/vnd.sailingtracker.track', - 'stc' => 'application/vnd.sun.xml.calc.template', - 'std' => 'application/vnd.sun.xml.draw.template', - 'stf' => 'application/vnd.wt.stf', - 'sti' => 'application/vnd.sun.xml.impress.template', - 'stk' => 'application/hyperstudio', - 'stl' => 'application/vnd.ms-pki.stl', - 'str' => 'application/vnd.pg.format', - 'stw' => 'application/vnd.sun.xml.writer.template', - 'sub' => 'image/vnd.dvb.subtitle', - 'sus' => 'application/vnd.sus-calendar', - 'susp' => 'application/vnd.sus-calendar', - 'sv4cpio' => 'application/x-sv4cpio', - 'sv4crc' => 'application/x-sv4crc', - 'svc' => 'application/vnd.dvb.service', - 'svd' => 'application/vnd.svd', - 'svg' => 'image/svg+xml', - 'svgz' => 'image/svg+xml', - 'swa' => 'application/x-director', - 'swf' => 'application/x-shockwave-flash', - 'swi' => 'application/vnd.aristanetworks.swi', - 'sxc' => 'application/vnd.sun.xml.calc', - 'sxd' => 'application/vnd.sun.xml.draw', - 'sxg' => 'application/vnd.sun.xml.writer.global', - 'sxi' => 'application/vnd.sun.xml.impress', - 'sxm' => 'application/vnd.sun.xml.math', - 'sxw' => 'application/vnd.sun.xml.writer', - 't' => 'text/troff', - 'tao' => 'application/vnd.tao.intent-module-archive', - 'tar' => 'application/x-tar', - 'tcap' => 'application/vnd.3gpp2.tcap', - 'tcl' => 'application/x-tcl', - 'teacher' => 'application/vnd.smart.teacher', - 'tei' => 'application/tei+xml', - 'teicorpus' => 'application/tei+xml', - 'tex' => 'application/x-tex', - 'texi' => 'application/x-texinfo', - 'texinfo' => 'application/x-texinfo', - 'text' => 'text/plain', - 'tfi' => 'application/thraud+xml', - 'tfm' => 'application/x-tex-tfm', - 'thmx' => 'application/vnd.ms-officetheme', - 'tif' => 'image/tiff', - 'tiff' => 'image/tiff', - 'tmo' => 'application/vnd.tmobile-livetv', - 'torrent' => 'application/x-bittorrent', - 'tpl' => 'application/vnd.groove-tool-template', - 'tpt' => 'application/vnd.trid.tpt', - 'tr' => 'text/troff', - 'tra' => 'application/vnd.trueapp', - 'trm' => 'application/x-msterminal', - 'tsd' => 'application/timestamped-data', - 'tsv' => 'text/tab-separated-values', - 'ttc' => 'application/x-font-ttf', - 'ttf' => 'application/x-font-ttf', - 'ttl' => 'text/turtle', - 'twd' => 'application/vnd.simtech-mindmapper', - 'twds' => 'application/vnd.simtech-mindmapper', - 'txd' => 'application/vnd.genomatix.tuxedo', - 'txf' => 'application/vnd.mobius.txf', - 'txt' => 'text/plain', - 'u32' => 'application/x-authorware-bin', - 'udeb' => 'application/x-debian-package', - 'ufd' => 'application/vnd.ufdl', - 'ufdl' => 'application/vnd.ufdl', - 'umj' => 'application/vnd.umajin', - 'unityweb' => 'application/vnd.unity', - 'uoml' => 'application/vnd.uoml+xml', - 'uri' => 'text/uri-list', - 'uris' => 'text/uri-list', - 'urls' => 'text/uri-list', - 'ustar' => 'application/x-ustar', - 'utz' => 'application/vnd.uiq.theme', - 'uu' => 'text/x-uuencode', - 'uva' => 'audio/vnd.dece.audio', - 'uvd' => 'application/vnd.dece.data', - 'uvf' => 'application/vnd.dece.data', - 'uvg' => 'image/vnd.dece.graphic', - 'uvh' => 'video/vnd.dece.hd', - 'uvi' => 'image/vnd.dece.graphic', - 'uvm' => 'video/vnd.dece.mobile', - 'uvp' => 'video/vnd.dece.pd', - 'uvs' => 'video/vnd.dece.sd', - 'uvt' => 'application/vnd.dece.ttml+xml', - 'uvu' => 'video/vnd.uvvu.mp4', - 'uvv' => 'video/vnd.dece.video', - 'uvva' => 'audio/vnd.dece.audio', - 'uvvd' => 'application/vnd.dece.data', - 'uvvf' => 'application/vnd.dece.data', - 'uvvg' => 'image/vnd.dece.graphic', - 'uvvh' => 'video/vnd.dece.hd', - 'uvvi' => 'image/vnd.dece.graphic', - 'uvvm' => 'video/vnd.dece.mobile', - 'uvvp' => 'video/vnd.dece.pd', - 'uvvs' => 'video/vnd.dece.sd', - 'uvvt' => 'application/vnd.dece.ttml+xml', - 'uvvu' => 'video/vnd.uvvu.mp4', - 'uvvv' => 'video/vnd.dece.video', - 'uvvx' => 'application/vnd.dece.unspecified', - 'uvx' => 'application/vnd.dece.unspecified', - 'vcd' => 'application/x-cdlink', - 'vcf' => 'text/x-vcard', - 'vcg' => 'application/vnd.groove-vcard', - 'vcs' => 'text/x-vcalendar', - 'vcx' => 'application/vnd.vcx', - 'vis' => 'application/vnd.visionary', - 'viv' => 'video/vnd.vivo', - 'vor' => 'application/vnd.stardivision.writer', - 'vox' => 'application/x-authorware-bin', - 'vrml' => 'model/vrml', - 'vsd' => 'application/vnd.visio', - 'vsf' => 'application/vnd.vsf', - 'vss' => 'application/vnd.visio', - 'vst' => 'application/vnd.visio', - 'vsw' => 'application/vnd.visio', - 'vtu' => 'model/vnd.vtu', - 'vxml' => 'application/voicexml+xml', - 'w3d' => 'application/x-director', - 'wad' => 'application/x-doom', - 'wav' => 'audio/x-wav', - 'wax' => 'audio/x-ms-wax', - 'wbmp' => 'image/vnd.wap.wbmp', - 'wbs' => 'application/vnd.criticaltools.wbs+xml', - 'wbxml' => 'application/vnd.wap.wbxml', - 'wcm' => 'application/vnd.ms-works', - 'wdb' => 'application/vnd.ms-works', - 'weba' => 'audio/webm', - 'webm' => 'video/webm', - 'webp' => 'image/webp', - 'wg' => 'application/vnd.pmi.widget', - 'wgt' => 'application/widget', - 'wks' => 'application/vnd.ms-works', - 'wm' => 'video/x-ms-wm', - 'wma' => 'audio/x-ms-wma', - 'wmd' => 'application/x-ms-wmd', - 'wmf' => 'application/x-msmetafile', - 'wml' => 'text/vnd.wap.wml', - 'wmlc' => 'application/vnd.wap.wmlc', - 'wmls' => 'text/vnd.wap.wmlscript', - 'wmlsc' => 'application/vnd.wap.wmlscriptc', - 'wmv' => 'video/x-ms-wmv', - 'wmx' => 'video/x-ms-wmx', - 'wmz' => 'application/x-ms-wmz', - 'woff' => 'application/x-font-woff', - 'wpd' => 'application/vnd.wordperfect', - 'wpl' => 'application/vnd.ms-wpl', - 'wps' => 'application/vnd.ms-works', - 'wqd' => 'application/vnd.wqd', - 'wri' => 'application/x-mswrite', - 'wrl' => 'model/vrml', - 'wsdl' => 'application/wsdl+xml', - 'wspolicy' => 'application/wspolicy+xml', - 'wtb' => 'application/vnd.webturbo', - 'wvx' => 'video/x-ms-wvx', - 'x32' => 'application/x-authorware-bin', - 'x3d' => 'application/vnd.hzn-3d-crossword', - 'xap' => 'application/x-silverlight-app', - 'xar' => 'application/vnd.xara', - 'xbap' => 'application/x-ms-xbap', - 'xbd' => 'application/vnd.fujixerox.docuworks.binder', - 'xbm' => 'image/x-xbitmap', - 'xdf' => 'application/xcap-diff+xml', - 'xdm' => 'application/vnd.syncml.dm+xml', - 'xdp' => 'application/vnd.adobe.xdp+xml', - 'xdssc' => 'application/dssc+xml', - 'xdw' => 'application/vnd.fujixerox.docuworks', - 'xenc' => 'application/xenc+xml', - 'xer' => 'application/patch-ops-error+xml', - 'xfdf' => 'application/vnd.adobe.xfdf', - 'xfdl' => 'application/vnd.xfdl', - 'xht' => 'application/xhtml+xml', - 'xhtml' => 'application/xhtml+xml', - 'xhvml' => 'application/xv+xml', - 'xif' => 'image/vnd.xiff', - 'xla' => 'application/vnd.ms-excel', - 'xlam' => 'application/vnd.ms-excel.addin.macroenabled.12', - 'xlc' => 'application/vnd.ms-excel', - 'xlm' => 'application/vnd.ms-excel', - 'xls' => 'application/vnd.ms-excel', - 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroenabled.12', - 'xlsm' => 'application/vnd.ms-excel.sheet.macroenabled.12', - 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', - 'xlt' => 'application/vnd.ms-excel', - 'xltm' => 'application/vnd.ms-excel.template.macroenabled.12', - 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', - 'xlw' => 'application/vnd.ms-excel', - 'xml' => 'application/xml', - 'xo' => 'application/vnd.olpc-sugar', - 'xop' => 'application/xop+xml', - 'xpi' => 'application/x-xpinstall', - 'xpm' => 'image/x-xpixmap', - 'xpr' => 'application/vnd.is-xpr', - 'xps' => 'application/vnd.ms-xpsdocument', - 'xpw' => 'application/vnd.intercon.formnet', - 'xpx' => 'application/vnd.intercon.formnet', - 'xsl' => 'application/xml', - 'xslt' => 'application/xslt+xml', - 'xsm' => 'application/vnd.syncml+xml', - 'xspf' => 'application/xspf+xml', - 'xul' => 'application/vnd.mozilla.xul+xml', - 'xvm' => 'application/xv+xml', - 'xvml' => 'application/xv+xml', - 'xwd' => 'image/x-xwindowdump', - 'xyz' => 'chemical/x-xyz', - 'yaml' => 'text/yaml', - 'yang' => 'application/yang', - 'yin' => 'application/yin+xml', - 'yml' => 'text/yaml', - 'zaz' => 'application/vnd.zzazz.deck+xml', - 'zip' => 'application/zip', - 'zir' => 'application/vnd.zul', - 'zirz' => 'application/vnd.zul', - 'zmm' => 'application/vnd.handheld-entertainment+xml' - ); - - /** - * Get a singleton instance of the class - * - * @return self - * @codeCoverageIgnore - */ - public static function getInstance() - { - if (!self::$instance) { - self::$instance = new self(); - } - - return self::$instance; - } - - /** - * Get a mimetype value from a file extension - * - * @param string $extension File extension - * - * @return string|null - * - */ - public function fromExtension($extension) - { - $extension = strtolower($extension); - - return isset($this->mimetypes[$extension]) - ? $this->mimetypes[$extension] - : null; - } - - /** - * Get a mimetype from a filename - * - * @param string $filename Filename to generate a mimetype from - * - * @return string|null - */ - public function fromFilename($filename) - { - return $this->fromExtension(pathinfo($filename, PATHINFO_EXTENSION)); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/src/Pool.php b/core/vendor/guzzlehttp/guzzle/src/Pool.php deleted file mode 100644 index 49d9940..0000000 --- a/core/vendor/guzzlehttp/guzzle/src/Pool.php +++ /dev/null @@ -1,333 +0,0 @@ -client = $client; - $this->iter = $this->coerceIterable($requests); - $this->deferred = new Deferred(); - $this->promise = $this->deferred->promise(); - $this->poolSize = isset($options['pool_size']) - ? $options['pool_size'] : 25; - $this->eventListeners = $this->prepareListeners( - $options, - ['before', 'complete', 'error', 'end'] - ); - } - - /** - * Sends multiple requests in parallel and returns an array of responses - * and exceptions that uses the same ordering as the provided requests. - * - * IMPORTANT: This method keeps every request and response in memory, and - * as such, is NOT recommended when sending a large number or an - * indeterminate number of requests concurrently. - * - * @param ClientInterface $client Client used to send the requests - * @param array|\Iterator $requests Requests to send in parallel - * @param array $options Passes through the options available in - * {@see GuzzleHttp\Pool::__construct} - * - * @return BatchResults Returns a container for the results. - * @throws \InvalidArgumentException if the event format is incorrect. - */ - public static function batch( - ClientInterface $client, - $requests, - array $options = [] - ) { - $hash = new \SplObjectStorage(); - foreach ($requests as $request) { - $hash->attach($request); - } - - // In addition to the normally run events when requests complete, add - // and event to continuously track the results of transfers in the hash. - (new self($client, $requests, RequestEvents::convertEventArray( - $options, - ['end'], - [ - 'priority' => RequestEvents::LATE, - 'fn' => function (EndEvent $e) use ($hash) { - $hash[$e->getRequest()] = $e->getException() - ? $e->getException() - : $e->getResponse(); - } - ] - )))->wait(); - - return new BatchResults($hash); - } - - /** - * Creates a Pool and immediately sends the requests. - * - * @param ClientInterface $client Client used to send the requests - * @param array|\Iterator $requests Requests to send in parallel - * @param array $options Passes through the options available in - * {@see GuzzleHttp\Pool::__construct} - */ - public static function send( - ClientInterface $client, - $requests, - array $options = [] - ) { - $pool = new self($client, $requests, $options); - $pool->wait(); - } - - private function getPoolSize() - { - return is_callable($this->poolSize) - ? call_user_func($this->poolSize, count($this->waitQueue)) - : $this->poolSize; - } - - /** - * Add as many requests as possible up to the current pool limit. - */ - private function addNextRequests() - { - $limit = max($this->getPoolSize() - count($this->waitQueue), 0); - while ($limit--) { - if (!$this->addNextRequest()) { - break; - } - } - } - - public function wait() - { - if ($this->isRealized) { - return false; - } - - // Seed the pool with N number of requests. - $this->addNextRequests(); - - // Stop if the pool was cancelled while transferring requests. - if ($this->isRealized) { - return false; - } - - // Wait on any outstanding FutureResponse objects. - while ($response = array_pop($this->waitQueue)) { - try { - $response->wait(); - } catch (\Exception $e) { - // Eat exceptions because they should be handled asynchronously - } - $this->addNextRequests(); - } - - // Clean up no longer needed state. - $this->isRealized = true; - $this->waitQueue = $this->eventListeners = []; - $this->client = $this->iter = null; - $this->deferred->resolve(true); - - return true; - } - - /** - * {@inheritdoc} - * - * Attempt to cancel all outstanding requests (requests that are queued for - * dereferencing). Returns true if all outstanding requests can be - * cancelled. - * - * @return bool - */ - public function cancel() - { - if ($this->isRealized) { - return false; - } - - $success = $this->isRealized = true; - foreach ($this->waitQueue as $response) { - if (!$response->cancel()) { - $success = false; - } - } - - return $success; - } - - /** - * Returns a promise that is invoked when the pool completed. There will be - * no passed value. - * - * {@inheritdoc} - */ - public function then( - callable $onFulfilled = null, - callable $onRejected = null, - callable $onProgress = null - ) { - return $this->promise->then($onFulfilled, $onRejected, $onProgress); - } - - public function promise() - { - return $this->promise; - } - - private function coerceIterable($requests) - { - if ($requests instanceof \Iterator) { - return $requests; - } elseif (is_array($requests)) { - return new \ArrayIterator($requests); - } - - throw new \InvalidArgumentException('Expected Iterator or array. ' - . 'Found ' . Core::describeType($requests)); - } - - /** - * Adds the next request to pool and tracks what requests need to be - * dereferenced when completing the pool. - */ - private function addNextRequest() - { - add_next: - - if ($this->isRealized || !$this->iter || !$this->iter->valid()) { - return false; - } - - $request = $this->iter->current(); - $this->iter->next(); - - if (!($request instanceof RequestInterface)) { - throw new \InvalidArgumentException(sprintf( - 'All requests in the provided iterator must implement ' - . 'RequestInterface. Found %s', - Core::describeType($request) - )); - } - - // Be sure to use "lazy" futures, meaning they do not send right away. - $request->getConfig()->set('future', 'lazy'); - $hash = spl_object_hash($request); - $this->attachListeners($request, $this->eventListeners); - $request->getEmitter()->on('before', [$this, '_trackRetries'], RequestEvents::EARLY); - $response = $this->client->send($request); - $this->waitQueue[$hash] = $response; - $promise = $response->promise(); - - // Don't recursively call itself for completed or rejected responses. - if ($promise instanceof FulfilledPromise - || $promise instanceof RejectedPromise - ) { - try { - $this->finishResponse($request, $response->wait(), $hash); - } catch (\Exception $e) { - $this->finishResponse($request, $e, $hash); - } - goto add_next; - } - - // Use this function for both resolution and rejection. - $thenFn = function ($value) use ($request, $hash) { - $this->finishResponse($request, $value, $hash); - if (!$request->getConfig()->get('_pool_retries')) { - $this->addNextRequests(); - } - }; - - $promise->then($thenFn, $thenFn); - - return true; - } - - public function _trackRetries(BeforeEvent $e) - { - $e->getRequest()->getConfig()->set('_pool_retries', $e->getRetryCount()); - } - - private function finishResponse($request, $value, $hash) - { - unset($this->waitQueue[$hash]); - $result = $value instanceof ResponseInterface - ? ['request' => $request, 'response' => $value, 'error' => null] - : ['request' => $request, 'response' => null, 'error' => $value]; - $this->deferred->progress($result); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/src/Post/MultipartBody.php b/core/vendor/guzzlehttp/guzzle/src/Post/MultipartBody.php deleted file mode 100644 index 1149e62..0000000 --- a/core/vendor/guzzlehttp/guzzle/src/Post/MultipartBody.php +++ /dev/null @@ -1,109 +0,0 @@ -boundary = $boundary ?: uniqid(); - $this->stream = $this->createStream($fields, $files); - } - - /** - * Get the boundary - * - * @return string - */ - public function getBoundary() - { - return $this->boundary; - } - - public function isWritable() - { - return false; - } - - /** - * Get the string needed to transfer a POST field - */ - private function getFieldString($name, $value) - { - return sprintf( - "--%s\r\nContent-Disposition: form-data; name=\"%s\"\r\n\r\n%s\r\n", - $this->boundary, - $name, - $value - ); - } - - /** - * Get the headers needed before transferring the content of a POST file - */ - private function getFileHeaders(PostFileInterface $file) - { - $headers = ''; - foreach ($file->getHeaders() as $key => $value) { - $headers .= "{$key}: {$value}\r\n"; - } - - return "--{$this->boundary}\r\n" . trim($headers) . "\r\n\r\n"; - } - - /** - * Create the aggregate stream that will be used to upload the POST data - */ - protected function createStream(array $fields, array $files) - { - $stream = new AppendStream(); - - foreach ($fields as $name => $fieldValues) { - foreach ((array) $fieldValues as $value) { - $stream->addStream( - Stream::factory($this->getFieldString($name, $value)) - ); - } - } - - foreach ($files as $file) { - - if (!$file instanceof PostFileInterface) { - throw new \InvalidArgumentException('All POST fields must ' - . 'implement PostFieldInterface'); - } - - $stream->addStream( - Stream::factory($this->getFileHeaders($file)) - ); - $stream->addStream($file->getContent()); - $stream->addStream(Stream::factory("\r\n")); - } - - // Add the trailing boundary with CRLF - $stream->addStream(Stream::factory("--{$this->boundary}--\r\n")); - - return $stream; - } -} diff --git a/core/vendor/guzzlehttp/guzzle/src/Post/PostBody.php b/core/vendor/guzzlehttp/guzzle/src/Post/PostBody.php deleted file mode 100644 index ed14d1f..0000000 --- a/core/vendor/guzzlehttp/guzzle/src/Post/PostBody.php +++ /dev/null @@ -1,287 +0,0 @@ -files || $this->forceMultipart) { - $request->setHeader( - 'Content-Type', - 'multipart/form-data; boundary=' . $this->getBody()->getBoundary() - ); - } elseif ($this->fields && !$request->hasHeader('Content-Type')) { - $request->setHeader( - 'Content-Type', - 'application/x-www-form-urlencoded' - ); - } - - if ($size = $this->getSize()) { - $request->setHeader('Content-Length', $size); - } - } - - public function forceMultipartUpload($force) - { - $this->forceMultipart = $force; - } - - public function setAggregator(callable $aggregator) - { - $this->aggregator = $aggregator; - } - - public function setField($name, $value) - { - $this->fields[$name] = $value; - $this->mutate(); - } - - public function replaceFields(array $fields) - { - $this->fields = $fields; - $this->mutate(); - } - - public function getField($name) - { - return isset($this->fields[$name]) ? $this->fields[$name] : null; - } - - public function removeField($name) - { - unset($this->fields[$name]); - $this->mutate(); - } - - public function getFields($asString = false) - { - if (!$asString) { - return $this->fields; - } - - $query = new Query($this->fields); - $query->setEncodingType(Query::RFC1738); - $query->setAggregator($this->getAggregator()); - - return (string) $query; - } - - public function hasField($name) - { - return isset($this->fields[$name]); - } - - public function getFile($name) - { - foreach ($this->files as $file) { - if ($file->getName() == $name) { - return $file; - } - } - - return null; - } - - public function getFiles() - { - return $this->files; - } - - public function addFile(PostFileInterface $file) - { - $this->files[] = $file; - $this->mutate(); - } - - public function clearFiles() - { - $this->files = []; - $this->mutate(); - } - - /** - * Returns the numbers of fields + files - * - * @return int - */ - public function count() - { - return count($this->files) + count($this->fields); - } - - public function __toString() - { - return (string) $this->getBody(); - } - - public function getContents($maxLength = -1) - { - return $this->getBody()->getContents(); - } - - public function close() - { - $this->detach(); - } - - public function detach() - { - $this->detached = true; - $this->fields = $this->files = []; - - if ($this->body) { - $this->body->close(); - $this->body = null; - } - } - - public function attach($stream) - { - throw new CannotAttachException(); - } - - public function eof() - { - return $this->getBody()->eof(); - } - - public function tell() - { - return $this->body ? $this->body->tell() : 0; - } - - public function isSeekable() - { - return true; - } - - public function isReadable() - { - return true; - } - - public function isWritable() - { - return false; - } - - public function getSize() - { - return $this->getBody()->getSize(); - } - - public function seek($offset, $whence = SEEK_SET) - { - return $this->getBody()->seek($offset, $whence); - } - - public function read($length) - { - return $this->getBody()->read($length); - } - - public function write($string) - { - return false; - } - - public function getMetadata($key = null) - { - return $key ? null : []; - } - - /** - * Return a stream object that is built from the POST fields and files. - * - * If one has already been created, the previously created stream will be - * returned. - */ - private function getBody() - { - if ($this->body) { - return $this->body; - } elseif ($this->files || $this->forceMultipart) { - return $this->body = $this->createMultipart(); - } elseif ($this->fields) { - return $this->body = $this->createUrlEncoded(); - } else { - return $this->body = Stream::factory(); - } - } - - /** - * Get the aggregator used to join multi-valued field parameters - * - * @return callable - */ - final protected function getAggregator() - { - if (!$this->aggregator) { - $this->aggregator = Query::phpAggregator(); - } - - return $this->aggregator; - } - - /** - * Creates a multipart/form-data body stream - * - * @return MultipartBody - */ - private function createMultipart() - { - // Flatten the nested query string values using the correct aggregator - return new MultipartBody( - call_user_func($this->getAggregator(), $this->fields), - $this->files - ); - } - - /** - * Creates an application/x-www-form-urlencoded stream body - * - * @return StreamInterface - */ - private function createUrlEncoded() - { - return Stream::factory($this->getFields(true)); - } - - /** - * Get rid of any cached data - */ - private function mutate() - { - $this->body = null; - } -} diff --git a/core/vendor/guzzlehttp/guzzle/src/Post/PostBodyInterface.php b/core/vendor/guzzlehttp/guzzle/src/Post/PostBodyInterface.php deleted file mode 100644 index c2ec9a6..0000000 --- a/core/vendor/guzzlehttp/guzzle/src/Post/PostBodyInterface.php +++ /dev/null @@ -1,109 +0,0 @@ -headers = $headers; - $this->name = $name; - $this->prepareContent($content); - $this->prepareFilename($filename); - $this->prepareDefaultHeaders(); - } - - public function getName() - { - return $this->name; - } - - public function getFilename() - { - return $this->filename; - } - - public function getContent() - { - return $this->content; - } - - public function getHeaders() - { - return $this->headers; - } - - /** - * Prepares the contents of a POST file. - * - * @param mixed $content Content of the POST file - */ - private function prepareContent($content) - { - $this->content = $content; - - if (!($this->content instanceof StreamInterface)) { - $this->content = Stream::factory($this->content); - } elseif ($this->content instanceof MultipartBody) { - if (!$this->hasHeader('Content-Disposition')) { - $disposition = 'form-data; name="' . $this->name .'"'; - $this->headers['Content-Disposition'] = $disposition; - } - - if (!$this->hasHeader('Content-Type')) { - $this->headers['Content-Type'] = sprintf( - "multipart/form-data; boundary=%s", - $this->content->getBoundary() - ); - } - } - } - - /** - * Applies a file name to the POST file based on various checks. - * - * @param string|null $filename Filename to apply (or null to guess) - */ - private function prepareFilename($filename) - { - $this->filename = $filename; - - if (!$this->filename) { - $this->filename = $this->content->getMetadata('uri'); - } - - if (!$this->filename || substr($this->filename, 0, 6) === 'php://') { - $this->filename = $this->name; - } - } - - /** - * Applies default Content-Disposition and Content-Type headers if needed. - */ - private function prepareDefaultHeaders() - { - // Set a default content-disposition header if one was no provided - if (!$this->hasHeader('Content-Disposition')) { - $this->headers['Content-Disposition'] = sprintf( - 'form-data; name="%s"; filename="%s"', - $this->name, - basename($this->filename) - ); - } - - // Set a default Content-Type if one was not supplied - if (!$this->hasHeader('Content-Type')) { - $this->headers['Content-Type'] = Mimetypes::getInstance() - ->fromFilename($this->filename) ?: 'text/plain'; - } - } - - /** - * Check if a specific header exists on the POST file by name. - * - * @param string $name Case-insensitive header to check - * - * @return bool - */ - private function hasHeader($name) - { - return isset(array_change_key_case($this->headers)[strtolower($name)]); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/src/Post/PostFileInterface.php b/core/vendor/guzzlehttp/guzzle/src/Post/PostFileInterface.php deleted file mode 100644 index 2e816c0..0000000 --- a/core/vendor/guzzlehttp/guzzle/src/Post/PostFileInterface.php +++ /dev/null @@ -1,41 +0,0 @@ -setEncodingType($urlEncoding); - } - - $qp->parseInto($q, $query, $urlEncoding); - - return $q; - } - - /** - * Convert the query string parameters to a query string string - * - * @return string - */ - public function __toString() - { - if (!$this->data) { - return ''; - } - - // The default aggregator is statically cached - static $defaultAggregator; - - if (!$this->aggregator) { - if (!$defaultAggregator) { - $defaultAggregator = self::phpAggregator(); - } - $this->aggregator = $defaultAggregator; - } - - $result = ''; - $aggregator = $this->aggregator; - $encoder = $this->encoding; - - foreach ($aggregator($this->data) as $key => $values) { - foreach ($values as $value) { - if ($result) { - $result .= '&'; - } - $result .= $encoder($key); - if ($value !== null) { - $result .= '=' . $encoder($value); - } - } - } - - return $result; - } - - /** - * Controls how multi-valued query string parameters are aggregated into a - * string. - * - * $query->setAggregator($query::duplicateAggregator()); - * - * @param callable $aggregator Callable used to convert a deeply nested - * array of query string variables into a flattened array of key value - * pairs. The callable accepts an array of query data and returns a - * flattened array of key value pairs where each value is an array of - * strings. - */ - public function setAggregator(callable $aggregator) - { - $this->aggregator = $aggregator; - } - - /** - * Specify how values are URL encoded - * - * @param string|bool $type One of 'RFC1738', 'RFC3986', or false to disable encoding - * - * @throws \InvalidArgumentException - */ - public function setEncodingType($type) - { - switch ($type) { - case self::RFC3986: - $this->encoding = 'rawurlencode'; - break; - case self::RFC1738: - $this->encoding = 'urlencode'; - break; - case false: - $this->encoding = function ($v) { return $v; }; - break; - default: - throw new \InvalidArgumentException('Invalid URL encoding type'); - } - } - - /** - * Query string aggregator that does not aggregate nested query string - * values and allows duplicates in the resulting array. - * - * Example: http://test.com?q=1&q=2 - * - * @return callable - */ - public static function duplicateAggregator() - { - return function (array $data) { - return self::walkQuery($data, '', function ($key, $prefix) { - return is_int($key) ? $prefix : "{$prefix}[{$key}]"; - }); - }; - } - - /** - * Aggregates nested query string variables using the same technique as - * ``http_build_query()``. - * - * @param bool $numericIndices Pass false to not include numeric indices - * when multi-values query string parameters are present. - * - * @return callable - */ - public static function phpAggregator($numericIndices = true) - { - return function (array $data) use ($numericIndices) { - return self::walkQuery( - $data, - '', - function ($key, $prefix) use ($numericIndices) { - return !$numericIndices && is_int($key) - ? "{$prefix}[]" - : "{$prefix}[{$key}]"; - } - ); - }; - } - - /** - * Easily create query aggregation functions by providing a key prefix - * function to this query string array walker. - * - * @param array $query Query string to walk - * @param string $keyPrefix Key prefix (start with '') - * @param callable $prefixer Function used to create a key prefix - * - * @return array - */ - public static function walkQuery(array $query, $keyPrefix, callable $prefixer) - { - $result = []; - foreach ($query as $key => $value) { - if ($keyPrefix) { - $key = $prefixer($key, $keyPrefix); - } - if (is_array($value)) { - $result += self::walkQuery($value, $key, $prefixer); - } elseif (isset($result[$key])) { - $result[$key][] = $value; - } else { - $result[$key] = array($value); - } - } - - return $result; - } -} diff --git a/core/vendor/guzzlehttp/guzzle/src/QueryParser.php b/core/vendor/guzzlehttp/guzzle/src/QueryParser.php deleted file mode 100644 index 90727cc..0000000 --- a/core/vendor/guzzlehttp/guzzle/src/QueryParser.php +++ /dev/null @@ -1,163 +0,0 @@ -duplicates = false; - $this->numericIndices = true; - $decoder = self::getDecoder($urlEncoding); - - foreach (explode('&', $str) as $kvp) { - - $parts = explode('=', $kvp, 2); - $key = $decoder($parts[0]); - $value = isset($parts[1]) ? $decoder($parts[1]) : null; - - // Special handling needs to be taken for PHP nested array syntax - if (strpos($key, '[') !== false) { - $this->parsePhpValue($key, $value, $result); - continue; - } - - if (!isset($result[$key])) { - $result[$key] = $value; - } else { - $this->duplicates = true; - if (!is_array($result[$key])) { - $result[$key] = [$result[$key]]; - } - $result[$key][] = $value; - } - } - - $query->replace($result); - - if (!$this->numericIndices) { - $query->setAggregator(Query::phpAggregator(false)); - } elseif ($this->duplicates) { - $query->setAggregator(Query::duplicateAggregator()); - } - } - - /** - * Returns a callable that is used to URL decode query keys and values. - * - * @param string|bool $type One of true, false, RFC3986, and RFC1738 - * - * @return callable|string - */ - private static function getDecoder($type) - { - if ($type === true) { - return function ($value) { - return rawurldecode(str_replace('+', ' ', $value)); - }; - } elseif ($type == Query::RFC3986) { - return 'rawurldecode'; - } elseif ($type == Query::RFC1738) { - return 'urldecode'; - } else { - return function ($str) { return $str; }; - } - } - - /** - * Parses a PHP style key value pair. - * - * @param string $key Key to parse (e.g., "foo[a][b]") - * @param string|null $value Value to set - * @param array $result Result to modify by reference - */ - private function parsePhpValue($key, $value, array &$result) - { - $node =& $result; - $keyBuffer = ''; - - for ($i = 0, $t = strlen($key); $i < $t; $i++) { - switch ($key[$i]) { - case '[': - if ($keyBuffer) { - $this->prepareNode($node, $keyBuffer); - $node =& $node[$keyBuffer]; - $keyBuffer = ''; - } - break; - case ']': - $k = $this->cleanKey($node, $keyBuffer); - $this->prepareNode($node, $k); - $node =& $node[$k]; - $keyBuffer = ''; - break; - default: - $keyBuffer .= $key[$i]; - break; - } - } - - if (isset($node)) { - $this->duplicates = true; - $node[] = $value; - } else { - $node = $value; - } - } - - /** - * Prepares a value in the array at the given key. - * - * If the key already exists, the key value is converted into an array. - * - * @param array $node Result node to modify - * @param string $key Key to add or modify in the node - */ - private function prepareNode(&$node, $key) - { - if (!isset($node[$key])) { - $node[$key] = null; - } elseif (!is_array($node[$key])) { - $node[$key] = [$node[$key]]; - } - } - - /** - * Returns the appropriate key based on the node and key. - */ - private function cleanKey($node, $key) - { - if ($key === '') { - $key = $node ? (string) count($node) : 0; - // Found a [] key, so track this to ensure that we disable numeric - // indexing of keys in the resolved query aggregator. - $this->numericIndices = false; - } - - return $key; - } -} diff --git a/core/vendor/guzzlehttp/guzzle/src/RequestFsm.php b/core/vendor/guzzlehttp/guzzle/src/RequestFsm.php deleted file mode 100644 index b37c190..0000000 --- a/core/vendor/guzzlehttp/guzzle/src/RequestFsm.php +++ /dev/null @@ -1,153 +0,0 @@ -mf = $messageFactory; - $this->maxTransitions = $maxTransitions; - $this->handler = $handler; - } - - /** - * Runs the state machine until a terminal state is entered or the - * optionally supplied $finalState is entered. - * - * @param Transaction $trans Transaction being transitioned. - * - * @throws \Exception if a terminal state throws an exception. - */ - public function __invoke(Transaction $trans) - { - $trans->_transitionCount = 0; - - if (!$trans->state) { - $trans->state = 'before'; - } - - transition: - - if (++$trans->_transitionCount > $this->maxTransitions) { - throw new StateException("Too many state transitions were " - . "encountered ({$trans->_transitionCount}). This likely " - . "means that a combination of event listeners are in an " - . "infinite loop."); - } - - switch ($trans->state) { - case 'before': goto before; - case 'complete': goto complete; - case 'error': goto error; - case 'retry': goto retry; - case 'send': goto send; - case 'end': goto end; - default: throw new StateException("Invalid state: {$trans->state}"); - } - - before: { - try { - $trans->request->getEmitter()->emit('before', new BeforeEvent($trans)); - $trans->state = 'send'; - if ((bool) $trans->response) { - $trans->state = 'complete'; - } - } catch (\Exception $e) { - $trans->state = 'error'; - $trans->exception = $e; - } - goto transition; - } - - complete: { - try { - if ($trans->response instanceof FutureInterface) { - // Futures will have their own end events emitted when - // dereferenced. - return; - } - $trans->state = 'end'; - $trans->response->setEffectiveUrl($trans->request->getUrl()); - $trans->request->getEmitter()->emit('complete', new CompleteEvent($trans)); - } catch (\Exception $e) { - $trans->state = 'error'; - $trans->exception = $e; - } - goto transition; - } - - error: { - try { - // Convert non-request exception to a wrapped exception - $trans->exception = RequestException::wrapException( - $trans->request, $trans->exception - ); - $trans->state = 'end'; - $trans->request->getEmitter()->emit('error', new ErrorEvent($trans)); - // An intercepted request (not retried) transitions to complete - if (!$trans->exception && $trans->state !== 'retry') { - $trans->state = 'complete'; - } - } catch (\Exception $e) { - $trans->state = 'end'; - $trans->exception = $e; - } - goto transition; - } - - retry: { - $trans->retries++; - $trans->response = null; - $trans->exception = null; - $trans->state = 'before'; - goto transition; - } - - send: { - $fn = $this->handler; - $trans->response = FutureResponse::proxy( - $fn(RingBridge::prepareRingRequest($trans)), - function ($value) use ($trans) { - RingBridge::completeRingResponse($trans, $value, $this->mf, $this); - $this($trans); - return $trans->response; - } - ); - return; - } - - end: { - $trans->request->getEmitter()->emit('end', new EndEvent($trans)); - // Throw exceptions in the terminal event if the exception - // was not handled by an "end" event listener. - if ($trans->exception) { - if (!($trans->exception instanceof RequestException)) { - $trans->exception = RequestException::wrapException( - $trans->request, $trans->exception - ); - } - throw $trans->exception; - } - } - } -} diff --git a/core/vendor/guzzlehttp/guzzle/src/RingBridge.php b/core/vendor/guzzlehttp/guzzle/src/RingBridge.php deleted file mode 100644 index bc6841d..0000000 --- a/core/vendor/guzzlehttp/guzzle/src/RingBridge.php +++ /dev/null @@ -1,165 +0,0 @@ -getConfig()->toArray(); - $url = $request->getUrl(); - // No need to calculate the query string twice (in URL and query). - $qs = ($pos = strpos($url, '?')) ? substr($url, $pos + 1) : null; - - return [ - 'scheme' => $request->getScheme(), - 'http_method' => $request->getMethod(), - 'url' => $url, - 'uri' => $request->getPath(), - 'headers' => $request->getHeaders(), - 'body' => $request->getBody(), - 'version' => $request->getProtocolVersion(), - 'client' => $options, - 'query_string' => $qs, - 'future' => isset($options['future']) ? $options['future'] : false - ]; - } - - /** - * Creates a Ring request from a request object AND prepares the callbacks. - * - * @param Transaction $trans Transaction to update. - * - * @return array Converted Guzzle Ring request. - */ - public static function prepareRingRequest(Transaction $trans) - { - // Clear out the transaction state when initiating. - $trans->exception = null; - $request = self::createRingRequest($trans->request); - - // Emit progress events if any progress listeners are registered. - if ($trans->request->getEmitter()->hasListeners('progress')) { - $emitter = $trans->request->getEmitter(); - $request['client']['progress'] = function ($a, $b, $c, $d) use ($trans, $emitter) { - $emitter->emit('progress', new ProgressEvent($trans, $a, $b, $c, $d)); - }; - } - - return $request; - } - - /** - * Handles the process of processing a response received from a ring - * handler. The created response is added to the transaction, and the - * transaction stat is set appropriately. - * - * @param Transaction $trans Owns request and response. - * @param array $response Ring response array - * @param MessageFactoryInterface $messageFactory Creates response objects. - */ - public static function completeRingResponse( - Transaction $trans, - array $response, - MessageFactoryInterface $messageFactory - ) { - $trans->state = 'complete'; - $trans->transferInfo = isset($response['transfer_stats']) - ? $response['transfer_stats'] : []; - - if (!empty($response['status'])) { - $options = []; - if (isset($response['version'])) { - $options['protocol_version'] = $response['version']; - } - if (isset($response['reason'])) { - $options['reason_phrase'] = $response['reason']; - } - $trans->response = $messageFactory->createResponse( - $response['status'], - isset($response['headers']) ? $response['headers'] : [], - isset($response['body']) ? $response['body'] : null, - $options - ); - if (isset($response['effective_url'])) { - $trans->response->setEffectiveUrl($response['effective_url']); - } - } elseif (empty($response['error'])) { - // When nothing was returned, then we need to add an error. - $response['error'] = self::getNoRingResponseException($trans->request); - } - - if (isset($response['error'])) { - $trans->state = 'error'; - $trans->exception = $response['error']; - } - } - - /** - * Creates a Guzzle request object using a ring request array. - * - * @param array $request Ring request - * - * @return Request - * @throws \InvalidArgumentException for incomplete requests. - */ - public static function fromRingRequest(array $request) - { - $options = []; - if (isset($request['version'])) { - $options['protocol_version'] = $request['version']; - } - - if (!isset($request['http_method'])) { - throw new \InvalidArgumentException('No http_method'); - } - - return new Request( - $request['http_method'], - Core::url($request), - isset($request['headers']) ? $request['headers'] : [], - isset($request['body']) ? Stream::factory($request['body']) : null, - $options - ); - } - - /** - * Get an exception that can be used when a RingPHP handler does not - * populate a response. - * - * @param RequestInterface $request - * - * @return RequestException - */ - public static function getNoRingResponseException(RequestInterface $request) - { - $message = <<cookieJar = $cookieJar ?: new CookieJar(); - } - - public function getEvents() - { - // Fire the cookie plugin complete event before redirecting - return [ - 'before' => ['onBefore'], - 'complete' => ['onComplete', RequestEvents::REDIRECT_RESPONSE + 10] - ]; - } - - /** - * Get the cookie cookieJar - * - * @return CookieJarInterface - */ - public function getCookieJar() - { - return $this->cookieJar; - } - - public function onBefore(BeforeEvent $event) - { - $this->cookieJar->addCookieHeader($event->getRequest()); - } - - public function onComplete(CompleteEvent $event) - { - $this->cookieJar->extractCookies( - $event->getRequest(), - $event->getResponse() - ); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/src/Subscriber/History.php b/core/vendor/guzzlehttp/guzzle/src/Subscriber/History.php deleted file mode 100644 index 5cf0611..0000000 --- a/core/vendor/guzzlehttp/guzzle/src/Subscriber/History.php +++ /dev/null @@ -1,172 +0,0 @@ -limit = $limit; - } - - public function getEvents() - { - return [ - 'complete' => ['onComplete', RequestEvents::EARLY], - 'error' => ['onError', RequestEvents::EARLY], - ]; - } - - /** - * Convert to a string that contains all request and response headers - * - * @return string - */ - public function __toString() - { - $lines = array(); - foreach ($this->transactions as $entry) { - $response = isset($entry['response']) ? $entry['response'] : ''; - $lines[] = '> ' . trim($entry['sent_request']) - . "\n\n< " . trim($response) . "\n"; - } - - return implode("\n", $lines); - } - - public function onComplete(CompleteEvent $event) - { - $this->add($event->getRequest(), $event->getResponse()); - } - - public function onError(ErrorEvent $event) - { - // Only track when no response is present, meaning this didn't ever - // emit a complete event - if (!$event->getResponse()) { - $this->add($event->getRequest()); - } - } - - /** - * Returns an Iterator that yields associative array values where each - * associative array contains the following key value pairs: - * - * - request: Representing the actual request that was received. - * - sent_request: A clone of the request that will not be mutated. - * - response: The response that was received (if available). - * - * @return \Iterator - */ - public function getIterator() - { - return new \ArrayIterator($this->transactions); - } - - /** - * Get all of the requests sent through the plugin. - * - * Requests can be modified after they are logged by the history - * subscriber. By default this method will return the actual request - * instances that were received. Pass true to this method if you wish to - * get copies of the requests that represent the request state when it was - * initially logged by the history subscriber. - * - * @param bool $asSent Set to true to get clones of the requests that have - * not been mutated since the request was received by - * the history subscriber. - * - * @return RequestInterface[] - */ - public function getRequests($asSent = false) - { - return array_map(function ($t) use ($asSent) { - return $asSent ? $t['sent_request'] : $t['request']; - }, $this->transactions); - } - - /** - * Get the number of requests in the history - * - * @return int - */ - public function count() - { - return count($this->transactions); - } - - /** - * Get the last request sent. - * - * Requests can be modified after they are logged by the history - * subscriber. By default this method will return the actual request - * instance that was received. Pass true to this method if you wish to get - * a copy of the request that represents the request state when it was - * initially logged by the history subscriber. - * - * @param bool $asSent Set to true to get a clone of the last request that - * has not been mutated since the request was received - * by the history subscriber. - * - * @return RequestInterface - */ - public function getLastRequest($asSent = false) - { - return $asSent - ? end($this->transactions)['sent_request'] - : end($this->transactions)['request']; - } - - /** - * Get the last response in the history - * - * @return ResponseInterface|null - */ - public function getLastResponse() - { - return end($this->transactions)['response']; - } - - /** - * Clears the history - */ - public function clear() - { - $this->transactions = array(); - } - - /** - * Add a request to the history - * - * @param RequestInterface $request Request to add - * @param ResponseInterface $response Response of the request - */ - private function add( - RequestInterface $request, - ResponseInterface $response = null - ) { - $this->transactions[] = [ - 'request' => $request, - 'sent_request' => clone $request, - 'response' => $response - ]; - if (count($this->transactions) > $this->limit) { - array_shift($this->transactions); - } - } -} diff --git a/core/vendor/guzzlehttp/guzzle/src/Subscriber/HttpError.php b/core/vendor/guzzlehttp/guzzle/src/Subscriber/HttpError.php deleted file mode 100644 index ed9de5b..0000000 --- a/core/vendor/guzzlehttp/guzzle/src/Subscriber/HttpError.php +++ /dev/null @@ -1,36 +0,0 @@ - ['onComplete', RequestEvents::VERIFY_RESPONSE]]; - } - - /** - * Throw a RequestException on an HTTP protocol error - * - * @param CompleteEvent $event Emitted event - * @throws RequestException - */ - public function onComplete(CompleteEvent $event) - { - $code = (string) $event->getResponse()->getStatusCode(); - // Throw an exception for an unsuccessful response - if ($code[0] >= 4) { - throw RequestException::create( - $event->getRequest(), - $event->getResponse() - ); - } - } -} diff --git a/core/vendor/guzzlehttp/guzzle/src/Subscriber/Mock.php b/core/vendor/guzzlehttp/guzzle/src/Subscriber/Mock.php deleted file mode 100644 index 39a3c44..0000000 --- a/core/vendor/guzzlehttp/guzzle/src/Subscriber/Mock.php +++ /dev/null @@ -1,132 +0,0 @@ -factory = new MessageFactory(); - $this->readBodies = $readBodies; - $this->addMultiple($items); - } - - public function getEvents() - { - // Fire the event last, after signing - return ['before' => ['onBefore', RequestEvents::SIGN_REQUEST - 10]]; - } - - /** - * @throws \OutOfBoundsException|\Exception - */ - public function onBefore(BeforeEvent $event) - { - if (!$item = array_shift($this->queue)) { - throw new \OutOfBoundsException('Mock queue is empty'); - } elseif ($item instanceof RequestException) { - throw $item; - } - - // Emulate reading a response body - $request = $event->getRequest(); - if ($this->readBodies && $request->getBody()) { - while (!$request->getBody()->eof()) { - $request->getBody()->read(8096); - } - } - - $event->intercept($item); - } - - public function count() - { - return count($this->queue); - } - - /** - * Add a response to the end of the queue - * - * @param string|ResponseInterface $response Response or path to response file - * - * @return self - * @throws \InvalidArgumentException if a string or Response is not passed - */ - public function addResponse($response) - { - if (is_string($response)) { - $response = file_exists($response) - ? $this->factory->fromMessage(file_get_contents($response)) - : $this->factory->fromMessage($response); - } elseif (!($response instanceof ResponseInterface)) { - throw new \InvalidArgumentException('Response must a message ' - . 'string, response object, or path to a file'); - } - - $this->queue[] = $response; - - return $this; - } - - /** - * Add an exception to the end of the queue - * - * @param RequestException $e Exception to throw when the request is executed - * - * @return self - */ - public function addException(RequestException $e) - { - $this->queue[] = $e; - - return $this; - } - - /** - * Add multiple items to the queue - * - * @param array $items Items to add - */ - public function addMultiple(array $items) - { - foreach ($items as $item) { - if ($item instanceof RequestException) { - $this->addException($item); - } else { - $this->addResponse($item); - } - } - } - - /** - * Clear the queue - */ - public function clearQueue() - { - $this->queue = []; - } -} diff --git a/core/vendor/guzzlehttp/guzzle/src/Subscriber/Prepare.php b/core/vendor/guzzlehttp/guzzle/src/Subscriber/Prepare.php deleted file mode 100644 index b5ed4e2..0000000 --- a/core/vendor/guzzlehttp/guzzle/src/Subscriber/Prepare.php +++ /dev/null @@ -1,130 +0,0 @@ - ['onBefore', RequestEvents::PREPARE_REQUEST]]; - } - - public function onBefore(BeforeEvent $event) - { - $request = $event->getRequest(); - - // Set the appropriate Content-Type for a request if one is not set and - // there are form fields - if (!($body = $request->getBody())) { - return; - } - - $this->addContentLength($request, $body); - - if ($body instanceof AppliesHeadersInterface) { - // Synchronize the body with the request headers - $body->applyRequestHeaders($request); - } elseif (!$request->hasHeader('Content-Type')) { - $this->addContentType($request, $body); - } - - $this->addExpectHeader($request, $body); - } - - private function addContentType( - RequestInterface $request, - StreamInterface $body - ) { - if (!($uri = $body->getMetadata('uri'))) { - return; - } - - // Guess the content-type based on the stream's "uri" metadata value. - // The file extension is used to determine the appropriate mime-type. - if ($contentType = Mimetypes::getInstance()->fromFilename($uri)) { - $request->setHeader('Content-Type', $contentType); - } - } - - private function addContentLength( - RequestInterface $request, - StreamInterface $body - ) { - // Set the Content-Length header if it can be determined, and never - // send a Transfer-Encoding: chunked and Content-Length header in - // the same request. - if ($request->hasHeader('Content-Length')) { - // Remove transfer-encoding if content-length is set. - $request->removeHeader('Transfer-Encoding'); - return; - } - - if ($request->hasHeader('Transfer-Encoding')) { - return; - } - - if (null !== ($size = $body->getSize())) { - $request->setHeader('Content-Length', $size); - $request->removeHeader('Transfer-Encoding'); - } elseif ('1.1' == $request->getProtocolVersion()) { - // Use chunked Transfer-Encoding if there is no determinable - // content-length header and we're using HTTP/1.1. - $request->setHeader('Transfer-Encoding', 'chunked'); - $request->removeHeader('Content-Length'); - } - } - - private function addExpectHeader( - RequestInterface $request, - StreamInterface $body - ) { - // Determine if the Expect header should be used - if ($request->hasHeader('Expect')) { - return; - } - - $expect = $request->getConfig()['expect']; - - // Return if disabled or if you're not using HTTP/1.1 - if ($expect === false || $request->getProtocolVersion() !== '1.1') { - return; - } - - // The expect header is unconditionally enabled - if ($expect === true) { - $request->setHeader('Expect', '100-Continue'); - return; - } - - // By default, send the expect header when the payload is > 1mb - if ($expect === null) { - $expect = 1048576; - } - - // Always add if the body cannot be rewound, the size cannot be - // determined, or the size is greater than the cutoff threshold - $size = $body->getSize(); - if ($size === null || $size >= (int) $expect || !$body->isSeekable()) { - $request->setHeader('Expect', '100-Continue'); - } - } -} diff --git a/core/vendor/guzzlehttp/guzzle/src/Subscriber/Redirect.php b/core/vendor/guzzlehttp/guzzle/src/Subscriber/Redirect.php deleted file mode 100644 index ff99226..0000000 --- a/core/vendor/guzzlehttp/guzzle/src/Subscriber/Redirect.php +++ /dev/null @@ -1,176 +0,0 @@ - ['onComplete', RequestEvents::REDIRECT_RESPONSE]]; - } - - /** - * Rewind the entity body of the request if needed - * - * @param RequestInterface $redirectRequest - * @throws CouldNotRewindStreamException - */ - public static function rewindEntityBody(RequestInterface $redirectRequest) - { - // Rewind the entity body of the request if needed - if ($body = $redirectRequest->getBody()) { - // Only rewind the body if some of it has been read already, and - // throw an exception if the rewind fails - if ($body->tell() && !$body->seek(0)) { - throw new CouldNotRewindStreamException( - 'Unable to rewind the non-seekable request body after redirecting', - $redirectRequest - ); - } - } - } - - /** - * Called when a request receives a redirect response - * - * @param CompleteEvent $event Event emitted - * @throws TooManyRedirectsException - */ - public function onComplete(CompleteEvent $event) - { - $response = $event->getResponse(); - - if (substr($response->getStatusCode(), 0, 1) != '3' - || !$response->hasHeader('Location') - ) { - return; - } - - $request = $event->getRequest(); - $config = $request->getConfig(); - - // Increment the redirect and initialize the redirect state. - if ($redirectCount = $config['redirect_count']) { - $config['redirect_count'] = ++$redirectCount; - } else { - $config['redirect_scheme'] = $request->getScheme(); - $config['redirect_count'] = $redirectCount = 1; - } - - $max = $config->getPath('redirect/max') ?: 5; - - if ($redirectCount > $max) { - throw new TooManyRedirectsException( - "Will not follow more than {$redirectCount} redirects", - $request - ); - } - - $this->modifyRedirectRequest($request, $response); - $event->retry(); - } - - private function modifyRedirectRequest( - RequestInterface $request, - ResponseInterface $response - ) { - $config = $request->getConfig(); - $protocols = $config->getPath('redirect/protocols') ?: ['http', 'https']; - - // Use a GET request if this is an entity enclosing request and we are - // not forcing RFC compliance, but rather emulating what all browsers - // would do. - $statusCode = $response->getStatusCode(); - if ($statusCode == 303 || - ($statusCode <= 302 && $request->getBody() && !$config->getPath('redirect/strict')) - ) { - $request->setMethod('GET'); - $request->setBody(null); - } - - $previousUrl = $request->getUrl(); - $this->setRedirectUrl($request, $response, $protocols); - $this->rewindEntityBody($request); - - // Add the Referer header if it is told to do so and only - // add the header if we are not redirecting from https to http. - if ($config->getPath('redirect/referer') - && ($request->getScheme() == 'https' || $request->getScheme() == $config['redirect_scheme']) - ) { - $url = Url::fromString($previousUrl); - $url->setUsername(null); - $url->setPassword(null); - $request->setHeader('Referer', (string) $url); - } else { - $request->removeHeader('Referer'); - } - } - - /** - * Set the appropriate URL on the request based on the location header - * - * @param RequestInterface $request - * @param ResponseInterface $response - * @param array $protocols - */ - private function setRedirectUrl( - RequestInterface $request, - ResponseInterface $response, - array $protocols - ) { - $location = $response->getHeader('Location'); - $location = Url::fromString($location); - - // Combine location with the original URL if it is not absolute. - if (!$location->isAbsolute()) { - $originalUrl = Url::fromString($request->getUrl()); - // Remove query string parameters and just take what is present on - // the redirect Location header - $originalUrl->getQuery()->clear(); - $location = $originalUrl->combine($location); - } - - // Ensure that the redirect URL is allowed based on the protocols. - if (!in_array($location->getScheme(), $protocols)) { - throw new BadResponseException( - sprintf( - 'Redirect URL, %s, does not use one of the allowed redirect protocols: %s', - $location, - implode(', ', $protocols) - ), - $request, - $response - ); - } - - $request->setUrl($location); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/src/ToArrayInterface.php b/core/vendor/guzzlehttp/guzzle/src/ToArrayInterface.php deleted file mode 100644 index d57c022..0000000 --- a/core/vendor/guzzlehttp/guzzle/src/ToArrayInterface.php +++ /dev/null @@ -1,15 +0,0 @@ -client = $client; - $this->request = $request; - $this->_future = $future; - } -} diff --git a/core/vendor/guzzlehttp/guzzle/src/UriTemplate.php b/core/vendor/guzzlehttp/guzzle/src/UriTemplate.php deleted file mode 100644 index 55dfeb5..0000000 --- a/core/vendor/guzzlehttp/guzzle/src/UriTemplate.php +++ /dev/null @@ -1,241 +0,0 @@ - array('prefix' => '', 'joiner' => ',', 'query' => false), - '+' => array('prefix' => '', 'joiner' => ',', 'query' => false), - '#' => array('prefix' => '#', 'joiner' => ',', 'query' => false), - '.' => array('prefix' => '.', 'joiner' => '.', 'query' => false), - '/' => array('prefix' => '/', 'joiner' => '/', 'query' => false), - ';' => array('prefix' => ';', 'joiner' => ';', 'query' => true), - '?' => array('prefix' => '?', 'joiner' => '&', 'query' => true), - '&' => array('prefix' => '&', 'joiner' => '&', 'query' => true) - ); - - /** @var array Delimiters */ - private static $delims = array(':', '/', '?', '#', '[', ']', '@', '!', '$', - '&', '\'', '(', ')', '*', '+', ',', ';', '='); - - /** @var array Percent encoded delimiters */ - private static $delimsPct = array('%3A', '%2F', '%3F', '%23', '%5B', '%5D', - '%40', '%21', '%24', '%26', '%27', '%28', '%29', '%2A', '%2B', '%2C', - '%3B', '%3D'); - - public function expand($template, array $variables) - { - if (false === strpos($template, '{')) { - return $template; - } - - $this->template = $template; - $this->variables = $variables; - - return preg_replace_callback( - '/\{([^\}]+)\}/', - [$this, 'expandMatch'], - $this->template - ); - } - - /** - * Parse an expression into parts - * - * @param string $expression Expression to parse - * - * @return array Returns an associative array of parts - */ - private function parseExpression($expression) - { - $result = array(); - - if (isset(self::$operatorHash[$expression[0]])) { - $result['operator'] = $expression[0]; - $expression = substr($expression, 1); - } else { - $result['operator'] = ''; - } - - foreach (explode(',', $expression) as $value) { - $value = trim($value); - $varspec = array(); - if ($colonPos = strpos($value, ':')) { - $varspec['value'] = substr($value, 0, $colonPos); - $varspec['modifier'] = ':'; - $varspec['position'] = (int) substr($value, $colonPos + 1); - } elseif (substr($value, -1) == '*') { - $varspec['modifier'] = '*'; - $varspec['value'] = substr($value, 0, -1); - } else { - $varspec['value'] = (string) $value; - $varspec['modifier'] = ''; - } - $result['values'][] = $varspec; - } - - return $result; - } - - /** - * Process an expansion - * - * @param array $matches Matches met in the preg_replace_callback - * - * @return string Returns the replacement string - */ - private function expandMatch(array $matches) - { - static $rfc1738to3986 = array('+' => '%20', '%7e' => '~'); - - $replacements = array(); - $parsed = self::parseExpression($matches[1]); - $prefix = self::$operatorHash[$parsed['operator']]['prefix']; - $joiner = self::$operatorHash[$parsed['operator']]['joiner']; - $useQuery = self::$operatorHash[$parsed['operator']]['query']; - - foreach ($parsed['values'] as $value) { - - if (!isset($this->variables[$value['value']])) { - continue; - } - - $variable = $this->variables[$value['value']]; - $actuallyUseQuery = $useQuery; - $expanded = ''; - - if (is_array($variable)) { - - $isAssoc = $this->isAssoc($variable); - $kvp = array(); - foreach ($variable as $key => $var) { - - if ($isAssoc) { - $key = rawurlencode($key); - $isNestedArray = is_array($var); - } else { - $isNestedArray = false; - } - - if (!$isNestedArray) { - $var = rawurlencode($var); - if ($parsed['operator'] == '+' || - $parsed['operator'] == '#' - ) { - $var = $this->decodeReserved($var); - } - } - - if ($value['modifier'] == '*') { - if ($isAssoc) { - if ($isNestedArray) { - // Nested arrays must allow for deeply nested - // structures. - $var = strtr( - http_build_query([$key => $var]), - $rfc1738to3986 - ); - } else { - $var = $key . '=' . $var; - } - } elseif ($key > 0 && $actuallyUseQuery) { - $var = $value['value'] . '=' . $var; - } - } - - $kvp[$key] = $var; - } - - if (empty($variable)) { - $actuallyUseQuery = false; - } elseif ($value['modifier'] == '*') { - $expanded = implode($joiner, $kvp); - if ($isAssoc) { - // Don't prepend the value name when using the explode - // modifier with an associative array. - $actuallyUseQuery = false; - } - } else { - if ($isAssoc) { - // When an associative array is encountered and the - // explode modifier is not set, then the result must be - // a comma separated list of keys followed by their - // respective values. - foreach ($kvp as $k => &$v) { - $v = $k . ',' . $v; - } - } - $expanded = implode(',', $kvp); - } - - } else { - if ($value['modifier'] == ':') { - $variable = substr($variable, 0, $value['position']); - } - $expanded = rawurlencode($variable); - if ($parsed['operator'] == '+' || $parsed['operator'] == '#') { - $expanded = $this->decodeReserved($expanded); - } - } - - if ($actuallyUseQuery) { - if (!$expanded && $joiner != '&') { - $expanded = $value['value']; - } else { - $expanded = $value['value'] . '=' . $expanded; - } - } - - $replacements[] = $expanded; - } - - $ret = implode($joiner, $replacements); - if ($ret && $prefix) { - return $prefix . $ret; - } - - return $ret; - } - - /** - * Determines if an array is associative. - * - * This makes the assumption that input arrays are sequences or hashes. - * This assumption is a tradeoff for accuracy in favor of speed, but it - * should work in almost every case where input is supplied for a URI - * template. - * - * @param array $array Array to check - * - * @return bool - */ - private function isAssoc(array $array) - { - return $array && array_keys($array)[0] !== 0; - } - - /** - * Removes percent encoding on reserved characters (used with + and # - * modifiers). - * - * @param string $string String to fix - * - * @return string - */ - private function decodeReserved($string) - { - return str_replace(self::$delimsPct, self::$delims, $string); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/src/Url.php b/core/vendor/guzzlehttp/guzzle/src/Url.php deleted file mode 100644 index a81bad2..0000000 --- a/core/vendor/guzzlehttp/guzzle/src/Url.php +++ /dev/null @@ -1,595 +0,0 @@ - 80, 'https' => 443, 'ftp' => 21]; - private static $pathPattern = '/[^a-zA-Z0-9\-\._~!\$&\'\(\)\*\+,;=%:@\/]+|%(?![A-Fa-f0-9]{2})/'; - private static $queryPattern = '/[^a-zA-Z0-9\-\._~!\$\'\(\)\*\+,;%:@\/\?=&]+|%(?![A-Fa-f0-9]{2})/'; - /** @var Query|string Query part of the URL */ - private $query; - - /** - * Factory method to create a new URL from a URL string - * - * @param string $url Full URL used to create a Url object - * - * @return Url - * @throws \InvalidArgumentException - */ - public static function fromString($url) - { - static $defaults = ['scheme' => null, 'host' => null, - 'path' => null, 'port' => null, 'query' => null, - 'user' => null, 'pass' => null, 'fragment' => null]; - - if (false === ($parts = parse_url($url))) { - throw new \InvalidArgumentException('Unable to parse malformed ' - . 'url: ' . $url); - } - - $parts += $defaults; - - // Convert the query string into a Query object - if ($parts['query'] || 0 !== strlen($parts['query'])) { - $parts['query'] = Query::fromString($parts['query']); - } - - return new static($parts['scheme'], $parts['host'], $parts['user'], - $parts['pass'], $parts['port'], $parts['path'], $parts['query'], - $parts['fragment']); - } - - /** - * Build a URL from parse_url parts. The generated URL will be a relative - * URL if a scheme or host are not provided. - * - * @param array $parts Array of parse_url parts - * - * @return string - */ - public static function buildUrl(array $parts) - { - $url = $scheme = ''; - - if (!empty($parts['scheme'])) { - $scheme = $parts['scheme']; - $url .= $scheme . ':'; - } - - if (!empty($parts['host'])) { - $url .= '//'; - if (isset($parts['user'])) { - $url .= $parts['user']; - if (isset($parts['pass'])) { - $url .= ':' . $parts['pass']; - } - $url .= '@'; - } - - $url .= $parts['host']; - - // Only include the port if it is not the default port of the scheme - if (isset($parts['port']) && - (!isset(self::$defaultPorts[$scheme]) || - $parts['port'] != self::$defaultPorts[$scheme]) - ) { - $url .= ':' . $parts['port']; - } - } - - // Add the path component if present - if (isset($parts['path']) && strlen($parts['path'])) { - // Always ensure that the path begins with '/' if set and something - // is before the path - if (!empty($parts['host']) && $parts['path'][0] != '/') { - $url .= '/'; - } - $url .= $parts['path']; - } - - // Add the query string if present - if (isset($parts['query'])) { - $queryStr = (string) $parts['query']; - if ($queryStr || $queryStr === '0') { - $url .= '?' . $queryStr; - } - } - - // Ensure that # is only added to the url if fragment contains anything. - if (isset($parts['fragment'])) { - $url .= '#' . $parts['fragment']; - } - - return $url; - } - - /** - * Create a new URL from URL parts - * - * @param string $scheme Scheme of the URL - * @param string $host Host of the URL - * @param string $username Username of the URL - * @param string $password Password of the URL - * @param int $port Port of the URL - * @param string $path Path of the URL - * @param Query|array|string $query Query string of the URL - * @param string $fragment Fragment of the URL - */ - public function __construct( - $scheme, - $host, - $username = null, - $password = null, - $port = null, - $path = null, - $query = null, - $fragment = null - ) { - $this->scheme = $scheme; - $this->host = $host; - $this->port = $port; - $this->username = $username; - $this->password = $password; - $this->fragment = $fragment; - - if ($query) { - $this->setQuery($query); - } - - $this->setPath($path); - } - - /** - * Clone the URL - */ - public function __clone() - { - if ($this->query instanceof Query) { - $this->query = clone $this->query; - } - } - - /** - * Returns the URL as a URL string - * - * @return string - */ - public function __toString() - { - return static::buildUrl($this->getParts()); - } - - /** - * Get the parts of the URL as an array - * - * @return array - */ - public function getParts() - { - return array( - 'scheme' => $this->scheme, - 'user' => $this->username, - 'pass' => $this->password, - 'host' => $this->host, - 'port' => $this->port, - 'path' => $this->path, - 'query' => $this->query, - 'fragment' => $this->fragment, - ); - } - - /** - * Set the host of the request. - * - * @param string $host Host to set (e.g. www.yahoo.com, yahoo.com) - * - * @return Url - */ - public function setHost($host) - { - if (strpos($host, ':') === false) { - $this->host = $host; - } else { - list($host, $port) = explode(':', $host); - $this->host = $host; - $this->setPort($port); - } - } - - /** - * Get the host part of the URL - * - * @return string - */ - public function getHost() - { - return $this->host; - } - - /** - * Set the scheme part of the URL (http, https, ftp, etc.) - * - * @param string $scheme Scheme to set - */ - public function setScheme($scheme) - { - // Remove the default port if one is specified - if ($this->port - && isset(self::$defaultPorts[$this->scheme]) - && self::$defaultPorts[$this->scheme] == $this->port - ) { - $this->port = null; - } - - $this->scheme = $scheme; - } - - /** - * Get the scheme part of the URL - * - * @return string - */ - public function getScheme() - { - return $this->scheme; - } - - /** - * Set the port part of the URL - * - * @param int $port Port to set - */ - public function setPort($port) - { - $this->port = $port; - } - - /** - * Get the port part of the URl. - * - * If no port was set, this method will return the default port for the - * scheme of the URI. - * - * @return int|null - */ - public function getPort() - { - if ($this->port) { - return $this->port; - } elseif (isset(self::$defaultPorts[$this->scheme])) { - return self::$defaultPorts[$this->scheme]; - } - - return null; - } - - /** - * Set the path part of the URL. - * - * The provided URL is URL encoded as necessary. - * - * @param string $path Path string to set - */ - public function setPath($path) - { - $this->path = self::encodePath($path); - } - - /** - * Removes dot segments from a URL - * @link http://tools.ietf.org/html/rfc3986#section-5.2.4 - */ - public function removeDotSegments() - { - static $noopPaths = ['' => true, '/' => true, '*' => true]; - static $ignoreSegments = ['.' => true, '..' => true]; - - if (isset($noopPaths[$this->path])) { - return; - } - - $results = []; - $segments = $this->getPathSegments(); - foreach ($segments as $segment) { - if ($segment == '..') { - array_pop($results); - } elseif (!isset($ignoreSegments[$segment])) { - $results[] = $segment; - } - } - - $newPath = implode('/', $results); - - // Add the leading slash if necessary - if (substr($this->path, 0, 1) === '/' && - substr($newPath, 0, 1) !== '/' - ) { - $newPath = '/' . $newPath; - } - - // Add the trailing slash if necessary - if ($newPath != '/' && isset($ignoreSegments[end($segments)])) { - $newPath .= '/'; - } - - $this->path = $newPath; - } - - /** - * Add a relative path to the currently set path. - * - * @param string $relativePath Relative path to add - */ - public function addPath($relativePath) - { - if ($relativePath != '/' && - is_string($relativePath) && - strlen($relativePath) > 0 - ) { - // Add a leading slash if needed - if ($relativePath[0] !== '/' && - substr($this->path, -1, 1) !== '/' - ) { - $relativePath = '/' . $relativePath; - } - - $this->setPath($this->path . $relativePath); - } - } - - /** - * Get the path part of the URL - * - * @return string - */ - public function getPath() - { - return $this->path; - } - - /** - * Get the path segments of the URL as an array - * - * @return array - */ - public function getPathSegments() - { - return explode('/', $this->path); - } - - /** - * Set the password part of the URL - * - * @param string $password Password to set - */ - public function setPassword($password) - { - $this->password = $password; - } - - /** - * Get the password part of the URL - * - * @return null|string - */ - public function getPassword() - { - return $this->password; - } - - /** - * Set the username part of the URL - * - * @param string $username Username to set - */ - public function setUsername($username) - { - $this->username = $username; - } - - /** - * Get the username part of the URl - * - * @return null|string - */ - public function getUsername() - { - return $this->username; - } - - /** - * Get the query part of the URL as a Query object - * - * @return Query - */ - public function getQuery() - { - // Convert the query string to a query object if not already done. - if (!$this->query instanceof Query) { - $this->query = $this->query === null - ? new Query() - : Query::fromString($this->query); - } - - return $this->query; - } - - /** - * Set the query part of the URL. - * - * You may provide a query string as a string and pass $rawString as true - * to provide a query string that is not parsed until a call to getQuery() - * is made. Setting a raw query string will still encode invalid characters - * in a query string. - * - * @param Query|string|array $query Query string value to set. Can - * be a string that will be parsed into a Query object, an array - * of key value pairs, or a Query object. - * @param bool $rawString Set to true when providing a raw query string. - * - * @throws \InvalidArgumentException - */ - public function setQuery($query, $rawString = false) - { - if ($query instanceof Query) { - $this->query = $query; - } elseif (is_string($query)) { - if (!$rawString) { - $this->query = Query::fromString($query); - } else { - // Ensure the query does not have illegal characters. - $this->query = preg_replace_callback( - self::$queryPattern, - [__CLASS__, 'encodeMatch'], - $query - ); - } - - } elseif (is_array($query)) { - $this->query = new Query($query); - } else { - throw new \InvalidArgumentException('Query must be a Query, ' - . 'array, or string. Got ' . Core::describeType($query)); - } - } - - /** - * Get the fragment part of the URL - * - * @return null|string - */ - public function getFragment() - { - return $this->fragment; - } - - /** - * Set the fragment part of the URL - * - * @param string $fragment Fragment to set - */ - public function setFragment($fragment) - { - $this->fragment = $fragment; - } - - /** - * Check if this is an absolute URL - * - * @return bool - */ - public function isAbsolute() - { - return $this->scheme && $this->host; - } - - /** - * Combine the URL with another URL and return a new URL instance. - * - * Follows the rules specific in RFC 3986 section 5.4. - * - * @param string $url Relative URL to combine with - * - * @return Url - * @throws \InvalidArgumentException - * @link http://tools.ietf.org/html/rfc3986#section-5.4 - */ - public function combine($url) - { - $url = static::fromString($url); - - // Use the more absolute URL as the base URL - if (!$this->isAbsolute() && $url->isAbsolute()) { - $url = $url->combine($this); - } - - $parts = $url->getParts(); - - // Passing a URL with a scheme overrides everything - if ($parts['scheme']) { - return clone $url; - } - - // Setting a host overrides the entire rest of the URL - if ($parts['host']) { - return new static( - $this->scheme, - $parts['host'], - $parts['user'], - $parts['pass'], - $parts['port'], - $parts['path'], - $parts['query'] instanceof Query - ? clone $parts['query'] - : $parts['query'], - $parts['fragment'] - ); - } - - if (!$parts['path'] && $parts['path'] !== '0') { - // The relative URL has no path, so check if it is just a query - $path = $this->path ?: ''; - $query = $parts['query'] ?: $this->query; - } else { - $query = $parts['query']; - if ($parts['path'][0] == '/' || !$this->path) { - // Overwrite the existing path if the rel path starts with "/" - $path = $parts['path']; - } else { - // If the relative URL does not have a path or the base URL - // path does not end in a "/" then overwrite the existing path - // up to the last "/" - $path = substr($this->path, 0, strrpos($this->path, '/') + 1) . $parts['path']; - } - } - - $result = new self( - $this->scheme, - $this->host, - $this->username, - $this->password, - $this->port, - $path, - $query instanceof Query ? clone $query : $query, - $parts['fragment'] - ); - - if ($path) { - $result->removeDotSegments(); - } - - return $result; - } - - /** - * Encodes the path part of a URL without double-encoding percent-encoded - * key value pairs. - * - * @param string $path Path to encode - * - * @return string - */ - public static function encodePath($path) - { - static $cb = [__CLASS__, 'encodeMatch']; - return preg_replace_callback(self::$pathPattern, $cb, $path); - } - - private static function encodeMatch(array $match) - { - return rawurlencode($match[0]); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/src/Utils.php b/core/vendor/guzzlehttp/guzzle/src/Utils.php deleted file mode 100644 index 285fe30..0000000 --- a/core/vendor/guzzlehttp/guzzle/src/Utils.php +++ /dev/null @@ -1,145 +0,0 @@ -expand($template, $variables); - } - - /** - * Wrapper for JSON decode that implements error detection with helpful - * error messages. - * - * @param string $json JSON data to parse - * @param bool $assoc When true, returned objects will be converted - * into associative arrays. - * @param int $depth User specified recursion depth. - * @param int $options Bitmask of JSON decode options. - * - * @return mixed - * @throws \InvalidArgumentException if the JSON cannot be parsed. - * @link http://www.php.net/manual/en/function.json-decode.php - */ - public static function jsonDecode($json, $assoc = false, $depth = 512, $options = 0) - { - static $jsonErrors = [ - JSON_ERROR_DEPTH => 'JSON_ERROR_DEPTH - Maximum stack depth exceeded', - JSON_ERROR_STATE_MISMATCH => 'JSON_ERROR_STATE_MISMATCH - Underflow or the modes mismatch', - JSON_ERROR_CTRL_CHAR => 'JSON_ERROR_CTRL_CHAR - Unexpected control character found', - JSON_ERROR_SYNTAX => 'JSON_ERROR_SYNTAX - Syntax error, malformed JSON', - JSON_ERROR_UTF8 => 'JSON_ERROR_UTF8 - Malformed UTF-8 characters, possibly incorrectly encoded' - ]; - - $data = \json_decode($json, $assoc, $depth, $options); - - if (JSON_ERROR_NONE !== json_last_error()) { - $last = json_last_error(); - throw new \InvalidArgumentException( - 'Unable to parse JSON data: ' - . (isset($jsonErrors[$last]) - ? $jsonErrors[$last] - : 'Unknown error') - ); - } - - return $data; - } -} diff --git a/core/vendor/guzzlehttp/guzzle/tests/BatchResultsTest.php b/core/vendor/guzzlehttp/guzzle/tests/BatchResultsTest.php deleted file mode 100644 index 080d44c..0000000 --- a/core/vendor/guzzlehttp/guzzle/tests/BatchResultsTest.php +++ /dev/null @@ -1,58 +0,0 @@ -assertCount(3, $batch); - $this->assertEquals([$a, $b, $c], $batch->getKeys()); - $this->assertEquals([$hash[$c]], $batch->getFailures()); - $this->assertEquals(['1', '2'], $batch->getSuccessful()); - $this->assertEquals('1', $batch->getResult($a)); - $this->assertNull($batch->getResult(new \stdClass())); - $this->assertTrue(isset($batch[0])); - $this->assertFalse(isset($batch[10])); - $this->assertEquals('1', $batch[0]); - $this->assertEquals('2', $batch[1]); - $this->assertNull($batch[100]); - $this->assertInstanceOf('Exception', $batch[2]); - - $results = iterator_to_array($batch); - $this->assertEquals(['1', '2', $hash[$c]], $results); - } - - /** - * @expectedException \RuntimeException - */ - public function testCannotSetByIndex() - { - $hash = new \SplObjectStorage(); - $batch = new BatchResults($hash); - $batch[10] = 'foo'; - } - - /** - * @expectedException \RuntimeException - */ - public function testCannotUnsetByIndex() - { - $hash = new \SplObjectStorage(); - $batch = new BatchResults($hash); - unset($batch[10]); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/tests/ClientTest.php b/core/vendor/guzzlehttp/guzzle/tests/ClientTest.php deleted file mode 100644 index 913e535..0000000 --- a/core/vendor/guzzlehttp/guzzle/tests/ClientTest.php +++ /dev/null @@ -1,624 +0,0 @@ -ma = function () { - throw new \RuntimeException('Should not have been called.'); - }; - } - - public function testProvidesDefaultUserAgent() - { - $ua = Client::getDefaultUserAgent(); - $this->assertEquals(1, preg_match('#^Guzzle/.+ curl/.+ PHP/.+$#', $ua)); - } - - public function testUsesDefaultDefaultOptions() - { - $client = new Client(); - $this->assertTrue($client->getDefaultOption('allow_redirects')); - $this->assertTrue($client->getDefaultOption('exceptions')); - $this->assertTrue($client->getDefaultOption('verify')); - } - - public function testUsesProvidedDefaultOptions() - { - $client = new Client([ - 'defaults' => [ - 'allow_redirects' => false, - 'query' => ['foo' => 'bar'] - ] - ]); - $this->assertFalse($client->getDefaultOption('allow_redirects')); - $this->assertTrue($client->getDefaultOption('exceptions')); - $this->assertTrue($client->getDefaultOption('verify')); - $this->assertEquals(['foo' => 'bar'], $client->getDefaultOption('query')); - } - - public function testCanSpecifyBaseUrl() - { - $this->assertSame('', (new Client())->getBaseUrl()); - $this->assertEquals('http://foo', (new Client([ - 'base_url' => 'http://foo' - ]))->getBaseUrl()); - } - - public function testCanSpecifyBaseUrlUriTemplate() - { - $client = new Client(['base_url' => ['http://foo.com/{var}/', ['var' => 'baz']]]); - $this->assertEquals('http://foo.com/baz/', $client->getBaseUrl()); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testValidatesUriTemplateValue() - { - new Client(['base_url' => ['http://foo.com/']]); - } - - /** - * @expectedException \Exception - * @expectedExceptionMessage Foo - */ - public function testCanSpecifyHandler() - { - $client = new Client(['handler' => function () { - throw new \Exception('Foo'); - }]); - $client->get('http://httpbin.org'); - } - - /** - * @expectedException \Exception - * @expectedExceptionMessage Foo - */ - public function testCanSpecifyHandlerAsAdapter() - { - $client = new Client(['adapter' => function () { - throw new \Exception('Foo'); - }]); - $client->get('http://httpbin.org'); - } - - /** - * @expectedException \Exception - * @expectedExceptionMessage Foo - */ - public function testCanSpecifyMessageFactory() - { - $factory = $this->getMockBuilder('GuzzleHttp\Message\MessageFactoryInterface') - ->setMethods(['createRequest']) - ->getMockForAbstractClass(); - $factory->expects($this->once()) - ->method('createRequest') - ->will($this->throwException(new \Exception('Foo'))); - $client = new Client(['message_factory' => $factory]); - $client->get(); - } - - public function testCanSpecifyEmitter() - { - $emitter = $this->getMockBuilder('GuzzleHttp\Event\EmitterInterface') - ->setMethods(['listeners']) - ->getMockForAbstractClass(); - $emitter->expects($this->once()) - ->method('listeners') - ->will($this->returnValue('foo')); - - $client = new Client(['emitter' => $emitter]); - $this->assertEquals('foo', $client->getEmitter()->listeners()); - } - - public function testAddsDefaultUserAgentHeaderWithDefaultOptions() - { - $client = new Client(['defaults' => ['allow_redirects' => false]]); - $this->assertFalse($client->getDefaultOption('allow_redirects')); - $this->assertEquals( - ['User-Agent' => Client::getDefaultUserAgent()], - $client->getDefaultOption('headers') - ); - } - - public function testAddsDefaultUserAgentHeaderWithoutDefaultOptions() - { - $client = new Client(); - $this->assertEquals( - ['User-Agent' => Client::getDefaultUserAgent()], - $client->getDefaultOption('headers') - ); - } - - private function getRequestClient() - { - $client = $this->getMockBuilder('GuzzleHttp\Client') - ->setMethods(['send']) - ->getMock(); - $client->expects($this->once()) - ->method('send') - ->will($this->returnArgument(0)); - - return $client; - } - - public function requestMethodProvider() - { - return [ - ['GET', false], - ['HEAD', false], - ['DELETE', false], - ['OPTIONS', false], - ['POST', 'foo'], - ['PUT', 'foo'], - ['PATCH', 'foo'] - ]; - } - - /** - * @dataProvider requestMethodProvider - */ - public function testClientProvidesMethodShortcut($method, $body) - { - $client = $this->getRequestClient(); - if ($body) { - $request = $client->{$method}('http://foo.com', [ - 'headers' => ['X-Baz' => 'Bar'], - 'body' => $body, - 'query' => ['a' => 'b'] - ]); - } else { - $request = $client->{$method}('http://foo.com', [ - 'headers' => ['X-Baz' => 'Bar'], - 'query' => ['a' => 'b'] - ]); - } - $this->assertEquals($method, $request->getMethod()); - $this->assertEquals('Bar', $request->getHeader('X-Baz')); - $this->assertEquals('a=b', $request->getQuery()); - if ($body) { - $this->assertEquals($body, $request->getBody()); - } - } - - public function testClientMergesDefaultOptionsWithRequestOptions() - { - $f = $this->getMockBuilder('GuzzleHttp\Message\MessageFactoryInterface') - ->setMethods(array('createRequest')) - ->getMockForAbstractClass(); - - $o = null; - // Intercept the creation - $f->expects($this->once()) - ->method('createRequest') - ->will($this->returnCallback( - function ($method, $url, array $options = []) use (&$o) { - $o = $options; - return (new MessageFactory())->createRequest($method, $url, $options); - } - )); - - $client = new Client([ - 'message_factory' => $f, - 'defaults' => [ - 'headers' => ['Foo' => 'Bar'], - 'query' => ['baz' => 'bam'], - 'exceptions' => false - ] - ]); - - $request = $client->createRequest('GET', 'http://foo.com?a=b', [ - 'headers' => ['Hi' => 'there', '1' => 'one'], - 'allow_redirects' => false, - 'query' => ['t' => 1] - ]); - - $this->assertFalse($o['allow_redirects']); - $this->assertFalse($o['exceptions']); - $this->assertEquals('Bar', $request->getHeader('Foo')); - $this->assertEquals('there', $request->getHeader('Hi')); - $this->assertEquals('one', $request->getHeader('1')); - $this->assertEquals('a=b&baz=bam&t=1', $request->getQuery()); - } - - public function testClientMergesDefaultHeadersCaseInsensitively() - { - $client = new Client(['defaults' => ['headers' => ['Foo' => 'Bar']]]); - $request = $client->createRequest('GET', 'http://foo.com?a=b', [ - 'headers' => ['foo' => 'custom', 'user-agent' => 'test'] - ]); - $this->assertEquals('test', $request->getHeader('User-Agent')); - $this->assertEquals('custom', $request->getHeader('Foo')); - } - - public function testCanOverrideDefaultOptionWithNull() - { - $client = new Client(['defaults' => ['proxy' => 'invalid!']]); - $request = $client->createRequest('GET', 'http://foo.com?a=b', [ - 'proxy' => null - ]); - $this->assertFalse($request->getConfig()->hasKey('proxy')); - } - - public function testDoesNotOverwriteExistingUA() - { - $client = new Client(['defaults' => [ - 'headers' => ['User-Agent' => 'test'] - ]]); - $this->assertEquals( - ['User-Agent' => 'test'], - $client->getDefaultOption('headers') - ); - } - - public function testUsesBaseUrlWhenNoUrlIsSet() - { - $client = new Client(['base_url' => 'http://www.foo.com/baz?bam=bar']); - $this->assertEquals( - 'http://www.foo.com/baz?bam=bar', - $client->createRequest('GET')->getUrl() - ); - } - - public function testUsesBaseUrlCombinedWithProvidedUrl() - { - $client = new Client(['base_url' => 'http://www.foo.com/baz?bam=bar']); - $this->assertEquals( - 'http://www.foo.com/bar/bam', - $client->createRequest('GET', 'bar/bam')->getUrl() - ); - } - - public function testFalsyPathsAreCombinedWithBaseUrl() - { - $client = new Client(['base_url' => 'http://www.foo.com/baz?bam=bar']); - $this->assertEquals( - 'http://www.foo.com/0', - $client->createRequest('GET', '0')->getUrl() - ); - } - - public function testUsesBaseUrlCombinedWithProvidedUrlViaUriTemplate() - { - $client = new Client(['base_url' => 'http://www.foo.com/baz?bam=bar']); - $this->assertEquals( - 'http://www.foo.com/bar/123', - $client->createRequest('GET', ['bar/{bam}', ['bam' => '123']])->getUrl() - ); - } - - public function testSettingAbsoluteUrlOverridesBaseUrl() - { - $client = new Client(['base_url' => 'http://www.foo.com/baz?bam=bar']); - $this->assertEquals( - 'http://www.foo.com/foo', - $client->createRequest('GET', '/foo')->getUrl() - ); - } - - public function testSettingAbsoluteUriTemplateOverridesBaseUrl() - { - $client = new Client(['base_url' => 'http://www.foo.com/baz?bam=bar']); - $this->assertEquals( - 'http://goo.com/1', - $client->createRequest( - 'GET', - ['http://goo.com/{bar}', ['bar' => '1']] - )->getUrl() - ); - } - - public function testCanSetRelativeUrlStartingWithHttp() - { - $client = new Client(['base_url' => 'http://www.foo.com']); - $this->assertEquals( - 'http://www.foo.com/httpfoo', - $client->createRequest('GET', 'httpfoo')->getUrl() - ); - } - - public function testClientSendsRequests() - { - $mock = new MockHandler(['status' => 200, 'headers' => []]); - $client = new Client(['handler' => $mock]); - $response = $client->get('http://test.com'); - $this->assertEquals(200, $response->getStatusCode()); - $this->assertEquals('http://test.com', $response->getEffectiveUrl()); - } - - public function testSendingRequestCanBeIntercepted() - { - $response = new Response(200); - $client = new Client(['handler' => $this->ma]); - $client->getEmitter()->on( - 'before', - function (BeforeEvent $e) use ($response) { - $e->intercept($response); - } - ); - $this->assertSame($response, $client->get('http://test.com')); - $this->assertEquals('http://test.com', $response->getEffectiveUrl()); - } - - /** - * @expectedException \GuzzleHttp\Exception\RequestException - * @expectedExceptionMessage Argument 1 passed to GuzzleHttp\Message\FutureResponse::proxy() must implement interface GuzzleHttp\Ring\Future\FutureInterface - */ - public function testEnsuresResponseIsPresentAfterSending() - { - $handler = function () {}; - $client = new Client(['handler' => $handler]); - $client->get('http://httpbin.org'); - } - - /** - * @expectedException \GuzzleHttp\Exception\RequestException - * @expectedExceptionMessage Waiting did not resolve future - */ - public function testEnsuresResponseIsPresentAfterDereferencing() - { - $deferred = new Deferred(); - $handler = new MockHandler(function () use ($deferred) { - return new FutureArray( - $deferred->promise(), - function () {} - ); - }); - $client = new Client(['handler' => $handler]); - $response = $client->get('http://httpbin.org'); - $response->wait(); - } - - public function testClientHandlesErrorsDuringBeforeSend() - { - $client = new Client(); - $client->getEmitter()->on('before', function ($e) { - throw new \Exception('foo'); - }); - $client->getEmitter()->on('error', function (ErrorEvent $e) { - $e->intercept(new Response(200)); - }); - $this->assertEquals( - 200, - $client->get('http://test.com')->getStatusCode() - ); - } - - /** - * @expectedException \GuzzleHttp\Exception\RequestException - * @expectedExceptionMessage foo - */ - public function testClientHandlesErrorsDuringBeforeSendAndThrowsIfUnhandled() - { - $client = new Client(); - $client->getEmitter()->on('before', function (BeforeEvent $e) { - throw new RequestException('foo', $e->getRequest()); - }); - $client->get('http://httpbin.org'); - } - - /** - * @expectedException \GuzzleHttp\Exception\RequestException - * @expectedExceptionMessage foo - */ - public function testClientWrapsExceptions() - { - $client = new Client(); - $client->getEmitter()->on('before', function (BeforeEvent $e) { - throw new \Exception('foo'); - }); - $client->get('http://httpbin.org'); - } - - public function testCanInjectResponseForFutureError() - { - $calledFuture = false; - $deferred = new Deferred(); - $future = new FutureArray( - $deferred->promise(), - function () use ($deferred, &$calledFuture) { - $calledFuture = true; - $deferred->resolve(['error' => new \Exception('Noo!')]); - } - ); - $mock = new MockHandler($future); - $client = new Client(['handler' => $mock]); - $called = 0; - $response = $client->get('http://localhost:123/foo', [ - 'future' => true, - 'events' => [ - 'error' => function (ErrorEvent $e) use (&$called) { - $called++; - $e->intercept(new Response(200)); - } - ] - ]); - $this->assertEquals(0, $called); - $this->assertInstanceOf('GuzzleHttp\Message\FutureResponse', $response); - $this->assertEquals(200, $response->getStatusCode()); - $this->assertTrue($calledFuture); - $this->assertEquals(1, $called); - } - - public function testCanReturnFutureResults() - { - $called = false; - $deferred = new Deferred(); - $future = new FutureArray( - $deferred->promise(), - function () use ($deferred, &$called) { - $called = true; - $deferred->resolve(['status' => 201, 'headers' => []]); - } - ); - $mock = new MockHandler($future); - $client = new Client(['handler' => $mock]); - $response = $client->get('http://localhost:123/foo', ['future' => true]); - $this->assertFalse($called); - $this->assertInstanceOf('GuzzleHttp\Message\FutureResponse', $response); - $this->assertEquals(201, $response->getStatusCode()); - $this->assertTrue($called); - } - - public function testThrowsExceptionsWhenDereferenced() - { - $calledFuture = false; - $deferred = new Deferred(); - $future = new FutureArray( - $deferred->promise(), - function () use ($deferred, &$calledFuture) { - $calledFuture = true; - $deferred->resolve(['error' => new \Exception('Noop!')]); - } - ); - $client = new Client(['handler' => new MockHandler($future)]); - try { - $res = $client->get('http://localhost:123/foo', ['future' => true]); - $res->wait(); - $this->fail('Did not throw'); - } catch (RequestException $e) { - $this->assertEquals(1, $calledFuture); - } - } - - /** - * @expectedExceptionMessage Noo! - * @expectedException \GuzzleHttp\Exception\RequestException - */ - public function testThrowsExceptionsSynchronously() - { - $client = new Client([ - 'handler' => new MockHandler(['error' => new \Exception('Noo!')]) - ]); - $client->get('http://localhost:123/foo'); - } - - public function testCanSetDefaultValues() - { - $client = new Client(['foo' => 'bar']); - $client->setDefaultOption('headers/foo', 'bar'); - $this->assertNull($client->getDefaultOption('foo')); - $this->assertEquals('bar', $client->getDefaultOption('headers/foo')); - } - - public function testSendsAllInParallel() - { - $client = new Client(); - $client->getEmitter()->attach(new Mock([ - new Response(200), - new Response(201), - new Response(202), - ])); - $history = new History(); - $client->getEmitter()->attach($history); - - $requests = [ - $client->createRequest('GET', 'http://test.com'), - $client->createRequest('POST', 'http://test.com'), - $client->createRequest('PUT', 'http://test.com') - ]; - - $client->sendAll($requests); - $requests = array_map(function($r) { - return $r->getMethod(); - }, $history->getRequests()); - $this->assertContains('GET', $requests); - $this->assertContains('POST', $requests); - $this->assertContains('PUT', $requests); - } - - public function testCanDisableAuthPerRequest() - { - $client = new Client(['defaults' => ['auth' => 'foo']]); - $request = $client->createRequest('GET', 'http://test.com'); - $this->assertEquals('foo', $request->getConfig()['auth']); - $request = $client->createRequest('GET', 'http://test.com', ['auth' => null]); - $this->assertFalse($request->getConfig()->hasKey('auth')); - } - - public function testUsesProxyEnvironmentVariables() - { - $http = getenv('HTTP_PROXY'); - $https = getenv('HTTPS_PROXY'); - - $client = new Client(); - $this->assertNull($client->getDefaultOption('proxy')); - - putenv('HTTP_PROXY=127.0.0.1'); - $client = new Client(); - $this->assertEquals( - ['http' => '127.0.0.1'], - $client->getDefaultOption('proxy') - ); - - putenv('HTTPS_PROXY=127.0.0.2'); - $client = new Client(); - $this->assertEquals( - ['http' => '127.0.0.1', 'https' => '127.0.0.2'], - $client->getDefaultOption('proxy') - ); - - putenv("HTTP_PROXY=$http"); - putenv("HTTPS_PROXY=$https"); - } - - public function testReturnsFutureForErrorWhenRequested() - { - $client = new Client(['handler' => new MockHandler(['status' => 404])]); - $request = $client->createRequest('GET', 'http://localhost:123/foo', [ - 'future' => true - ]); - $res = $client->send($request); - $this->assertInstanceOf('GuzzleHttp\Message\FutureResponse', $res); - try { - $res->wait(); - $this->fail('did not throw'); - } catch (RequestException $e) { - $this->assertContains('404', $e->getMessage()); - } - } - - public function testReturnsFutureForResponseWhenRequested() - { - $client = new Client(['handler' => new MockHandler(['status' => 200])]); - $request = $client->createRequest('GET', 'http://localhost:123/foo', [ - 'future' => true - ]); - $res = $client->send($request); - $this->assertInstanceOf('GuzzleHttp\Message\FutureResponse', $res); - $this->assertEquals(200, $res->getStatusCode()); - } - - public function testCanUseUrlWithCustomQuery() - { - $client = new Client(); - $url = Url::fromString('http://foo.com/bar'); - $query = new Query(['baz' => '123%20']); - $query->setEncodingType(false); - $url->setQuery($query); - $r = $client->createRequest('GET', $url); - $this->assertEquals('http://foo.com/bar?baz=123%20', $r->getUrl()); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/tests/CollectionTest.php b/core/vendor/guzzlehttp/guzzle/tests/CollectionTest.php deleted file mode 100644 index d137947..0000000 --- a/core/vendor/guzzlehttp/guzzle/tests/CollectionTest.php +++ /dev/null @@ -1,416 +0,0 @@ -coll = new Collection(); - } - - public function testConstructorCanBeCalledWithNoParams() - { - $this->coll = new Collection(); - $p = $this->coll->toArray(); - $this->assertEmpty($p, '-> Collection must be empty when no data is passed'); - } - - public function testConstructorCanBeCalledWithParams() - { - $testData = array( - 'test' => 'value', - 'test_2' => 'value2' - ); - $this->coll = new Collection($testData); - $this->assertEquals($this->coll->toArray(), $testData); - $this->assertEquals($this->coll->toArray(), $this->coll->toArray()); - } - - public function testImplementsIteratorAggregate() - { - $this->coll->set('key', 'value'); - $this->assertInstanceOf('ArrayIterator', $this->coll->getIterator()); - $this->assertEquals(1, count($this->coll)); - $total = 0; - foreach ($this->coll as $key => $value) { - $this->assertEquals('key', $key); - $this->assertEquals('value', $value); - $total++; - } - $this->assertEquals(1, $total); - } - - public function testCanAddValuesToExistingKeysByUsingArray() - { - $this->coll->add('test', 'value1'); - $this->assertEquals($this->coll->toArray(), array('test' => 'value1')); - $this->coll->add('test', 'value2'); - $this->assertEquals($this->coll->toArray(), array('test' => array('value1', 'value2'))); - $this->coll->add('test', 'value3'); - $this->assertEquals($this->coll->toArray(), array('test' => array('value1', 'value2', 'value3'))); - } - - public function testHandlesMergingInDisparateDataSources() - { - $params = array( - 'test' => 'value1', - 'test2' => 'value2', - 'test3' => array('value3', 'value4') - ); - $this->coll->merge($params); - $this->assertEquals($this->coll->toArray(), $params); - $this->coll->merge(new Collection(['test4' => 'hi'])); - $this->assertEquals( - $this->coll->toArray(), - $params + ['test4' => 'hi'] - ); - } - - public function testCanClearAllDataOrSpecificKeys() - { - $this->coll->merge(array( - 'test' => 'value1', - 'test2' => 'value2' - )); - - // Clear a specific parameter by name - $this->coll->remove('test'); - - $this->assertEquals($this->coll->toArray(), array( - 'test2' => 'value2' - )); - - // Clear all parameters - $this->coll->clear(); - - $this->assertEquals($this->coll->toArray(), array()); - } - - public function testProvidesKeys() - { - $this->assertEquals(array(), $this->coll->getKeys()); - $this->coll->merge(array( - 'test1' => 'value1', - 'test2' => 'value2' - )); - $this->assertEquals(array('test1', 'test2'), $this->coll->getKeys()); - // Returns the cached array previously returned - $this->assertEquals(array('test1', 'test2'), $this->coll->getKeys()); - $this->coll->remove('test1'); - $this->assertEquals(array('test2'), $this->coll->getKeys()); - $this->coll->add('test3', 'value3'); - $this->assertEquals(array('test2', 'test3'), $this->coll->getKeys()); - } - - public function testChecksIfHasKey() - { - $this->assertFalse($this->coll->hasKey('test')); - $this->coll->add('test', 'value'); - $this->assertEquals(true, $this->coll->hasKey('test')); - $this->coll->add('test2', 'value2'); - $this->assertEquals(true, $this->coll->hasKey('test')); - $this->assertEquals(true, $this->coll->hasKey('test2')); - $this->assertFalse($this->coll->hasKey('testing')); - $this->assertEquals(false, $this->coll->hasKey('AB-C', 'junk')); - } - - public function testChecksIfHasValue() - { - $this->assertFalse($this->coll->hasValue('value')); - $this->coll->add('test', 'value'); - $this->assertEquals('test', $this->coll->hasValue('value')); - $this->coll->add('test2', 'value2'); - $this->assertEquals('test', $this->coll->hasValue('value')); - $this->assertEquals('test2', $this->coll->hasValue('value2')); - $this->assertFalse($this->coll->hasValue('val')); - } - - public function testImplementsCount() - { - $data = new Collection(); - $this->assertEquals(0, $data->count()); - $data->add('key', 'value'); - $this->assertEquals(1, count($data)); - $data->add('key', 'value2'); - $this->assertEquals(1, count($data)); - $data->add('key_2', 'value3'); - $this->assertEquals(2, count($data)); - } - - public function testAddParamsByMerging() - { - $params = array( - 'test' => 'value1', - 'test2' => 'value2', - 'test3' => array('value3', 'value4') - ); - - // Add some parameters - $this->coll->merge($params); - - // Add more parameters by merging them in - $this->coll->merge(array( - 'test' => 'another', - 'different_key' => 'new value' - )); - - $this->assertEquals(array( - 'test' => array('value1', 'another'), - 'test2' => 'value2', - 'test3' => array('value3', 'value4'), - 'different_key' => 'new value' - ), $this->coll->toArray()); - } - - public function testAllowsFunctionalFilter() - { - $this->coll->merge(array( - 'fruit' => 'apple', - 'number' => 'ten', - 'prepositions' => array('about', 'above', 'across', 'after'), - 'same_number' => 'ten' - )); - - $filtered = $this->coll->filter(function ($key, $value) { - return $value == 'ten'; - }); - - $this->assertNotSame($filtered, $this->coll); - - $this->assertEquals(array( - 'number' => 'ten', - 'same_number' => 'ten' - ), $filtered->toArray()); - } - - public function testAllowsFunctionalMapping() - { - $this->coll->merge(array( - 'number_1' => 1, - 'number_2' => 2, - 'number_3' => 3 - )); - - $mapped = $this->coll->map(function ($key, $value) { - return $value * $value; - }); - - $this->assertNotSame($mapped, $this->coll); - - $this->assertEquals(array( - 'number_1' => 1, - 'number_2' => 4, - 'number_3' => 9 - ), $mapped->toArray()); - } - - public function testImplementsArrayAccess() - { - $this->coll->merge(array( - 'k1' => 'v1', - 'k2' => 'v2' - )); - - $this->assertTrue($this->coll->offsetExists('k1')); - $this->assertFalse($this->coll->offsetExists('Krull')); - - $this->coll->offsetSet('k3', 'v3'); - $this->assertEquals('v3', $this->coll->offsetGet('k3')); - $this->assertEquals('v3', $this->coll->get('k3')); - - $this->coll->offsetUnset('k1'); - $this->assertFalse($this->coll->offsetExists('k1')); - } - - public function testCanReplaceAllData() - { - $this->coll->replace(array('a' => '123')); - $this->assertEquals(array('a' => '123'), $this->coll->toArray()); - } - - public function testPreparesFromConfig() - { - $c = Collection::fromConfig(array( - 'a' => '123', - 'base_url' => 'http://www.test.com/' - ), array( - 'a' => 'xyz', - 'b' => 'lol' - ), array('a')); - - $this->assertInstanceOf('GuzzleHttp\Collection', $c); - $this->assertEquals(array( - 'a' => '123', - 'b' => 'lol', - 'base_url' => 'http://www.test.com/' - ), $c->toArray()); - - try { - $c = Collection::fromConfig(array(), array(), array('a')); - $this->fail('Exception not throw when missing config'); - } catch (\InvalidArgumentException $e) { - } - } - - function falseyDataProvider() - { - return array( - array(false, false), - array(null, null), - array('', ''), - array(array(), array()), - array(0, 0), - ); - } - - /** - * @dataProvider falseyDataProvider - */ - public function testReturnsCorrectData($a, $b) - { - $c = new Collection(array('value' => $a)); - $this->assertSame($b, $c->get('value')); - } - - public function testRetrievesNestedKeysUsingPath() - { - $data = array( - 'foo' => 'bar', - 'baz' => array( - 'mesa' => array( - 'jar' => 'jar' - ) - ) - ); - $collection = new Collection($data); - $this->assertEquals('bar', $collection->getPath('foo')); - $this->assertEquals('jar', $collection->getPath('baz/mesa/jar')); - $this->assertNull($collection->getPath('wewewf')); - $this->assertNull($collection->getPath('baz/mesa/jar/jar')); - } - - public function testFalseyKeysStillDescend() - { - $collection = new Collection(array( - '0' => array( - 'a' => 'jar' - ), - 1 => 'other' - )); - $this->assertEquals('jar', $collection->getPath('0/a')); - $this->assertEquals('other', $collection->getPath('1')); - } - - public function getPathProvider() - { - $data = array( - 'foo' => 'bar', - 'baz' => array( - 'mesa' => array( - 'jar' => 'jar', - 'array' => array('a', 'b', 'c') - ), - 'bar' => array( - 'baz' => 'bam', - 'array' => array('d', 'e', 'f') - ) - ), - 'bam' => array( - array('foo' => 1), - array('foo' => 2), - array('array' => array('h', 'i')) - ) - ); - $c = new Collection($data); - - return array( - // Simple path selectors - array($c, 'foo', 'bar'), - array($c, 'baz', $data['baz']), - array($c, 'bam', $data['bam']), - array($c, 'baz/mesa', $data['baz']['mesa']), - array($c, 'baz/mesa/jar', 'jar'), - // Does not barf on missing keys - array($c, 'fefwfw', null), - array($c, 'baz/mesa/array', $data['baz']['mesa']['array']) - ); - } - - /** - * @dataProvider getPathProvider - */ - public function testGetPath(Collection $c, $path, $expected, $separator = '/') - { - $this->assertEquals($expected, $c->getPath($path, $separator)); - } - - public function testOverridesSettings() - { - $c = new Collection(array('foo' => 1, 'baz' => 2, 'bar' => 3)); - $c->overwriteWith(array('foo' => 10, 'bar' => 300)); - $this->assertEquals(array('foo' => 10, 'baz' => 2, 'bar' => 300), $c->toArray()); - } - - public function testOverwriteWithCollection() - { - $c = new Collection(array('foo' => 1, 'baz' => 2, 'bar' => 3)); - $b = new Collection(array('foo' => 10, 'bar' => 300)); - $c->overwriteWith($b); - $this->assertEquals(array('foo' => 10, 'baz' => 2, 'bar' => 300), $c->toArray()); - } - - public function testOverwriteWithTraversable() - { - $c = new Collection(array('foo' => 1, 'baz' => 2, 'bar' => 3)); - $b = new Collection(array('foo' => 10, 'bar' => 300)); - $c->overwriteWith($b->getIterator()); - $this->assertEquals(array('foo' => 10, 'baz' => 2, 'bar' => 300), $c->toArray()); - } - - public function testCanSetNestedPathValueThatDoesNotExist() - { - $c = new Collection(array()); - $c->setPath('foo/bar/baz/123', 'hi'); - $this->assertEquals('hi', $c['foo']['bar']['baz']['123']); - } - - public function testCanSetNestedPathValueThatExists() - { - $c = new Collection(array('foo' => array('bar' => 'test'))); - $c->setPath('foo/bar', 'hi'); - $this->assertEquals('hi', $c['foo']['bar']); - } - - /** - * @expectedException \RuntimeException - */ - public function testVerifiesNestedPathIsValidAtExactLevel() - { - $c = new Collection(array('foo' => 'bar')); - $c->setPath('foo/bar', 'hi'); - $this->assertEquals('hi', $c['foo']['bar']); - } - - /** - * @expectedException \RuntimeException - */ - public function testVerifiesThatNestedPathIsValidAtAnyLevel() - { - $c = new Collection(array('foo' => 'bar')); - $c->setPath('foo/bar/baz', 'test'); - } - - public function testCanAppendToNestedPathValues() - { - $c = new Collection(); - $c->setPath('foo/bar/[]', 'a'); - $c->setPath('foo/bar/[]', 'b'); - $this->assertEquals(['a', 'b'], $c['foo']['bar']); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/tests/Cookie/CookieJarTest.php b/core/vendor/guzzlehttp/guzzle/tests/Cookie/CookieJarTest.php deleted file mode 100644 index 1360419..0000000 --- a/core/vendor/guzzlehttp/guzzle/tests/Cookie/CookieJarTest.php +++ /dev/null @@ -1,339 +0,0 @@ -jar = new CookieJar(); - } - - protected function getTestCookies() - { - return [ - new SetCookie(['Name' => 'foo', 'Value' => 'bar', 'Domain' => 'foo.com', 'Path' => '/', 'Discard' => true]), - new SetCookie(['Name' => 'test', 'Value' => '123', 'Domain' => 'baz.com', 'Path' => '/foo', 'Expires' => 2]), - new SetCookie(['Name' => 'you', 'Value' => '123', 'Domain' => 'bar.com', 'Path' => '/boo', 'Expires' => time() + 1000]) - ]; - } - - public function testQuotesBadCookieValues() - { - $this->assertEquals('foo', CookieJar::getCookieValue('foo')); - $this->assertEquals('"foo,bar"', CookieJar::getCookieValue('foo,bar')); - } - - public function testCreatesFromArray() - { - $jar = CookieJar::fromArray([ - 'foo' => 'bar', - 'baz' => 'bam' - ], 'example.com'); - $this->assertCount(2, $jar); - } - - /** - * Provides test data for cookie cookieJar retrieval - */ - public function getCookiesDataProvider() - { - return [ - [['foo', 'baz', 'test', 'muppet', 'googoo'], '', '', '', false], - [['foo', 'baz', 'muppet', 'googoo'], '', '', '', true], - [['googoo'], 'www.example.com', '', '', false], - [['muppet', 'googoo'], 'test.y.example.com', '', '', false], - [['foo', 'baz'], 'example.com', '', '', false], - [['muppet'], 'x.y.example.com', '/acme/', '', false], - [['muppet'], 'x.y.example.com', '/acme/test/', '', false], - [['googoo'], 'x.y.example.com', '/test/acme/test/', '', false], - [['foo', 'baz'], 'example.com', '', '', false], - [['baz'], 'example.com', '', 'baz', false], - ]; - } - - public function testStoresAndRetrievesCookies() - { - $cookies = $this->getTestCookies(); - foreach ($cookies as $cookie) { - $this->assertTrue($this->jar->setCookie($cookie)); - } - - $this->assertEquals(3, count($this->jar)); - $this->assertEquals(3, count($this->jar->getIterator())); - $this->assertEquals($cookies, $this->jar->getIterator()->getArrayCopy()); - } - - public function testRemovesTemporaryCookies() - { - $cookies = $this->getTestCookies(); - foreach ($this->getTestCookies() as $cookie) { - $this->jar->setCookie($cookie); - } - $this->jar->clearSessionCookies(); - $this->assertEquals( - [$cookies[1], $cookies[2]], - $this->jar->getIterator()->getArrayCopy() - ); - } - - public function testRemovesSelectively() - { - foreach ($this->getTestCookies() as $cookie) { - $this->jar->setCookie($cookie); - } - - // Remove foo.com cookies - $this->jar->clear('foo.com'); - $this->assertEquals(2, count($this->jar)); - // Try again, removing no further cookies - $this->jar->clear('foo.com'); - $this->assertEquals(2, count($this->jar)); - - // Remove bar.com cookies with path of /boo - $this->jar->clear('bar.com', '/boo'); - $this->assertEquals(1, count($this->jar)); - - // Remove cookie by name - $this->jar->clear(null, null, 'test'); - $this->assertEquals(0, count($this->jar)); - } - - public function testDoesNotAddIncompleteCookies() - { - $this->assertEquals(false, $this->jar->setCookie(new SetCookie())); - $this->assertFalse($this->jar->setCookie(new SetCookie(array( - 'Name' => 'foo' - )))); - $this->assertFalse($this->jar->setCookie(new SetCookie(array( - 'Name' => false - )))); - $this->assertFalse($this->jar->setCookie(new SetCookie(array( - 'Name' => true - )))); - $this->assertFalse($this->jar->setCookie(new SetCookie(array( - 'Name' => 'foo', - 'Domain' => 'foo.com' - )))); - } - - public function testDoesAddValidCookies() - { - $this->assertTrue($this->jar->setCookie(new SetCookie(array( - 'Name' => 'foo', - 'Domain' => 'foo.com', - 'Value' => 0 - )))); - $this->assertTrue($this->jar->setCookie(new SetCookie(array( - 'Name' => 'foo', - 'Domain' => 'foo.com', - 'Value' => 0.0 - )))); - $this->assertTrue($this->jar->setCookie(new SetCookie(array( - 'Name' => 'foo', - 'Domain' => 'foo.com', - 'Value' => '0' - )))); - } - - public function testOverwritesCookiesThatAreOlderOrDiscardable() - { - $t = time() + 1000; - $data = array( - 'Name' => 'foo', - 'Value' => 'bar', - 'Domain' => '.example.com', - 'Path' => '/', - 'Max-Age' => '86400', - 'Secure' => true, - 'Discard' => true, - 'Expires' => $t - ); - - // Make sure that the discard cookie is overridden with the non-discard - $this->assertTrue($this->jar->setCookie(new SetCookie($data))); - $this->assertEquals(1, count($this->jar)); - - $data['Discard'] = false; - $this->assertTrue($this->jar->setCookie(new SetCookie($data))); - $this->assertEquals(1, count($this->jar)); - - $c = $this->jar->getIterator()->getArrayCopy(); - $this->assertEquals(false, $c[0]->getDiscard()); - - // Make sure it doesn't duplicate the cookie - $this->jar->setCookie(new SetCookie($data)); - $this->assertEquals(1, count($this->jar)); - - // Make sure the more future-ful expiration date supersede the other - $data['Expires'] = time() + 2000; - $this->assertTrue($this->jar->setCookie(new SetCookie($data))); - $this->assertEquals(1, count($this->jar)); - $c = $this->jar->getIterator()->getArrayCopy(); - $this->assertNotEquals($t, $c[0]->getExpires()); - } - - public function testOverwritesCookiesThatHaveChanged() - { - $t = time() + 1000; - $data = array( - 'Name' => 'foo', - 'Value' => 'bar', - 'Domain' => '.example.com', - 'Path' => '/', - 'Max-Age' => '86400', - 'Secure' => true, - 'Discard' => true, - 'Expires' => $t - ); - - // Make sure that the discard cookie is overridden with the non-discard - $this->assertTrue($this->jar->setCookie(new SetCookie($data))); - - $data['Value'] = 'boo'; - $this->assertTrue($this->jar->setCookie(new SetCookie($data))); - $this->assertEquals(1, count($this->jar)); - - // Changing the value plus a parameter also must overwrite the existing one - $data['Value'] = 'zoo'; - $data['Secure'] = false; - $this->assertTrue($this->jar->setCookie(new SetCookie($data))); - $this->assertEquals(1, count($this->jar)); - - $c = $this->jar->getIterator()->getArrayCopy(); - $this->assertEquals('zoo', $c[0]->getValue()); - } - - public function testAddsCookiesFromResponseWithRequest() - { - $response = new Response(200, array( - 'Set-Cookie' => "fpc=d=.Hm.yh4.1XmJWjJfs4orLQzKzPImxklQoxXSHOZATHUSEFciRueW_7704iYUtsXNEXq0M92Px2glMdWypmJ7HIQl6XIUvrZimWjQ3vIdeuRbI.FNQMAfcxu_XN1zSx7l.AcPdKL6guHc2V7hIQFhnjRW0rxm2oHY1P4bGQxFNz7f.tHm12ZD3DbdMDiDy7TBXsuP4DM-&v=2; expires=Fri, 02-Mar-2019 02:17:40 GMT;" - )); - $request = new Request('GET', 'http://www.example.com'); - $this->jar->extractCookies($request, $response); - $this->assertEquals(1, count($this->jar)); - } - - public function getMatchingCookiesDataProvider() - { - return array( - array('https://example.com', 'foo=bar; baz=foobar'), - array('http://example.com', ''), - array('https://example.com:8912', 'foo=bar; baz=foobar'), - array('https://foo.example.com', 'foo=bar; baz=foobar'), - array('http://foo.example.com/test/acme/', 'googoo=gaga') - ); - } - - /** - * @dataProvider getMatchingCookiesDataProvider - */ - public function testReturnsCookiesMatchingRequests($url, $cookies) - { - $bag = [ - new SetCookie([ - 'Name' => 'foo', - 'Value' => 'bar', - 'Domain' => 'example.com', - 'Path' => '/', - 'Max-Age' => '86400', - 'Secure' => true - ]), - new SetCookie([ - 'Name' => 'baz', - 'Value' => 'foobar', - 'Domain' => 'example.com', - 'Path' => '/', - 'Max-Age' => '86400', - 'Secure' => true - ]), - new SetCookie([ - 'Name' => 'test', - 'Value' => '123', - 'Domain' => 'www.foobar.com', - 'Path' => '/path/', - 'Discard' => true - ]), - new SetCookie([ - 'Name' => 'muppet', - 'Value' => 'cookie_monster', - 'Domain' => '.y.example.com', - 'Path' => '/acme/', - 'Expires' => time() + 86400 - ]), - new SetCookie([ - 'Name' => 'googoo', - 'Value' => 'gaga', - 'Domain' => '.example.com', - 'Path' => '/test/acme/', - 'Max-Age' => 1500 - ]) - ]; - - foreach ($bag as $cookie) { - $this->jar->setCookie($cookie); - } - - $request = new Request('GET', $url); - $this->jar->addCookieHeader($request); - $this->assertEquals($cookies, $request->getHeader('Cookie')); - } - - /** - * @expectedException \RuntimeException - * @expectedExceptionMessage Invalid cookie: Cookie name must not cannot invalid characters: - */ - public function testThrowsExceptionWithStrictMode() - { - $a = new CookieJar(true); - $a->setCookie(new SetCookie(['Name' => "abc\n", 'Value' => 'foo', 'Domain' => 'bar'])); - } - - public function testDeletesCookiesByName() - { - $cookies = $this->getTestCookies(); - $cookies[] = new SetCookie([ - 'Name' => 'other', - 'Value' => '123', - 'Domain' => 'bar.com', - 'Path' => '/boo', - 'Expires' => time() + 1000 - ]); - $jar = new CookieJar(); - foreach ($cookies as $cookie) { - $jar->setCookie($cookie); - } - $this->assertCount(4, $jar); - $jar->clear('bar.com', '/boo', 'other'); - $this->assertCount(3, $jar); - $names = array_map(function (SetCookie $c) { - return $c->getName(); - }, $jar->getIterator()->getArrayCopy()); - $this->assertEquals(['foo', 'test', 'you'], $names); - } - - public function testCanConvertToAndLoadFromArray() - { - $jar = new CookieJar(true); - foreach ($this->getTestCookies() as $cookie) { - $jar->setCookie($cookie); - } - $this->assertCount(3, $jar); - $arr = $jar->toArray(); - $this->assertCount(3, $arr); - $newCookieJar = new CookieJar(false, $arr); - $this->assertCount(3, $newCookieJar); - $this->assertSame($jar->toArray(), $newCookieJar->toArray()); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/tests/Cookie/FileCookieJarTest.php b/core/vendor/guzzlehttp/guzzle/tests/Cookie/FileCookieJarTest.php deleted file mode 100644 index 1d11337..0000000 --- a/core/vendor/guzzlehttp/guzzle/tests/Cookie/FileCookieJarTest.php +++ /dev/null @@ -1,71 +0,0 @@ -file = tempnam('/tmp', 'file-cookies'); - } - - /** - * @expectedException \RuntimeException - */ - public function testValidatesCookieFile() - { - file_put_contents($this->file, 'true'); - new FileCookieJar($this->file); - } - - public function testLoadsFromFileFile() - { - $jar = new FileCookieJar($this->file); - $this->assertEquals([], $jar->getIterator()->getArrayCopy()); - unlink($this->file); - } - - public function testPersistsToFileFile() - { - $jar = new FileCookieJar($this->file); - $jar->setCookie(new SetCookie([ - 'Name' => 'foo', - 'Value' => 'bar', - 'Domain' => 'foo.com', - 'Expires' => time() + 1000 - ])); - $jar->setCookie(new SetCookie([ - 'Name' => 'baz', - 'Value' => 'bar', - 'Domain' => 'foo.com', - 'Expires' => time() + 1000 - ])); - $jar->setCookie(new SetCookie([ - 'Name' => 'boo', - 'Value' => 'bar', - 'Domain' => 'foo.com', - ])); - - $this->assertEquals(3, count($jar)); - unset($jar); - - // Make sure it wrote to the file - $contents = file_get_contents($this->file); - $this->assertNotEmpty($contents); - - // Load the cookieJar from the file - $jar = new FileCookieJar($this->file); - - // Weeds out temporary and session cookies - $this->assertEquals(2, count($jar)); - unset($jar); - unlink($this->file); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/tests/Cookie/SessionCookieJarTest.php b/core/vendor/guzzlehttp/guzzle/tests/Cookie/SessionCookieJarTest.php deleted file mode 100644 index ccc6d4e..0000000 --- a/core/vendor/guzzlehttp/guzzle/tests/Cookie/SessionCookieJarTest.php +++ /dev/null @@ -1,76 +0,0 @@ -sessionVar = 'sessionKey'; - - if (!isset($_SESSION)) { - $_SESSION = array(); - } - } - - /** - * @expectedException \RuntimeException - */ - public function testValidatesCookieSession() - { - $_SESSION[$this->sessionVar] = 'true'; - new SessionCookieJar($this->sessionVar); - } - - public function testLoadsFromSession() - { - $jar = new SessionCookieJar($this->sessionVar); - $this->assertEquals([], $jar->getIterator()->getArrayCopy()); - unset($_SESSION[$this->sessionVar]); - } - - public function testPersistsToSession() - { - $jar = new SessionCookieJar($this->sessionVar); - $jar->setCookie(new SetCookie([ - 'Name' => 'foo', - 'Value' => 'bar', - 'Domain' => 'foo.com', - 'Expires' => time() + 1000 - ])); - $jar->setCookie(new SetCookie([ - 'Name' => 'baz', - 'Value' => 'bar', - 'Domain' => 'foo.com', - 'Expires' => time() + 1000 - ])); - $jar->setCookie(new SetCookie([ - 'Name' => 'boo', - 'Value' => 'bar', - 'Domain' => 'foo.com', - ])); - - $this->assertEquals(3, count($jar)); - unset($jar); - - // Make sure it wrote to the sessionVar in $_SESSION - $contents = $_SESSION[$this->sessionVar]; - $this->assertNotEmpty($contents); - - // Load the cookieJar from the file - $jar = new SessionCookieJar($this->sessionVar); - - // Weeds out temporary and session cookies - $this->assertEquals(2, count($jar)); - unset($jar); - unset($_SESSION[$this->sessionVar]); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/tests/Cookie/SetCookieTest.php b/core/vendor/guzzlehttp/guzzle/tests/Cookie/SetCookieTest.php deleted file mode 100644 index 3ddd082..0000000 --- a/core/vendor/guzzlehttp/guzzle/tests/Cookie/SetCookieTest.php +++ /dev/null @@ -1,364 +0,0 @@ -assertEquals('/', $cookie->getPath()); - } - - public function testConvertsDateTimeMaxAgeToUnixTimestamp() - { - $cookie = new SetCookie(['Expires' => 'November 20, 1984']); - $this->assertInternalType('integer', $cookie->getExpires()); - } - - public function testAddsExpiresBasedOnMaxAge() - { - $t = time(); - $cookie = new SetCookie(['Max-Age' => 100]); - $this->assertEquals($t + 100, $cookie->getExpires()); - } - - public function testHoldsValues() - { - $t = time(); - $data = array( - 'Name' => 'foo', - 'Value' => 'baz', - 'Path' => '/bar', - 'Domain' => 'baz.com', - 'Expires' => $t, - 'Max-Age' => 100, - 'Secure' => true, - 'Discard' => true, - 'HttpOnly' => true, - 'foo' => 'baz', - 'bar' => 'bam' - ); - - $cookie = new SetCookie($data); - $this->assertEquals($data, $cookie->toArray()); - - $this->assertEquals('foo', $cookie->getName()); - $this->assertEquals('baz', $cookie->getValue()); - $this->assertEquals('baz.com', $cookie->getDomain()); - $this->assertEquals('/bar', $cookie->getPath()); - $this->assertEquals($t, $cookie->getExpires()); - $this->assertEquals(100, $cookie->getMaxAge()); - $this->assertTrue($cookie->getSecure()); - $this->assertTrue($cookie->getDiscard()); - $this->assertTrue($cookie->getHttpOnly()); - $this->assertEquals('baz', $cookie->toArray()['foo']); - $this->assertEquals('bam', $cookie->toArray()['bar']); - - $cookie->setName('a'); - $cookie->setValue('b'); - $cookie->setPath('c'); - $cookie->setDomain('bar.com'); - $cookie->setExpires(10); - $cookie->setMaxAge(200); - $cookie->setSecure(false); - $cookie->setHttpOnly(false); - $cookie->setDiscard(false); - - $this->assertEquals('a', $cookie->getName()); - $this->assertEquals('b', $cookie->getValue()); - $this->assertEquals('c', $cookie->getPath()); - $this->assertEquals('bar.com', $cookie->getDomain()); - $this->assertEquals(10, $cookie->getExpires()); - $this->assertEquals(200, $cookie->getMaxAge()); - $this->assertFalse($cookie->getSecure()); - $this->assertFalse($cookie->getDiscard()); - $this->assertFalse($cookie->getHttpOnly()); - } - - public function testDeterminesIfExpired() - { - $c = new SetCookie(); - $c->setExpires(10); - $this->assertTrue($c->isExpired()); - $c->setExpires(time() + 10000); - $this->assertFalse($c->isExpired()); - } - - public function testMatchesDomain() - { - $cookie = new SetCookie(); - $this->assertTrue($cookie->matchesDomain('baz.com')); - - $cookie->setDomain('baz.com'); - $this->assertTrue($cookie->matchesDomain('baz.com')); - $this->assertFalse($cookie->matchesDomain('bar.com')); - - $cookie->setDomain('.baz.com'); - $this->assertTrue($cookie->matchesDomain('.baz.com')); - $this->assertTrue($cookie->matchesDomain('foo.baz.com')); - $this->assertFalse($cookie->matchesDomain('baz.bar.com')); - $this->assertTrue($cookie->matchesDomain('baz.com')); - - $cookie->setDomain('.127.0.0.1'); - $this->assertTrue($cookie->matchesDomain('127.0.0.1')); - - $cookie->setDomain('127.0.0.1'); - $this->assertTrue($cookie->matchesDomain('127.0.0.1')); - - $cookie->setDomain('.com.'); - $this->assertFalse($cookie->matchesDomain('baz.com')); - - $cookie->setDomain('.local'); - $this->assertTrue($cookie->matchesDomain('example.local')); - } - - public function testMatchesPath() - { - $cookie = new SetCookie(); - $this->assertTrue($cookie->matchesPath('/foo')); - - $cookie->setPath('/foo'); - $this->assertTrue($cookie->matchesPath('/foo')); - $this->assertTrue($cookie->matchesPath('/foo/bar')); - $this->assertFalse($cookie->matchesPath('/bar')); - } - - public function cookieValidateProvider() - { - return array( - array('foo', 'baz', 'bar', true), - array('0', '0', '0', true), - array('', 'baz', 'bar', 'The cookie name must not be empty'), - array('foo', '', 'bar', 'The cookie value must not be empty'), - array('foo', 'baz', '', 'The cookie domain must not be empty'), - array("foo\r", 'baz', '0', 'Cookie name must not cannot invalid characters: =,; \t\r\n\013\014'), - ); - } - - /** - * @dataProvider cookieValidateProvider - */ - public function testValidatesCookies($name, $value, $domain, $result) - { - $cookie = new SetCookie(array( - 'Name' => $name, - 'Value' => $value, - 'Domain' => $domain - )); - $this->assertSame($result, $cookie->validate()); - } - - public function testDoesNotMatchIp() - { - $cookie = new SetCookie(['Domain' => '192.168.16.']); - $this->assertFalse($cookie->matchesDomain('192.168.16.121')); - } - - public function testConvertsToString() - { - $t = 1382916008; - $cookie = new SetCookie([ - 'Name' => 'test', - 'Value' => '123', - 'Domain' => 'foo.com', - 'Expires' => $t, - 'Path' => '/abc', - 'HttpOnly' => true, - 'Secure' => true - ]); - $this->assertEquals( - 'test=123; Domain=foo.com; Path=/abc; Expires=Sun, 27 Oct 2013 23:20:08 GMT; Secure; HttpOnly', - (string) $cookie - ); - } - - /** - * Provides the parsed information from a cookie - * - * @return array - */ - public function cookieParserDataProvider() - { - return array( - array( - 'ASIHTTPRequestTestCookie=This+is+the+value; expires=Sat, 26-Jul-2008 17:00:42 GMT; path=/tests; domain=allseeing-i.com; PHPSESSID=6c951590e7a9359bcedde25cda73e43c; path=/";', - array( - 'Domain' => 'allseeing-i.com', - 'Path' => '/', - 'PHPSESSID' => '6c951590e7a9359bcedde25cda73e43c', - 'Max-Age' => NULL, - 'Expires' => 'Sat, 26-Jul-2008 17:00:42 GMT', - 'Secure' => NULL, - 'Discard' => NULL, - 'Name' => 'ASIHTTPRequestTestCookie', - 'Value' => 'This+is+the+value', - 'HttpOnly' => false - ) - ), - array('', []), - array('foo', []), - // Test setting a blank value for a cookie - array(array( - 'foo=', 'foo =', 'foo =;', 'foo= ;', 'foo =', 'foo= '), - array( - 'Name' => 'foo', - 'Value' => '', - 'Discard' => null, - 'Domain' => null, - 'Expires' => null, - 'Max-Age' => null, - 'Path' => '/', - 'Secure' => null, - 'HttpOnly' => false - ) - ), - // Test setting a value and removing quotes - array(array( - 'foo=1', 'foo =1', 'foo =1;', 'foo=1 ;', 'foo =1', 'foo= 1', 'foo = 1 ;', 'foo="1"', 'foo="1";', 'foo= "1";'), - array( - 'Name' => 'foo', - 'Value' => '1', - 'Discard' => null, - 'Domain' => null, - 'Expires' => null, - 'Max-Age' => null, - 'Path' => '/', - 'Secure' => null, - 'HttpOnly' => false - ) - ), - // Some of the following tests are based on http://framework.zend.com/svn/framework/standard/trunk/tests/Zend/Http/CookieTest.php - array( - 'justacookie=foo; domain=example.com', - array( - 'Name' => 'justacookie', - 'Value' => 'foo', - 'Domain' => 'example.com', - 'Discard' => null, - 'Expires' => null, - 'Max-Age' => null, - 'Path' => '/', - 'Secure' => null, - 'HttpOnly' => false - ) - ), - array( - 'expires=tomorrow; secure; path=/Space Out/; expires=Tue, 21-Nov-2006 08:33:44 GMT; domain=.example.com', - array( - 'Name' => 'expires', - 'Value' => 'tomorrow', - 'Domain' => '.example.com', - 'Path' => '/Space Out/', - 'Expires' => 'Tue, 21-Nov-2006 08:33:44 GMT', - 'Discard' => null, - 'Secure' => true, - 'Max-Age' => null, - 'HttpOnly' => false - ) - ), - array( - 'domain=unittests; expires=Tue, 21-Nov-2006 08:33:44 GMT; domain=example.com; path=/some value/', - array( - 'Name' => 'domain', - 'Value' => 'unittests', - 'Domain' => 'example.com', - 'Path' => '/some value/', - 'Expires' => 'Tue, 21-Nov-2006 08:33:44 GMT', - 'Secure' => false, - 'Discard' => null, - 'Max-Age' => null, - 'HttpOnly' => false - ) - ), - array( - 'path=indexAction; path=/; domain=.foo.com; expires=Tue, 21-Nov-2006 08:33:44 GMT', - array( - 'Name' => 'path', - 'Value' => 'indexAction', - 'Domain' => '.foo.com', - 'Path' => '/', - 'Expires' => 'Tue, 21-Nov-2006 08:33:44 GMT', - 'Secure' => false, - 'Discard' => null, - 'Max-Age' => null, - 'HttpOnly' => false - ) - ), - array( - 'secure=sha1; secure; SECURE; domain=some.really.deep.domain.com; version=1; Max-Age=86400', - array( - 'Name' => 'secure', - 'Value' => 'sha1', - 'Domain' => 'some.really.deep.domain.com', - 'Path' => '/', - 'Secure' => true, - 'Discard' => null, - 'Expires' => time() + 86400, - 'Max-Age' => 86400, - 'HttpOnly' => false, - 'version' => '1' - ) - ), - array( - 'PHPSESSID=123456789+abcd%2Cef; secure; discard; domain=.localdomain; path=/foo/baz; expires=Tue, 21-Nov-2006 08:33:44 GMT;', - array( - 'Name' => 'PHPSESSID', - 'Value' => '123456789+abcd%2Cef', - 'Domain' => '.localdomain', - 'Path' => '/foo/baz', - 'Expires' => 'Tue, 21-Nov-2006 08:33:44 GMT', - 'Secure' => true, - 'Discard' => true, - 'Max-Age' => null, - 'HttpOnly' => false - ) - ), - ); - } - - /** - * @dataProvider cookieParserDataProvider - */ - public function testParseCookie($cookie, $parsed) - { - foreach ((array) $cookie as $v) { - $c = SetCookie::fromString($v); - $p = $c->toArray(); - - if (isset($p['Expires'])) { - // Remove expires values from the assertion if they are relatively equal - if (abs($p['Expires'] != strtotime($parsed['Expires'])) < 40) { - unset($p['Expires']); - unset($parsed['Expires']); - } - } - - if (!empty($parsed)) { - foreach ($parsed as $key => $value) { - $this->assertEquals($parsed[$key], $p[$key], 'Comparing ' . $key . ' ' . var_export($value, true) . ' : ' . var_export($parsed, true) . ' | ' . var_export($p, true)); - } - foreach ($p as $key => $value) { - $this->assertEquals($p[$key], $parsed[$key], 'Comparing ' . $key . ' ' . var_export($value, true) . ' : ' . var_export($parsed, true) . ' | ' . var_export($p, true)); - } - } else { - $this->assertEquals([ - 'Name' => null, - 'Value' => null, - 'Domain' => null, - 'Path' => '/', - 'Max-Age' => null, - 'Expires' => null, - 'Secure' => false, - 'Discard' => false, - 'HttpOnly' => false, - ], $p); - } - } - } -} diff --git a/core/vendor/guzzlehttp/guzzle/tests/Event/AbstractEventTest.php b/core/vendor/guzzlehttp/guzzle/tests/Event/AbstractEventTest.php deleted file mode 100644 index b8c06f1..0000000 --- a/core/vendor/guzzlehttp/guzzle/tests/Event/AbstractEventTest.php +++ /dev/null @@ -1,14 +0,0 @@ -getMockBuilder('GuzzleHttp\Event\AbstractEvent') - ->getMockForAbstractClass(); - $this->assertFalse($e->isPropagationStopped()); - $e->stopPropagation(); - $this->assertTrue($e->isPropagationStopped()); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/tests/Event/AbstractRequestEventTest.php b/core/vendor/guzzlehttp/guzzle/tests/Event/AbstractRequestEventTest.php deleted file mode 100644 index 50536c5..0000000 --- a/core/vendor/guzzlehttp/guzzle/tests/Event/AbstractRequestEventTest.php +++ /dev/null @@ -1,33 +0,0 @@ -getMockBuilder('GuzzleHttp\Event\AbstractRequestEvent') - ->setConstructorArgs([$t]) - ->getMockForAbstractClass(); - $this->assertSame($t->client, $e->getClient()); - $this->assertSame($t->request, $e->getRequest()); - } - - public function testHasTransaction() - { - $t = new Transaction(new Client(), new Request('GET', '/')); - $e = $this->getMockBuilder('GuzzleHttp\Event\AbstractRequestEvent') - ->setConstructorArgs([$t]) - ->getMockForAbstractClass(); - $r = new \ReflectionMethod($e, 'getTransaction'); - $r->setAccessible(true); - $this->assertSame($t, $r->invoke($e)); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/tests/Event/AbstractRetryableEventTest.php b/core/vendor/guzzlehttp/guzzle/tests/Event/AbstractRetryableEventTest.php deleted file mode 100644 index 6a39d8b..0000000 --- a/core/vendor/guzzlehttp/guzzle/tests/Event/AbstractRetryableEventTest.php +++ /dev/null @@ -1,37 +0,0 @@ -transferInfo = ['foo' => 'bar']; - $e = $this->getMockBuilder('GuzzleHttp\Event\AbstractRetryableEvent') - ->setConstructorArgs([$t]) - ->getMockForAbstractClass(); - $e->retry(); - $this->assertTrue($e->isPropagationStopped()); - $this->assertEquals('retry', $t->state); - } - - public function testCanRetryAfterDelay() - { - $t = new Transaction(new Client(), new Request('GET', '/')); - $t->transferInfo = ['foo' => 'bar']; - $e = $this->getMockBuilder('GuzzleHttp\Event\AbstractRetryableEvent') - ->setConstructorArgs([$t]) - ->getMockForAbstractClass(); - $e->retry(10); - $this->assertTrue($e->isPropagationStopped()); - $this->assertEquals('retry', $t->state); - $this->assertEquals(10, $t->request->getConfig()->get('delay')); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/tests/Event/AbstractTransferEventTest.php b/core/vendor/guzzlehttp/guzzle/tests/Event/AbstractTransferEventTest.php deleted file mode 100644 index 5313c8e..0000000 --- a/core/vendor/guzzlehttp/guzzle/tests/Event/AbstractTransferEventTest.php +++ /dev/null @@ -1,59 +0,0 @@ -transferInfo = ['foo' => 'bar']; - $e = $this->getMockBuilder('GuzzleHttp\Event\AbstractTransferEvent') - ->setConstructorArgs([$t]) - ->getMockForAbstractClass(); - $this->assertNull($e->getTransferInfo('baz')); - $this->assertEquals('bar', $e->getTransferInfo('foo')); - $this->assertEquals($t->transferInfo, $e->getTransferInfo()); - } - - public function testHasResponse() - { - $t = new Transaction(new Client(), new Request('GET', '/')); - $t->response = new Response(200); - $e = $this->getMockBuilder('GuzzleHttp\Event\AbstractTransferEvent') - ->setConstructorArgs([$t]) - ->getMockForAbstractClass(); - $this->assertTrue($e->hasResponse()); - $this->assertSame($t->response, $e->getResponse()); - } - - public function testCanInterceptWithResponse() - { - $t = new Transaction(new Client(), new Request('GET', '/')); - $r = new Response(200); - $e = $this->getMockBuilder('GuzzleHttp\Event\AbstractTransferEvent') - ->setConstructorArgs([$t]) - ->getMockForAbstractClass(); - $e->intercept($r); - $this->assertSame($t->response, $r); - $this->assertSame($t->response, $e->getResponse()); - $this->assertTrue($e->isPropagationStopped()); - } - - public function testReturnsNumberOfRetries() - { - $t = new Transaction(new Client(), new Request('GET', '/')); - $t->retries = 2; - $e = $this->getMockBuilder('GuzzleHttp\Event\AbstractTransferEvent') - ->setConstructorArgs([$t]) - ->getMockForAbstractClass(); - $this->assertEquals(2, $e->getRetryCount()); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/tests/Event/BeforeEventTest.php b/core/vendor/guzzlehttp/guzzle/tests/Event/BeforeEventTest.php deleted file mode 100644 index 469e4e2..0000000 --- a/core/vendor/guzzlehttp/guzzle/tests/Event/BeforeEventTest.php +++ /dev/null @@ -1,26 +0,0 @@ -exception = new \Exception('foo'); - $e = new BeforeEvent($t); - $response = new Response(200); - $e->intercept($response); - $this->assertTrue($e->isPropagationStopped()); - $this->assertSame($t->response, $response); - $this->assertNull($t->exception); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/tests/Event/EmitterTest.php b/core/vendor/guzzlehttp/guzzle/tests/Event/EmitterTest.php deleted file mode 100644 index 5b7061b..0000000 --- a/core/vendor/guzzlehttp/guzzle/tests/Event/EmitterTest.php +++ /dev/null @@ -1,363 +0,0 @@ -emitter = new Emitter(); - $this->listener = new TestEventListener(); - } - - protected function tearDown() - { - $this->emitter = null; - $this->listener = null; - } - - public function testInitialState() - { - $this->assertEquals(array(), $this->emitter->listeners()); - } - - public function testAddListener() - { - $this->emitter->on('pre.foo', array($this->listener, 'preFoo')); - $this->emitter->on('post.foo', array($this->listener, 'postFoo')); - $this->assertTrue($this->emitter->hasListeners(self::preFoo)); - $this->assertTrue($this->emitter->hasListeners(self::preFoo)); - $this->assertCount(1, $this->emitter->listeners(self::postFoo)); - $this->assertCount(1, $this->emitter->listeners(self::postFoo)); - $this->assertCount(2, $this->emitter->listeners()); - } - - public function testGetListenersSortsByPriority() - { - $listener1 = new TestEventListener(); - $listener2 = new TestEventListener(); - $listener3 = new TestEventListener(); - $listener1->name = '1'; - $listener2->name = '2'; - $listener3->name = '3'; - - $this->emitter->on('pre.foo', array($listener1, 'preFoo'), -10); - $this->emitter->on('pre.foo', array($listener2, 'preFoo'), 10); - $this->emitter->on('pre.foo', array($listener3, 'preFoo')); - - $expected = array( - array($listener2, 'preFoo'), - array($listener3, 'preFoo'), - array($listener1, 'preFoo'), - ); - - $this->assertSame($expected, $this->emitter->listeners('pre.foo')); - } - - public function testGetAllListenersSortsByPriority() - { - $listener1 = new TestEventListener(); - $listener2 = new TestEventListener(); - $listener3 = new TestEventListener(); - $listener4 = new TestEventListener(); - $listener5 = new TestEventListener(); - $listener6 = new TestEventListener(); - - $this->emitter->on('pre.foo', [$listener1, 'preFoo'], -10); - $this->emitter->on('pre.foo', [$listener2, 'preFoo']); - $this->emitter->on('pre.foo', [$listener3, 'preFoo'], 10); - $this->emitter->on('post.foo', [$listener4, 'preFoo'], -10); - $this->emitter->on('post.foo', [$listener5, 'preFoo']); - $this->emitter->on('post.foo', [$listener6, 'preFoo'], 10); - - $expected = [ - 'pre.foo' => [[$listener3, 'preFoo'], [$listener2, 'preFoo'], [$listener1, 'preFoo']], - 'post.foo' => [[$listener6, 'preFoo'], [$listener5, 'preFoo'], [$listener4, 'preFoo']], - ]; - - $this->assertSame($expected, $this->emitter->listeners()); - } - - public function testDispatch() - { - $this->emitter->on('pre.foo', array($this->listener, 'preFoo')); - $this->emitter->on('post.foo', array($this->listener, 'postFoo')); - $this->emitter->emit(self::preFoo, $this->getEvent()); - $this->assertTrue($this->listener->preFooInvoked); - $this->assertFalse($this->listener->postFooInvoked); - $this->assertInstanceOf('GuzzleHttp\Event\EventInterface', $this->emitter->emit(self::preFoo, $this->getEvent())); - $event = $this->getEvent(); - $return = $this->emitter->emit(self::preFoo, $event); - $this->assertSame($event, $return); - } - - public function testDispatchForClosure() - { - $invoked = 0; - $listener = function () use (&$invoked) { - $invoked++; - }; - $this->emitter->on('pre.foo', $listener); - $this->emitter->on('post.foo', $listener); - $this->emitter->emit(self::preFoo, $this->getEvent()); - $this->assertEquals(1, $invoked); - } - - public function testStopEventPropagation() - { - $otherListener = new TestEventListener(); - - // postFoo() stops the propagation, so only one listener should - // be executed - // Manually set priority to enforce $this->listener to be called first - $this->emitter->on('post.foo', array($this->listener, 'postFoo'), 10); - $this->emitter->on('post.foo', array($otherListener, 'preFoo')); - $this->emitter->emit(self::postFoo, $this->getEvent()); - $this->assertTrue($this->listener->postFooInvoked); - $this->assertFalse($otherListener->postFooInvoked); - } - - public function testDispatchByPriority() - { - $invoked = array(); - $listener1 = function () use (&$invoked) { - $invoked[] = '1'; - }; - $listener2 = function () use (&$invoked) { - $invoked[] = '2'; - }; - $listener3 = function () use (&$invoked) { - $invoked[] = '3'; - }; - $this->emitter->on('pre.foo', $listener1, -10); - $this->emitter->on('pre.foo', $listener2); - $this->emitter->on('pre.foo', $listener3, 10); - $this->emitter->emit(self::preFoo, $this->getEvent()); - $this->assertEquals(array('3', '2', '1'), $invoked); - } - - public function testRemoveListener() - { - $this->emitter->on('pre.bar', [$this->listener, 'preFoo']); - $this->assertNotEmpty($this->emitter->listeners(self::preBar)); - $this->emitter->removeListener('pre.bar', [$this->listener, 'preFoo']); - $this->assertEmpty($this->emitter->listeners(self::preBar)); - $this->emitter->removeListener('notExists', [$this->listener, 'preFoo']); - } - - public function testAddSubscriber() - { - $eventSubscriber = new TestEventSubscriber(); - $this->emitter->attach($eventSubscriber); - $this->assertNotEmpty($this->emitter->listeners(self::preFoo)); - $this->assertNotEmpty($this->emitter->listeners(self::postFoo)); - } - - public function testAddSubscriberWithMultiple() - { - $eventSubscriber = new TestEventSubscriberWithMultiple(); - $this->emitter->attach($eventSubscriber); - $listeners = $this->emitter->listeners('pre.foo'); - $this->assertNotEmpty($this->emitter->listeners(self::preFoo)); - $this->assertCount(2, $listeners); - } - - public function testAddSubscriberWithPriorities() - { - $eventSubscriber = new TestEventSubscriber(); - $this->emitter->attach($eventSubscriber); - - $eventSubscriber = new TestEventSubscriberWithPriorities(); - $this->emitter->attach($eventSubscriber); - - $listeners = $this->emitter->listeners('pre.foo'); - $this->assertNotEmpty($this->emitter->listeners(self::preFoo)); - $this->assertCount(2, $listeners); - $this->assertInstanceOf('GuzzleHttp\Tests\Event\TestEventSubscriberWithPriorities', $listeners[0][0]); - } - - public function testdetach() - { - $eventSubscriber = new TestEventSubscriber(); - $this->emitter->attach($eventSubscriber); - $this->assertNotEmpty($this->emitter->listeners(self::preFoo)); - $this->assertNotEmpty($this->emitter->listeners(self::postFoo)); - $this->emitter->detach($eventSubscriber); - $this->assertEmpty($this->emitter->listeners(self::preFoo)); - $this->assertEmpty($this->emitter->listeners(self::postFoo)); - } - - public function testdetachWithPriorities() - { - $eventSubscriber = new TestEventSubscriberWithPriorities(); - $this->emitter->attach($eventSubscriber); - $this->assertNotEmpty($this->emitter->listeners(self::preFoo)); - $this->assertNotEmpty($this->emitter->listeners(self::postFoo)); - $this->emitter->detach($eventSubscriber); - $this->assertEmpty($this->emitter->listeners(self::preFoo)); - $this->assertEmpty($this->emitter->listeners(self::postFoo)); - } - - public function testEventReceivesEventNameAsArgument() - { - $listener = new TestWithDispatcher(); - $this->emitter->on('test', array($listener, 'foo')); - $this->assertNull($listener->name); - $this->emitter->emit('test', $this->getEvent()); - $this->assertEquals('test', $listener->name); - } - - /** - * @see https://bugs.php.net/bug.php?id=62976 - * - * This bug affects: - * - The PHP 5.3 branch for versions < 5.3.18 - * - The PHP 5.4 branch for versions < 5.4.8 - * - The PHP 5.5 branch is not affected - */ - public function testWorkaroundForPhpBug62976() - { - $dispatcher = new Emitter(); - $dispatcher->on('bug.62976', new CallableClass()); - $dispatcher->removeListener('bug.62976', function () {}); - $this->assertNotEmpty($dispatcher->listeners('bug.62976')); - } - - public function testRegistersEventsOnce() - { - $this->emitter->once('pre.foo', array($this->listener, 'preFoo')); - $this->emitter->on('pre.foo', array($this->listener, 'preFoo')); - $this->assertCount(2, $this->emitter->listeners(self::preFoo)); - $this->emitter->emit(self::preFoo, $this->getEvent()); - $this->assertTrue($this->listener->preFooInvoked); - $this->assertCount(1, $this->emitter->listeners(self::preFoo)); - } - - public function testReturnsEmptyArrayForNonExistentEvent() - { - $this->assertEquals([], $this->emitter->listeners('doesnotexist')); - } - - public function testCanAddFirstAndLastListeners() - { - $b = ''; - $this->emitter->on('foo', function () use (&$b) { $b .= 'a'; }, 'first'); // 1 - $this->emitter->on('foo', function () use (&$b) { $b .= 'b'; }, 'last'); // 0 - $this->emitter->on('foo', function () use (&$b) { $b .= 'c'; }, 'first'); // 2 - $this->emitter->on('foo', function () use (&$b) { $b .= 'd'; }, 'first'); // 3 - $this->emitter->on('foo', function () use (&$b) { $b .= 'e'; }, 'first'); // 4 - $this->emitter->on('foo', function () use (&$b) { $b .= 'f'; }); // 0 - $this->emitter->emit('foo', $this->getEvent()); - $this->assertEquals('edcabf', $b); - } - - /** - * @return \GuzzleHttp\Event\EventInterface - */ - private function getEvent() - { - return $this->getMockBuilder('GuzzleHttp\Event\AbstractEvent') - ->getMockForAbstractClass(); - } -} - -class CallableClass -{ - public function __invoke() - { - } -} - -class TestEventListener -{ - public $preFooInvoked = false; - public $postFooInvoked = false; - - /* Listener methods */ - - public function preFoo(EventInterface $e) - { - $this->preFooInvoked = true; - } - - public function postFoo(EventInterface $e) - { - $this->postFooInvoked = true; - - $e->stopPropagation(); - } - - /** - * @expectedException \PHPUnit_Framework_Error_Deprecated - */ - public function testHasDeprecatedAddListener() - { - $emitter = new Emitter(); - $emitter->addListener('foo', function () {}); - } - - /** - * @expectedException \PHPUnit_Framework_Error_Deprecated - */ - public function testHasDeprecatedAddSubscriber() - { - $emitter = new Emitter(); - $emitter->addSubscriber('foo', new TestEventSubscriber()); - } -} - -class TestWithDispatcher -{ - public $name; - - public function foo(EventInterface $e, $name) - { - $this->name = $name; - } -} - -class TestEventSubscriber extends TestEventListener implements SubscriberInterface -{ - public function getEvents() - { - return [ - 'pre.foo' => ['preFoo'], - 'post.foo' => ['postFoo'] - ]; - } -} - -class TestEventSubscriberWithPriorities extends TestEventListener implements SubscriberInterface -{ - public function getEvents() - { - return [ - 'pre.foo' => ['preFoo', 10], - 'post.foo' => ['postFoo'] - ]; - } -} - -class TestEventSubscriberWithMultiple extends TestEventListener implements SubscriberInterface -{ - public function getEvents() - { - return ['pre.foo' => [['preFoo', 10],['preFoo', 20]]]; - } -} diff --git a/core/vendor/guzzlehttp/guzzle/tests/Event/ErrorEventTest.php b/core/vendor/guzzlehttp/guzzle/tests/Event/ErrorEventTest.php deleted file mode 100644 index e91b7f0..0000000 --- a/core/vendor/guzzlehttp/guzzle/tests/Event/ErrorEventTest.php +++ /dev/null @@ -1,23 +0,0 @@ -request); - $t->exception = $except; - $e = new ErrorEvent($t); - $this->assertSame($e->getException(), $t->exception); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/tests/Event/HasEmitterTraitTest.php b/core/vendor/guzzlehttp/guzzle/tests/Event/HasEmitterTraitTest.php deleted file mode 100644 index 4709918..0000000 --- a/core/vendor/guzzlehttp/guzzle/tests/Event/HasEmitterTraitTest.php +++ /dev/null @@ -1,27 +0,0 @@ -getMockBuilder('GuzzleHttp\Tests\Event\AbstractHasEmitter') - ->getMockForAbstractClass(); - - $result = $mock->getEmitter(); - $this->assertInstanceOf('GuzzleHttp\Event\EmitterInterface', $result); - $result2 = $mock->getEmitter(); - $this->assertSame($result, $result2); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/tests/Event/ListenerAttacherTraitTest.php b/core/vendor/guzzlehttp/guzzle/tests/Event/ListenerAttacherTraitTest.php deleted file mode 100644 index c066788..0000000 --- a/core/vendor/guzzlehttp/guzzle/tests/Event/ListenerAttacherTraitTest.php +++ /dev/null @@ -1,92 +0,0 @@ -listeners = $this->prepareListeners($args, ['foo', 'bar']); - $this->attachListeners($this, $this->listeners); - } -} - -class ListenerAttacherTraitTest extends \PHPUnit_Framework_TestCase -{ - public function testRegistersEvents() - { - $fn = function () {}; - $o = new ObjectWithEvents([ - 'foo' => $fn, - 'bar' => $fn, - ]); - - $this->assertEquals([ - ['name' => 'foo', 'fn' => $fn, 'priority' => 0, 'once' => false], - ['name' => 'bar', 'fn' => $fn, 'priority' => 0, 'once' => false], - ], $o->listeners); - - $this->assertCount(1, $o->getEmitter()->listeners('foo')); - $this->assertCount(1, $o->getEmitter()->listeners('bar')); - } - - public function testRegistersEventsWithPriorities() - { - $fn = function () {}; - $o = new ObjectWithEvents([ - 'foo' => ['fn' => $fn, 'priority' => 99, 'once' => true], - 'bar' => ['fn' => $fn, 'priority' => 50], - ]); - - $this->assertEquals([ - ['name' => 'foo', 'fn' => $fn, 'priority' => 99, 'once' => true], - ['name' => 'bar', 'fn' => $fn, 'priority' => 50, 'once' => false], - ], $o->listeners); - } - - public function testRegistersMultipleEvents() - { - $fn = function () {}; - $eventArray = [['fn' => $fn], ['fn' => $fn]]; - $o = new ObjectWithEvents([ - 'foo' => $eventArray, - 'bar' => $eventArray, - ]); - - $this->assertEquals([ - ['name' => 'foo', 'fn' => $fn, 'priority' => 0, 'once' => false], - ['name' => 'foo', 'fn' => $fn, 'priority' => 0, 'once' => false], - ['name' => 'bar', 'fn' => $fn, 'priority' => 0, 'once' => false], - ['name' => 'bar', 'fn' => $fn, 'priority' => 0, 'once' => false], - ], $o->listeners); - - $this->assertCount(2, $o->getEmitter()->listeners('foo')); - $this->assertCount(2, $o->getEmitter()->listeners('bar')); - } - - public function testRegistersEventsWithOnce() - { - $called = 0; - $fn = function () use (&$called) { $called++; }; - $o = new ObjectWithEvents(['foo' => ['fn' => $fn, 'once' => true]]); - $ev = $this->getMock('GuzzleHttp\Event\EventInterface'); - $o->getEmitter()->emit('foo', $ev); - $o->getEmitter()->emit('foo', $ev); - $this->assertEquals(1, $called); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testValidatesEvents() - { - $o = new ObjectWithEvents(['foo' => 'bar']); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/tests/Event/ProgressEventTest.php b/core/vendor/guzzlehttp/guzzle/tests/Event/ProgressEventTest.php deleted file mode 100644 index 664f8b6..0000000 --- a/core/vendor/guzzlehttp/guzzle/tests/Event/ProgressEventTest.php +++ /dev/null @@ -1,25 +0,0 @@ -assertSame($t->request, $p->getRequest()); - $this->assertSame($t->client, $p->getClient()); - $this->assertEquals(2, $p->downloadSize); - $this->assertEquals(1, $p->downloaded); - $this->assertEquals(3, $p->uploadSize); - $this->assertEquals(0, $p->uploaded); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/tests/Event/RequestEventsTest.php b/core/vendor/guzzlehttp/guzzle/tests/Event/RequestEventsTest.php deleted file mode 100644 index b3b9666..0000000 --- a/core/vendor/guzzlehttp/guzzle/tests/Event/RequestEventsTest.php +++ /dev/null @@ -1,74 +0,0 @@ - [$cb]]], - [ - ['complete' => $cb], - ['complete'], - $cb, - ['complete' => [$cb, $cb]] - ], - [ - ['prepare' => []], - ['error', 'foo'], - $cb, - [ - 'prepare' => [], - 'error' => [$cb], - 'foo' => [$cb] - ] - ], - [ - ['prepare' => []], - ['prepare'], - $cb, - [ - 'prepare' => [$cb] - ] - ], - [ - ['prepare' => ['fn' => $cb]], - ['prepare'], $cb, - [ - 'prepare' => [ - ['fn' => $cb], - $cb - ] - ] - ], - ]; - } - - /** - * @dataProvider prepareEventProvider - */ - public function testConvertsEventArrays( - array $in, - array $events, - $add, - array $out - ) { - $result = RequestEvents::convertEventArray($in, $events, $add); - $this->assertEquals($out, $result); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testValidatesEventFormat() - { - RequestEvents::convertEventArray(['foo' => false], ['foo'], []); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/tests/Exception/ParseExceptionTest.php b/core/vendor/guzzlehttp/guzzle/tests/Exception/ParseExceptionTest.php deleted file mode 100644 index 4ff9bfb..0000000 --- a/core/vendor/guzzlehttp/guzzle/tests/Exception/ParseExceptionTest.php +++ /dev/null @@ -1,20 +0,0 @@ -assertSame($res, $e->getResponse()); - $this->assertEquals('foo', $e->getMessage()); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/tests/Exception/RequestExceptionTest.php b/core/vendor/guzzlehttp/guzzle/tests/Exception/RequestExceptionTest.php deleted file mode 100644 index bea9077..0000000 --- a/core/vendor/guzzlehttp/guzzle/tests/Exception/RequestExceptionTest.php +++ /dev/null @@ -1,83 +0,0 @@ -assertSame($req, $e->getRequest()); - $this->assertSame($res, $e->getResponse()); - $this->assertTrue($e->hasResponse()); - $this->assertEquals('foo', $e->getMessage()); - } - - public function testCreatesGenerateException() - { - $e = RequestException::create(new Request('GET', '/')); - $this->assertEquals('Error completing request', $e->getMessage()); - $this->assertInstanceOf('GuzzleHttp\Exception\RequestException', $e); - } - - public function testCreatesClientErrorResponseException() - { - $e = RequestException::create(new Request('GET', '/'), new Response(400)); - $this->assertEquals( - 'Client error response [url] / [status code] 400 [reason phrase] Bad Request', - $e->getMessage() - ); - $this->assertInstanceOf('GuzzleHttp\Exception\ClientException', $e); - } - - public function testCreatesServerErrorResponseException() - { - $e = RequestException::create(new Request('GET', '/'), new Response(500)); - $this->assertEquals( - 'Server error response [url] / [status code] 500 [reason phrase] Internal Server Error', - $e->getMessage() - ); - $this->assertInstanceOf('GuzzleHttp\Exception\ServerException', $e); - } - - public function testCreatesGenericErrorResponseException() - { - $e = RequestException::create(new Request('GET', '/'), new Response(600)); - $this->assertEquals( - 'Unsuccessful response [url] / [status code] 600 [reason phrase] ', - $e->getMessage() - ); - $this->assertInstanceOf('GuzzleHttp\Exception\RequestException', $e); - } - - public function testHasStatusCodeAsExceptionCode() { - $e = RequestException::create(new Request('GET', '/'), new Response(442)); - $this->assertEquals(442, $e->getCode()); - } - - public function testWrapsRequestExceptions() - { - $e = new \Exception('foo'); - $r = new Request('GET', 'http://www.oo.com'); - $ex = RequestException::wrapException($r, $e); - $this->assertInstanceOf('GuzzleHttp\Exception\RequestException', $ex); - $this->assertSame($e, $ex->getPrevious()); - } - - public function testWrapsConnectExceptions() - { - $e = new ConnectException('foo'); - $r = new Request('GET', 'http://www.oo.com'); - $ex = RequestException::wrapException($r, $e); - $this->assertInstanceOf('GuzzleHttp\Exception\ConnectException', $ex); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/tests/Exception/XmlParseExceptionTest.php b/core/vendor/guzzlehttp/guzzle/tests/Exception/XmlParseExceptionTest.php deleted file mode 100644 index 51b9742..0000000 --- a/core/vendor/guzzlehttp/guzzle/tests/Exception/XmlParseExceptionTest.php +++ /dev/null @@ -1,19 +0,0 @@ -assertSame($error, $e->getError()); - $this->assertEquals('foo', $e->getMessage()); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/tests/IntegrationTest.php b/core/vendor/guzzlehttp/guzzle/tests/IntegrationTest.php deleted file mode 100644 index e26c64d..0000000 --- a/core/vendor/guzzlehttp/guzzle/tests/IntegrationTest.php +++ /dev/null @@ -1,123 +0,0 @@ -createRequest( - 'GET', - Server::$url, - [ - 'timeout' => 1, - 'connect_timeout' => 1, - 'proxy' => 'http://127.0.0.1:123/foo' - ] - ); - - $events = []; - $fn = function(AbstractTransferEvent $event) use (&$events) { - $events[] = [ - get_class($event), - $event->hasResponse(), - $event->getResponse() - ]; - }; - - $pool = new Pool($c, [$r], [ - 'error' => $fn, - 'end' => $fn - ]); - - $pool->wait(); - - $this->assertCount(2, $events); - $this->assertEquals('GuzzleHttp\Event\ErrorEvent', $events[0][0]); - $this->assertFalse($events[0][1]); - $this->assertNull($events[0][2]); - - $this->assertEquals('GuzzleHttp\Event\EndEvent', $events[1][0]); - $this->assertFalse($events[1][1]); - $this->assertNull($events[1][2]); - } - - /** - * @issue https://github.com/guzzle/guzzle/issues/866 - */ - public function testProperyGetsTransferStats() - { - $transfer = []; - Server::enqueue([new Response(200)]); - $c = new Client(); - $response = $c->get(Server::$url . '/foo', [ - 'events' => [ - 'end' => function (EndEvent $e) use (&$transfer) { - $transfer = $e->getTransferInfo(); - } - ] - ]); - $this->assertEquals(Server::$url . '/foo', $response->getEffectiveUrl()); - $this->assertNotEmpty($transfer); - $this->assertArrayHasKey('url', $transfer); - } - - public function testNestedFutureResponsesAreResolvedWhenSending() - { - $c = new Client(); - $total = 3; - Server::enqueue([ - new Response(200), - new Response(201), - new Response(202) - ]); - $c->getEmitter()->on( - 'complete', - function (CompleteEvent $e) use (&$total) { - if (--$total) { - $e->retry(); - } - } - ); - $response = $c->get(Server::$url); - $this->assertEquals(202, $response->getStatusCode()); - $this->assertEquals('GuzzleHttp\Message\Response', get_class($response)); - } - - public function testNestedFutureErrorsAreResolvedWhenSending() - { - $c = new Client(); - $total = 3; - Server::enqueue([ - new Response(500), - new Response(501), - new Response(502) - ]); - $c->getEmitter()->on( - 'error', - function (ErrorEvent $e) use (&$total) { - if (--$total) { - $e->retry(); - } - } - ); - try { - $c->get(Server::$url); - $this->fail('Did not throw!'); - } catch (RequestException $e) { - $this->assertEquals(502, $e->getResponse()->getStatusCode()); - } - } -} diff --git a/core/vendor/guzzlehttp/guzzle/tests/Message/AbstractMessageTest.php b/core/vendor/guzzlehttp/guzzle/tests/Message/AbstractMessageTest.php deleted file mode 100644 index f02a576..0000000 --- a/core/vendor/guzzlehttp/guzzle/tests/Message/AbstractMessageTest.php +++ /dev/null @@ -1,269 +0,0 @@ -assertEquals(1.1, $m->getProtocolVersion()); - } - - public function testHasHeaders() - { - $m = new Request('GET', 'http://foo.com'); - $this->assertFalse($m->hasHeader('foo')); - $m->addHeader('foo', 'bar'); - $this->assertTrue($m->hasHeader('foo')); - } - - public function testInitializesMessageWithProtocolVersionOption() - { - $m = new Request('GET', '/', [], null, [ - 'protocol_version' => '10' - ]); - $this->assertEquals(10, $m->getProtocolVersion()); - } - - public function testHasBody() - { - $m = new Request('GET', 'http://foo.com'); - $this->assertNull($m->getBody()); - $s = Stream::factory('test'); - $m->setBody($s); - $this->assertSame($s, $m->getBody()); - $this->assertFalse($m->hasHeader('Content-Length')); - } - - public function testCanRemoveBodyBySettingToNullAndRemovesCommonBodyHeaders() - { - $m = new Request('GET', 'http://foo.com'); - $m->setBody(Stream::factory('foo')); - $m->setHeader('Content-Length', 3); - $m->setHeader('Transfer-Encoding', 'chunked'); - $m->setBody(null); - $this->assertNull($m->getBody()); - $this->assertFalse($m->hasHeader('Content-Length')); - $this->assertFalse($m->hasHeader('Transfer-Encoding')); - } - - public function testCastsToString() - { - $m = new Request('GET', 'http://foo.com'); - $m->setHeader('foo', 'bar'); - $m->setBody(Stream::factory('baz')); - $this->assertEquals("GET / HTTP/1.1\r\nHost: foo.com\r\nfoo: bar\r\n\r\nbaz", (string) $m); - } - - public function parseParamsProvider() - { - $res1 = array( - array( - '', - 'rel' => 'front', - 'type' => 'image/jpeg', - ), - array( - '', - 'rel' => 'back', - 'type' => 'image/jpeg', - ), - ); - - return array( - array( - '; rel="front"; type="image/jpeg", ; rel=back; type="image/jpeg"', - $res1 - ), - array( - '; rel="front"; type="image/jpeg",; rel=back; type="image/jpeg"', - $res1 - ), - array( - 'foo="baz"; bar=123, boo, test="123", foobar="foo;bar"', - array( - array('foo' => 'baz', 'bar' => '123'), - array('boo'), - array('test' => '123'), - array('foobar' => 'foo;bar') - ) - ), - array( - '; rel="side"; type="image/jpeg",; rel=side; type="image/jpeg"', - array( - array('', 'rel' => 'side', 'type' => 'image/jpeg'), - array('', 'rel' => 'side', 'type' => 'image/jpeg') - ) - ), - array( - '', - array() - ) - ); - } - - /** - * @dataProvider parseParamsProvider - */ - public function testParseParams($header, $result) - { - $request = new Request('GET', '/', ['foo' => $header]); - $this->assertEquals($result, Request::parseHeader($request, 'foo')); - } - - public function testAddsHeadersWhenNotPresent() - { - $h = new Request('GET', 'http://foo.com'); - $h->addHeader('foo', 'bar'); - $this->assertInternalType('string', $h->getHeader('foo')); - $this->assertEquals('bar', $h->getHeader('foo')); - } - - public function testAddsHeadersWhenPresentSameCase() - { - $h = new Request('GET', 'http://foo.com'); - $h->addHeader('foo', 'bar'); - $h->addHeader('foo', 'baz'); - $this->assertEquals('bar, baz', $h->getHeader('foo')); - $this->assertEquals(['bar', 'baz'], $h->getHeaderAsArray('foo')); - } - - public function testAddsMultipleHeaders() - { - $h = new Request('GET', 'http://foo.com'); - $h->addHeaders([ - 'foo' => ' bar', - 'baz' => [' bam ', 'boo'] - ]); - $this->assertEquals([ - 'foo' => ['bar'], - 'baz' => ['bam', 'boo'], - 'Host' => ['foo.com'] - ], $h->getHeaders()); - } - - public function testAddsHeadersWhenPresentDifferentCase() - { - $h = new Request('GET', 'http://foo.com'); - $h->addHeader('Foo', 'bar'); - $h->addHeader('fOO', 'baz'); - $this->assertEquals('bar, baz', $h->getHeader('foo')); - } - - public function testAddsHeadersWithArray() - { - $h = new Request('GET', 'http://foo.com'); - $h->addHeader('Foo', ['bar', 'baz']); - $this->assertEquals('bar, baz', $h->getHeader('foo')); - } - - public function testGetHeadersReturnsAnArrayOfOverTheWireHeaderValues() - { - $h = new Request('GET', 'http://foo.com'); - $h->addHeader('foo', 'bar'); - $h->addHeader('Foo', 'baz'); - $h->addHeader('boO', 'test'); - $result = $h->getHeaders(); - $this->assertInternalType('array', $result); - $this->assertArrayHasKey('Foo', $result); - $this->assertArrayNotHasKey('foo', $result); - $this->assertArrayHasKey('boO', $result); - $this->assertEquals(['bar', 'baz'], $result['Foo']); - $this->assertEquals(['test'], $result['boO']); - } - - public function testSetHeaderOverwritesExistingValues() - { - $h = new Request('GET', 'http://foo.com'); - $h->setHeader('foo', 'bar'); - $this->assertEquals('bar', $h->getHeader('foo')); - $h->setHeader('Foo', 'baz'); - $this->assertEquals('baz', $h->getHeader('foo')); - $this->assertArrayHasKey('Foo', $h->getHeaders()); - } - - public function testSetHeaderOverwritesExistingValuesUsingHeaderArray() - { - $h = new Request('GET', 'http://foo.com'); - $h->setHeader('foo', ['bar']); - $this->assertEquals('bar', $h->getHeader('foo')); - } - - public function testSetHeaderOverwritesExistingValuesUsingArray() - { - $h = new Request('GET', 'http://foo.com'); - $h->setHeader('foo', ['bar']); - $this->assertEquals('bar', $h->getHeader('foo')); - } - - public function testSetHeadersOverwritesAllHeaders() - { - $h = new Request('GET', 'http://foo.com'); - $h->setHeader('foo', 'bar'); - $h->setHeaders(['foo' => 'a', 'boo' => 'b']); - $this->assertEquals(['foo' => ['a'], 'boo' => ['b']], $h->getHeaders()); - } - - public function testChecksIfCaseInsensitiveHeaderIsPresent() - { - $h = new Request('GET', 'http://foo.com'); - $h->setHeader('foo', 'bar'); - $this->assertTrue($h->hasHeader('foo')); - $this->assertTrue($h->hasHeader('Foo')); - $h->setHeader('fOo', 'bar'); - $this->assertTrue($h->hasHeader('Foo')); - } - - public function testRemovesHeaders() - { - $h = new Request('GET', 'http://foo.com'); - $h->setHeader('foo', 'bar'); - $h->removeHeader('foo'); - $this->assertFalse($h->hasHeader('foo')); - $h->setHeader('Foo', 'bar'); - $h->removeHeader('FOO'); - $this->assertFalse($h->hasHeader('foo')); - } - - public function testReturnsCorrectTypeWhenMissing() - { - $h = new Request('GET', 'http://foo.com'); - $this->assertInternalType('string', $h->getHeader('foo')); - $this->assertInternalType('array', $h->getHeaderAsArray('foo')); - } - - public function testSetsIntegersAndFloatsAsHeaders() - { - $h = new Request('GET', 'http://foo.com'); - $h->setHeader('foo', 10); - $h->setHeader('bar', 10.5); - $h->addHeader('foo', 10); - $h->addHeader('bar', 10.5); - $this->assertSame('10, 10', $h->getHeader('foo')); - $this->assertSame('10.5, 10.5', $h->getHeader('bar')); - } - - public function testGetsResponseStartLine() - { - $m = new Response(200); - $this->assertEquals('HTTP/1.1 200 OK', Response::getStartLine($m)); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testThrowsWhenMessageIsUnknown() - { - $m = $this->getMockBuilder('GuzzleHttp\Message\AbstractMessage') - ->getMockForAbstractClass(); - AbstractMessage::getStartLine($m); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/tests/Message/FutureResponseTest.php b/core/vendor/guzzlehttp/guzzle/tests/Message/FutureResponseTest.php deleted file mode 100644 index 771631d..0000000 --- a/core/vendor/guzzlehttp/guzzle/tests/Message/FutureResponseTest.php +++ /dev/null @@ -1,160 +0,0 @@ -foo; - } - - public function testDoesTheSameAsResponseWhenDereferenced() - { - $str = Stream::factory('foo'); - $response = new Response(200, ['Foo' => 'bar'], $str); - $future = MockTest::createFuture(function () use ($response) { - return $response; - }); - $this->assertFalse($this->readAttribute($future, 'isRealized')); - $this->assertEquals(200, $future->getStatusCode()); - $this->assertTrue($this->readAttribute($future, 'isRealized')); - // Deref again does nothing. - $future->wait(); - $this->assertTrue($this->readAttribute($future, 'isRealized')); - $this->assertEquals('bar', $future->getHeader('Foo')); - $this->assertEquals(['bar'], $future->getHeaderAsarray('Foo')); - $this->assertSame($response->getHeaders(), $future->getHeaders()); - $this->assertSame( - $response->getBody(), - $future->getBody() - ); - $this->assertSame( - $response->getProtocolVersion(), - $future->getProtocolVersion() - ); - $this->assertSame( - $response->getEffectiveUrl(), - $future->getEffectiveUrl() - ); - $future->setEffectiveUrl('foo'); - $this->assertEquals('foo', $response->getEffectiveUrl()); - $this->assertSame( - $response->getReasonPhrase(), - $future->getReasonPhrase() - ); - - $this->assertTrue($future->hasHeader('foo')); - - $future->removeHeader('Foo'); - $this->assertFalse($future->hasHeader('foo')); - $this->assertFalse($response->hasHeader('foo')); - - $future->setBody(Stream::factory('true')); - $this->assertEquals('true', (string) $response->getBody()); - $this->assertTrue($future->json()); - $this->assertSame((string) $response, (string) $future); - - $future->setBody(Stream::factory('c')); - $this->assertEquals('c', (string) $future->xml()->b); - - $future->addHeader('a', 'b'); - $this->assertEquals('b', $future->getHeader('a')); - - $future->addHeaders(['a' => '2']); - $this->assertEquals('b, 2', $future->getHeader('a')); - - $future->setHeader('a', '2'); - $this->assertEquals('2', $future->getHeader('a')); - - $future->setHeaders(['a' => '3']); - $this->assertEquals(['a' => ['3']], $future->getHeaders()); - } - - public function testCanDereferenceManually() - { - $response = new Response(200, ['Foo' => 'bar']); - $future = MockTest::createFuture(function () use ($response) { - return $response; - }); - $this->assertSame($response, $future->wait()); - $this->assertTrue($this->readAttribute($future, 'isRealized')); - } - - public function testCanCancel() - { - $c = false; - $deferred = new Deferred(); - $future = new FutureResponse( - $deferred->promise(), - function () {}, - function () use (&$c) { - $c = true; - return true; - } - ); - - $this->assertFalse($this->readAttribute($future, 'isRealized')); - $future->cancel(); - $this->assertTrue($this->readAttribute($future, 'isRealized')); - $future->cancel(); - } - - public function testCanCancelButReturnsFalseForNoCancelFunction() - { - $future = MockTest::createFuture(function () {}); - $future->cancel(); - $this->assertTrue($this->readAttribute($future, 'isRealized')); - } - - /** - * @expectedException \GuzzleHttp\Ring\Exception\CancelledFutureAccessException - */ - public function testAccessingCancelledResponseThrows() - { - $future = MockTest::createFuture(function () {}); - $future->cancel(); - $future->getStatusCode(); - } - - public function testExceptionInToStringTriggersError() - { - $future = MockTest::createFuture(function () { - throw new \Exception('foo'); - }); - $err = ''; - set_error_handler(function () use (&$err) { - $err = func_get_args()[1]; - }); - echo $future; - restore_error_handler(); - $this->assertContains('foo', $err); - } - - public function testProxiesSetters() - { - $str = Stream::factory('foo'); - $response = new Response(200, ['Foo' => 'bar'], $str); - $future = MockTest::createFuture(function () use ($response) { - return $response; - }); - - $future->setStatusCode(202); - $this->assertEquals(202, $future->getStatusCode()); - $this->assertEquals(202, $response->getStatusCode()); - - $future->setReasonPhrase('foo'); - $this->assertEquals('foo', $future->getReasonPhrase()); - $this->assertEquals('foo', $response->getReasonPhrase()); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/tests/Message/MessageFactoryTest.php b/core/vendor/guzzlehttp/guzzle/tests/Message/MessageFactoryTest.php deleted file mode 100644 index aa2e45e..0000000 --- a/core/vendor/guzzlehttp/guzzle/tests/Message/MessageFactoryTest.php +++ /dev/null @@ -1,601 +0,0 @@ -createResponse(200, ['foo' => 'bar'], 'test', [ - 'protocol_version' => 1.0 - ]); - $this->assertEquals(200, $response->getStatusCode()); - $this->assertEquals(['foo' => ['bar']], $response->getHeaders()); - $this->assertEquals('test', $response->getBody()); - $this->assertEquals(1.0, $response->getProtocolVersion()); - } - - public function testCreatesRequestFromMessage() - { - $f = new MessageFactory(); - $req = $f->fromMessage("GET / HTTP/1.1\r\nBaz: foo\r\n\r\n"); - $this->assertEquals('GET', $req->getMethod()); - $this->assertEquals('/', $req->getPath()); - $this->assertEquals('foo', $req->getHeader('Baz')); - $this->assertNull($req->getBody()); - } - - public function testCreatesRequestFromMessageWithBody() - { - $req = (new MessageFactory())->fromMessage("GET / HTTP/1.1\r\nBaz: foo\r\n\r\ntest"); - $this->assertEquals('test', $req->getBody()); - } - - public function testCreatesRequestWithPostBody() - { - $req = (new MessageFactory())->createRequest('GET', 'http://www.foo.com', ['body' => ['abc' => '123']]); - $this->assertEquals('abc=123', $req->getBody()); - } - - public function testCreatesRequestWithPostBodyScalars() - { - $req = (new MessageFactory())->createRequest( - 'GET', - 'http://www.foo.com', - ['body' => [ - 'abc' => true, - '123' => false, - 'foo' => null, - 'baz' => 10, - 'bam' => 1.5, - 'boo' => [1]] - ] - ); - $this->assertEquals( - 'abc=1&123=&foo&baz=10&bam=1.5&boo%5B0%5D=1', - (string) $req->getBody() - ); - } - - public function testCreatesRequestWithPostBodyAndPostFiles() - { - $pf = fopen(__FILE__, 'r'); - $pfi = new PostFile('ghi', 'abc', __FILE__); - $req = (new MessageFactory())->createRequest('GET', 'http://www.foo.com', [ - 'body' => [ - 'abc' => '123', - 'def' => $pf, - 'ghi' => $pfi - ] - ]); - $this->assertInstanceOf('GuzzleHttp\Post\PostBody', $req->getBody()); - $s = (string) $req; - $this->assertContains('testCreatesRequestWithPostBodyAndPostFiles', $s); - $this->assertContains('multipart/form-data', $s); - $this->assertTrue(in_array($pfi, $req->getBody()->getFiles(), true)); - } - - public function testCreatesResponseFromMessage() - { - $response = (new MessageFactory())->fromMessage("HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\ntest"); - $this->assertEquals(200, $response->getStatusCode()); - $this->assertEquals('OK', $response->getReasonPhrase()); - $this->assertEquals('4', $response->getHeader('Content-Length')); - $this->assertEquals('test', $response->getBody(true)); - } - - public function testCanCreateHeadResponses() - { - $response = (new MessageFactory())->fromMessage("HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\n"); - $this->assertEquals(200, $response->getStatusCode()); - $this->assertEquals('OK', $response->getReasonPhrase()); - $this->assertEquals(null, $response->getBody()); - $this->assertEquals('4', $response->getHeader('Content-Length')); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testFactoryRequiresMessageForRequest() - { - (new MessageFactory())->fromMessage(''); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage foo - */ - public function testValidatesOptionsAreImplemented() - { - (new MessageFactory())->createRequest('GET', 'http://test.com', ['foo' => 'bar']); - } - - public function testOptionsAddsRequestOptions() - { - $request = (new MessageFactory())->createRequest( - 'GET', 'http://test.com', ['config' => ['baz' => 'bar']] - ); - $this->assertEquals('bar', $request->getConfig()->get('baz')); - } - - public function testCanDisableRedirects() - { - $request = (new MessageFactory())->createRequest('GET', '/', ['allow_redirects' => false]); - $this->assertEmpty($request->getEmitter()->listeners('complete')); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testValidatesRedirects() - { - (new MessageFactory())->createRequest('GET', '/', ['allow_redirects' => 'foo']); - } - - public function testCanEnableStrictRedirectsAndSpecifyMax() - { - $request = (new MessageFactory())->createRequest('GET', '/', [ - 'allow_redirects' => ['max' => 10, 'strict' => true] - ]); - $this->assertTrue($request->getConfig()['redirect']['strict']); - $this->assertEquals(10, $request->getConfig()['redirect']['max']); - } - - public function testCanAddCookiesFromHash() - { - $request = (new MessageFactory())->createRequest('GET', 'http://www.test.com/', [ - 'cookies' => ['Foo' => 'Bar'] - ]); - $cookies = null; - foreach ($request->getEmitter()->listeners('before') as $l) { - if ($l[0] instanceof Cookie) { - $cookies = $l[0]; - break; - } - } - if (!$cookies) { - $this->fail('Did not add cookie listener'); - } else { - $this->assertCount(1, $cookies->getCookieJar()); - } - } - - public function testAddsCookieUsingTrue() - { - $factory = new MessageFactory(); - $request1 = $factory->createRequest('GET', '/', ['cookies' => true]); - $request2 = $factory->createRequest('GET', '/', ['cookies' => true]); - $listeners = function ($r) { - return array_filter($r->getEmitter()->listeners('before'), function ($l) { - return $l[0] instanceof Cookie; - }); - }; - $this->assertSame($listeners($request1), $listeners($request2)); - } - - public function testAddsCookieFromCookieJar() - { - $jar = new CookieJar(); - $request = (new MessageFactory())->createRequest('GET', '/', ['cookies' => $jar]); - foreach ($request->getEmitter()->listeners('before') as $l) { - if ($l[0] instanceof Cookie) { - $this->assertSame($jar, $l[0]->getCookieJar()); - } - } - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testValidatesCookies() - { - (new MessageFactory())->createRequest('GET', '/', ['cookies' => 'baz']); - } - - public function testCanAddQuery() - { - $request = (new MessageFactory())->createRequest('GET', 'http://foo.com', [ - 'query' => ['Foo' => 'Bar'] - ]); - $this->assertEquals('Bar', $request->getQuery()->get('Foo')); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testValidatesQuery() - { - (new MessageFactory())->createRequest('GET', 'http://foo.com', [ - 'query' => 'foo' - ]); - } - - public function testCanSetDefaultQuery() - { - $request = (new MessageFactory())->createRequest('GET', 'http://foo.com?test=abc', [ - 'query' => ['Foo' => 'Bar', 'test' => 'def'] - ]); - $this->assertEquals('Bar', $request->getQuery()->get('Foo')); - $this->assertEquals('abc', $request->getQuery()->get('test')); - } - - public function testCanSetDefaultQueryWithObject() - { - $request = (new MessageFactory)->createRequest( - 'GET', - 'http://foo.com?test=abc', [ - 'query' => new Query(['Foo' => 'Bar', 'test' => 'def']) - ] - ); - $this->assertEquals('Bar', $request->getQuery()->get('Foo')); - $this->assertEquals('abc', $request->getQuery()->get('test')); - } - - public function testCanAddBasicAuth() - { - $request = (new MessageFactory())->createRequest('GET', 'http://foo.com', [ - 'auth' => ['michael', 'test'] - ]); - $this->assertTrue($request->hasHeader('Authorization')); - } - - public function testCanAddDigestAuth() - { - $request = (new MessageFactory())->createRequest('GET', 'http://foo.com', [ - 'auth' => ['michael', 'test', 'digest'] - ]); - $this->assertEquals('michael:test', $request->getConfig()->getPath('curl/' . CURLOPT_USERPWD)); - $this->assertEquals(CURLAUTH_DIGEST, $request->getConfig()->getPath('curl/' . CURLOPT_HTTPAUTH)); - } - - public function testCanDisableAuth() - { - $request = (new MessageFactory())->createRequest('GET', 'http://foo.com', [ - 'auth' => false - ]); - $this->assertFalse($request->hasHeader('Authorization')); - } - - public function testCanSetCustomAuth() - { - $request = (new MessageFactory())->createRequest('GET', 'http://foo.com', [ - 'auth' => 'foo' - ]); - $this->assertEquals('foo', $request->getConfig()['auth']); - } - - public function testCanAddEvents() - { - $foo = null; - $client = new Client(); - $client->getEmitter()->attach(new Mock([new Response(200)])); - $client->get('http://test.com', [ - 'events' => [ - 'before' => function () use (&$foo) { $foo = true; } - ] - ]); - $this->assertTrue($foo); - } - - public function testCanAddEventsWithPriority() - { - $foo = null; - $client = new Client(); - $client->getEmitter()->attach(new Mock(array(new Response(200)))); - $request = $client->createRequest('GET', 'http://test.com', [ - 'events' => [ - 'before' => [ - 'fn' => function () use (&$foo) { $foo = true; }, - 'priority' => 123 - ] - ] - ]); - $client->send($request); - $this->assertTrue($foo); - $l = $this->readAttribute($request->getEmitter(), 'listeners'); - $this->assertArrayHasKey(123, $l['before']); - } - - public function testCanAddEventsOnce() - { - $foo = 0; - $client = new Client(); - $client->getEmitter()->attach(new Mock([ - new Response(200), - new Response(200), - ])); - $fn = function () use (&$foo) { ++$foo; }; - $request = $client->createRequest('GET', 'http://test.com', [ - 'events' => ['before' => ['fn' => $fn, 'once' => true]] - ]); - $client->send($request); - $this->assertEquals(1, $foo); - $client->send($request); - $this->assertEquals(1, $foo); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testValidatesEventContainsFn() - { - $client = new Client(['base_url' => 'http://test.com']); - $client->createRequest('GET', '/', ['events' => ['before' => ['foo' => 'bar']]]); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testValidatesEventIsArray() - { - $client = new Client(['base_url' => 'http://test.com']); - $client->createRequest('GET', '/', ['events' => ['before' => '123']]); - } - - public function testCanAddSubscribers() - { - $mock = new Mock([new Response(200)]); - $client = new Client(); - $client->getEmitter()->attach($mock); - $request = $client->get('http://test.com', ['subscribers' => [$mock]]); - } - - public function testCanDisableExceptions() - { - $client = new Client(); - $this->assertEquals(500, $client->get('http://test.com', [ - 'subscribers' => [new Mock([new Response(500)])], - 'exceptions' => false - ])->getStatusCode()); - } - - public function testCanChangeSaveToLocation() - { - $saveTo = Stream::factory(); - $request = (new MessageFactory())->createRequest('GET', '/', ['save_to' => $saveTo]); - $this->assertSame($saveTo, $request->getConfig()->get('save_to')); - } - - public function testCanSetProxy() - { - $request = (new MessageFactory())->createRequest('GET', '/', ['proxy' => '192.168.16.121']); - $this->assertEquals('192.168.16.121', $request->getConfig()->get('proxy')); - } - - public function testCanSetHeadersOption() - { - $request = (new MessageFactory())->createRequest('GET', '/', ['headers' => ['Foo' => 'Bar']]); - $this->assertEquals('Bar', (string) $request->getHeader('Foo')); - } - - public function testCanSetHeaders() - { - $request = (new MessageFactory())->createRequest('GET', '/', [ - 'headers' => ['Foo' => ['Baz', 'Bar'], 'Test' => '123'] - ]); - $this->assertEquals('Baz, Bar', $request->getHeader('Foo')); - $this->assertEquals('123', $request->getHeader('Test')); - } - - public function testCanSetTimeoutOption() - { - $request = (new MessageFactory())->createRequest('GET', '/', ['timeout' => 1.5]); - $this->assertEquals(1.5, $request->getConfig()->get('timeout')); - } - - public function testCanSetConnectTimeoutOption() - { - $request = (new MessageFactory())->createRequest('GET', '/', ['connect_timeout' => 1.5]); - $this->assertEquals(1.5, $request->getConfig()->get('connect_timeout')); - } - - public function testCanSetDebug() - { - $request = (new MessageFactory())->createRequest('GET', '/', ['debug' => true]); - $this->assertTrue($request->getConfig()->get('debug')); - } - - public function testCanSetVerifyToOff() - { - $request = (new MessageFactory())->createRequest('GET', '/', ['verify' => false]); - $this->assertFalse($request->getConfig()->get('verify')); - } - - public function testCanSetVerifyToOn() - { - $request = (new MessageFactory())->createRequest('GET', '/', ['verify' => true]); - $this->assertTrue($request->getConfig()->get('verify')); - } - - public function testCanSetVerifyToPath() - { - $request = (new MessageFactory())->createRequest('GET', '/', ['verify' => '/foo.pem']); - $this->assertEquals('/foo.pem', $request->getConfig()->get('verify')); - } - - public function inputValidation() - { - return array_map(function ($option) { return array($option); }, array( - 'headers', 'events', 'subscribers', 'params' - )); - } - - /** - * @dataProvider inputValidation - * @expectedException \InvalidArgumentException - */ - public function testValidatesInput($option) - { - (new MessageFactory())->createRequest('GET', '/', [$option => 'foo']); - } - - public function testCanAddSslKey() - { - $request = (new MessageFactory())->createRequest('GET', '/', ['ssl_key' => '/foo.pem']); - $this->assertEquals('/foo.pem', $request->getConfig()->get('ssl_key')); - } - - public function testCanAddSslKeyPassword() - { - $request = (new MessageFactory())->createRequest('GET', '/', ['ssl_key' => ['/foo.pem', 'bar']]); - $this->assertEquals(['/foo.pem', 'bar'], $request->getConfig()->get('ssl_key')); - } - - public function testCanAddSslCert() - { - $request = (new MessageFactory())->createRequest('GET', '/', ['cert' => '/foo.pem']); - $this->assertEquals('/foo.pem', $request->getConfig()->get('cert')); - } - - public function testCanAddSslCertPassword() - { - $request = (new MessageFactory())->createRequest('GET', '/', ['cert' => ['/foo.pem', 'bar']]); - $this->assertEquals(['/foo.pem', 'bar'], $request->getConfig()->get('cert')); - } - - public function testCreatesBodyWithoutZeroString() - { - $request = (new MessageFactory())->createRequest('PUT', 'http://test.com', ['body' => '0']); - $this->assertSame('0', (string) $request->getBody()); - } - - public function testCanSetProtocolVersion() - { - $request = (new MessageFactory())->createRequest('GET', 'http://t.com', ['version' => 1.0]); - $this->assertEquals(1.0, $request->getProtocolVersion()); - } - - public function testCanAddJsonData() - { - $request = (new MessageFactory())->createRequest('PUT', 'http://f.com', [ - 'json' => ['foo' => 'bar'] - ]); - $this->assertEquals( - 'application/json', - $request->getHeader('Content-Type') - ); - $this->assertEquals('{"foo":"bar"}', (string) $request->getBody()); - } - - public function testCanAddJsonDataToAPostRequest() - { - $request = (new MessageFactory())->createRequest('POST', 'http://f.com', [ - 'json' => ['foo' => 'bar'] - ]); - $this->assertEquals( - 'application/json', - $request->getHeader('Content-Type') - ); - $this->assertEquals('{"foo":"bar"}', (string) $request->getBody()); - } - - public function testCanAddJsonDataAndNotOverwriteContentType() - { - $request = (new MessageFactory())->createRequest('PUT', 'http://f.com', [ - 'headers' => ['Content-Type' => 'foo'], - 'json' => null - ]); - $this->assertEquals('foo', $request->getHeader('Content-Type')); - $this->assertEquals('null', (string) $request->getBody()); - } - - public function testCanUseCustomRequestOptions() - { - $c = false; - $f = new MessageFactory([ - 'foo' => function (RequestInterface $request, $value) use (&$c) { - $c = true; - $this->assertEquals('bar', $value); - } - ]); - - $f->createRequest('PUT', 'http://f.com', [ - 'headers' => ['Content-Type' => 'foo'], - 'foo' => 'bar' - ]); - - $this->assertTrue($c); - } - - /** - * @ticket https://github.com/guzzle/guzzle/issues/706 - */ - public function testDoesNotApplyPostBodyRightAway() - { - $request = (new MessageFactory())->createRequest('POST', 'http://f.cn', [ - 'body' => ['foo' => ['bar', 'baz']] - ]); - $this->assertEquals('', $request->getHeader('Content-Type')); - $this->assertEquals('', $request->getHeader('Content-Length')); - $request->getBody()->setAggregator(Query::duplicateAggregator()); - $request->getBody()->applyRequestHeaders($request); - $this->assertEquals('foo=bar&foo=baz', $request->getBody()); - } - - public function testCanForceMultipartUploadWithContentType() - { - $client = new Client(); - $client->getEmitter()->attach(new Mock([new Response(200)])); - $history = new History(); - $client->getEmitter()->attach($history); - $client->post('http://foo.com', [ - 'headers' => ['Content-Type' => 'multipart/form-data'], - 'body' => ['foo' => 'bar'] - ]); - $this->assertContains( - 'multipart/form-data; boundary=', - $history->getLastRequest()->getHeader('Content-Type') - ); - $this->assertContains( - "Content-Disposition: form-data; name=\"foo\"\r\n\r\nbar", - (string) $history->getLastRequest()->getBody() - ); - } - - public function testDecodeDoesNotForceAcceptHeader() - { - $request = (new MessageFactory())->createRequest('POST', 'http://f.cn', [ - 'decode_content' => true - ]); - $this->assertEquals('', $request->getHeader('Accept-Encoding')); - $this->assertTrue($request->getConfig()->get('decode_content')); - } - - public function testDecodeCanAddAcceptHeader() - { - $request = (new MessageFactory())->createRequest('POST', 'http://f.cn', [ - 'decode_content' => 'gzip' - ]); - $this->assertEquals('gzip', $request->getHeader('Accept-Encoding')); - $this->assertTrue($request->getConfig()->get('decode_content')); - } - - public function testCanDisableDecoding() - { - $request = (new MessageFactory())->createRequest('POST', 'http://f.cn', [ - 'decode_content' => false - ]); - $this->assertEquals('', $request->getHeader('Accept-Encoding')); - $this->assertNull($request->getConfig()->get('decode_content')); - } -} - -class ExtendedFactory extends MessageFactory -{ - protected function add_foo() {} -} diff --git a/core/vendor/guzzlehttp/guzzle/tests/Message/MessageParserTest.php b/core/vendor/guzzlehttp/guzzle/tests/Message/MessageParserTest.php deleted file mode 100644 index 0bcc943..0000000 --- a/core/vendor/guzzlehttp/guzzle/tests/Message/MessageParserTest.php +++ /dev/null @@ -1,276 +0,0 @@ -compareRequestResults($parts, $parser->parseRequest($message)); - } - - /** - * @dataProvider responseProvider - */ - public function testParsesResponses($message, $parts) - { - $parser = new MessageParser(); - $this->compareResponseResults($parts, $parser->parseResponse($message)); - } - - public function testParsesRequestsWithMissingProtocol() - { - $parser = new MessageParser(); - $parts = $parser->parseRequest("GET /\r\nHost: Foo.com\r\n\r\n"); - $this->assertEquals('GET', $parts['method']); - $this->assertEquals('HTTP', $parts['protocol']); - $this->assertEquals('1.1', $parts['protocol_version']); - } - - public function testParsesRequestsWithMissingVersion() - { - $parser = new MessageParser(); - $parts = $parser->parseRequest("GET / HTTP\r\nHost: Foo.com\r\n\r\n"); - $this->assertEquals('GET', $parts['method']); - $this->assertEquals('HTTP', $parts['protocol']); - $this->assertEquals('1.1', $parts['protocol_version']); - } - - public function testParsesResponsesWithMissingReasonPhrase() - { - $parser = new MessageParser(); - $parts = $parser->parseResponse("HTTP/1.1 200\r\n\r\n"); - $this->assertEquals('200', $parts['code']); - $this->assertEquals('', $parts['reason_phrase']); - $this->assertEquals('HTTP', $parts['protocol']); - $this->assertEquals('1.1', $parts['protocol_version']); - } - - public function requestProvider() - { - $auth = base64_encode('michael:foo'); - - return array( - - // Empty request - array('', false), - - // Converts casing of request. Does not require host header. - array("GET / HTTP/1.1\r\n\r\n", array( - 'method' => 'GET', - 'protocol' => 'HTTP', - 'protocol_version' => '1.1', - 'request_url' => array( - 'scheme' => 'http', - 'host' => '', - 'port' => '', - 'path' => '/', - 'query' => '' - ), - 'headers' => array(), - 'body' => '' - )), - // Path and query string, multiple header values per header and case sensitive storage - array("HEAD /path?query=foo HTTP/1.0\r\nHost: example.com\r\nX-Foo: foo\r\nx-foo: Bar\r\nX-Foo: foo\r\nX-Foo: Baz\r\n\r\n", array( - 'method' => 'HEAD', - 'protocol' => 'HTTP', - 'protocol_version' => '1.0', - 'request_url' => array( - 'scheme' => 'http', - 'host' => 'example.com', - 'port' => '', - 'path' => '/path', - 'query' => 'query=foo' - ), - 'headers' => array( - 'Host' => 'example.com', - 'X-Foo' => array('foo', 'foo', 'Baz'), - 'x-foo' => 'Bar' - ), - 'body' => '' - )), - // Includes a body - array("PUT / HTTP/1.0\r\nhost: example.com:443\r\nContent-Length: 4\r\n\r\ntest", array( - 'method' => 'PUT', - 'protocol' => 'HTTP', - 'protocol_version' => '1.0', - 'request_url' => array( - 'scheme' => 'https', - 'host' => 'example.com', - 'port' => '443', - 'path' => '/', - 'query' => '' - ), - 'headers' => array( - 'host' => 'example.com:443', - 'Content-Length' => '4' - ), - 'body' => 'test' - )), - // Includes Authorization headers - array("GET / HTTP/1.1\r\nHost: example.com:8080\r\nAuthorization: Basic {$auth}\r\n\r\n", array( - 'method' => 'GET', - 'protocol' => 'HTTP', - 'protocol_version' => '1.1', - 'request_url' => array( - 'scheme' => 'http', - 'host' => 'example.com', - 'port' => '8080', - 'path' => '/', - 'query' => '' - ), - 'headers' => array( - 'Host' => 'example.com:8080', - 'Authorization' => "Basic {$auth}" - ), - 'body' => '' - )), - // Include authorization header - array("GET / HTTP/1.1\r\nHost: example.com:8080\r\nauthorization: Basic {$auth}\r\n\r\n", array( - 'method' => 'GET', - 'protocol' => 'HTTP', - 'protocol_version' => '1.1', - 'request_url' => array( - 'scheme' => 'http', - 'host' => 'example.com', - 'port' => '8080', - 'path' => '/', - 'query' => '' - ), - 'headers' => array( - 'Host' => 'example.com:8080', - 'authorization' => "Basic {$auth}" - ), - 'body' => '' - )), - ); - } - - public function responseProvider() - { - return array( - // Empty request - array('', false), - - array("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n", array( - 'protocol' => 'HTTP', - 'protocol_version' => '1.1', - 'code' => '200', - 'reason_phrase' => 'OK', - 'headers' => array( - 'Content-Length' => 0 - ), - 'body' => '' - )), - array("HTTP/1.0 400 Bad Request\r\nContent-Length: 0\r\n\r\n", array( - 'protocol' => 'HTTP', - 'protocol_version' => '1.0', - 'code' => '400', - 'reason_phrase' => 'Bad Request', - 'headers' => array( - 'Content-Length' => 0 - ), - 'body' => '' - )), - array("HTTP/1.0 100 Continue\r\n\r\n", array( - 'protocol' => 'HTTP', - 'protocol_version' => '1.0', - 'code' => '100', - 'reason_phrase' => 'Continue', - 'headers' => array(), - 'body' => '' - )), - array("HTTP/1.1 204 No Content\r\nX-Foo: foo\r\nx-foo: Bar\r\nX-Foo: foo\r\n\r\n", array( - 'protocol' => 'HTTP', - 'protocol_version' => '1.1', - 'code' => '204', - 'reason_phrase' => 'No Content', - 'headers' => array( - 'X-Foo' => array('foo', 'foo'), - 'x-foo' => 'Bar' - ), - 'body' => '' - )), - array("HTTP/1.1 200 Ok that is great!\r\nContent-Length: 4\r\n\r\nTest", array( - 'protocol' => 'HTTP', - 'protocol_version' => '1.1', - 'code' => '200', - 'reason_phrase' => 'Ok that is great!', - 'headers' => array( - 'Content-Length' => 4 - ), - 'body' => 'Test' - )), - ); - } - - public function compareRequestResults($result, $expected) - { - if (!$result) { - $this->assertFalse($expected); - return; - } - - $this->assertEquals($result['method'], $expected['method']); - $this->assertEquals($result['protocol'], $expected['protocol']); - $this->assertEquals($result['protocol_version'], $expected['protocol_version']); - $this->assertEquals($result['request_url'], $expected['request_url']); - $this->assertEquals($result['body'], $expected['body']); - $this->compareHttpHeaders($result['headers'], $expected['headers']); - } - - public function compareResponseResults($result, $expected) - { - if (!$result) { - $this->assertFalse($expected); - return; - } - - $this->assertEquals($result['protocol'], $expected['protocol']); - $this->assertEquals($result['protocol_version'], $expected['protocol_version']); - $this->assertEquals($result['code'], $expected['code']); - $this->assertEquals($result['reason_phrase'], $expected['reason_phrase']); - $this->assertEquals($result['body'], $expected['body']); - $this->compareHttpHeaders($result['headers'], $expected['headers']); - } - - protected function normalizeHeaders($headers) - { - $normalized = array(); - foreach ($headers as $key => $value) { - $key = strtolower($key); - if (!isset($normalized[$key])) { - $normalized[$key] = $value; - } elseif (!is_array($normalized[$key])) { - $normalized[$key] = array($value); - } else { - $normalized[$key][] = $value; - } - } - - foreach ($normalized as $key => &$value) { - if (is_array($value)) { - sort($value); - } - } - - return $normalized; - } - - public function compareHttpHeaders($result, $expected) - { - // Aggregate all headers case-insensitively - $result = $this->normalizeHeaders($result); - $expected = $this->normalizeHeaders($expected); - $this->assertEquals($result, $expected); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/tests/Message/RequestTest.php b/core/vendor/guzzlehttp/guzzle/tests/Message/RequestTest.php deleted file mode 100644 index a6241a4..0000000 --- a/core/vendor/guzzlehttp/guzzle/tests/Message/RequestTest.php +++ /dev/null @@ -1,132 +0,0 @@ - '123'], Stream::factory('foo')); - $this->assertEquals('PUT', $r->getMethod()); - $this->assertEquals('/test', $r->getUrl()); - $this->assertEquals('123', $r->getHeader('test')); - $this->assertEquals('foo', $r->getBody()); - } - - public function testConstructorInitializesMessageWithProtocolVersion() - { - $r = new Request('GET', '', [], null, ['protocol_version' => 10]); - $this->assertEquals(10, $r->getProtocolVersion()); - } - - public function testConstructorInitializesMessageWithEmitter() - { - $e = new Emitter(); - $r = new Request('GET', '', [], null, ['emitter' => $e]); - $this->assertSame($r->getEmitter(), $e); - } - - public function testCloneIsDeep() - { - $r = new Request('GET', '/test', ['foo' => 'baz'], Stream::factory('foo')); - $r2 = clone $r; - - $this->assertNotSame($r->getEmitter(), $r2->getEmitter()); - $this->assertEquals('foo', $r2->getBody()); - - $r->getConfig()->set('test', 123); - $this->assertFalse($r2->getConfig()->hasKey('test')); - - $r->setPath('/abc'); - $this->assertEquals('/test', $r2->getPath()); - } - - public function testCastsToString() - { - $r = new Request('GET', 'http://test.com/test', ['foo' => 'baz'], Stream::factory('body')); - $s = explode("\r\n", (string) $r); - $this->assertEquals("GET /test HTTP/1.1", $s[0]); - $this->assertContains('Host: test.com', $s); - $this->assertContains('foo: baz', $s); - $this->assertContains('', $s); - $this->assertContains('body', $s); - } - - public function testSettingUrlOverridesHostHeaders() - { - $r = new Request('GET', 'http://test.com/test'); - $r->setUrl('https://baz.com/bar'); - $this->assertEquals('baz.com', $r->getHost()); - $this->assertEquals('baz.com', $r->getHeader('Host')); - $this->assertEquals('/bar', $r->getPath()); - $this->assertEquals('https', $r->getScheme()); - } - - public function testQueryIsMutable() - { - $r = new Request('GET', 'http://www.foo.com?baz=bar'); - $this->assertEquals('baz=bar', $r->getQuery()); - $this->assertInstanceOf('GuzzleHttp\Query', $r->getQuery()); - $r->getQuery()->set('hi', 'there'); - $this->assertEquals('/?baz=bar&hi=there', $r->getResource()); - } - - public function testQueryCanChange() - { - $r = new Request('GET', 'http://www.foo.com?baz=bar'); - $r->setQuery(new Query(['foo' => 'bar'])); - $this->assertEquals('foo=bar', $r->getQuery()); - } - - public function testCanChangeMethod() - { - $r = new Request('GET', 'http://www.foo.com'); - $r->setMethod('put'); - $this->assertEquals('PUT', $r->getMethod()); - } - - public function testCanChangeSchemeWithPort() - { - $r = new Request('GET', 'http://www.foo.com:80'); - $r->setScheme('https'); - $this->assertEquals('https://www.foo.com', $r->getUrl()); - } - - public function testCanChangeScheme() - { - $r = new Request('GET', 'http://www.foo.com'); - $r->setScheme('https'); - $this->assertEquals('https://www.foo.com', $r->getUrl()); - } - - public function testCanChangeHost() - { - $r = new Request('GET', 'http://www.foo.com:222'); - $r->setHost('goo'); - $this->assertEquals('http://goo:222', $r->getUrl()); - $this->assertEquals('goo:222', $r->getHeader('host')); - $r->setHost('goo:80'); - $this->assertEquals('http://goo', $r->getUrl()); - $this->assertEquals('goo', $r->getHeader('host')); - } - - public function testCanChangePort() - { - $r = new Request('GET', 'http://www.foo.com:222'); - $this->assertSame(222, $r->getPort()); - $this->assertEquals('www.foo.com', $r->getHost()); - $this->assertEquals('www.foo.com:222', $r->getHeader('host')); - $r->setPort(80); - $this->assertSame(80, $r->getPort()); - $this->assertEquals('www.foo.com', $r->getHost()); - $this->assertEquals('www.foo.com', $r->getHeader('host')); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/tests/Message/ResponseTest.php b/core/vendor/guzzlehttp/guzzle/tests/Message/ResponseTest.php deleted file mode 100644 index bbae24a..0000000 --- a/core/vendor/guzzlehttp/guzzle/tests/Message/ResponseTest.php +++ /dev/null @@ -1,120 +0,0 @@ - 'hi!']); - $this->assertEquals(999, $response->getStatusCode()); - $this->assertEquals('hi!', $response->getReasonPhrase()); - } - - public function testConvertsToString() - { - $response = new Response(200); - $this->assertEquals("HTTP/1.1 200 OK\r\n\r\n", (string) $response); - // Add another header - $response = new Response(200, ['X-Test' => 'Guzzle']); - $this->assertEquals("HTTP/1.1 200 OK\r\nX-Test: Guzzle\r\n\r\n", (string) $response); - $response = new Response(200, ['Content-Length' => 4], Stream::factory('test')); - $this->assertEquals("HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\ntest", (string) $response); - } - - public function testConvertsToStringAndSeeksToByteZero() - { - $response = new Response(200); - $s = Stream::factory('foo'); - $s->read(1); - $response->setBody($s); - $this->assertEquals("HTTP/1.1 200 OK\r\n\r\nfoo", (string) $response); - } - - public function testParsesJsonResponses() - { - $json = '{"foo": "bar"}'; - $response = new Response(200, [], Stream::factory($json)); - $this->assertEquals(['foo' => 'bar'], $response->json()); - $this->assertEquals(json_decode($json), $response->json(['object' => true])); - - $response = new Response(200); - $this->assertEquals(null, $response->json()); - } - - /** - * @expectedException \GuzzleHttp\Exception\ParseException - * @expectedExceptionMessage Unable to parse JSON data: JSON_ERROR_SYNTAX - Syntax error, malformed JSON - */ - public function testThrowsExceptionWhenFailsToParseJsonResponse() - { - $response = new Response(200, [], Stream::factory('{"foo": "')); - $response->json(); - } - - public function testParsesXmlResponses() - { - $response = new Response(200, [], Stream::factory('bar')); - $this->assertEquals('bar', (string) $response->xml()->foo); - // Always return a SimpleXMLElement from the xml method - $response = new Response(200); - $this->assertEmpty((string) $response->xml()->foo); - } - - /** - * @expectedException \GuzzleHttp\Exception\XmlParseException - * @expectedExceptionMessage Unable to parse response body into XML: String could not be parsed as XML - */ - public function testThrowsExceptionWhenFailsToParseXmlResponse() - { - $response = new Response(200, [], Stream::factory('xml(); - } catch (XmlParseException $e) { - $xmlParseError = $e->getError(); - $this->assertInstanceOf('\LibXMLError', $xmlParseError); - $this->assertContains("Couldn't find end of Start Tag abc line 1", $xmlParseError->message); - throw $e; - } - } - - public function testHasEffectiveUrl() - { - $r = new Response(200); - $this->assertNull($r->getEffectiveUrl()); - $r->setEffectiveUrl('http://www.test.com'); - $this->assertEquals('http://www.test.com', $r->getEffectiveUrl()); - } - - public function testPreventsComplexExternalEntities() - { - $xml = ']>&test;'; - $response = new Response(200, [], Stream::factory($xml)); - - $oldCwd = getcwd(); - chdir(__DIR__); - try { - $xml = $response->xml(); - chdir($oldCwd); - $this->markTestIncomplete('Did not throw the expected exception! XML resolved as: ' . $xml->asXML()); - } catch (\Exception $e) { - chdir($oldCwd); - } - } - - public function testStatusAndReasonAreMutable() - { - $response = new Response(200); - $response->setStatusCode(201); - $this->assertEquals(201, $response->getStatusCode()); - $response->setReasonPhrase('Foo'); - $this->assertEquals('Foo', $response->getReasonPhrase()); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/tests/MimetypesTest.php b/core/vendor/guzzlehttp/guzzle/tests/MimetypesTest.php deleted file mode 100644 index a18ec38..0000000 --- a/core/vendor/guzzlehttp/guzzle/tests/MimetypesTest.php +++ /dev/null @@ -1,31 +0,0 @@ -assertEquals('text/x-php', Mimetypes::getInstance()->fromExtension('php')); - } - - public function testGetsFromFilename() - { - $this->assertEquals('text/x-php', Mimetypes::getInstance()->fromFilename(__FILE__)); - } - - public function testGetsFromCaseInsensitiveFilename() - { - $this->assertEquals('text/x-php', Mimetypes::getInstance()->fromFilename(strtoupper(__FILE__))); - } - - public function testReturnsNullWhenNoMatchFound() - { - $this->assertNull(Mimetypes::getInstance()->fromExtension('foobar')); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/tests/PoolTest.php b/core/vendor/guzzlehttp/guzzle/tests/PoolTest.php deleted file mode 100644 index b5f02ad..0000000 --- a/core/vendor/guzzlehttp/guzzle/tests/PoolTest.php +++ /dev/null @@ -1,319 +0,0 @@ - 10]); - $this->assertSame($c, $this->readAttribute($p, 'client')); - $this->assertEquals(10, $this->readAttribute($p, 'poolSize')); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testValidatesEachElement() - { - $c = new Client(); - $requests = ['foo']; - $p = new Pool($c, new \ArrayIterator($requests)); - $p->wait(); - } - - public function testSendsAndRealizesFuture() - { - $c = $this->getClient(); - $p = new Pool($c, [$c->createRequest('GET', 'http://foo.com')]); - $this->assertTrue($p->wait()); - $this->assertFalse($p->wait()); - $this->assertTrue($this->readAttribute($p, 'isRealized')); - $this->assertFalse($p->cancel()); - } - - public function testSendsManyRequestsInCappedPool() - { - $c = $this->getClient(); - $p = new Pool($c, [$c->createRequest('GET', 'http://foo.com')]); - $this->assertTrue($p->wait()); - $this->assertFalse($p->wait()); - } - - public function testSendsRequestsThatHaveNotBeenRealized() - { - $c = $this->getClient(); - $p = new Pool($c, [$c->createRequest('GET', 'http://foo.com')]); - $this->assertTrue($p->wait()); - $this->assertFalse($p->wait()); - $this->assertFalse($p->cancel()); - } - - public function testCancelsInFlightRequests() - { - $c = $this->getClient(); - $h = new History(); - $c->getEmitter()->attach($h); - $p = new Pool($c, [ - $c->createRequest('GET', 'http://foo.com'), - $c->createRequest('GET', 'http://foo.com', [ - 'events' => [ - 'before' => [ - 'fn' => function () use (&$p) { - $this->assertTrue($p->cancel()); - }, - 'priority' => RequestEvents::EARLY - ] - ] - ]) - ]); - ob_start(); - $p->wait(); - $contents = ob_get_clean(); - $this->assertEquals(1, count($h)); - $this->assertEquals('Cancelling', $contents); - } - - private function getClient() - { - $deferred = new Deferred(); - $future = new FutureArray( - $deferred->promise(), - function() use ($deferred) { - $deferred->resolve(['status' => 200, 'headers' => []]); - }, function () { - echo 'Cancelling'; - } - ); - - return new Client(['handler' => new MockHandler($future)]); - } - - public function testBatchesRequests() - { - $client = new Client(['handler' => function () { - throw new \RuntimeException('No network access'); - }]); - - $responses = [ - new Response(301, ['Location' => 'http://foo.com/bar']), - new Response(200), - new Response(200), - new Response(404) - ]; - - $client->getEmitter()->attach(new Mock($responses)); - $requests = [ - $client->createRequest('GET', 'http://foo.com/baz'), - $client->createRequest('HEAD', 'http://httpbin.org/get'), - $client->createRequest('PUT', 'http://httpbin.org/put'), - ]; - - $a = $b = $c = $d = 0; - $result = Pool::batch($client, $requests, [ - 'before' => function (BeforeEvent $e) use (&$a) { $a++; }, - 'complete' => function (CompleteEvent $e) use (&$b) { $b++; }, - 'error' => function (ErrorEvent $e) use (&$c) { $c++; }, - 'end' => function (EndEvent $e) use (&$d) { $d++; } - ]); - - $this->assertEquals(4, $a); - $this->assertEquals(2, $b); - $this->assertEquals(1, $c); - $this->assertEquals(3, $d); - $this->assertCount(3, $result); - $this->assertInstanceOf('GuzzleHttp\BatchResults', $result); - - // The first result is actually the second (redirect) response. - $this->assertSame($responses[1], $result[0]); - // The second result is a 1:1 request:response map - $this->assertSame($responses[2], $result[1]); - // The third entry is the 404 RequestException - $this->assertSame($responses[3], $result[2]->getResponse()); - } - - public function testBatchesRequestsWithDynamicPoolSize() - { - $client = new Client(['handler' => function () { - throw new \RuntimeException('No network access'); - }]); - - $responses = [ - new Response(301, ['Location' => 'http://foo.com/bar']), - new Response(200), - new Response(200), - new Response(404) - ]; - - $client->getEmitter()->attach(new Mock($responses)); - $requests = [ - $client->createRequest('GET', 'http://foo.com/baz'), - $client->createRequest('HEAD', 'http://httpbin.org/get'), - $client->createRequest('PUT', 'http://httpbin.org/put'), - ]; - - $a = $b = $c = $d = 0; - $result = Pool::batch($client, $requests, [ - 'before' => function (BeforeEvent $e) use (&$a) { $a++; }, - 'complete' => function (CompleteEvent $e) use (&$b) { $b++; }, - 'error' => function (ErrorEvent $e) use (&$c) { $c++; }, - 'end' => function (EndEvent $e) use (&$d) { $d++; }, - 'pool_size' => function ($queueSize) { - static $options = [1, 2, 1]; - static $queued = 0; - - $this->assertEquals( - $queued, - $queueSize, - 'The number of queued requests should be equal to the sum of pool sizes so far.' - ); - - $next = array_shift($options); - $queued += $next; - - return $next; - } - ]); - - $this->assertEquals(4, $a); - $this->assertEquals(2, $b); - $this->assertEquals(1, $c); - $this->assertEquals(3, $d); - $this->assertCount(3, $result); - $this->assertInstanceOf('GuzzleHttp\BatchResults', $result); - - // The first result is actually the second (redirect) response. - $this->assertSame($responses[1], $result[0]); - // The second result is a 1:1 request:response map - $this->assertSame($responses[2], $result[1]); - // The third entry is the 404 RequestException - $this->assertSame($responses[3], $result[2]->getResponse()); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Each event listener must be a callable or - */ - public function testBatchValidatesTheEventFormat() - { - $client = new Client(); - $requests = [$client->createRequest('GET', 'http://foo.com/baz')]; - Pool::batch($client, $requests, ['complete' => 'foo']); - } - - public function testEmitsProgress() - { - $client = new Client(['handler' => function () { - throw new \RuntimeException('No network access'); - }]); - - $responses = [new Response(200), new Response(404)]; - $client->getEmitter()->attach(new Mock($responses)); - $requests = [ - $client->createRequest('GET', 'http://foo.com/baz'), - $client->createRequest('HEAD', 'http://httpbin.org/get') - ]; - - $pool = new Pool($client, $requests); - $count = 0; - $thenned = null; - $pool->then( - function ($value) use (&$thenned) { - $thenned = $value; - }, - null, - function ($result) use (&$count, $requests) { - $this->assertSame($requests[$count], $result['request']); - if ($count == 0) { - $this->assertNull($result['error']); - $this->assertEquals(200, $result['response']->getStatusCode()); - } else { - $this->assertInstanceOf( - 'GuzzleHttp\Exception\ClientException', - $result['error'] - ); - } - $count++; - } - ); - - $pool->wait(); - $this->assertEquals(2, $count); - $this->assertEquals(true, $thenned); - } - - public function testDoesNotThrowInErrorEvent() - { - $client = new Client(); - $responses = [new Response(404)]; - $client->getEmitter()->attach(new Mock($responses)); - $requests = [$client->createRequest('GET', 'http://foo.com/baz')]; - $result = Pool::batch($client, $requests); - $this->assertCount(1, $result); - $this->assertInstanceOf('GuzzleHttp\Exception\ClientException', $result[0]); - } - - public function testHasSendMethod() - { - $client = new Client(); - $responses = [new Response(404)]; - $history = new History(); - $client->getEmitter()->attach($history); - $client->getEmitter()->attach(new Mock($responses)); - $requests = [$client->createRequest('GET', 'http://foo.com/baz')]; - Pool::send($client, $requests); - $this->assertCount(1, $history); - } - - public function testDoesNotInfinitelyRecurse() - { - $client = new Client(['handler' => function () { - throw new \RuntimeException('No network access'); - }]); - - $last = null; - $client->getEmitter()->on( - 'before', - function (BeforeEvent $e) use (&$last) { - $e->intercept(new Response(200)); - if (function_exists('xdebug_get_stack_depth')) { - if ($last) { - $this->assertEquals($last, xdebug_get_stack_depth()); - } else { - $last = xdebug_get_stack_depth(); - } - } - } - ); - - $requests = []; - for ($i = 0; $i < 100; $i++) { - $requests[] = $client->createRequest('GET', 'http://foo.com'); - } - - $pool = new Pool($client, $requests); - $pool->wait(); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/tests/Post/MultipartBodyTest.php b/core/vendor/guzzlehttp/guzzle/tests/Post/MultipartBodyTest.php deleted file mode 100644 index 4b3b391..0000000 --- a/core/vendor/guzzlehttp/guzzle/tests/Post/MultipartBodyTest.php +++ /dev/null @@ -1,120 +0,0 @@ - 'bar'], [ - new PostFile('foo', 'abc', 'foo.txt') - ], 'abcdef'); - } - - public function testConstructorAddsFieldsAndFiles() - { - $b = $this->getTestBody(); - $this->assertEquals('abcdef', $b->getBoundary()); - $c = (string) $b; - $this->assertContains("--abcdef\r\nContent-Disposition: form-data; name=\"foo\"\r\n\r\nbar\r\n", $c); - $this->assertContains("--abcdef\r\nContent-Disposition: form-data; name=\"foo\"; filename=\"foo.txt\"\r\n" - . "Content-Type: text/plain\r\n\r\nabc\r\n--abcdef--", $c); - } - - public function testDoesNotModifyFieldFormat() - { - $m = new MultipartBody(['foo+baz' => 'bar+bam %20 boo'], [ - new PostFile('foo+bar', 'abc %20 123', 'foo.txt') - ], 'abcdef'); - $this->assertContains('name="foo+baz"', (string) $m); - $this->assertContains('name="foo+bar"', (string) $m); - $this->assertContains('bar+bam %20 boo', (string) $m); - $this->assertContains('abc %20 123', (string) $m); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testConstructorValidatesFiles() - { - new MultipartBody([], ['bar']); - } - - public function testConstructorCanCreateBoundary() - { - $b = new MultipartBody(); - $this->assertNotNull($b->getBoundary()); - } - - public function testWrapsStreamMethods() - { - $b = $this->getTestBody(); - $this->assertFalse($b->write('foo')); - $this->assertFalse($b->isWritable()); - $this->assertTrue($b->isReadable()); - $this->assertTrue($b->isSeekable()); - $this->assertEquals(0, $b->tell()); - } - - public function testCanDetachFieldsAndFiles() - { - $b = $this->getTestBody(); - $b->detach(); - $b->close(); - $this->assertEquals('', (string) $b); - } - - public function testIsSeekableReturnsTrueIfAllAreSeekable() - { - $s = $this->getMockBuilder('GuzzleHttp\Stream\StreamInterface') - ->setMethods(['isSeekable', 'isReadable']) - ->getMockForAbstractClass(); - $s->expects($this->once()) - ->method('isSeekable') - ->will($this->returnValue(false)); - $s->expects($this->once()) - ->method('isReadable') - ->will($this->returnValue(true)); - $p = new PostFile('foo', $s, 'foo.php'); - $b = new MultipartBody([], [$p]); - $this->assertFalse($b->isSeekable()); - $this->assertFalse($b->seek(10)); - } - - public function testReadsFromBuffer() - { - $b = $this->getTestBody(); - $c = $b->read(1); - $c .= $b->read(1); - $c .= $b->read(1); - $c .= $b->read(1); - $c .= $b->read(1); - $this->assertEquals('--abc', $c); - } - - public function testCalculatesSize() - { - $b = $this->getTestBody(); - $this->assertEquals(strlen($b), $b->getSize()); - } - - public function testCalculatesSizeAndReturnsNullForUnknown() - { - $s = $this->getMockBuilder('GuzzleHttp\Stream\StreamInterface') - ->setMethods(['getSize', 'isReadable']) - ->getMockForAbstractClass(); - $s->expects($this->once()) - ->method('getSize') - ->will($this->returnValue(null)); - $s->expects($this->once()) - ->method('isReadable') - ->will($this->returnValue(true)); - $b = new MultipartBody([], [new PostFile('foo', $s, 'foo.php')]); - $this->assertNull($b->getSize()); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/tests/Post/PostBodyTest.php b/core/vendor/guzzlehttp/guzzle/tests/Post/PostBodyTest.php deleted file mode 100644 index 0283a5e..0000000 --- a/core/vendor/guzzlehttp/guzzle/tests/Post/PostBodyTest.php +++ /dev/null @@ -1,255 +0,0 @@ -assertTrue($b->isSeekable()); - $this->assertTrue($b->isReadable()); - $this->assertFalse($b->isWritable()); - $this->assertFalse($b->write('foo')); - } - - public function testApplyingWithNothingDoesNothing() - { - $b = new PostBody(); - $m = new Request('POST', '/'); - $b->applyRequestHeaders($m); - $this->assertFalse($m->hasHeader('Content-Length')); - $this->assertFalse($m->hasHeader('Content-Type')); - } - - public function testCanForceMultipartUploadsWhenApplying() - { - $b = new PostBody(); - $b->forceMultipartUpload(true); - $m = new Request('POST', '/'); - $b->applyRequestHeaders($m); - $this->assertContains( - 'multipart/form-data', - $m->getHeader('Content-Type') - ); - } - - public function testApplyingWithFilesAddsMultipartUpload() - { - $b = new PostBody(); - $p = new PostFile('foo', fopen(__FILE__, 'r')); - $b->addFile($p); - $this->assertEquals([$p], $b->getFiles()); - $this->assertNull($b->getFile('missing')); - $this->assertSame($p, $b->getFile('foo')); - $m = new Request('POST', '/'); - $b->applyRequestHeaders($m); - $this->assertContains( - 'multipart/form-data', - $m->getHeader('Content-Type') - ); - $this->assertTrue($m->hasHeader('Content-Length')); - } - - public function testApplyingWithFieldsAddsMultipartUpload() - { - $b = new PostBody(); - $b->setField('foo', 'bar'); - $this->assertEquals(['foo' => 'bar'], $b->getFields()); - $m = new Request('POST', '/'); - $b->applyRequestHeaders($m); - $this->assertContains( - 'application/x-www-form', - $m->getHeader('Content-Type') - ); - $this->assertTrue($m->hasHeader('Content-Length')); - } - - public function testMultipartWithNestedFields() - { - $b = new PostBody(); - $b->setField('foo', ['bar' => 'baz']); - $b->forceMultipartUpload(true); - $this->assertEquals(['foo' => ['bar' => 'baz']], $b->getFields()); - $m = new Request('POST', '/'); - $b->applyRequestHeaders($m); - $this->assertContains( - 'multipart/form-data', - $m->getHeader('Content-Type') - ); - $this->assertTrue($m->hasHeader('Content-Length')); - $contents = $b->getContents(); - $this->assertContains('name="foo[bar]"', $contents); - $this->assertNotContains('name="foo"', $contents); - } - - public function testCountProvidesFieldsAndFiles() - { - $b = new PostBody(); - $b->setField('foo', 'bar'); - $b->addFile(new PostFile('foo', fopen(__FILE__, 'r'))); - $this->assertEquals(2, count($b)); - $b->clearFiles(); - $b->removeField('foo'); - $this->assertEquals(0, count($b)); - $this->assertEquals([], $b->getFiles()); - $this->assertEquals([], $b->getFields()); - } - - public function testHasFields() - { - $b = new PostBody(); - $b->setField('foo', 'bar'); - $b->setField('baz', '123'); - $this->assertEquals('bar', $b->getField('foo')); - $this->assertEquals('123', $b->getField('baz')); - $this->assertNull($b->getField('ahh')); - $this->assertTrue($b->hasField('foo')); - $this->assertFalse($b->hasField('test')); - $b->replaceFields(['abc' => '123']); - $this->assertFalse($b->hasField('foo')); - $this->assertTrue($b->hasField('abc')); - } - - public function testConvertsFieldsToQueryStyleBody() - { - $b = new PostBody(); - $b->setField('foo', 'bar'); - $b->setField('baz', '123'); - $this->assertEquals('foo=bar&baz=123', $b); - $this->assertEquals(15, $b->getSize()); - $b->seek(0); - $this->assertEquals('foo=bar&baz=123', $b->getContents()); - $b->seek(0); - $this->assertEquals('foo=bar&baz=123', $b->read(1000)); - $this->assertEquals(15, $b->tell()); - } - - public function testCanSpecifyQueryAggregator() - { - $b = new PostBody(); - $b->setField('foo', ['baz', 'bar']); - $this->assertEquals('foo%5B0%5D=baz&foo%5B1%5D=bar', (string) $b); - $b = new PostBody(); - $b->setField('foo', ['baz', 'bar']); - $agg = Query::duplicateAggregator(); - $b->setAggregator($agg); - $this->assertEquals('foo=baz&foo=bar', (string) $b); - } - - public function testDetachesAndCloses() - { - $b = new PostBody(); - $b->setField('foo', 'bar'); - $b->detach(); - $b->close(); - $this->assertEquals('', $b->read(10)); - } - - public function testDetachesWhenBodyIsPresent() - { - $b = new PostBody(); - $b->setField('foo', 'bar'); - $b->getContents(); - $b->detach(); - } - - public function testFlushAndMetadataPlaceholders() - { - $b = new PostBody(); - $this->assertEquals([], $b->getMetadata()); - $this->assertNull($b->getMetadata('foo')); - } - - public function testCreatesMultipartUploadWithMultiFields() - { - $b = new PostBody(); - $b->setField('testing', ['baz', 'bar']); - $b->setField('other', 'hi'); - $b->setField('third', 'there'); - $b->addFile(new PostFile('foo', fopen(__FILE__, 'r'))); - $s = (string) $b; - $this->assertContains(file_get_contents(__FILE__), $s); - $this->assertContains('testing=bar', $s); - $this->assertContains( - 'Content-Disposition: form-data; name="third"', - $s - ); - $this->assertContains( - 'Content-Disposition: form-data; name="other"', - $s - ); - } - - public function testMultipartWithBase64Fields() - { - $b = new PostBody(); - $b->setField('foo64', '/xA2JhWEqPcgyLRDdir9WSRi/khpb2Lh3ooqv+5VYoc='); - $b->forceMultipartUpload(true); - $this->assertEquals( - ['foo64' => '/xA2JhWEqPcgyLRDdir9WSRi/khpb2Lh3ooqv+5VYoc='], - $b->getFields() - ); - $m = new Request('POST', '/'); - $b->applyRequestHeaders($m); - $this->assertContains( - 'multipart/form-data', - $m->getHeader('Content-Type') - ); - $this->assertTrue($m->hasHeader('Content-Length')); - $contents = $b->getContents(); - $this->assertContains('name="foo64"', $contents); - $this->assertContains( - '/xA2JhWEqPcgyLRDdir9WSRi/khpb2Lh3ooqv+5VYoc=', - $contents - ); - } - - public function testMultipartWithAmpersandInValue() - { - $b = new PostBody(); - $b->setField('a', 'b&c=d'); - $b->forceMultipartUpload(true); - $this->assertEquals(['a' => 'b&c=d'], $b->getFields()); - $m = new Request('POST', '/'); - $b->applyRequestHeaders($m); - $this->assertContains( - 'multipart/form-data', - $m->getHeader('Content-Type') - ); - $this->assertTrue($m->hasHeader('Content-Length')); - $contents = $b->getContents(); - $this->assertContains('name="a"', $contents); - $this->assertContains('b&c=d', $contents); - } - - /** - * @expectedException \GuzzleHttp\Stream\Exception\CannotAttachException - */ - public function testCannotAttach() - { - $b = new PostBody(); - $b->attach('foo'); - } - - public function testDoesNotOverwriteExistingHeaderForUrlencoded() - { - $m = new Request('POST', 'http://foo.com', [ - 'content-type' => 'application/x-www-form-urlencoded; charset=utf-8' - ]); - $b = new PostBody(); - $b->setField('foo', 'bar'); - $b->applyRequestHeaders($m); - $this->assertEquals( - 'application/x-www-form-urlencoded; charset=utf-8', - $m->getHeader('Content-Type') - ); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/tests/Post/PostFileTest.php b/core/vendor/guzzlehttp/guzzle/tests/Post/PostFileTest.php deleted file mode 100644 index 800cee5..0000000 --- a/core/vendor/guzzlehttp/guzzle/tests/Post/PostFileTest.php +++ /dev/null @@ -1,61 +0,0 @@ -assertInstanceOf('GuzzleHttp\Post\PostFileInterface', $p); - $this->assertEquals('hi', $p->getContent()); - $this->assertEquals('foo', $p->getName()); - $this->assertEquals('/path/to/test.php', $p->getFilename()); - $this->assertEquals( - 'form-data; name="foo"; filename="test.php"', - $p->getHeaders()['Content-Disposition'] - ); - } - - public function testGetsFilenameFromMetadata() - { - $p = new PostFile('foo', fopen(__FILE__, 'r')); - $this->assertEquals(__FILE__, $p->getFilename()); - } - - public function testDefaultsToNameWhenNoFilenameExists() - { - $p = new PostFile('foo', 'bar'); - $this->assertEquals('foo', $p->getFilename()); - } - - public function testCreatesFromMultipartFormData() - { - $mp = new MultipartBody([], [], 'baz'); - $p = new PostFile('foo', $mp); - $this->assertEquals( - 'form-data; name="foo"', - $p->getHeaders()['Content-Disposition'] - ); - $this->assertEquals( - 'multipart/form-data; boundary=baz', - $p->getHeaders()['Content-Type'] - ); - } - - public function testCanAddHeaders() - { - $p = new PostFile('foo', Stream::factory('hi'), 'test.php', [ - 'X-Foo' => '123', - 'Content-Disposition' => 'bar' - ]); - $this->assertEquals('bar', $p->getHeaders()['Content-Disposition']); - $this->assertEquals('123', $p->getHeaders()['X-Foo']); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/tests/QueryParserTest.php b/core/vendor/guzzlehttp/guzzle/tests/QueryParserTest.php deleted file mode 100644 index e9075a8..0000000 --- a/core/vendor/guzzlehttp/guzzle/tests/QueryParserTest.php +++ /dev/null @@ -1,80 +0,0 @@ - ['a', 'b']]], - // Can parse multi-valued items that use numeric indices - ['q[0]=a&q[1]=b', ['q' => ['a', 'b']]], - // Can parse duplicates and does not include numeric indices - ['q[]=a&q[]=b', ['q' => ['a', 'b']]], - // Ensures that the value of "q" is an array even though one value - ['q[]=a', ['q' => ['a']]], - // Does not modify "." to "_" like PHP's parse_str() - ['q.a=a&q.b=b', ['q.a' => 'a', 'q.b' => 'b']], - // Can decode %20 to " " - ['q%20a=a%20b', ['q a' => 'a b']], - // Can parse funky strings with no values by assigning each to null - ['q&a', ['q' => null, 'a' => null]], - // Does not strip trailing equal signs - ['data=abc=', ['data' => 'abc=']], - // Can store duplicates without affecting other values - ['foo=a&foo=b&?µ=c', ['foo' => ['a', 'b'], '?µ' => 'c']], - // Sets value to null when no "=" is present - ['foo', ['foo' => null]], - // Preserves "0" keys. - ['0', ['0' => null]], - // Sets the value to an empty string when "=" is present - ['0=', ['0' => '']], - // Preserves falsey keys - ['var=0', ['var' => '0']], - // Can deeply nest and store duplicate PHP values - ['a[b][c]=1&a[b][c]=2', [ - 'a' => ['b' => ['c' => ['1', '2']]] - ]], - // Can parse PHP style arrays - ['a[b]=c&a[d]=e', ['a' => ['b' => 'c', 'd' => 'e']]], - // Ensure it doesn't leave things behind with repeated values - // Can parse mult-values items - ['q=a&q=b&q=c', ['q' => ['a', 'b', 'c']]], - ]; - } - - /** - * @dataProvider parseQueryProvider - */ - public function testParsesQueries($input, $output) - { - $query = Query::fromString($input); - $this->assertEquals($output, $query->toArray()); - // Normalize the input and output - $query->setEncodingType(false); - $this->assertEquals(rawurldecode($input), (string) $query); - } - - public function testConvertsPlusSymbolsToSpacesByDefault() - { - $query = Query::fromString('var=foo+bar', true); - $this->assertEquals('foo bar', $query->get('var')); - } - - public function testCanControlDecodingType() - { - $qp = new QueryParser(); - $q = new Query(); - $qp->parseInto($q, 'var=foo+bar', Query::RFC3986); - $this->assertEquals('foo+bar', $q->get('var')); - $qp->parseInto($q, 'var=foo+bar', Query::RFC1738); - $this->assertEquals('foo bar', $q->get('var')); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/tests/QueryTest.php b/core/vendor/guzzlehttp/guzzle/tests/QueryTest.php deleted file mode 100644 index 8b9d344..0000000 --- a/core/vendor/guzzlehttp/guzzle/tests/QueryTest.php +++ /dev/null @@ -1,171 +0,0 @@ - 'baz', 'bar' => 'bam boozle']); - $this->assertEquals('foo=baz&bar=bam%20boozle', (string) $q); - } - - public function testCanDisableUrlEncoding() - { - $q = new Query(['bar' => 'bam boozle']); - $q->setEncodingType(false); - $this->assertEquals('bar=bam boozle', (string) $q); - } - - public function testCanSpecifyRfc1783UrlEncodingType() - { - $q = new Query(['bar abc' => 'bam boozle']); - $q->setEncodingType(Query::RFC1738); - $this->assertEquals('bar+abc=bam+boozle', (string) $q); - } - - public function testCanSpecifyRfc3986UrlEncodingType() - { - $q = new Query(['bar abc' => 'bam boozle', 'ሴ' => 'hi']); - $q->setEncodingType(Query::RFC3986); - $this->assertEquals('bar%20abc=bam%20boozle&%E1%88%B4=hi', (string) $q); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testValidatesEncodingType() - { - (new Query(['bar' => 'bam boozle']))->setEncodingType('foo'); - } - - public function testAggregatesMultipleValues() - { - $q = new Query(['foo' => ['bar', 'baz']]); - $this->assertEquals('foo%5B0%5D=bar&foo%5B1%5D=baz', (string) $q); - } - - public function testCanSetAggregator() - { - $q = new Query(['foo' => ['bar', 'baz']]); - $q->setAggregator(function (array $data) { - return ['foo' => ['barANDbaz']]; - }); - $this->assertEquals('foo=barANDbaz', (string) $q); - } - - public function testAllowsMultipleValuesPerKey() - { - $q = new Query(); - $q->add('facet', 'size'); - $q->add('facet', 'width'); - $q->add('facet.field', 'foo'); - // Use the duplicate aggregator - $q->setAggregator($q::duplicateAggregator()); - $this->assertEquals('facet=size&facet=width&facet.field=foo', (string) $q); - } - - public function testAllowsZeroValues() - { - $query = new Query(array( - 'foo' => 0, - 'baz' => '0', - 'bar' => null, - 'boo' => false - )); - $this->assertEquals('foo=0&baz=0&bar&boo=', (string) $query); - } - - private $encodeData = [ - 't' => [ - 'v1' => ['a', '1'], - 'v2' => 'b', - 'v3' => ['v4' => 'c', 'v5' => 'd'] - ] - ]; - - public function testEncodesDuplicateAggregator() - { - $agg = Query::duplicateAggregator(); - $result = $agg($this->encodeData); - $this->assertEquals(array( - 't[v1]' => ['a', '1'], - 't[v2]' => ['b'], - 't[v3][v4]' => ['c'], - 't[v3][v5]' => ['d'], - ), $result); - } - - public function testDuplicateEncodesNoNumericIndices() - { - $agg = Query::duplicateAggregator(); - $result = $agg($this->encodeData); - $this->assertEquals(array( - 't[v1]' => ['a', '1'], - 't[v2]' => ['b'], - 't[v3][v4]' => ['c'], - 't[v3][v5]' => ['d'], - ), $result); - } - - public function testEncodesPhpAggregator() - { - $agg = Query::phpAggregator(); - $result = $agg($this->encodeData); - $this->assertEquals(array( - 't[v1][0]' => ['a'], - 't[v1][1]' => ['1'], - 't[v2]' => ['b'], - 't[v3][v4]' => ['c'], - 't[v3][v5]' => ['d'], - ), $result); - } - - public function testPhpEncodesNoNumericIndices() - { - $agg = Query::phpAggregator(false); - $result = $agg($this->encodeData); - $this->assertEquals(array( - 't[v1][]' => ['a', '1'], - 't[v2]' => ['b'], - 't[v3][v4]' => ['c'], - 't[v3][v5]' => ['d'], - ), $result); - } - - public function testCanDisableUrlEncodingDecoding() - { - $q = Query::fromString('foo=bar+baz boo%20', false); - $this->assertEquals('bar+baz boo%20', $q['foo']); - $this->assertEquals('foo=bar+baz boo%20', (string) $q); - } - - public function testCanChangeUrlEncodingDecodingToRfc1738() - { - $q = Query::fromString('foo=bar+baz', Query::RFC1738); - $this->assertEquals('bar baz', $q['foo']); - $this->assertEquals('foo=bar+baz', (string) $q); - } - - public function testCanChangeUrlEncodingDecodingToRfc3986() - { - $q = Query::fromString('foo=bar%20baz', Query::RFC3986); - $this->assertEquals('bar baz', $q['foo']); - $this->assertEquals('foo=bar%20baz', (string) $q); - } - - public function testQueryStringsAllowSlashButDoesNotDecodeWhenDisable() - { - $q = Query::fromString('foo=bar%2Fbaz&bam=boo%20boo', Query::RFC3986); - $q->setEncodingType(false); - $this->assertEquals('foo=bar/baz&bam=boo boo', (string) $q); - } - - public function testQueryStringsAllowDecodingEncodingCompletelyDisabled() - { - $q = Query::fromString('foo=bar%2Fbaz&bam=boo boo!', false); - $this->assertEquals('foo=bar%2Fbaz&bam=boo boo!', (string) $q); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/tests/RequestFsmTest.php b/core/vendor/guzzlehttp/guzzle/tests/RequestFsmTest.php deleted file mode 100644 index dd67684..0000000 --- a/core/vendor/guzzlehttp/guzzle/tests/RequestFsmTest.php +++ /dev/null @@ -1,187 +0,0 @@ -mf = new MessageFactory(); - } - - public function testEmitsBeforeEventInTransition() - { - $fsm = new RequestFsm(function () { - return new CompletedFutureArray(['status' => 200]); - }, $this->mf); - $t = new Transaction(new Client(), new Request('GET', 'http://foo.com')); - $c = false; - $t->request->getEmitter()->on('before', function (BeforeEvent $e) use (&$c) { - $c = true; - }); - $fsm($t); - $this->assertTrue($c); - } - - public function testEmitsCompleteEventInTransition() - { - $fsm = new RequestFsm(function () { - return new CompletedFutureArray(['status' => 200]); - }, $this->mf); - $t = new Transaction(new Client(), new Request('GET', 'http://foo.com')); - $t->response = new Response(200); - $t->state = 'complete'; - $c = false; - $t->request->getEmitter()->on('complete', function (CompleteEvent $e) use (&$c) { - $c = true; - }); - $fsm($t); - $this->assertTrue($c); - } - - public function testDoesNotEmitCompleteForFuture() - { - $fsm = new RequestFsm(function () { - return new CompletedFutureArray(['status' => 200]); - }, $this->mf); - $t = new Transaction(new Client(), new Request('GET', 'http://foo.com')); - $deferred = new Deferred(); - $t->response = new FutureResponse($deferred->promise()); - $t->state = 'complete'; - $c = false; - $t->request->getEmitter()->on('complete', function (CompleteEvent $e) use (&$c) { - $c = true; - }); - $fsm($t); - $this->assertFalse($c); - } - - public function testTransitionsThroughSuccessfulTransfer() - { - $client = new Client(); - $client->getEmitter()->attach(new Mock([new Response(200)])); - $request = $client->createRequest('GET', 'http://ewfewwef.com'); - $this->addListeners($request, $calls); - $client->send($request); - $this->assertEquals(['before', 'complete', 'end'], $calls); - } - - public function testTransitionsThroughErrorsInBefore() - { - $fsm = new RequestFsm(function () { - return new CompletedFutureArray(['status' => 200]); - }, $this->mf); - $client = new Client(); - $request = $client->createRequest('GET', 'http://ewfewwef.com'); - $t = new Transaction($client, $request); - $calls = []; - $this->addListeners($t->request, $calls); - $t->request->getEmitter()->on('before', function (BeforeEvent $e) { - throw new \Exception('foo'); - }); - try { - $fsm($t); - $this->fail('did not throw'); - } catch (RequestException $e) { - $this->assertContains('foo', $t->exception->getMessage()); - $this->assertEquals(['before', 'error', 'end'], $calls); - } - } - - public function testTransitionsThroughErrorsInComplete() - { - $client = new Client(); - $client->getEmitter()->attach(new Mock([new Response(200)])); - $request = $client->createRequest('GET', 'http://ewfewwef.com'); - $this->addListeners($request, $calls); - $request->getEmitter()->once('complete', function (CompleteEvent $e) { - throw new \Exception('foo'); - }); - try { - $client->send($request); - $this->fail('did not throw'); - } catch (RequestException $e) { - $this->assertContains('foo', $e->getMessage()); - $this->assertEquals(['before', 'complete', 'error', 'end'], $calls); - } - } - - public function testTransitionsThroughErrorInterception() - { - $fsm = new RequestFsm(function () { - return new CompletedFutureArray(['status' => 404]); - }, $this->mf); - $client = new Client(); - $request = $client->createRequest('GET', 'http://ewfewwef.com'); - $t = new Transaction($client, $request); - $calls = []; - $this->addListeners($t->request, $calls); - $t->request->getEmitter()->on('error', function (ErrorEvent $e) { - $e->intercept(new Response(200)); - }); - $fsm($t); - $this->assertEquals(200, $t->response->getStatusCode()); - $this->assertNull($t->exception); - $this->assertEquals(['before', 'complete', 'error', 'complete', 'end'], $calls); - } - - private function addListeners(RequestInterface $request, &$calls) - { - $request->getEmitter()->on('before', function (BeforeEvent $e) use (&$calls) { - $calls[] = 'before'; - }, RequestEvents::EARLY); - $request->getEmitter()->on('complete', function (CompleteEvent $e) use (&$calls) { - $calls[] = 'complete'; - }, RequestEvents::EARLY); - $request->getEmitter()->on('error', function (ErrorEvent $e) use (&$calls) { - $calls[] = 'error'; - }, RequestEvents::EARLY); - $request->getEmitter()->on('end', function (EndEvent $e) use (&$calls) { - $calls[] = 'end'; - }, RequestEvents::EARLY); - } - - /** - * @expectedException \GuzzleHttp\Exception\RequestException - * @expectedExceptionMessage Too many state transitions - */ - public function testDetectsInfiniteLoops() - { - $client = new Client([ - 'fsm' => $fsm = new RequestFsm( - function () { - return new CompletedFutureArray(['status' => 200]); - }, - new MessageFactory(), - 3 - ) - ]); - $request = $client->createRequest('GET', 'http://foo.com:123'); - $request->getEmitter()->on('before', function () { - throw new \Exception('foo'); - }); - $request->getEmitter()->on('error', function ($e) { - $e->retry(); - }); - $client->send($request); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/tests/RingBridgeTest.php b/core/vendor/guzzlehttp/guzzle/tests/RingBridgeTest.php deleted file mode 100644 index dc26a42..0000000 --- a/core/vendor/guzzlehttp/guzzle/tests/RingBridgeTest.php +++ /dev/null @@ -1,195 +0,0 @@ - 'hello' - ], $stream); - $request->getConfig()->set('foo', 'bar'); - $trans = new Transaction(new Client(), $request); - $factory = new MessageFactory(); - $fsm = new RequestFsm(function () {}, new MessageFactory()); - $r = RingBridge::prepareRingRequest($trans, $factory, $fsm); - $this->assertEquals('http', $r['scheme']); - $this->assertEquals('1.1', $r['version']); - $this->assertEquals('GET', $r['http_method']); - $this->assertEquals('http://httpbin.org/get?a=b', $r['url']); - $this->assertEquals('/get', $r['uri']); - $this->assertEquals('a=b', $r['query_string']); - $this->assertEquals([ - 'Host' => ['httpbin.org'], - 'test' => ['hello'] - ], $r['headers']); - $this->assertSame($stream, $r['body']); - $this->assertEquals(['foo' => 'bar'], $r['client']); - $this->assertFalse($r['future']); - } - - public function testCreatesRingRequestsWithNullQueryString() - { - $request = new Request('GET', 'http://httpbin.org'); - $trans = new Transaction(new Client(), $request); - $factory = new MessageFactory(); - $fsm = new RequestFsm(function () {}, new MessageFactory()); - $r = RingBridge::prepareRingRequest($trans, $factory, $fsm); - $this->assertNull($r['query_string']); - $this->assertEquals('/', $r['uri']); - $this->assertEquals(['Host' => ['httpbin.org']], $r['headers']); - $this->assertNull($r['body']); - $this->assertEquals([], $r['client']); - } - - public function testAddsProgress() - { - Server::enqueue([new Response(200)]); - $client = new Client(['base_url' => Server::$url]); - $request = $client->createRequest('GET'); - $called = false; - $request->getEmitter()->on( - 'progress', - function (ProgressEvent $e) use (&$called) { - $called = true; - } - ); - $this->assertEquals(200, $client->send($request)->getStatusCode()); - $this->assertTrue($called); - } - - public function testGetsResponseProtocolVersionAndEffectiveUrlAndReason() - { - $client = new Client([ - 'handler' => new MockHandler([ - 'status' => 200, - 'reason' => 'test', - 'headers' => [], - 'version' => '1.0', - 'effective_url' => 'http://foo.com' - ]) - ]); - $request = $client->createRequest('GET', 'http://foo.com'); - $response = $client->send($request); - $this->assertEquals('1.0', $response->getProtocolVersion()); - $this->assertEquals('http://foo.com', $response->getEffectiveUrl()); - $this->assertEquals('test', $response->getReasonPhrase()); - } - - public function testGetsStreamFromResponse() - { - $res = fopen('php://temp', 'r+'); - fwrite($res, 'foo'); - rewind($res); - $client = new Client([ - 'handler' => new MockHandler([ - 'status' => 200, - 'headers' => [], - 'body' => $res - ]) - ]); - $request = $client->createRequest('GET', 'http://foo.com'); - $response = $client->send($request); - $this->assertEquals('foo', (string) $response->getBody()); - } - - public function testEmitsErrorEventOnError() - { - $client = new Client(['base_url' => 'http://127.0.0.1:123']); - $request = $client->createRequest('GET'); - $called = false; - $request->getEmitter()->on('error', function () use (&$called) { - $called = true; - }); - $request->getConfig()['timeout'] = 0.001; - $request->getConfig()['connect_timeout'] = 0.001; - try { - $client->send($request); - $this->fail('did not throw'); - } catch (RequestException $e) { - $this->assertSame($request, $e->getRequest()); - $this->assertContains('cURL error', $e->getMessage()); - $this->assertTrue($called); - } - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testValidatesRingRequest() - { - RingBridge::fromRingRequest([]); - } - - public function testCreatesRequestFromRing() - { - $request = RingBridge::fromRingRequest([ - 'http_method' => 'GET', - 'uri' => '/', - 'headers' => [ - 'foo' => ['bar'], - 'host' => ['foo.com'] - ], - 'body' => 'test', - 'version' => '1.0' - ]); - $this->assertEquals('GET', $request->getMethod()); - $this->assertEquals('http://foo.com/', $request->getUrl()); - $this->assertEquals('1.0', $request->getProtocolVersion()); - $this->assertEquals('test', (string) $request->getBody()); - $this->assertEquals('bar', $request->getHeader('foo')); - } - - public function testCanInterceptException() - { - $client = new Client(['base_url' => 'http://127.0.0.1:123']); - $request = $client->createRequest('GET'); - $called = false; - $request->getEmitter()->on( - 'error', - function (ErrorEvent $e) use (&$called) { - $called = true; - $e->intercept(new Response(200)); - } - ); - $request->getConfig()['timeout'] = 0.001; - $request->getConfig()['connect_timeout'] = 0.001; - $this->assertEquals(200, $client->send($request)->getStatusCode()); - $this->assertTrue($called); - } - - public function testCreatesLongException() - { - $r = new Request('GET', 'http://www.google.com'); - $e = RingBridge::getNoRingResponseException($r); - $this->assertInstanceOf('GuzzleHttp\Exception\RequestException', $e); - $this->assertSame($r, $e->getRequest()); - } - - public function testEnsuresResponseOrExceptionWhenCompletingResponse() - { - $trans = new Transaction(new Client(), new Request('GET', 'http://f.co')); - $f = new MessageFactory(); - $fsm = new RequestFsm(function () {}, new MessageFactory()); - try { - RingBridge::completeRingResponse($trans, [], $f, $fsm); - } catch (RequestException $e) { - $this->assertSame($trans->request, $e->getRequest()); - $this->assertContains('RingPHP', $e->getMessage()); - } - } -} diff --git a/core/vendor/guzzlehttp/guzzle/tests/Server.php b/core/vendor/guzzlehttp/guzzle/tests/Server.php deleted file mode 100644 index 1de20e3..0000000 --- a/core/vendor/guzzlehttp/guzzle/tests/Server.php +++ /dev/null @@ -1,107 +0,0 @@ -fromMessage($response); - } elseif (!($response instanceof ResponseInterface)) { - throw new \Exception('Responses must be strings or Responses'); - } - $data[] = self::convertResponse($response); - } - - TestServer::enqueue($data); - } - - /** - * Get all of the received requests - * - * @param bool $hydrate Set to TRUE to turn the messages into - * actual {@see RequestInterface} objects. If $hydrate is FALSE, - * requests will be returned as strings. - * - * @return array - * @throws \RuntimeException - */ - public static function received($hydrate = false) - { - $response = TestServer::received(); - - if ($hydrate) { - $c = new Client(); - $factory = new MessageFactory(); - $response = array_map(function($message) use ($factory, $c) { - return RingBridge::fromRingRequest($message); - }, $response); - } - - return $response; - } - - public static function flush() - { - TestServer::flush(); - } - - public static function stop() - { - TestServer::stop(); - } - - public static function wait($maxTries = 5) - { - TestServer::wait($maxTries); - } - - public static function start() - { - TestServer::start(); - } - - private static function convertResponse(Response $response) - { - $headers = array_map(function ($h) { - return implode(', ', $h); - }, $response->getHeaders()); - - return [ - 'status' => $response->getStatusCode(), - 'reason' => $response->getReasonPhrase(), - 'headers' => $headers, - 'body' => base64_encode((string) $response->getBody()) - ]; - } -} diff --git a/core/vendor/guzzlehttp/guzzle/tests/Subscriber/CookieTest.php b/core/vendor/guzzlehttp/guzzle/tests/Subscriber/CookieTest.php deleted file mode 100644 index bc17e2d..0000000 --- a/core/vendor/guzzlehttp/guzzle/tests/Subscriber/CookieTest.php +++ /dev/null @@ -1,74 +0,0 @@ -getMockBuilder('GuzzleHttp\Cookie\CookieJar') - ->setMethods(array('extractCookies')) - ->getMock(); - - $mock->expects($this->exactly(1)) - ->method('extractCookies') - ->with($request, $response); - - $plugin = new Cookie($mock); - $t = new Transaction(new Client(), $request); - $t->response = $response; - $plugin->onComplete(new CompleteEvent($t)); - } - - public function testProvidesCookieJar() - { - $jar = new CookieJar(); - $plugin = new Cookie($jar); - $this->assertSame($jar, $plugin->getCookieJar()); - } - - public function testCookiesAreExtractedFromRedirectResponses() - { - $jar = new CookieJar(); - $cookie = new Cookie($jar); - $history = new History(); - $mock = new Mock([ - "HTTP/1.1 302 Moved Temporarily\r\n" . - "Set-Cookie: test=583551; Domain=www.foo.com; Expires=Wednesday, 23-Mar-2050 19:49:45 GMT; Path=/\r\n" . - "Location: /redirect\r\n\r\n", - "HTTP/1.1 200 OK\r\n" . - "Content-Length: 0\r\n\r\n", - "HTTP/1.1 200 OK\r\n" . - "Content-Length: 0\r\n\r\n" - ]); - $client = new Client(['base_url' => 'http://www.foo.com']); - $client->getEmitter()->attach($cookie); - $client->getEmitter()->attach($mock); - $client->getEmitter()->attach($history); - - $client->get(); - $request = $client->createRequest('GET', '/'); - $client->send($request); - - $this->assertEquals('test=583551', $request->getHeader('Cookie')); - $requests = $history->getRequests(); - // Confirm subsequent requests have the cookie. - $this->assertEquals('test=583551', $requests[2]->getHeader('Cookie')); - // Confirm the redirected request has the cookie. - $this->assertEquals('test=583551', $requests[1]->getHeader('Cookie')); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/tests/Subscriber/HistoryTest.php b/core/vendor/guzzlehttp/guzzle/tests/Subscriber/HistoryTest.php deleted file mode 100644 index d28e301..0000000 --- a/core/vendor/guzzlehttp/guzzle/tests/Subscriber/HistoryTest.php +++ /dev/null @@ -1,140 +0,0 @@ -response = $response; - $e = new RequestException('foo', $request, $response); - $ev = new ErrorEvent($t, $e); - $h = new History(2); - $h->onError($ev); - // Only tracks when no response is present - $this->assertEquals([], $h->getRequests()); - } - - public function testLogsConnectionErrors() - { - $request = new Request('GET', '/'); - $t = new Transaction(new Client(), $request); - $e = new RequestException('foo', $request); - $ev = new ErrorEvent($t, $e); - $h = new History(); - $h->onError($ev); - $this->assertEquals([$request], $h->getRequests()); - } - - public function testMaintainsLimitValue() - { - $request = new Request('GET', '/'); - $response = new Response(200); - $t = new Transaction(new Client(), $request); - $t->response = $response; - $ev = new CompleteEvent($t); - $h = new History(2); - $h->onComplete($ev); - $h->onComplete($ev); - $h->onComplete($ev); - $this->assertEquals(2, count($h)); - $this->assertSame($request, $h->getLastRequest()); - $this->assertSame($response, $h->getLastResponse()); - foreach ($h as $trans) { - $this->assertInstanceOf('GuzzleHttp\Message\RequestInterface', $trans['request']); - $this->assertInstanceOf('GuzzleHttp\Message\ResponseInterface', $trans['response']); - } - return $h; - } - - /** - * @depends testMaintainsLimitValue - */ - public function testClearsHistory($h) - { - $this->assertEquals(2, count($h)); - $h->clear(); - $this->assertEquals(0, count($h)); - } - - public function testWorksWithMock() - { - $client = new Client(['base_url' => 'http://localhost/']); - $h = new History(); - $client->getEmitter()->attach($h); - $mock = new Mock([new Response(200), new Response(201), new Response(202)]); - $client->getEmitter()->attach($mock); - $request = $client->createRequest('GET', '/'); - $client->send($request); - $request->setMethod('PUT'); - $client->send($request); - $request->setMethod('POST'); - $client->send($request); - $this->assertEquals(3, count($h)); - - $result = implode("\n", array_map(function ($line) { - return strpos($line, 'User-Agent') === 0 - ? 'User-Agent:' - : trim($line); - }, explode("\n", $h))); - - $this->assertEquals("> GET / HTTP/1.1 -Host: localhost -User-Agent: - -< HTTP/1.1 200 OK - -> PUT / HTTP/1.1 -Host: localhost -User-Agent: - -< HTTP/1.1 201 Created - -> POST / HTTP/1.1 -Host: localhost -User-Agent: - -< HTTP/1.1 202 Accepted -", $result); - } - - public function testCanCastToString() - { - $client = new Client(['base_url' => 'http://localhost/']); - $h = new History(); - $client->getEmitter()->attach($h); - - $mock = new Mock(array( - new Response(301, array('Location' => '/redirect1', 'Content-Length' => 0)), - new Response(307, array('Location' => '/redirect2', 'Content-Length' => 0)), - new Response(200, array('Content-Length' => '2'), Stream::factory('HI')) - )); - - $client->getEmitter()->attach($mock); - $request = $client->createRequest('GET', '/'); - $client->send($request); - $this->assertEquals(3, count($h)); - - $h = str_replace("\r", '', $h); - $this->assertContains("> GET / HTTP/1.1\nHost: localhost\nUser-Agent:", $h); - $this->assertContains("< HTTP/1.1 301 Moved Permanently\nLocation: /redirect1", $h); - $this->assertContains("< HTTP/1.1 307 Temporary Redirect\nLocation: /redirect2", $h); - $this->assertContains("< HTTP/1.1 200 OK\nContent-Length: 2\n\nHI", $h); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/tests/Subscriber/HttpErrorTest.php b/core/vendor/guzzlehttp/guzzle/tests/Subscriber/HttpErrorTest.php deleted file mode 100644 index b026634..0000000 --- a/core/vendor/guzzlehttp/guzzle/tests/Subscriber/HttpErrorTest.php +++ /dev/null @@ -1,60 +0,0 @@ -getEvent(); - $event->intercept(new Response(200)); - (new HttpError())->onComplete($event); - } - - /** - * @expectedException \GuzzleHttp\Exception\ClientException - */ - public function testThrowsClientExceptionOnFailure() - { - $event = $this->getEvent(); - $event->intercept(new Response(403)); - (new HttpError())->onComplete($event); - } - - /** - * @expectedException \GuzzleHttp\Exception\ServerException - */ - public function testThrowsServerExceptionOnFailure() - { - $event = $this->getEvent(); - $event->intercept(new Response(500)); - (new HttpError())->onComplete($event); - } - - private function getEvent() - { - return new CompleteEvent(new Transaction(new Client(), new Request('PUT', '/'))); - } - - /** - * @expectedException \GuzzleHttp\Exception\ClientException - */ - public function testFullTransaction() - { - $client = new Client(); - $client->getEmitter()->attach(new Mock([ - new Response(403) - ])); - $client->get('http://httpbin.org'); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/tests/Subscriber/MockTest.php b/core/vendor/guzzlehttp/guzzle/tests/Subscriber/MockTest.php deleted file mode 100644 index 5e82093..0000000 --- a/core/vendor/guzzlehttp/guzzle/tests/Subscriber/MockTest.php +++ /dev/null @@ -1,192 +0,0 @@ -promise(), - function () use ($deferred, $wait) { - $deferred->resolve($wait()); - }, - $cancel - ); - } - - public function testDescribesSubscribedEvents() - { - $mock = new Mock(); - $this->assertInternalType('array', $mock->getEvents()); - } - - public function testIsCountable() - { - $plugin = new Mock(); - $plugin->addResponse((new MessageFactory())->fromMessage("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n")); - $this->assertEquals(1, count($plugin)); - } - - public function testCanClearQueue() - { - $plugin = new Mock(); - $plugin->addResponse((new MessageFactory())->fromMessage("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n")); - $plugin->clearQueue(); - $this->assertEquals(0, count($plugin)); - } - - public function testRetrievesResponsesFromFiles() - { - $tmp = tempnam('/tmp', 'tfile'); - file_put_contents($tmp, "HTTP/1.1 201 OK\r\nContent-Length: 0\r\n\r\n"); - $plugin = new Mock(); - $plugin->addResponse($tmp); - unlink($tmp); - $this->assertEquals(1, count($plugin)); - $q = $this->readAttribute($plugin, 'queue'); - $this->assertEquals(201, $q[0]->getStatusCode()); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testThrowsExceptionWhenInvalidResponse() - { - (new Mock())->addResponse(false); - } - - public function testAddsMockResponseToRequestFromClient() - { - $response = new Response(200); - $t = new Transaction(new Client(), new Request('GET', '/')); - $m = new Mock([$response]); - $ev = new BeforeEvent($t); - $m->onBefore($ev); - $this->assertSame($response, $t->response); - } - - /** - * @expectedException \OutOfBoundsException - */ - public function testUpdateThrowsExceptionWhenEmpty() - { - $p = new Mock(); - $ev = new BeforeEvent(new Transaction(new Client(), new Request('GET', '/'))); - $p->onBefore($ev); - } - - public function testReadsBodiesFromMockedRequests() - { - $m = new Mock([new Response(200)]); - $client = new Client(['base_url' => 'http://test.com']); - $client->getEmitter()->attach($m); - $body = Stream::factory('foo'); - $client->put('/', ['body' => $body]); - $this->assertEquals(3, $body->tell()); - } - - public function testCanMockBadRequestExceptions() - { - $client = new Client(['base_url' => 'http://test.com']); - $request = $client->createRequest('GET', '/'); - $ex = new RequestException('foo', $request); - $mock = new Mock([$ex]); - $this->assertCount(1, $mock); - $request->getEmitter()->attach($mock); - - try { - $client->send($request); - $this->fail('Did not dequeue an exception'); - } catch (RequestException $e) { - $this->assertSame($e, $ex); - $this->assertSame($request, $ex->getRequest()); - } - } - - public function testCanMockFutureResponses() - { - $client = new Client(['base_url' => 'http://test.com']); - $request = $client->createRequest('GET', '/', ['future' => true]); - $response = new Response(200); - $future = self::createFuture(function () use ($response) { - return $response; - }); - $mock = new Mock([$future]); - $this->assertCount(1, $mock); - $request->getEmitter()->attach($mock); - $res = $client->send($request); - $this->assertSame($future, $res); - $this->assertFalse($this->readAttribute($res, 'isRealized')); - $this->assertSame($response, $res->wait()); - } - - public function testCanMockExceptionFutureResponses() - { - $client = new Client(['base_url' => 'http://test.com']); - $request = $client->createRequest('GET', '/', ['future' => true]); - $future = self::createFuture(function () use ($request) { - throw new RequestException('foo', $request); - }); - - $mock = new Mock([$future]); - $request->getEmitter()->attach($mock); - $response = $client->send($request); - $this->assertSame($future, $response); - $this->assertFalse($this->readAttribute($response, 'isRealized')); - - try { - $response->wait(); - $this->fail('Did not throw'); - } catch (RequestException $e) { - $this->assertContains('foo', $e->getMessage()); - } - } - - public function testCanMockFailedFutureResponses() - { - $client = new Client(['base_url' => 'http://test.com']); - $request = $client->createRequest('GET', '/', ['future' => true]); - - // The first mock will be a mocked future response. - $future = self::createFuture(function () use ($client) { - // When dereferenced, we will set a mocked response and send - // another request. - $client->get('http://httpbin.org', ['events' => [ - 'before' => function (BeforeEvent $e) { - $e->intercept(new Response(404)); - } - ]]); - }); - - $mock = new Mock([$future]); - $request->getEmitter()->attach($mock); - $response = $client->send($request); - $this->assertSame($future, $response); - $this->assertFalse($this->readAttribute($response, 'isRealized')); - - try { - $response->wait(); - $this->fail('Did not throw'); - } catch (RequestException $e) { - $this->assertEquals(404, $e->getResponse()->getStatusCode()); - } - } -} diff --git a/core/vendor/guzzlehttp/guzzle/tests/Subscriber/PrepareTest.php b/core/vendor/guzzlehttp/guzzle/tests/Subscriber/PrepareTest.php deleted file mode 100644 index d07fdb4..0000000 --- a/core/vendor/guzzlehttp/guzzle/tests/Subscriber/PrepareTest.php +++ /dev/null @@ -1,213 +0,0 @@ -getTrans(); - $s->onBefore(new BeforeEvent($t)); - $this->assertFalse($t->request->hasHeader('Expect')); - } - - public function testAppliesPostBody() - { - $s = new Prepare(); - $t = $this->getTrans(); - $p = $this->getMockBuilder('GuzzleHttp\Post\PostBody') - ->setMethods(['applyRequestHeaders']) - ->getMockForAbstractClass(); - $p->expects($this->once()) - ->method('applyRequestHeaders'); - $t->request->setBody($p); - $s->onBefore(new BeforeEvent($t)); - } - - public function testAddsExpectHeaderWithTrue() - { - $s = new Prepare(); - $t = $this->getTrans(); - $t->request->getConfig()->set('expect', true); - $t->request->setBody(Stream::factory('foo')); - $s->onBefore(new BeforeEvent($t)); - $this->assertEquals('100-Continue', $t->request->getHeader('Expect')); - } - - public function testAddsExpectHeaderBySize() - { - $s = new Prepare(); - $t = $this->getTrans(); - $t->request->getConfig()->set('expect', 2); - $t->request->setBody(Stream::factory('foo')); - $s->onBefore(new BeforeEvent($t)); - $this->assertTrue($t->request->hasHeader('Expect')); - } - - public function testDoesNotModifyExpectHeaderIfPresent() - { - $s = new Prepare(); - $t = $this->getTrans(); - $t->request->setHeader('Expect', 'foo'); - $t->request->setBody(Stream::factory('foo')); - $s->onBefore(new BeforeEvent($t)); - $this->assertEquals('foo', $t->request->getHeader('Expect')); - } - - public function testDoesAddExpectHeaderWhenSetToFalse() - { - $s = new Prepare(); - $t = $this->getTrans(); - $t->request->getConfig()->set('expect', false); - $t->request->setBody(Stream::factory('foo')); - $s->onBefore(new BeforeEvent($t)); - $this->assertFalse($t->request->hasHeader('Expect')); - } - - public function testDoesNotAddExpectHeaderBySize() - { - $s = new Prepare(); - $t = $this->getTrans(); - $t->request->getConfig()->set('expect', 10); - $t->request->setBody(Stream::factory('foo')); - $s->onBefore(new BeforeEvent($t)); - $this->assertFalse($t->request->hasHeader('Expect')); - } - - public function testAddsExpectHeaderForNonSeekable() - { - $s = new Prepare(); - $t = $this->getTrans(); - $t->request->setBody(new NoSeekStream(Stream::factory('foo'))); - $s->onBefore(new BeforeEvent($t)); - $this->assertTrue($t->request->hasHeader('Expect')); - } - - public function testRemovesContentLengthWhenSendingWithChunked() - { - $s = new Prepare(); - $t = $this->getTrans(); - $t->request->setBody(Stream::factory('foo')); - $t->request->setHeader('Transfer-Encoding', 'chunked'); - $s->onBefore(new BeforeEvent($t)); - $this->assertFalse($t->request->hasHeader('Content-Length')); - } - - public function testUsesProvidedContentLengthAndRemovesXferEncoding() - { - $s = new Prepare(); - $t = $this->getTrans(); - $t->request->setBody(Stream::factory('foo')); - $t->request->setHeader('Content-Length', '3'); - $t->request->setHeader('Transfer-Encoding', 'chunked'); - $s->onBefore(new BeforeEvent($t)); - $this->assertEquals(3, $t->request->getHeader('Content-Length')); - $this->assertFalse($t->request->hasHeader('Transfer-Encoding')); - } - - public function testSetsContentTypeIfPossibleFromStream() - { - $body = $this->getMockBody(); - $sub = new Prepare(); - $t = $this->getTrans(); - $t->request->setBody($body); - $sub->onBefore(new BeforeEvent($t)); - $this->assertEquals( - 'image/jpeg', - $t->request->getHeader('Content-Type') - ); - $this->assertEquals(4, $t->request->getHeader('Content-Length')); - } - - public function testDoesNotOverwriteExistingContentType() - { - $s = new Prepare(); - $t = $this->getTrans(); - $t->request->setBody($this->getMockBody()); - $t->request->setHeader('Content-Type', 'foo/baz'); - $s->onBefore(new BeforeEvent($t)); - $this->assertEquals( - 'foo/baz', - $t->request->getHeader('Content-Type') - ); - } - - public function testSetsContentLengthIfPossible() - { - $s = new Prepare(); - $t = $this->getTrans(); - $t->request->setBody($this->getMockBody()); - $s->onBefore(new BeforeEvent($t)); - $this->assertEquals(4, $t->request->getHeader('Content-Length')); - } - - public function testSetsTransferEncodingChunkedIfNeeded() - { - $r = new Request('PUT', '/'); - $s = $this->getMockBuilder('GuzzleHttp\Stream\StreamInterface') - ->setMethods(['getSize']) - ->getMockForAbstractClass(); - $s->expects($this->exactly(2)) - ->method('getSize') - ->will($this->returnValue(null)); - $r->setBody($s); - $t = $this->getTrans($r); - $s = new Prepare(); - $s->onBefore(new BeforeEvent($t)); - $this->assertEquals('chunked', $r->getHeader('Transfer-Encoding')); - } - - public function testContentLengthIntegrationTest() - { - Server::flush(); - Server::enqueue([new Response(200)]); - $client = new Client(['base_url' => Server::$url]); - $this->assertEquals(200, $client->put('/', [ - 'body' => 'test' - ])->getStatusCode()); - $request = Server::received(true)[0]; - $this->assertEquals('PUT', $request->getMethod()); - $this->assertEquals('4', $request->getHeader('Content-Length')); - $this->assertEquals('test', (string) $request->getBody()); - } - - private function getTrans($request = null) - { - return new Transaction( - new Client(), - $request ?: new Request('PUT', '/') - ); - } - - /** - * @return \GuzzleHttp\Stream\StreamInterface - */ - private function getMockBody() - { - $s = $this->getMockBuilder('GuzzleHttp\Stream\MetadataStreamInterface') - ->setMethods(['getMetadata', 'getSize']) - ->getMockForAbstractClass(); - $s->expects($this->any()) - ->method('getMetadata') - ->with('uri') - ->will($this->returnValue('/foo/baz/bar.jpg')); - $s->expects($this->exactly(2)) - ->method('getSize') - ->will($this->returnValue(4)); - - return $s; - } -} diff --git a/core/vendor/guzzlehttp/guzzle/tests/Subscriber/RedirectTest.php b/core/vendor/guzzlehttp/guzzle/tests/Subscriber/RedirectTest.php deleted file mode 100644 index 293cfc2..0000000 --- a/core/vendor/guzzlehttp/guzzle/tests/Subscriber/RedirectTest.php +++ /dev/null @@ -1,288 +0,0 @@ -addMultiple([ - "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect1\r\nContent-Length: 0\r\n\r\n", - "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect2\r\nContent-Length: 0\r\n\r\n", - "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n", - ]); - - $client = new Client(['base_url' => 'http://test.com']); - $client->getEmitter()->attach($history); - $client->getEmitter()->attach($mock); - - $request = $client->createRequest('GET', '/foo'); - // Ensure "end" is called only once - $called = 0; - $request->getEmitter()->on('end', function () use (&$called) { - $called++; - }); - $response = $client->send($request); - - $this->assertEquals(200, $response->getStatusCode()); - $this->assertContains('/redirect2', $response->getEffectiveUrl()); - - // Ensure that two requests were sent - $requests = $history->getRequests(true); - - $this->assertEquals('/foo', $requests[0]->getPath()); - $this->assertEquals('GET', $requests[0]->getMethod()); - $this->assertEquals('/redirect1', $requests[1]->getPath()); - $this->assertEquals('GET', $requests[1]->getMethod()); - $this->assertEquals('/redirect2', $requests[2]->getPath()); - $this->assertEquals('GET', $requests[2]->getMethod()); - - $this->assertEquals(1, $called); - } - - /** - * @expectedException \GuzzleHttp\Exception\TooManyRedirectsException - * @expectedExceptionMessage Will not follow more than - */ - public function testCanLimitNumberOfRedirects() - { - $mock = new Mock([ - "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect1\r\nContent-Length: 0\r\n\r\n", - "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect2\r\nContent-Length: 0\r\n\r\n", - "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect3\r\nContent-Length: 0\r\n\r\n", - "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect4\r\nContent-Length: 0\r\n\r\n", - "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect5\r\nContent-Length: 0\r\n\r\n", - "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect6\r\nContent-Length: 0\r\n\r\n" - ]); - $client = new Client(); - $client->getEmitter()->attach($mock); - $client->get('http://www.example.com/foo'); - } - - public function testDefaultBehaviorIsToRedirectWithGetForEntityEnclosingRequests() - { - $h = new History(); - $mock = new Mock([ - "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect\r\nContent-Length: 0\r\n\r\n", - "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect\r\nContent-Length: 0\r\n\r\n", - "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n", - ]); - $client = new Client(); - $client->getEmitter()->attach($mock); - $client->getEmitter()->attach($h); - $client->post('http://test.com/foo', [ - 'headers' => ['X-Baz' => 'bar'], - 'body' => 'testing' - ]); - - $requests = $h->getRequests(true); - $this->assertEquals('POST', $requests[0]->getMethod()); - $this->assertEquals('GET', $requests[1]->getMethod()); - $this->assertEquals('bar', (string) $requests[1]->getHeader('X-Baz')); - $this->assertEquals('GET', $requests[2]->getMethod()); - } - - public function testCanRedirectWithStrictRfcCompliance() - { - $h = new History(); - $mock = new Mock([ - "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect\r\nContent-Length: 0\r\n\r\n", - "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect\r\nContent-Length: 0\r\n\r\n", - "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n", - ]); - $client = new Client(['base_url' => 'http://test.com']); - $client->getEmitter()->attach($mock); - $client->getEmitter()->attach($h); - $client->post('/foo', [ - 'headers' => ['X-Baz' => 'bar'], - 'body' => 'testing', - 'allow_redirects' => ['max' => 10, 'strict' => true] - ]); - - $requests = $h->getRequests(true); - $this->assertEquals('POST', $requests[0]->getMethod()); - $this->assertEquals('POST', $requests[1]->getMethod()); - $this->assertEquals('bar', (string) $requests[1]->getHeader('X-Baz')); - $this->assertEquals('POST', $requests[2]->getMethod()); - } - - public function testRewindsStreamWhenRedirectingIfNeeded() - { - $h = new History(); - $mock = new Mock([ - "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect\r\nContent-Length: 0\r\n\r\n", - "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n", - ]); - $client = new Client(['base_url' => 'http://test.com']); - $client->getEmitter()->attach($mock); - $client->getEmitter()->attach($h); - - $body = $this->getMockBuilder('GuzzleHttp\Stream\StreamInterface') - ->setMethods(['seek', 'read', 'eof', 'tell']) - ->getMockForAbstractClass(); - $body->expects($this->once())->method('tell')->will($this->returnValue(1)); - $body->expects($this->once())->method('seek')->will($this->returnValue(true)); - $body->expects($this->any())->method('eof')->will($this->returnValue(true)); - $body->expects($this->any())->method('read')->will($this->returnValue('foo')); - $client->post('/foo', [ - 'body' => $body, - 'allow_redirects' => ['max' => 5, 'strict' => true] - ]); - } - - /** - * @expectedException \GuzzleHttp\Exception\CouldNotRewindStreamException - * @expectedExceptionMessage Unable to rewind the non-seekable request body after redirecting - */ - public function testThrowsExceptionWhenStreamCannotBeRewound() - { - $h = new History(); - $mock = new Mock([ - "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect\r\nContent-Length: 0\r\n\r\n", - "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n", - ]); - $client = new Client(); - $client->getEmitter()->attach($mock); - $client->getEmitter()->attach($h); - - $body = $this->getMockBuilder('GuzzleHttp\Stream\StreamInterface') - ->setMethods(['seek', 'read', 'eof', 'tell']) - ->getMockForAbstractClass(); - $body->expects($this->once())->method('tell')->will($this->returnValue(1)); - $body->expects($this->once())->method('seek')->will($this->returnValue(false)); - $body->expects($this->any())->method('eof')->will($this->returnValue(true)); - $body->expects($this->any())->method('read')->will($this->returnValue('foo')); - $client->post('http://example.com/foo', [ - 'body' => $body, - 'allow_redirects' => ['max' => 10, 'strict' => true] - ]); - } - - public function testRedirectsCanBeDisabledPerRequest() - { - $client = new Client(['base_url' => 'http://test.com']); - $client->getEmitter()->attach(new Mock([ - "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect\r\nContent-Length: 0\r\n\r\n", - "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n", - ])); - $response = $client->put('/', ['body' => 'test', 'allow_redirects' => false]); - $this->assertEquals(301, $response->getStatusCode()); - } - - public function testCanRedirectWithNoLeadingSlashAndQuery() - { - $h = new History(); - $client = new Client(['base_url' => 'http://www.foo.com']); - $client->getEmitter()->attach(new Mock([ - "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect?foo=bar\r\nContent-Length: 0\r\n\r\n", - "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n", - ])); - $client->getEmitter()->attach($h); - $client->get('?foo=bar'); - $requests = $h->getRequests(true); - $this->assertEquals('http://www.foo.com?foo=bar', $requests[0]->getUrl()); - $this->assertEquals('http://www.foo.com/redirect?foo=bar', $requests[1]->getUrl()); - } - - public function testHandlesRedirectsWithSpacesProperly() - { - $client = new Client(['base_url' => 'http://www.foo.com']); - $client->getEmitter()->attach(new Mock([ - "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect 1\r\nContent-Length: 0\r\n\r\n", - "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n" - ])); - $h = new History(); - $client->getEmitter()->attach($h); - $client->get('/foo'); - $reqs = $h->getRequests(true); - $this->assertEquals('/redirect%201', $reqs[1]->getResource()); - } - - public function testAddsRefererWhenPossible() - { - $client = new Client(['base_url' => 'http://www.foo.com']); - $client->getEmitter()->attach(new Mock([ - "HTTP/1.1 301 Moved Permanently\r\nLocation: /bar\r\nContent-Length: 0\r\n\r\n", - "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n" - ])); - $h = new History(); - $client->getEmitter()->attach($h); - $client->get('/foo', ['allow_redirects' => ['max' => 5, 'referer' => true]]); - $reqs = $h->getRequests(true); - $this->assertEquals('http://www.foo.com/foo', $reqs[1]->getHeader('Referer')); - } - - public function testDoesNotAddRefererWhenChangingProtocols() - { - $client = new Client(['base_url' => 'https://www.foo.com']); - $client->getEmitter()->attach(new Mock([ - "HTTP/1.1 301 Moved Permanently\r\n" - . "Location: http://www.foo.com/foo\r\n" - . "Content-Length: 0\r\n\r\n", - "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n" - ])); - $h = new History(); - $client->getEmitter()->attach($h); - $client->get('/foo', ['allow_redirects' => ['max' => 5, 'referer' => true]]); - $reqs = $h->getRequests(true); - $this->assertFalse($reqs[1]->hasHeader('Referer')); - } - - public function testRedirectsWithGetOn303() - { - $h = new History(); - $mock = new Mock([ - "HTTP/1.1 303 Moved Permanently\r\nLocation: /redirect\r\nContent-Length: 0\r\n\r\n", - "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n", - ]); - $client = new Client(); - $client->getEmitter()->attach($mock); - $client->getEmitter()->attach($h); - $client->post('http://test.com/foo', ['body' => 'testing']); - $requests = $h->getRequests(true); - $this->assertEquals('POST', $requests[0]->getMethod()); - $this->assertEquals('GET', $requests[1]->getMethod()); - } - - public function testRelativeLinkBasedLatestRequest() - { - $client = new Client(['base_url' => 'http://www.foo.com']); - $client->getEmitter()->attach(new Mock([ - "HTTP/1.1 301 Moved Permanently\r\nLocation: http://www.bar.com\r\nContent-Length: 0\r\n\r\n", - "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect\r\nContent-Length: 0\r\n\r\n", - "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n" - ])); - $response = $client->get('/'); - $this->assertEquals( - 'http://www.bar.com/redirect', - $response->getEffectiveUrl() - ); - } - - /** - * @expectedException \GuzzleHttp\Exception\BadResponseException - * @expectedExceptionMessage Redirect URL, https://foo.com/redirect2, does not use one of the allowed redirect protocols: http - */ - public function testThrowsWhenRedirectingToInvalidUrlProtocol() - { - $mock = new Mock([ - "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect1\r\nContent-Length: 0\r\n\r\n", - "HTTP/1.1 301 Moved Permanently\r\nLocation: https://foo.com/redirect2\r\nContent-Length: 0\r\n\r\n" - ]); - $client = new Client(); - $client->getEmitter()->attach($mock); - $client->get('http://www.example.com/foo', [ - 'allow_redirects' => [ - 'protocols' => ['http'] - ] - ]); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/tests/TransactionTest.php b/core/vendor/guzzlehttp/guzzle/tests/TransactionTest.php deleted file mode 100644 index 42965b1..0000000 --- a/core/vendor/guzzlehttp/guzzle/tests/TransactionTest.php +++ /dev/null @@ -1,22 +0,0 @@ -assertSame($client, $t->client); - $this->assertSame($request, $t->request); - $response = new Response(200); - $t->response = $response; - $this->assertSame($response, $t->response); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/tests/UriTemplateTest.php b/core/vendor/guzzlehttp/guzzle/tests/UriTemplateTest.php deleted file mode 100644 index 3f7a7f0..0000000 --- a/core/vendor/guzzlehttp/guzzle/tests/UriTemplateTest.php +++ /dev/null @@ -1,202 +0,0 @@ - 'value', - 'hello' => 'Hello World!', - 'empty' => '', - 'path' => '/foo/bar', - 'x' => '1024', - 'y' => '768', - 'null' => null, - 'list' => array('red', 'green', 'blue'), - 'keys' => array( - "semi" => ';', - "dot" => '.', - "comma" => ',' - ), - 'empty_keys' => array(), - ); - - return array_map(function ($t) use ($params) { - $t[] = $params; - return $t; - }, array( - array('foo', 'foo'), - array('{var}', 'value'), - array('{hello}', 'Hello%20World%21'), - array('{+var}', 'value'), - array('{+hello}', 'Hello%20World!'), - array('{+path}/here', '/foo/bar/here'), - array('here?ref={+path}', 'here?ref=/foo/bar'), - array('X{#var}', 'X#value'), - array('X{#hello}', 'X#Hello%20World!'), - array('map?{x,y}', 'map?1024,768'), - array('{x,hello,y}', '1024,Hello%20World%21,768'), - array('{+x,hello,y}', '1024,Hello%20World!,768'), - array('{+path,x}/here', '/foo/bar,1024/here'), - array('{#x,hello,y}', '#1024,Hello%20World!,768'), - array('{#path,x}/here', '#/foo/bar,1024/here'), - array('X{.var}', 'X.value'), - array('X{.x,y}', 'X.1024.768'), - array('{/var}', '/value'), - array('{/var,x}/here', '/value/1024/here'), - array('{;x,y}', ';x=1024;y=768'), - array('{;x,y,empty}', ';x=1024;y=768;empty'), - array('{?x,y}', '?x=1024&y=768'), - array('{?x,y,empty}', '?x=1024&y=768&empty='), - array('?fixed=yes{&x}', '?fixed=yes&x=1024'), - array('{&x,y,empty}', '&x=1024&y=768&empty='), - array('{var:3}', 'val'), - array('{var:30}', 'value'), - array('{list}', 'red,green,blue'), - array('{list*}', 'red,green,blue'), - array('{keys}', 'semi,%3B,dot,.,comma,%2C'), - array('{keys*}', 'semi=%3B,dot=.,comma=%2C'), - array('{+path:6}/here', '/foo/b/here'), - array('{+list}', 'red,green,blue'), - array('{+list*}', 'red,green,blue'), - array('{+keys}', 'semi,;,dot,.,comma,,'), - array('{+keys*}', 'semi=;,dot=.,comma=,'), - array('{#path:6}/here', '#/foo/b/here'), - array('{#list}', '#red,green,blue'), - array('{#list*}', '#red,green,blue'), - array('{#keys}', '#semi,;,dot,.,comma,,'), - array('{#keys*}', '#semi=;,dot=.,comma=,'), - array('X{.var:3}', 'X.val'), - array('X{.list}', 'X.red,green,blue'), - array('X{.list*}', 'X.red.green.blue'), - array('X{.keys}', 'X.semi,%3B,dot,.,comma,%2C'), - array('X{.keys*}', 'X.semi=%3B.dot=..comma=%2C'), - array('{/var:1,var}', '/v/value'), - array('{/list}', '/red,green,blue'), - array('{/list*}', '/red/green/blue'), - array('{/list*,path:4}', '/red/green/blue/%2Ffoo'), - array('{/keys}', '/semi,%3B,dot,.,comma,%2C'), - array('{/keys*}', '/semi=%3B/dot=./comma=%2C'), - array('{;hello:5}', ';hello=Hello'), - array('{;list}', ';list=red,green,blue'), - array('{;list*}', ';list=red;list=green;list=blue'), - array('{;keys}', ';keys=semi,%3B,dot,.,comma,%2C'), - array('{;keys*}', ';semi=%3B;dot=.;comma=%2C'), - array('{?var:3}', '?var=val'), - array('{?list}', '?list=red,green,blue'), - array('{?list*}', '?list=red&list=green&list=blue'), - array('{?keys}', '?keys=semi,%3B,dot,.,comma,%2C'), - array('{?keys*}', '?semi=%3B&dot=.&comma=%2C'), - array('{&var:3}', '&var=val'), - array('{&list}', '&list=red,green,blue'), - array('{&list*}', '&list=red&list=green&list=blue'), - array('{&keys}', '&keys=semi,%3B,dot,.,comma,%2C'), - array('{&keys*}', '&semi=%3B&dot=.&comma=%2C'), - array('{.null}', ''), - array('{.null,var}', '.value'), - array('X{.empty_keys*}', 'X'), - array('X{.empty_keys}', 'X'), - // Test that missing expansions are skipped - array('test{&missing*}', 'test'), - // Test that multiple expansions can be set - array('http://{var}/{var:2}{?keys*}', 'http://value/va?semi=%3B&dot=.&comma=%2C'), - // Test more complex query string stuff - array('http://www.test.com{+path}{?var,keys*}', 'http://www.test.com/foo/bar?var=value&semi=%3B&dot=.&comma=%2C') - )); - } - - /** - * @dataProvider templateProvider - */ - public function testExpandsUriTemplates($template, $expansion, $params) - { - $uri = new UriTemplate($template); - $this->assertEquals($expansion, $uri->expand($template, $params)); - } - - public function expressionProvider() - { - return array( - array( - '{+var*}', array( - 'operator' => '+', - 'values' => array( - array('value' => 'var', 'modifier' => '*') - ) - ), - ), - array( - '{?keys,var,val}', array( - 'operator' => '?', - 'values' => array( - array('value' => 'keys', 'modifier' => ''), - array('value' => 'var', 'modifier' => ''), - array('value' => 'val', 'modifier' => '') - ) - ), - ), - array( - '{+x,hello,y}', array( - 'operator' => '+', - 'values' => array( - array('value' => 'x', 'modifier' => ''), - array('value' => 'hello', 'modifier' => ''), - array('value' => 'y', 'modifier' => '') - ) - ) - ) - ); - } - - /** - * @dataProvider expressionProvider - */ - public function testParsesExpressions($exp, $data) - { - $template = new UriTemplate($exp); - - // Access the config object - $class = new \ReflectionClass($template); - $method = $class->getMethod('parseExpression'); - $method->setAccessible(true); - - $exp = substr($exp, 1, -1); - $this->assertEquals($data, $method->invokeArgs($template, array($exp))); - } - - /** - * @ticket https://github.com/guzzle/guzzle/issues/90 - */ - public function testAllowsNestedArrayExpansion() - { - $template = new UriTemplate(); - - $result = $template->expand('http://example.com{+path}{/segments}{?query,data*,foo*}', array( - 'path' => '/foo/bar', - 'segments' => array('one', 'two'), - 'query' => 'test', - 'data' => array( - 'more' => array('fun', 'ice cream') - ), - 'foo' => array( - 'baz' => array( - 'bar' => 'fizz', - 'test' => 'buzz' - ), - 'bam' => 'boo' - ) - )); - - $this->assertEquals('http://example.com/foo/bar/one,two?query=test&more%5B0%5D=fun&more%5B1%5D=ice%20cream&baz%5Bbar%5D=fizz&baz%5Btest%5D=buzz&bam=boo', $result); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/tests/UrlTest.php b/core/vendor/guzzlehttp/guzzle/tests/UrlTest.php deleted file mode 100644 index efd374c..0000000 --- a/core/vendor/guzzlehttp/guzzle/tests/UrlTest.php +++ /dev/null @@ -1,356 +0,0 @@ -assertEquals('', (string) $url); - } - - public function testPortIsDeterminedFromScheme() - { - $this->assertEquals(80, Url::fromString('http://www.test.com/')->getPort()); - $this->assertEquals(443, Url::fromString('https://www.test.com/')->getPort()); - $this->assertEquals(21, Url::fromString('ftp://www.test.com/')->getPort()); - $this->assertEquals(8192, Url::fromString('http://www.test.com:8192/')->getPort()); - $this->assertEquals(null, Url::fromString('foo://www.test.com/')->getPort()); - } - - public function testRemovesDefaultPortWhenSettingScheme() - { - $url = Url::fromString('http://www.test.com/'); - $url->setPort(80); - $url->setScheme('https'); - $this->assertEquals(443, $url->getPort()); - } - - public function testCloneCreatesNewInternalObjects() - { - $u1 = Url::fromString('http://www.test.com/'); - $u2 = clone $u1; - $this->assertNotSame($u1->getQuery(), $u2->getQuery()); - } - - public function testValidatesUrlPartsInFactory() - { - $url = Url::fromString('/index.php'); - $this->assertEquals('/index.php', (string) $url); - $this->assertFalse($url->isAbsolute()); - - $url = 'http://michael:test@test.com:80/path/123?q=abc#test'; - $u = Url::fromString($url); - $this->assertEquals('http://michael:test@test.com/path/123?q=abc#test', (string) $u); - $this->assertTrue($u->isAbsolute()); - } - - public function testAllowsFalsyUrlParts() - { - $url = Url::fromString('http://a:50/0?0#0'); - $this->assertSame('a', $url->getHost()); - $this->assertEquals(50, $url->getPort()); - $this->assertSame('/0', $url->getPath()); - $this->assertEquals('0', (string) $url->getQuery()); - $this->assertSame('0', $url->getFragment()); - $this->assertEquals('http://a:50/0?0#0', (string) $url); - - $url = Url::fromString(''); - $this->assertSame('', (string) $url); - - $url = Url::fromString('0'); - $this->assertSame('0', (string) $url); - } - - public function testBuildsRelativeUrlsWithFalsyParts() - { - $url = Url::buildUrl(['path' => '/0']); - $this->assertSame('/0', $url); - - $url = Url::buildUrl(['path' => '0']); - $this->assertSame('0', $url); - - $url = Url::buildUrl(['host' => '', 'path' => '0']); - $this->assertSame('0', $url); - } - - public function testUrlStoresParts() - { - $url = Url::fromString('http://test:pass@www.test.com:8081/path/path2/?a=1&b=2#fragment'); - $this->assertEquals('http', $url->getScheme()); - $this->assertEquals('test', $url->getUsername()); - $this->assertEquals('pass', $url->getPassword()); - $this->assertEquals('www.test.com', $url->getHost()); - $this->assertEquals(8081, $url->getPort()); - $this->assertEquals('/path/path2/', $url->getPath()); - $this->assertEquals('fragment', $url->getFragment()); - $this->assertEquals('a=1&b=2', (string) $url->getQuery()); - - $this->assertEquals(array( - 'fragment' => 'fragment', - 'host' => 'www.test.com', - 'pass' => 'pass', - 'path' => '/path/path2/', - 'port' => 8081, - 'query' => 'a=1&b=2', - 'scheme' => 'http', - 'user' => 'test' - ), $url->getParts()); - } - - public function testHandlesPathsCorrectly() - { - $url = Url::fromString('http://www.test.com'); - $this->assertEquals('', $url->getPath()); - $url->setPath('test'); - $this->assertEquals('test', $url->getPath()); - - $url->setPath('/test/123/abc'); - $this->assertEquals(array('', 'test', '123', 'abc'), $url->getPathSegments()); - - $parts = parse_url('http://www.test.com/test'); - $parts['path'] = ''; - $this->assertEquals('http://www.test.com', Url::buildUrl($parts)); - $parts['path'] = 'test'; - $this->assertEquals('http://www.test.com/test', Url::buildUrl($parts)); - } - - public function testAddsQueryIfPresent() - { - $this->assertEquals('?foo=bar', Url::buildUrl(array( - 'query' => 'foo=bar' - ))); - } - - public function testAddsToPath() - { - // Does nothing here - $url = Url::fromString('http://e.com/base?a=1'); - $url->addPath(false); - $this->assertEquals('http://e.com/base?a=1', $url); - $url = Url::fromString('http://e.com/base?a=1'); - $url->addPath(''); - $this->assertEquals('http://e.com/base?a=1', $url); - $url = Url::fromString('http://e.com/base?a=1'); - $url->addPath('/'); - $this->assertEquals('http://e.com/base?a=1', $url); - $url = Url::fromString('http://e.com/base'); - $url->addPath('0'); - $this->assertEquals('http://e.com/base/0', $url); - - $url = Url::fromString('http://e.com/base?a=1'); - $url->addPath('relative'); - $this->assertEquals('http://e.com/base/relative?a=1', $url); - $url = Url::fromString('http://e.com/base?a=1'); - $url->addPath('/relative'); - $this->assertEquals('http://e.com/base/relative?a=1', $url); - } - - /** - * URL combination data provider - * - * @return array - */ - public function urlCombineDataProvider() - { - return [ - // Specific test cases - ['http://www.example.com/', 'http://www.example.com/', 'http://www.example.com/'], - ['http://www.example.com/path', '/absolute', 'http://www.example.com/absolute'], - ['http://www.example.com/path', '/absolute?q=2', 'http://www.example.com/absolute?q=2'], - ['http://www.example.com/', '?q=1', 'http://www.example.com/?q=1'], - ['http://www.example.com/path', 'http://test.com', 'http://test.com'], - ['http://www.example.com:8080/path', 'http://test.com', 'http://test.com'], - ['http://www.example.com:8080/path', '?q=2#abc', 'http://www.example.com:8080/path?q=2#abc'], - ['http://www.example.com/path', 'http://u:a@www.example.com/', 'http://u:a@www.example.com/'], - ['/path?q=2', 'http://www.test.com/', 'http://www.test.com/path?q=2'], - ['http://api.flickr.com/services/', 'http://www.flickr.com/services/oauth/access_token', 'http://www.flickr.com/services/oauth/access_token'], - ['https://www.example.com/path', '//foo.com/abc', 'https://foo.com/abc'], - ['https://www.example.com/0/', 'relative/foo', 'https://www.example.com/0/relative/foo'], - ['', '0', '0'], - // RFC 3986 test cases - [self::RFC3986_BASE, 'g:h', 'g:h'], - [self::RFC3986_BASE, 'g', 'http://a/b/c/g'], - [self::RFC3986_BASE, './g', 'http://a/b/c/g'], - [self::RFC3986_BASE, 'g/', 'http://a/b/c/g/'], - [self::RFC3986_BASE, '/g', 'http://a/g'], - [self::RFC3986_BASE, '//g', 'http://g'], - [self::RFC3986_BASE, '?y', 'http://a/b/c/d;p?y'], - [self::RFC3986_BASE, 'g?y', 'http://a/b/c/g?y'], - [self::RFC3986_BASE, '#s', 'http://a/b/c/d;p?q#s'], - [self::RFC3986_BASE, 'g#s', 'http://a/b/c/g#s'], - [self::RFC3986_BASE, 'g?y#s', 'http://a/b/c/g?y#s'], - [self::RFC3986_BASE, ';x', 'http://a/b/c/;x'], - [self::RFC3986_BASE, 'g;x', 'http://a/b/c/g;x'], - [self::RFC3986_BASE, 'g;x?y#s', 'http://a/b/c/g;x?y#s'], - [self::RFC3986_BASE, '', self::RFC3986_BASE], - [self::RFC3986_BASE, '.', 'http://a/b/c/'], - [self::RFC3986_BASE, './', 'http://a/b/c/'], - [self::RFC3986_BASE, '..', 'http://a/b/'], - [self::RFC3986_BASE, '../', 'http://a/b/'], - [self::RFC3986_BASE, '../g', 'http://a/b/g'], - [self::RFC3986_BASE, '../..', 'http://a/'], - [self::RFC3986_BASE, '../../', 'http://a/'], - [self::RFC3986_BASE, '../../g', 'http://a/g'], - [self::RFC3986_BASE, '../../../g', 'http://a/g'], - [self::RFC3986_BASE, '../../../../g', 'http://a/g'], - [self::RFC3986_BASE, '/./g', 'http://a/g'], - [self::RFC3986_BASE, '/../g', 'http://a/g'], - [self::RFC3986_BASE, 'g.', 'http://a/b/c/g.'], - [self::RFC3986_BASE, '.g', 'http://a/b/c/.g'], - [self::RFC3986_BASE, 'g..', 'http://a/b/c/g..'], - [self::RFC3986_BASE, '..g', 'http://a/b/c/..g'], - [self::RFC3986_BASE, './../g', 'http://a/b/g'], - [self::RFC3986_BASE, 'foo////g', 'http://a/b/c/foo////g'], - [self::RFC3986_BASE, './g/.', 'http://a/b/c/g/'], - [self::RFC3986_BASE, 'g/./h', 'http://a/b/c/g/h'], - [self::RFC3986_BASE, 'g/../h', 'http://a/b/c/h'], - [self::RFC3986_BASE, 'g;x=1/./y', 'http://a/b/c/g;x=1/y'], - [self::RFC3986_BASE, 'g;x=1/../y', 'http://a/b/c/y'], - [self::RFC3986_BASE, 'http:g', 'http:g'], - ]; - } - - /** - * @dataProvider urlCombineDataProvider - */ - public function testCombinesUrls($a, $b, $c) - { - $this->assertEquals($c, (string) Url::fromString($a)->combine($b)); - } - - public function testHasGettersAndSetters() - { - $url = Url::fromString('http://www.test.com/'); - $url->setHost('example.com'); - $this->assertEquals('example.com', $url->getHost()); - $url->setPort(8080); - $this->assertEquals('8080', $url->getPort()); - $url->setPath('/foo/bar'); - $this->assertEquals('/foo/bar', $url->getPath()); - $url->setPassword('a'); - $this->assertEquals('a', $url->getPassword()); - $url->setUsername('b'); - $this->assertEquals('b', $url->getUsername()); - $url->setFragment('abc'); - $this->assertEquals('abc', $url->getFragment()); - $url->setScheme('https'); - $this->assertEquals('https', $url->getScheme()); - $url->setQuery('a=123'); - $this->assertEquals('a=123', (string) $url->getQuery()); - $this->assertEquals( - 'https://b:a@example.com:8080/foo/bar?a=123#abc', - (string) $url - ); - $url->setQuery(new Query(['b' => 'boo'])); - $this->assertEquals('b=boo', $url->getQuery()); - $this->assertEquals( - 'https://b:a@example.com:8080/foo/bar?b=boo#abc', - (string) $url - ); - - $url->setQuery('a%20=bar!', true); - $this->assertEquals( - 'https://b:a@example.com:8080/foo/bar?a%20=bar!#abc', - (string) $url - ); - } - - public function testSetQueryAcceptsArray() - { - $url = Url::fromString('http://www.test.com'); - $url->setQuery(array('a' => 'b')); - $this->assertEquals('http://www.test.com?a=b', (string) $url); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testQueryMustBeValid() - { - $url = Url::fromString('http://www.test.com'); - $url->setQuery(false); - } - - public function testDefersParsingAndEncodingQueryUntilNecessary() - { - $url = Url::fromString('http://www.test.com'); - // Note that invalid characters are encoded. - $url->setQuery('foo#bar/', true); - $this->assertEquals('http://www.test.com?foo%23bar/', (string) $url); - $this->assertInternalType('string', $this->readAttribute($url, 'query')); - $this->assertEquals('foo%23bar%2F', (string) $url->getQuery()); - $this->assertInstanceOf('GuzzleHttp\Query', $this->readAttribute($url, 'query')); - } - - public function urlProvider() - { - return array( - array('/foo/..', '/'), - array('//foo//..', '//foo/'), - array('/foo//', '/foo//'), - array('/foo/../..', '/'), - array('/foo/../.', '/'), - array('/./foo/..', '/'), - array('/./foo', '/foo'), - array('/./foo/', '/foo/'), - array('*', '*'), - array('/foo', '/foo'), - array('/abc/123/../foo/', '/abc/foo/'), - array('/a/b/c/./../../g', '/a/g'), - array('/b/c/./../../g', '/g'), - array('/b/c/./../../g', '/g'), - array('/c/./../../g', '/g'), - array('/./../../g', '/g'), - array('foo', 'foo'), - ); - } - - /** - * @dataProvider urlProvider - */ - public function testRemoveDotSegments($path, $result) - { - $url = Url::fromString('http://www.example.com'); - $url->setPath($path); - $url->removeDotSegments(); - $this->assertEquals($result, $url->getPath()); - } - - public function testSettingHostWithPortModifiesPort() - { - $url = Url::fromString('http://www.example.com'); - $url->setHost('foo:8983'); - $this->assertEquals('foo', $url->getHost()); - $this->assertEquals(8983, $url->getPort()); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testValidatesUrlCanBeParsed() - { - Url::fromString('foo:////'); - } - - public function testConvertsSpecialCharsInPathWhenCastingToString() - { - $url = Url::fromString('http://foo.com/baz bar?a=b'); - $url->addPath('?'); - $this->assertEquals('http://foo.com/baz%20bar/%3F?a=b', (string) $url); - } - - public function testCorrectlyEncodesPathWithoutDoubleEncoding() - { - $url = Url::fromString('http://foo.com/baz%20 bar:boo/baz!'); - $this->assertEquals('/baz%20%20bar:boo/baz!', $url->getPath()); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/tests/UtilsTest.php b/core/vendor/guzzlehttp/guzzle/tests/UtilsTest.php deleted file mode 100644 index d9bdc07..0000000 --- a/core/vendor/guzzlehttp/guzzle/tests/UtilsTest.php +++ /dev/null @@ -1,34 +0,0 @@ -assertEquals( - 'foo/123', - Utils::uriTemplate('foo/{bar}', ['bar' => '123']) - ); - } - - public function noBodyProvider() - { - return [['get'], ['head'], ['delete']]; - } - - public function testJsonDecodes() - { - $this->assertTrue(Utils::jsonDecode('true')); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Unable to parse JSON data: JSON_ERROR_SYNTAX - Syntax error, malformed JSON - */ - public function testJsonDecodesWithErrorMessages() - { - Utils::jsonDecode('!narf!'); - } -} diff --git a/core/vendor/guzzlehttp/guzzle/tests/bootstrap.php b/core/vendor/guzzlehttp/guzzle/tests/bootstrap.php deleted file mode 100644 index 8713f96..0000000 --- a/core/vendor/guzzlehttp/guzzle/tests/bootstrap.php +++ /dev/null @@ -1,11 +0,0 @@ - Server::$url]); - -$t = microtime(true); -for ($i = 0; $i < $total; $i++) { - $client->get('/guzzle-server/perf'); -} -$totalTime = microtime(true) - $t; -$perRequest = ($totalTime / $total) * 1000; -printf("Serial: %f (%f ms / request) %d total\n", - $totalTime, $perRequest, $total); - -// Create a generator used to yield batches of requests -$reqs = function () use ($client, $total) { - for ($i = 0; $i < $total; $i++) { - yield $client->createRequest('GET', '/guzzle-server/perf'); - } -}; - -$t = microtime(true); -Pool::send($client, $reqs(), ['parallel' => $parallel]); -$totalTime = microtime(true) - $t; -$perRequest = ($totalTime / $total) * 1000; -printf("Batch: %f (%f ms / request) %d total with %d in parallel\n", - $totalTime, $perRequest, $total, $parallel); - -$handler = new CurlMultiHandler(['max_handles' => $parallel]); -$client = new Client(['handler' => $handler, 'base_url' => Server::$url]); -$t = microtime(true); -for ($i = 0; $i < $total; $i++) { - $client->get('/guzzle-server/perf'); -} -unset($client); -$totalTime = microtime(true) - $t; -$perRequest = ($totalTime / $total) * 1000; -printf("Future: %f (%f ms / request) %d total\n", - $totalTime, $perRequest, $total); diff --git a/core/vendor/guzzlehttp/ringphp/.gitignore b/core/vendor/guzzlehttp/ringphp/.gitignore deleted file mode 100644 index 290a945..0000000 --- a/core/vendor/guzzlehttp/ringphp/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -vendor -build/artifacts/ -composer.lock -docs/_build/ diff --git a/core/vendor/guzzlehttp/ringphp/.travis.yml b/core/vendor/guzzlehttp/ringphp/.travis.yml deleted file mode 100644 index e43fbdd..0000000 --- a/core/vendor/guzzlehttp/ringphp/.travis.yml +++ /dev/null @@ -1,22 +0,0 @@ -language: php - -php: - - 5.4 - - 5.5 - - 5.6 - - 7.0 - - hhvm - -before_script: - - composer self-update - - composer install --no-interaction --prefer-source --dev - - ~/.nvm/nvm.sh install v0.6.14 - - ~/.nvm/nvm.sh run v0.6.14 - -script: - - make test - -matrix: - allow_failures: - - php: hhvm - fast_finish: true diff --git a/core/vendor/guzzlehttp/ringphp/CHANGELOG.md b/core/vendor/guzzlehttp/ringphp/CHANGELOG.md deleted file mode 100644 index 97458da..0000000 --- a/core/vendor/guzzlehttp/ringphp/CHANGELOG.md +++ /dev/null @@ -1,44 +0,0 @@ -# CHANGELOG - -## 1.0.7 - 2015-03-29 - -* PHP 7 fixes. - -## 1.0.6 - 2015-02-26 - -* Bug fix: futures now extend from React's PromiseInterface to ensure that they - are properly forwarded down the promise chain. -* The multi handle of the CurlMultiHandler is now created lazily. - -## 1.0.5 - 2014-12-10 - -* Adding more error information to PHP stream wrapper exceptions. -* Added digest auth integration test support to test server. - -## 1.0.4 - 2014-12-01 - -* Added support for older versions of cURL that do not have CURLOPT_TIMEOUT_MS. -* Setting debug to `false` does not enable debug output. -* Added a fix to the StreamHandler to return a `FutureArrayInterface` when an - error occurs. - -## 1.0.3 - 2014-11-03 - -* Setting the `header` stream option as a string to be compatible with GAE. -* Header parsing now ensures that header order is maintained in the parsed - message. - -## 1.0.2 - 2014-10-28 - -* Now correctly honoring a `version` option is supplied in a request. - See https://github.com/guzzle/RingPHP/pull/8 - -## 1.0.1 - 2014-10-26 - -* Fixed a header parsing issue with the `CurlHandler` and `CurlMultiHandler` - that caused cURL requests with multiple responses to merge repsonses together - (e.g., requests with digest authentication). - -## 1.0.0 - 2014-10-12 - -* Initial release. diff --git a/core/vendor/guzzlehttp/ringphp/LICENSE b/core/vendor/guzzlehttp/ringphp/LICENSE deleted file mode 100644 index 71d3b78..0000000 --- a/core/vendor/guzzlehttp/ringphp/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2014 Michael Dowling, https://github.com/mtdowling - -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/core/vendor/guzzlehttp/ringphp/Makefile b/core/vendor/guzzlehttp/ringphp/Makefile deleted file mode 100644 index 21c812e..0000000 --- a/core/vendor/guzzlehttp/ringphp/Makefile +++ /dev/null @@ -1,46 +0,0 @@ -all: clean coverage docs - -docs: - cd docs && make html - -view-docs: - open docs/_build/html/index.html - -start-server: stop-server - node tests/Client/server.js &> /dev/null & - -stop-server: - @PID=$(shell ps axo pid,command \ - | grep 'tests/Client/server.js' \ - | grep -v grep \ - | cut -f 1 -d " "\ - ) && [ -n "$$PID" ] && kill $$PID || true - -test: start-server - vendor/bin/phpunit $(TEST) - $(MAKE) stop-server - -coverage: start-server - vendor/bin/phpunit --coverage-html=build/artifacts/coverage $(TEST) - $(MAKE) stop-server - -view-coverage: - open build/artifacts/coverage/index.html - -clean: - rm -rf build/artifacts/* - cd docs && make clean - -tag: - $(if $(TAG),,$(error TAG is not defined. Pass via "make tag TAG=4.2.1")) - @echo Tagging $(TAG) - chag update -m '$(TAG) ()' - git add -A - git commit -m '$(TAG) release' - chag tag - -perf: start-server - php tests/perf.php - $(MAKE) stop-server - -.PHONY: docs diff --git a/core/vendor/guzzlehttp/ringphp/README.rst b/core/vendor/guzzlehttp/ringphp/README.rst deleted file mode 100644 index 10374e8..0000000 --- a/core/vendor/guzzlehttp/ringphp/README.rst +++ /dev/null @@ -1,46 +0,0 @@ -======= -RingPHP -======= - -Provides a simple API and specification that abstracts away the details of HTTP -into a single PHP function. RingPHP be used to power HTTP clients and servers -through a PHP function that accepts a request hash and returns a response hash -that is fulfilled using a `promise `_, -allowing RingPHP to support both synchronous and asynchronous workflows. - -By abstracting the implementation details of different HTTP clients and -servers, RingPHP allows you to utilize pluggable HTTP clients and servers -without tying your application to a specific implementation. - -.. code-block:: php - - 'GET', - 'uri' => '/', - 'headers' => [ - 'host' => ['www.google.com'], - 'x-foo' => ['baz'] - ] - ]); - - $response->then(function (array $response) { - echo $response['status']; - }); - - $response->wait(); - -RingPHP is inspired by Clojure's `Ring `_, -which, in turn, was inspired by Python's WSGI and Ruby's Rack. RingPHP is -utilized as the handler layer in `Guzzle `_ 5.0+ to send -HTTP requests. - -Documentation -------------- - -See http://ringphp.readthedocs.org/ for the full online documentation. diff --git a/core/vendor/guzzlehttp/ringphp/composer.json b/core/vendor/guzzlehttp/ringphp/composer.json deleted file mode 100644 index fcca629..0000000 --- a/core/vendor/guzzlehttp/ringphp/composer.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "guzzlehttp/ringphp", - "description": "Provides a simple API and specification that abstracts away the details of HTTP into a single PHP function.", - "license": "MIT", - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "require": { - "php": ">=5.4.0", - "guzzlehttp/streams": "~3.0", - "react/promise": "~2.0" - }, - "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "~4.0" - }, - "suggest": { - "ext-curl": "Guzzle will use specific adapters if cURL is present" - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Ring\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "GuzzleHttp\\Tests\\Ring\\": "tests/" - } - }, - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - } -} diff --git a/core/vendor/guzzlehttp/ringphp/docs/Makefile b/core/vendor/guzzlehttp/ringphp/docs/Makefile deleted file mode 100644 index 51270aa..0000000 --- a/core/vendor/guzzlehttp/ringphp/docs/Makefile +++ /dev/null @@ -1,153 +0,0 @@ -# Makefile for Sphinx documentation -# - -# You can set these variables from the command line. -SPHINXOPTS = -SPHINXBUILD = sphinx-build -PAPER = -BUILDDIR = _build - -# Internal variables. -PAPEROPT_a4 = -D latex_paper_size=a4 -PAPEROPT_letter = -D latex_paper_size=letter -ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . -# the i18n builder cannot share the environment and doctrees with the others -I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . - -.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext - -help: - @echo "Please use \`make ' where is one of" - @echo " html to make standalone HTML files" - @echo " dirhtml to make HTML files named index.html in directories" - @echo " singlehtml to make a single large HTML file" - @echo " pickle to make pickle files" - @echo " json to make JSON files" - @echo " htmlhelp to make HTML files and a HTML help project" - @echo " qthelp to make HTML files and a qthelp project" - @echo " devhelp to make HTML files and a Devhelp project" - @echo " epub to make an epub" - @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" - @echo " latexpdf to make LaTeX files and run them through pdflatex" - @echo " text to make text files" - @echo " man to make manual pages" - @echo " texinfo to make Texinfo files" - @echo " info to make Texinfo files and run them through makeinfo" - @echo " gettext to make PO message catalogs" - @echo " changes to make an overview of all changed/added/deprecated items" - @echo " linkcheck to check all external links for integrity" - @echo " doctest to run all doctests embedded in the documentation (if enabled)" - -clean: - -rm -rf $(BUILDDIR)/* - -html: - $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." - -dirhtml: - $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." - -singlehtml: - $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml - @echo - @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." - -pickle: - $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle - @echo - @echo "Build finished; now you can process the pickle files." - -json: - $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json - @echo - @echo "Build finished; now you can process the JSON files." - -htmlhelp: - $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp - @echo - @echo "Build finished; now you can run HTML Help Workshop with the" \ - ".hhp project file in $(BUILDDIR)/htmlhelp." - -qthelp: - $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp - @echo - @echo "Build finished; now you can run "qcollectiongenerator" with the" \ - ".qhcp project file in $(BUILDDIR)/qthelp, like this:" - @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/GuzzleRing.qhcp" - @echo "To view the help file:" - @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/GuzzleRing.qhc" - -devhelp: - $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp - @echo - @echo "Build finished." - @echo "To view the help file:" - @echo "# mkdir -p $$HOME/.local/share/devhelp/GuzzleRing" - @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/GuzzleRing" - @echo "# devhelp" - -epub: - $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub - @echo - @echo "Build finished. The epub file is in $(BUILDDIR)/epub." - -latex: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo - @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." - @echo "Run \`make' in that directory to run these through (pdf)latex" \ - "(use \`make latexpdf' here to do that automatically)." - -latexpdf: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo "Running LaTeX files through pdflatex..." - $(MAKE) -C $(BUILDDIR)/latex all-pdf - @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." - -text: - $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text - @echo - @echo "Build finished. The text files are in $(BUILDDIR)/text." - -man: - $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man - @echo - @echo "Build finished. The manual pages are in $(BUILDDIR)/man." - -texinfo: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo - @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." - @echo "Run \`make' in that directory to run these through makeinfo" \ - "(use \`make info' here to do that automatically)." - -info: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo "Running Texinfo files through makeinfo..." - make -C $(BUILDDIR)/texinfo info - @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." - -gettext: - $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale - @echo - @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." - -changes: - $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes - @echo - @echo "The overview file is in $(BUILDDIR)/changes." - -linkcheck: - $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck - @echo - @echo "Link check complete; look for any errors in the above output " \ - "or in $(BUILDDIR)/linkcheck/output.txt." - -doctest: - $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest - @echo "Testing of doctests in the sources finished, look at the " \ - "results in $(BUILDDIR)/doctest/output.txt." diff --git a/core/vendor/guzzlehttp/ringphp/docs/client_handlers.rst b/core/vendor/guzzlehttp/ringphp/docs/client_handlers.rst deleted file mode 100644 index 3151f00..0000000 --- a/core/vendor/guzzlehttp/ringphp/docs/client_handlers.rst +++ /dev/null @@ -1,173 +0,0 @@ -=============== -Client Handlers -=============== - -Client handlers accept a request array and return a future response array that -can be used synchronously as an array or asynchronously using a promise. - -Built-In Handlers ------------------ - -RingPHP comes with three built-in client handlers. - -Stream Handler -~~~~~~~~~~~~~~ - -The ``GuzzleHttp\Ring\Client\StreamHandler`` uses PHP's -`http stream wrapper `_ to send -requests. - -.. note:: - - This handler cannot send requests concurrently. - -You can provide an associative array of custom stream context options to the -StreamHandler using the ``stream_context`` key of the ``client`` request -option. - -.. code-block:: php - - use GuzzleHttp\Ring\Client\StreamHandler; - - $response = $handler([ - 'http_method' => 'GET', - 'uri' => '/', - 'headers' => ['host' => ['httpbin.org']], - 'client' => [ - 'stream_context' => [ - 'http' => [ - 'request_fulluri' => true, - 'method' => 'HEAD' - ], - 'socket' => [ - 'bindto' => '127.0.0.1:0' - ], - 'ssl' => [ - 'verify_peer' => false - ] - ] - ] - ]); - - // Even though it's already completed, you can still use a promise - $response->then(function ($response) { - echo $response['status']; // 200 - }); - - // Or access the response using the future interface - echo $response['status']; // 200 - -cURL Handler -~~~~~~~~~~~~ - -The ``GuzzleHttp\Ring\Client\CurlHandler`` can be used with PHP 5.5+ to send -requests using cURL easy handles. This handler is great for sending requests -one at a time because the execute and select loop is implemented in C code -which executes faster and consumes less memory than using PHP's -``curl_multi_*`` interface. - -.. note:: - - This handler cannot send requests concurrently. - -When using the CurlHandler, custom curl options can be specified as an -associative array of `cURL option constants `_ -mapping to values in the ``client`` option of a requst using the **curl** key. - -.. code-block:: php - - use GuzzleHttp\Ring\Client\CurlHandler; - - $handler = new CurlHandler(); - - $request = [ - 'http_method' => 'GET', - 'headers' => ['host' => [Server::$host]], - 'client' => ['curl' => [CURLOPT_LOW_SPEED_LIMIT => 10]] - ]; - - $response = $handler($request); - - // The response can be used directly as an array. - echo $response['status']; // 200 - - // Or, it can be used as a promise (that has already fulfilled). - $response->then(function ($response) { - echo $response['status']; // 200 - }); - -cURL Multi Handler -~~~~~~~~~~~~~~~~~~ - -The ``GuzzleHttp\Ring\Client\CurlMultiHandler`` transfers requests using -cURL's `multi API `_. The -``CurlMultiHandler`` is great for sending requests concurrently. - -.. code-block:: php - - use GuzzleHttp\Ring\Client\CurlMultiHandler; - - $handler = new CurlMultiHandler(); - - $request = [ - 'http_method' => 'GET', - 'headers' => ['host' => [Server::$host]] - ]; - - // this call returns a future array immediately. - $response = $handler($request); - - // Ideally, you should use the promise API to not block. - $response - ->then(function ($response) { - // Got the response at some point in the future - echo $response['status']; // 200 - // Don't break the chain - return $response; - })->then(function ($response) { - // ... - }); - - // If you really need to block, then you can use the response as an - // associative array. This will block until it has completed. - echo $response['status']; // 200 - -Just like the ``CurlHandler``, the ``CurlMultiHandler`` accepts custom curl -option in the ``curl`` key of the ``client`` request option. - -Mock Handler -~~~~~~~~~~~~ - -The ``GuzzleHttp\Ring\Client\MockHandler`` is used to return mock responses. -When constructed, the handler can be configured to return the same response -array over and over, a future response, or a the evaluation of a callback -function. - -.. code-block:: php - - use GuzzleHttp\Ring\Client\MockHandler; - - // Return a canned response. - $mock = new MockHandler(['status' => 200]); - $response = $mock([]); - assert(200 == $response['status']); - assert([] == $response['headers']); - -Implementing Handlers ---------------------- - -Client handlers are just PHP callables (functions or classes that have the -``__invoke`` magic method). The callable accepts a request array and MUST -return an instance of ``GuzzleHttp\Ring\Future\FutureArrayInterface`` so that -the response can be used by both blocking and non-blocking consumers. - -Handlers need to follow a few simple rules: - -1. Do not throw exceptions. If an error is encountered, return an array that - contains the ``error`` key that maps to an ``\Exception`` value. -2. If the request has a ``delay`` client option, then the handler should only - send the request after the specified delay time in seconds. Blocking - handlers may find it convenient to just let the - ``GuzzleHttp\Ring\Core::doSleep($request)`` function handle this for them. -3. Always return an instance of ``GuzzleHttp\Ring\Future\FutureArrayInterface``. -4. Complete any outstanding requests when the handler is destructed. diff --git a/core/vendor/guzzlehttp/ringphp/docs/client_middleware.rst b/core/vendor/guzzlehttp/ringphp/docs/client_middleware.rst deleted file mode 100644 index 7c52c8a..0000000 --- a/core/vendor/guzzlehttp/ringphp/docs/client_middleware.rst +++ /dev/null @@ -1,165 +0,0 @@ -================= -Client Middleware -================= - -Middleware intercepts requests before they are sent over the wire and can be -used to add functionality to handlers. - -Modifying Requests ------------------- - -Let's say you wanted to modify requests before they are sent over the wire -so that they always add specific headers. This can be accomplished by creating -a function that accepts a handler and returns a new function that adds the -composed behavior. - -.. code-block:: php - - use GuzzleHttp\Ring\Client\CurlHandler; - - $handler = new CurlHandler(); - - $addHeaderHandler = function (callable $handler, array $headers = []) { - return function (array $request) use ($handler, $headers) { - // Add our custom headers - foreach ($headers as $key => $value) { - $request['headers'][$key] = $value; - } - - // Send the request using the handler and return the response. - return $handler($request); - } - }; - - // Create a new handler that adds headers to each request. - $handler = $addHeaderHandler($handler, [ - 'X-AddMe' => 'hello', - 'Authorization' => 'Basic xyz' - ]); - - $response = $handler([ - 'http_method' => 'GET', - 'headers' => ['Host' => ['httpbin.org'] - ]); - -Modifying Responses -------------------- - -You can change a response as it's returned from a middleware. Remember that -responses returned from an handler (including middleware) must implement -``GuzzleHttp\Ring\Future\FutureArrayInterface``. In order to be a good citizen, -you should not expect that the responses returned through your middleware will -be completed synchronously. Instead, you should use the -``GuzzleHttp\Ring\Core::proxy()`` function to modify the response when the -underlying promise is resolved. This function is a helper function that makes it -easy to create a new instance of ``FutureArrayInterface`` that wraps an existing -``FutureArrayInterface`` object. - -Let's say you wanted to add headers to a response as they are returned from -your middleware, but you want to make sure you aren't causing future -responses to be dereferenced right away. You can achieve this by modifying the -incoming request and using the ``Core::proxy`` function. - -.. code-block:: php - - use GuzzleHttp\Ring\Core; - use GuzzleHttp\Ring\Client\CurlHandler; - - $handler = new CurlHandler(); - - $responseHeaderHandler = function (callable $handler, array $headers) { - return function (array $request) use ($handler, $headers) { - // Send the request using the wrapped handler. - return Core::proxy($handler($request), function ($response) use ($headers) { - // Add the headers to the response when it is available. - foreach ($headers as $key => $value) { - $response['headers'][$key] = (array) $value; - } - // Note that you can return a regular response array when using - // the proxy method. - return $response; - }); - } - }; - - // Create a new handler that adds headers to each response. - $handler = $responseHeaderHandler($handler, ['X-Header' => 'hello!']); - - $response = $handler([ - 'http_method' => 'GET', - 'headers' => ['Host' => ['httpbin.org'] - ]); - - assert($response['headers']['X-Header'] == 'hello!'); - -Built-In Middleware -------------------- - -RingPHP comes with a few basic client middlewares that modify requests -and responses. - -Streaming Middleware -~~~~~~~~~~~~~~~~~~~~ - -If you want to send all requests with the ``streaming`` option to a specific -handler but other requests to a different handler, then use the streaming -middleware. - -.. code-block:: php - - use GuzzleHttp\Ring\Client\CurlHandler; - use GuzzleHttp\Ring\Client\StreamHandler; - use GuzzleHttp\Ring\Client\Middleware; - - $defaultHandler = new CurlHandler(); - $streamingHandler = new StreamHandler(); - $streamingHandler = Middleware::wrapStreaming( - $defaultHandler, - $streamingHandler - ); - - // Send the request using the streaming handler. - $response = $streamingHandler([ - 'http_method' => 'GET', - 'headers' => ['Host' => ['www.google.com'], - 'stream' => true - ]); - - // Send the request using the default handler. - $response = $streamingHandler([ - 'http_method' => 'GET', - 'headers' => ['Host' => ['www.google.com'] - ]); - -Future Middleware -~~~~~~~~~~~~~~~~~ - -If you want to send all requests with the ``future`` option to a specific -handler but other requests to a different handler, then use the future -middleware. - -.. code-block:: php - - use GuzzleHttp\Ring\Client\CurlHandler; - use GuzzleHttp\Ring\Client\CurlMultiHandler; - use GuzzleHttp\Ring\Client\Middleware; - - $defaultHandler = new CurlHandler(); - $futureHandler = new CurlMultiHandler(); - $futureHandler = Middleware::wrapFuture( - $defaultHandler, - $futureHandler - ); - - // Send the request using the blocking CurlHandler. - $response = $futureHandler([ - 'http_method' => 'GET', - 'headers' => ['Host' => ['www.google.com'] - ]); - - // Send the request using the non-blocking CurlMultiHandler. - $response = $futureHandler([ - 'http_method' => 'GET', - 'headers' => ['Host' => ['www.google.com'], - 'future' => true - ]); diff --git a/core/vendor/guzzlehttp/ringphp/docs/conf.py b/core/vendor/guzzlehttp/ringphp/docs/conf.py deleted file mode 100644 index c6404aa..0000000 --- a/core/vendor/guzzlehttp/ringphp/docs/conf.py +++ /dev/null @@ -1,23 +0,0 @@ -import sys, os -import sphinx_rtd_theme -from sphinx.highlighting import lexers -from pygments.lexers.web import PhpLexer - - -lexers['php'] = PhpLexer(startinline=True, linenos=1) -lexers['php-annotations'] = PhpLexer(startinline=True, linenos=1) -primary_domain = 'php' - -extensions = [] -templates_path = ['_templates'] -source_suffix = '.rst' -master_doc = 'index' -project = u'RingPHP' -copyright = u'2014, Michael Dowling' -version = '1.0.0-alpha' -exclude_patterns = ['_build'] - -html_title = "RingPHP" -html_short_title = "RingPHP" -html_theme = "sphinx_rtd_theme" -html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] diff --git a/core/vendor/guzzlehttp/ringphp/docs/futures.rst b/core/vendor/guzzlehttp/ringphp/docs/futures.rst deleted file mode 100644 index af29cb3..0000000 --- a/core/vendor/guzzlehttp/ringphp/docs/futures.rst +++ /dev/null @@ -1,164 +0,0 @@ -======= -Futures -======= - -Futures represent a computation that may have not yet completed. RingPHP -uses hybrid of futures and promises to provide a consistent API that can be -used for both blocking and non-blocking consumers. - -Promises --------- - -You can get the result of a future when it is ready using the promise interface -of a future. Futures expose a promise API via a ``then()`` method that utilizes -`React's promise library `_. You should -use this API when you do not wish to block. - -.. code-block:: php - - use GuzzleHttp\Ring\Client\CurlMultiHandler; - - $request = [ - 'http_method' => 'GET', - 'uri' => '/', - 'headers' => ['host' => ['httpbin.org']] - ]; - - $response = $handler($request); - - // Use the then() method to use the promise API of the future. - $response->then(function ($response) { - echo $response['status']; - }); - -You can get the promise used by a future, an instance of -``React\Promise\PromiseInterface``, by calling the ``promise()`` method. - -.. code-block:: php - - $response = $handler($request); - $promise = $response->promise(); - $promise->then(function ($response) { - echo $response['status']; - }); - -This promise value can be used with React's -`aggregate promise functions `_. - -Waiting -------- - -You can wait on a future to complete and retrieve the value, or *dereference* -the future, using the ``wait()`` method. Calling the ``wait()`` method of a -future will block until the result is available. The result is then returned or -an exception is thrown if and exception was encountered while waiting on the -the result. Subsequent calls to dereference a future will return the previously -completed result or throw the previously encountered exception. Futures can be -cancelled, which stops the computation if possible. - -.. code-block:: php - - use GuzzleHttp\Ring\Client\CurlMultiHandler; - - $response = $handler([ - 'http_method' => 'GET', - 'uri' => '/', - 'headers' => ['host' => ['httpbin.org']] - ]); - - // You can explicitly call block to wait on a result. - $realizedResponse = $response->wait(); - - // Future responses can be used like a regular PHP array. - echo $response['status']; - -In addition to explicitly calling the ``wait()`` function, using a future like -a normal value will implicitly trigger the ``wait()`` function. - -Future Responses ----------------- - -RingPHP uses futures to return asynchronous responses immediately. Client -handlers always return future responses that implement -``GuzzleHttp\Ring\Future\ArrayFutureInterface``. These future responses act -just like normal PHP associative arrays for blocking access and provide a -promise interface for non-blocking access. - -.. code-block:: php - - use GuzzleHttp\Ring\Client\CurlMultiHandler; - - $handler = new CurlMultiHandler(); - - $request = [ - 'http_method' => 'GET', - 'uri' => '/', - 'headers' => ['Host' => ['www.google.com']] - ]; - - $response = $handler($request); - - // Use the promise API for non-blocking access to the response. The actual - // response value will be delivered to the promise. - $response->then(function ($response) { - echo $response['status']; - }); - - // You can wait (block) until the future is completed. - $response->wait(); - - // This will implicitly call wait(), and will block too! - $response['status']; - -.. important:: - - Futures that are not completed by the time the underlying handler is - destructed will be completed when the handler is shutting down. - -Cancelling ----------- - -Futures can be cancelled if they have not already been dereferenced. - -RingPHP futures are typically implemented with the -``GuzzleHttp\Ring\Future\BaseFutureTrait``. This trait provides the cancellation -functionality that should be common to most implementations. Cancelling a -future response will try to prevent the request from sending over the wire. - -When a future is cancelled, the cancellation function is invoked and performs -the actual work needed to cancel the request from sending if possible -(e.g., telling an event loop to stop sending a request or to close a socket). -If no cancellation function is provided, then a request cannot be cancelled. If -a cancel function is provided, then it should accept the future as an argument -and return true if the future was successfully cancelled or false if it could -not be cancelled. - -Wrapping an existing Promise ----------------------------- - -You can easily create a future from any existing promise using the -``GuzzleHttp\Ring\Future\FutureValue`` class. This class's constructor -accepts a promise as the first argument, a wait function as the second -argument, and a cancellation function as the third argument. The dereference -function is used to force the promise to resolve (for example, manually ticking -an event loop). The cancel function is optional and is used to tell the thing -that created the promise that it can stop computing the result (for example, -telling an event loop to stop transferring a request). - -.. code-block:: php - - use GuzzleHttp\Ring\Future\FutureValue; - use React\Promise\Deferred; - - $deferred = new Deferred(); - $promise = $deferred->promise(); - - $f = new FutureValue( - $promise, - function () use ($deferred) { - // This function is responsible for blocking and resolving the - // promise. Here we pass in a reference to the deferred so that - // it can be resolved or rejected. - $deferred->resolve('foo'); - } - ); diff --git a/core/vendor/guzzlehttp/ringphp/docs/index.rst b/core/vendor/guzzlehttp/ringphp/docs/index.rst deleted file mode 100644 index 4bbce63..0000000 --- a/core/vendor/guzzlehttp/ringphp/docs/index.rst +++ /dev/null @@ -1,50 +0,0 @@ -======= -RingPHP -======= - -Provides a simple API and specification that abstracts away the details of HTTP -into a single PHP function. RingPHP be used to power HTTP clients and servers -through a PHP function that accepts a request hash and returns a response hash -that is fulfilled using a `promise `_, -allowing RingPHP to support both synchronous and asynchronous workflows. - -By abstracting the implementation details of different HTTP clients and -servers, RingPHP allows you to utilize pluggable HTTP clients and servers -without tying your application to a specific implementation. - -.. toctree:: - :maxdepth: 2 - - spec - futures - client_middleware - client_handlers - testing - -.. code-block:: php - - 'GET', - 'uri' => '/', - 'headers' => [ - 'host' => ['www.google.com'], - 'x-foo' => ['baz'] - ] - ]); - - $response->then(function (array $response) { - echo $response['status']; - }); - - $response->wait(); - -RingPHP is inspired by Clojure's `Ring `_, -which, in turn, was inspired by Python's WSGI and Ruby's Rack. RingPHP is -utilized as the handler layer in `Guzzle `_ 5.0+ to send -HTTP requests. diff --git a/core/vendor/guzzlehttp/ringphp/docs/requirements.txt b/core/vendor/guzzlehttp/ringphp/docs/requirements.txt deleted file mode 100644 index 483a4e9..0000000 --- a/core/vendor/guzzlehttp/ringphp/docs/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -sphinx_rtd_theme diff --git a/core/vendor/guzzlehttp/ringphp/docs/spec.rst b/core/vendor/guzzlehttp/ringphp/docs/spec.rst deleted file mode 100644 index bc91078..0000000 --- a/core/vendor/guzzlehttp/ringphp/docs/spec.rst +++ /dev/null @@ -1,311 +0,0 @@ -============= -Specification -============= - -RingPHP applications consist of handlers, requests, responses, and -middleware. - -Handlers --------- - -Handlers are implemented as a PHP ``callable`` that accept a request array -and return a response array (``GuzzleHttp\Ring\Future\FutureArrayInterface``). - -For example: - -.. code-block:: php - - use GuzzleHttp\Ring\Future\CompletedFutureArray; - - $mockHandler = function (array $request) { - return new CompletedFutureArray([ - 'status' => 200, - 'headers' => ['X-Foo' => ['Bar']], - 'body' => 'Hello!' - ]); - }; - -This handler returns the same response each time it is invoked. All RingPHP -handlers must return a ``GuzzleHttp\Ring\Future\FutureArrayInterface``. Use -``GuzzleHttp\Ring\Future\CompletedFutureArray`` when returning a response that -has already completed. - -Requests --------- - -A request array is a PHP associative array that contains the configuration -settings need to send a request. - -.. code-block:: php - - $request = [ - 'http_method' => 'GET', - 'scheme' => 'http', - 'uri' => '/', - 'body' => 'hello!', - 'client' => ['timeout' => 1.0], - 'headers' => [ - 'host' => ['httpbin.org'], - 'X-Foo' => ['baz', 'bar'] - ] - ]; - -The request array contains the following key value pairs: - -request_method - (string, required) The HTTP request method, must be all caps corresponding - to a HTTP request method, such as ``GET`` or ``POST``. - -scheme - (string) The transport protocol, must be one of ``http`` or ``https``. - Defaults to ``http``. - -uri - (string, required) The request URI excluding the query string. Must - start with "/". - -query_string - (string) The query string, if present (e.g., ``foo=bar``). - -version - (string) HTTP protocol version. Defaults to ``1.1``. - -headers - (required, array) Associative array of headers. Each key represents the - header name. Each value contains an array of strings where each entry of - the array SHOULD be sent over the wire on a separate header line. - -body - (string, fopen resource, ``Iterator``, ``GuzzleHttp\Stream\StreamInterface``) - The body of the request, if present. Can be a string, resource returned - from fopen, an ``Iterator`` that yields chunks of data, an object that - implemented ``__toString``, or a ``GuzzleHttp\Stream\StreamInterface``. - -future - (bool, string) Controls the asynchronous behavior of a response. - - Set to ``true`` or omit the ``future`` option to *request* that a request - will be completed asynchronously. Keep in mind that your request might not - necessarily be completed asynchronously based on the handler you are using. - Set the ``future`` option to ``false`` to request that a synchronous - response be provided. - - You can provide a string value to specify fine-tuned future behaviors that - may be specific to the underlying handlers you are using. There are, - however, some common future options that handlers should implement if - possible. - - lazy - Requests that the handler does not open and send the request - immediately, but rather only opens and sends the request once the - future is dereferenced. This option is often useful for sending a large - number of requests concurrently to allow handlers to take better - advantage of non-blocking transfers by first building up a pool of - requests. - - If an handler does not implement or understand a provided string value, - then the request MUST be treated as if the user provided ``true`` rather - than the string value. - - Future responses created by asynchronous handlers MUST attempt to complete - any outstanding future responses when they are destructed. Asynchronous - handlers MAY choose to automatically complete responses when the number - of outstanding requests reaches an handler-specific threshold. - -Client Specific Options -~~~~~~~~~~~~~~~~~~~~~~~ - -The following options are only used in ring client handlers. - -.. _client-options: - -client - (array) Associative array of client specific transfer options. The - ``client`` request key value pair can contain the following keys: - - cert - (string, array) Set to a string to specify the path to a file - containing a PEM formatted SSL client side certificate. If a password - is required, then set ``cert`` to an array containing the path to the - PEM file in the first array element followed by the certificate - password in the second array element. - - connect_timeout - (float) Float describing the number of seconds to wait while trying to - connect to a server. Use ``0`` to wait indefinitely (the default - behavior). - - debug - (bool, fopen() resource) Set to true or set to a PHP stream returned by - fopen() to enable debug output with the handler used to send a request. - If set to ``true``, the output is written to PHP's STDOUT. If a PHP - ``fopen`` resource handle is provided, the output is written to the - stream. - - "Debug output" is handler specific: different handlers will yield - different output and various various level of detail. For example, when - using cURL to transfer requests, cURL's `CURLOPT_VERBOSE `_ - will be used. When using the PHP stream wrapper, `stream notifications `_ - will be emitted. - - decode_content - (bool) Specify whether or not ``Content-Encoding`` responses - (gzip, deflate, etc.) are automatically decoded. Set to ``true`` to - automatically decode encoded responses. Set to ``false`` to not decode - responses. By default, content is *not* decoded automatically. - - delay - (int) The number of milliseconds to delay before sending the request. - This is often used for delaying before retrying a request. Handlers - SHOULD implement this if possible, but it is not a strict requirement. - - progress - (function) Defines a function to invoke when transfer progress is made. - The function accepts the following arguments: - - 1. The total number of bytes expected to be downloaded - 2. The number of bytes downloaded so far - 3. The number of bytes expected to be uploaded - 4. The number of bytes uploaded so far - - proxy - (string, array) Pass a string to specify an HTTP proxy, or an - associative array to specify different proxies for different protocols - where the scheme is the key and the value is the proxy address. - - .. code-block:: php - - $request = [ - 'http_method' => 'GET', - 'headers' => ['host' => ['httpbin.org']], - 'client' => [ - // Use different proxies for different URI schemes. - 'proxy' => [ - 'http' => 'http://proxy.example.com:5100', - 'https' => 'https://proxy.example.com:6100' - ] - ] - ]; - - ssl_key - (string, array) Specify the path to a file containing a private SSL key - in PEM format. If a password is required, then set to an array - containing the path to the SSL key in the first array element followed - by the password required for the certificate in the second element. - - save_to - (string, fopen resource, ``GuzzleHttp\Stream\StreamInterface``) - Specifies where the body of the response is downloaded. Pass a string to - open a local file on disk and save the output to the file. Pass an fopen - resource to save the output to a PHP stream resource. Pass a - ``GuzzleHttp\Stream\StreamInterface`` to save the output to a Guzzle - StreamInterface. Omitting this option will typically save the body of a - response to a PHP temp stream. - - stream - (bool) Set to true to stream a response rather than download it all - up-front. This option will only be utilized when the corresponding - handler supports it. - - timeout - (float) Float describing the timeout of the request in seconds. Use 0 to - wait indefinitely (the default behavior). - - verify - (bool, string) Describes the SSL certificate verification behavior of a - request. Set to true to enable SSL certificate verification using the - system CA bundle when available (the default). Set to false to disable - certificate verification (this is insecure!). Set to a string to provide - the path to a CA bundle on disk to enable verification using a custom - certificate. - - version - (string) HTTP protocol version to use with the request. - -Server Specific Options -~~~~~~~~~~~~~~~~~~~~~~~ - -The following options are only used in ring server handlers. - -server_port - (integer) The port on which the request is being handled. This is only - used with ring servers, and is required. - -server_name - (string) The resolved server name, or the server IP address. Required when - using a Ring server. - -remote_addr - (string) The IP address of the client or the last proxy that sent the - request. Required when using a Ring server. - -Responses ---------- - -A response is an array-like object that implements -``GuzzleHttp\Ring\Future\FutureArrayInterface``. Responses contain the -following key value pairs: - -body - (string, fopen resource, ``Iterator``, ``GuzzleHttp\Stream\StreamInterface``) - The body of the response, if present. Can be a string, resource returned - from fopen, an ``Iterator`` that yields chunks of data, an object that - implemented ``__toString``, or a ``GuzzleHttp\Stream\StreamInterface``. - -effective_url - (string) The URL that returned the resulting response. - -error - (``\Exception``) Contains an exception describing any errors that were - encountered during the transfer. - -headers - (Required, array) Associative array of headers. Each key represents the - header name. Each value contains an array of strings where each entry of - the array is a header line. The headers array MAY be an empty array in the - event an error occurred before a response was received. - -reason - (string) Optional reason phrase. This option should be provided when the - reason phrase does not match the typical reason phrase associated with the - ``status`` code. See `RFC 7231 `_ - for a list of HTTP reason phrases mapped to status codes. - -status - (Required, integer) The HTTP status code. The status code MAY be set to - ``null`` in the event an error occurred before a response was received - (e.g., a networking error). - -transfer_stats - (array) Provides an associative array of arbitrary transfer statistics if - provided by the underlying handler. - -version - (string) HTTP protocol version. Defaults to ``1.1``. - -Middleware ----------- - -Ring middleware augments the functionality of handlers by invoking them in the -process of generating responses. Middleware is typically implemented as a -higher-order function that takes one or more handlers as arguments followed by -an optional associative array of options as the last argument, returning a new -handler with the desired compound behavior. - -Here's an example of a middleware that adds a Content-Type header to each -request. - -.. code-block:: php - - use GuzzleHttp\Ring\Client\CurlHandler; - use GuzzleHttp\Ring\Core; - - $contentTypeHandler = function(callable $handler, $contentType) { - return function (array $request) use ($handler, $contentType) { - return $handler(Core::setHeader('Content-Type', $contentType)); - }; - }; - - $baseHandler = new CurlHandler(); - $wrappedHandler = $contentTypeHandler($baseHandler, 'text/html'); - $response = $wrappedHandler([/** request hash **/]); diff --git a/core/vendor/guzzlehttp/ringphp/docs/testing.rst b/core/vendor/guzzlehttp/ringphp/docs/testing.rst deleted file mode 100644 index 9df2562..0000000 --- a/core/vendor/guzzlehttp/ringphp/docs/testing.rst +++ /dev/null @@ -1,74 +0,0 @@ -======= -Testing -======= - -RingPHP tests client handlers using `PHPUnit `_ and a -built-in node.js web server. - -Running Tests -------------- - -First, install the dependencies using `Composer `_. - - composer.phar install - -Next, run the unit tests using ``Make``. - - make test - -The tests are also run on Travis-CI on each commit: https://travis-ci.org/guzzle/guzzle-ring - -Test Server ------------ - -Testing client handlers usually involves actually sending HTTP requests. -RingPHP provides a node.js web server that returns canned responses and -keep a list of the requests that have been received. The server can then -be queried to get a list of the requests that were sent by the client so that -you can ensure that the client serialized and transferred requests as intended. - -The server keeps a list of queued responses and returns responses that are -popped off of the queue as HTTP requests are received. When there are not -more responses to serve, the server returns a 500 error response. - -The test server uses the ``GuzzleHttp\Tests\Ring\Client\Server`` class to -control the server. - -.. code-block:: php - - use GuzzleHttp\Ring\Client\StreamHandler; - use GuzzleHttp\Tests\Ring\Client\Server; - - // First return a 200 followed by a 404 response. - Server::enqueue([ - ['status' => 200], - ['status' => 404] - ]); - - $handler = new StreamHandler(); - - $response = $handler([ - 'http_method' => 'GET', - 'headers' => ['host' => [Server::$host]], - 'uri' => '/' - ]); - - assert(200 == $response['status']); - - $response = $handler([ - 'http_method' => 'HEAD', - 'headers' => ['host' => [Server::$host]], - 'uri' => '/' - ]); - - assert(404 == $response['status']); - -After requests have been sent, you can get a list of the requests as they -were sent over the wire to ensure they were sent correctly. - -.. code-block:: php - - $received = Server::received(); - - assert('GET' == $received[0]['http_method']); - assert('HEAD' == $received[1]['http_method']); diff --git a/core/vendor/guzzlehttp/ringphp/phpunit.xml.dist b/core/vendor/guzzlehttp/ringphp/phpunit.xml.dist deleted file mode 100644 index 1d19290..0000000 --- a/core/vendor/guzzlehttp/ringphp/phpunit.xml.dist +++ /dev/null @@ -1,14 +0,0 @@ - - - - - tests - - - - - src - - - diff --git a/core/vendor/guzzlehttp/ringphp/src/Client/ClientUtils.php b/core/vendor/guzzlehttp/ringphp/src/Client/ClientUtils.php deleted file mode 100644 index 2acf92e..0000000 --- a/core/vendor/guzzlehttp/ringphp/src/Client/ClientUtils.php +++ /dev/null @@ -1,74 +0,0 @@ -getDefaultOptions($request, $headers); - $this->applyMethod($request, $options); - - if (isset($request['client'])) { - $this->applyHandlerOptions($request, $options); - } - - $this->applyHeaders($request, $options); - unset($options['_headers']); - - // Add handler options from the request's configuration options - if (isset($request['client']['curl'])) { - $options = $this->applyCustomCurlOptions( - $request['client']['curl'], - $options - ); - } - - if (!$handle) { - $handle = curl_init(); - } - - $body = $this->getOutputBody($request, $options); - curl_setopt_array($handle, $options); - - return [$handle, &$headers, $body]; - } - - /** - * Creates a response hash from a cURL result. - * - * @param callable $handler Handler that was used. - * @param array $request Request that sent. - * @param array $response Response hash to update. - * @param array $headers Headers received during transfer. - * @param resource $body Body fopen response. - * - * @return array - */ - public static function createResponse( - callable $handler, - array $request, - array $response, - array $headers, - $body - ) { - if (isset($response['transfer_stats']['url'])) { - $response['effective_url'] = $response['transfer_stats']['url']; - } - - if (!empty($headers)) { - $startLine = explode(' ', array_shift($headers), 3); - $headerList = Core::headersFromLines($headers); - $response['headers'] = $headerList; - $response['status'] = isset($startLine[1]) ? (int) $startLine[1] : null; - $response['reason'] = isset($startLine[2]) ? $startLine[2] : null; - $response['body'] = $body; - Core::rewindBody($response); - } - - return !empty($response['curl']['errno']) || !isset($response['status']) - ? self::createErrorResponse($handler, $request, $response) - : $response; - } - - private static function createErrorResponse( - callable $handler, - array $request, - array $response - ) { - static $connectionErrors = [ - CURLE_OPERATION_TIMEOUTED => true, - CURLE_COULDNT_RESOLVE_HOST => true, - CURLE_COULDNT_CONNECT => true, - CURLE_SSL_CONNECT_ERROR => true, - CURLE_GOT_NOTHING => true, - ]; - - // Retry when nothing is present or when curl failed to rewind. - if (!isset($response['err_message']) - && (empty($response['curl']['errno']) - || $response['curl']['errno'] == 65) - ) { - return self::retryFailedRewind($handler, $request, $response); - } - - $message = isset($response['err_message']) - ? $response['err_message'] - : sprintf('cURL error %s: %s', - $response['curl']['errno'], - isset($response['curl']['error']) - ? $response['curl']['error'] - : 'See http://curl.haxx.se/libcurl/c/libcurl-errors.html'); - - $error = isset($response['curl']['errno']) - && isset($connectionErrors[$response['curl']['errno']]) - ? new ConnectException($message) - : new RingException($message); - - return $response + [ - 'status' => null, - 'reason' => null, - 'body' => null, - 'headers' => [], - 'error' => $error, - ]; - } - - private function getOutputBody(array $request, array &$options) - { - // Determine where the body of the response (if any) will be streamed. - if (isset($options[CURLOPT_WRITEFUNCTION])) { - return $request['client']['save_to']; - } - - if (isset($options[CURLOPT_FILE])) { - return $options[CURLOPT_FILE]; - } - - if ($request['http_method'] != 'HEAD') { - // Create a default body if one was not provided - return $options[CURLOPT_FILE] = fopen('php://temp', 'w+'); - } - - return null; - } - - private function getDefaultOptions(array $request, array &$headers) - { - $url = Core::url($request); - $startingResponse = false; - - $options = [ - '_headers' => $request['headers'], - CURLOPT_CUSTOMREQUEST => $request['http_method'], - CURLOPT_URL => $url, - CURLOPT_RETURNTRANSFER => false, - CURLOPT_HEADER => false, - CURLOPT_CONNECTTIMEOUT => 150, - CURLOPT_HEADERFUNCTION => function ($ch, $h) use (&$headers, &$startingResponse) { - $value = trim($h); - if ($value === '') { - $startingResponse = true; - } elseif ($startingResponse) { - $startingResponse = false; - $headers = [$value]; - } else { - $headers[] = $value; - } - return strlen($h); - }, - ]; - - if (isset($request['version'])) { - $options[CURLOPT_HTTP_VERSION] = $request['version'] == 1.1 ? CURL_HTTP_VERSION_1_1 : CURL_HTTP_VERSION_1_0; - } - - if (defined('CURLOPT_PROTOCOLS')) { - $options[CURLOPT_PROTOCOLS] = CURLPROTO_HTTP | CURLPROTO_HTTPS; - } - - return $options; - } - - private function applyMethod(array $request, array &$options) - { - if (isset($request['body'])) { - $this->applyBody($request, $options); - return; - } - - switch ($request['http_method']) { - case 'PUT': - case 'POST': - // See http://tools.ietf.org/html/rfc7230#section-3.3.2 - if (!Core::hasHeader($request, 'Content-Length')) { - $options[CURLOPT_HTTPHEADER][] = 'Content-Length: 0'; - } - break; - case 'HEAD': - $options[CURLOPT_NOBODY] = true; - unset( - $options[CURLOPT_WRITEFUNCTION], - $options[CURLOPT_READFUNCTION], - $options[CURLOPT_FILE], - $options[CURLOPT_INFILE] - ); - } - } - - private function applyBody(array $request, array &$options) - { - $contentLength = Core::firstHeader($request, 'Content-Length'); - $size = $contentLength !== null ? (int) $contentLength : null; - - // Send the body as a string if the size is less than 1MB OR if the - // [client][curl][body_as_string] request value is set. - if (($size !== null && $size < 1000000) || - isset($request['client']['curl']['body_as_string']) || - is_string($request['body']) - ) { - $options[CURLOPT_POSTFIELDS] = Core::body($request); - // Don't duplicate the Content-Length header - $this->removeHeader('Content-Length', $options); - $this->removeHeader('Transfer-Encoding', $options); - } else { - $options[CURLOPT_UPLOAD] = true; - if ($size !== null) { - // Let cURL handle setting the Content-Length header - $options[CURLOPT_INFILESIZE] = $size; - $this->removeHeader('Content-Length', $options); - } - $this->addStreamingBody($request, $options); - } - - // If the Expect header is not present, prevent curl from adding it - if (!Core::hasHeader($request, 'Expect')) { - $options[CURLOPT_HTTPHEADER][] = 'Expect:'; - } - - // cURL sometimes adds a content-type by default. Prevent this. - if (!Core::hasHeader($request, 'Content-Type')) { - $options[CURLOPT_HTTPHEADER][] = 'Content-Type:'; - } - } - - private function addStreamingBody(array $request, array &$options) - { - $body = $request['body']; - - if ($body instanceof StreamInterface) { - $options[CURLOPT_READFUNCTION] = function ($ch, $fd, $length) use ($body) { - return (string) $body->read($length); - }; - if (!isset($options[CURLOPT_INFILESIZE])) { - if ($size = $body->getSize()) { - $options[CURLOPT_INFILESIZE] = $size; - } - } - } elseif (is_resource($body)) { - $options[CURLOPT_INFILE] = $body; - } elseif ($body instanceof \Iterator) { - $buf = ''; - $options[CURLOPT_READFUNCTION] = function ($ch, $fd, $length) use ($body, &$buf) { - if ($body->valid()) { - $buf .= $body->current(); - $body->next(); - } - $result = (string) substr($buf, 0, $length); - $buf = substr($buf, $length); - return $result; - }; - } else { - throw new \InvalidArgumentException('Invalid request body provided'); - } - } - - private function applyHeaders(array $request, array &$options) - { - foreach ($options['_headers'] as $name => $values) { - foreach ($values as $value) { - $options[CURLOPT_HTTPHEADER][] = "$name: $value"; - } - } - - // Remove the Accept header if one was not set - if (!Core::hasHeader($request, 'Accept')) { - $options[CURLOPT_HTTPHEADER][] = 'Accept:'; - } - } - - /** - * Takes an array of curl options specified in the 'curl' option of a - * request's configuration array and maps them to CURLOPT_* options. - * - * This method is only called when a request has a 'curl' config setting. - * - * @param array $config Configuration array of custom curl option - * @param array $options Array of existing curl options - * - * @return array Returns a new array of curl options - */ - private function applyCustomCurlOptions(array $config, array $options) - { - $curlOptions = []; - foreach ($config as $key => $value) { - if (is_int($key)) { - $curlOptions[$key] = $value; - } - } - - return $curlOptions + $options; - } - - /** - * Remove a header from the options array. - * - * @param string $name Case-insensitive header to remove - * @param array $options Array of options to modify - */ - private function removeHeader($name, array &$options) - { - foreach (array_keys($options['_headers']) as $key) { - if (!strcasecmp($key, $name)) { - unset($options['_headers'][$key]); - return; - } - } - } - - /** - * Applies an array of request client options to a the options array. - * - * This method uses a large switch rather than double-dispatch to save on - * high overhead of calling functions in PHP. - */ - private function applyHandlerOptions(array $request, array &$options) - { - foreach ($request['client'] as $key => $value) { - switch ($key) { - // Violating PSR-4 to provide more room. - case 'verify': - - if ($value === false) { - unset($options[CURLOPT_CAINFO]); - $options[CURLOPT_SSL_VERIFYHOST] = 0; - $options[CURLOPT_SSL_VERIFYPEER] = false; - continue; - } - - $options[CURLOPT_SSL_VERIFYHOST] = 2; - $options[CURLOPT_SSL_VERIFYPEER] = true; - - if (is_string($value)) { - $options[CURLOPT_CAINFO] = $value; - if (!file_exists($value)) { - throw new \InvalidArgumentException( - "SSL CA bundle not found: $value" - ); - } - } - break; - - case 'decode_content': - - if ($value === false) { - continue; - } - - $accept = Core::firstHeader($request, 'Accept-Encoding'); - if ($accept) { - $options[CURLOPT_ENCODING] = $accept; - } else { - $options[CURLOPT_ENCODING] = ''; - // Don't let curl send the header over the wire - $options[CURLOPT_HTTPHEADER][] = 'Accept-Encoding:'; - } - break; - - case 'save_to': - - if (is_string($value)) { - $value = new LazyOpenStream($value, 'w+'); - } - - if ($value instanceof StreamInterface) { - $options[CURLOPT_WRITEFUNCTION] = - function ($ch, $write) use ($value) { - return $value->write($write); - }; - } elseif (is_resource($value)) { - $options[CURLOPT_FILE] = $value; - } else { - throw new \InvalidArgumentException('save_to must be a ' - . 'GuzzleHttp\Stream\StreamInterface or resource'); - } - break; - - case 'timeout': - - if (defined('CURLOPT_TIMEOUT_MS')) { - $options[CURLOPT_TIMEOUT_MS] = $value * 1000; - } else { - $options[CURLOPT_TIMEOUT] = $value; - } - break; - - case 'connect_timeout': - - if (defined('CURLOPT_CONNECTTIMEOUT_MS')) { - $options[CURLOPT_CONNECTTIMEOUT_MS] = $value * 1000; - } else { - $options[CURLOPT_CONNECTTIMEOUT] = $value; - } - break; - - case 'proxy': - - if (!is_array($value)) { - $options[CURLOPT_PROXY] = $value; - } elseif (isset($request['scheme'])) { - $scheme = $request['scheme']; - if (isset($value[$scheme])) { - $options[CURLOPT_PROXY] = $value[$scheme]; - } - } - break; - - case 'cert': - - if (is_array($value)) { - $options[CURLOPT_SSLCERTPASSWD] = $value[1]; - $value = $value[0]; - } - - if (!file_exists($value)) { - throw new \InvalidArgumentException( - "SSL certificate not found: {$value}" - ); - } - - $options[CURLOPT_SSLCERT] = $value; - break; - - case 'ssl_key': - - if (is_array($value)) { - $options[CURLOPT_SSLKEYPASSWD] = $value[1]; - $value = $value[0]; - } - - if (!file_exists($value)) { - throw new \InvalidArgumentException( - "SSL private key not found: {$value}" - ); - } - - $options[CURLOPT_SSLKEY] = $value; - break; - - case 'progress': - - if (!is_callable($value)) { - throw new \InvalidArgumentException( - 'progress client option must be callable' - ); - } - - $options[CURLOPT_NOPROGRESS] = false; - $options[CURLOPT_PROGRESSFUNCTION] = - function () use ($value) { - $args = func_get_args(); - // PHP 5.5 pushed the handle onto the start of the args - if (is_resource($args[0])) { - array_shift($args); - } - call_user_func_array($value, $args); - }; - break; - - case 'debug': - - if ($value) { - $options[CURLOPT_STDERR] = Core::getDebugResource($value); - $options[CURLOPT_VERBOSE] = true; - } - break; - } - } - } - - /** - * This function ensures that a response was set on a transaction. If one - * was not set, then the request is retried if possible. This error - * typically means you are sending a payload, curl encountered a - * "Connection died, retrying a fresh connect" error, tried to rewind the - * stream, and then encountered a "necessary data rewind wasn't possible" - * error, causing the request to be sent through curl_multi_info_read() - * without an error status. - */ - private static function retryFailedRewind( - callable $handler, - array $request, - array $response - ) { - // If there is no body, then there is some other kind of issue. This - // is weird and should probably never happen. - if (!isset($request['body'])) { - $response['err_message'] = 'No response was received for a request ' - . 'with no body. This could mean that you are saturating your ' - . 'network.'; - return self::createErrorResponse($handler, $request, $response); - } - - if (!Core::rewindBody($request)) { - $response['err_message'] = 'The connection unexpectedly failed ' - . 'without providing an error. The request would have been ' - . 'retried, but attempting to rewind the request body failed.'; - return self::createErrorResponse($handler, $request, $response); - } - - // Retry no more than 3 times before giving up. - if (!isset($request['curl']['retries'])) { - $request['curl']['retries'] = 1; - } elseif ($request['curl']['retries'] == 2) { - $response['err_message'] = 'The cURL request was retried 3 times ' - . 'and did no succeed. cURL was unable to rewind the body of ' - . 'the request and subsequent retries resulted in the same ' - . 'error. Turn on the debug option to see what went wrong. ' - . 'See https://bugs.php.net/bug.php?id=47204 for more information.'; - return self::createErrorResponse($handler, $request, $response); - } else { - $request['curl']['retries']++; - } - - return $handler($request); - } -} diff --git a/core/vendor/guzzlehttp/ringphp/src/Client/CurlHandler.php b/core/vendor/guzzlehttp/ringphp/src/Client/CurlHandler.php deleted file mode 100644 index d8215c5..0000000 --- a/core/vendor/guzzlehttp/ringphp/src/Client/CurlHandler.php +++ /dev/null @@ -1,118 +0,0 @@ -handles = $this->ownedHandles = []; - $this->factory = isset($options['handle_factory']) - ? $options['handle_factory'] - : new CurlFactory(); - $this->maxHandles = isset($options['max_handles']) - ? $options['max_handles'] - : 5; - } - - public function __destruct() - { - foreach ($this->handles as $handle) { - if (is_resource($handle)) { - curl_close($handle); - } - } - } - - public function __invoke(array $request) - { - $factory = $this->factory; - - // Ensure headers are by reference. They're updated elsewhere. - $result = $factory($request, $this->checkoutEasyHandle()); - $h = $result[0]; - $hd =& $result[1]; - $bd = $result[2]; - Core::doSleep($request); - curl_exec($h); - $response = ['transfer_stats' => curl_getinfo($h)]; - $response['curl']['error'] = curl_error($h); - $response['curl']['errno'] = curl_errno($h); - $response['transfer_stats'] = array_merge($response['transfer_stats'], $response['curl']); - $this->releaseEasyHandle($h); - - return new CompletedFutureArray( - CurlFactory::createResponse($this, $request, $response, $hd, $bd) - ); - } - - private function checkoutEasyHandle() - { - // Find an unused handle in the cache - if (false !== ($key = array_search(false, $this->ownedHandles, true))) { - $this->ownedHandles[$key] = true; - return $this->handles[$key]; - } - - // Add a new handle - $handle = curl_init(); - $id = (int) $handle; - $this->handles[$id] = $handle; - $this->ownedHandles[$id] = true; - - return $handle; - } - - private function releaseEasyHandle($handle) - { - $id = (int) $handle; - if (count($this->ownedHandles) > $this->maxHandles) { - curl_close($this->handles[$id]); - unset($this->handles[$id], $this->ownedHandles[$id]); - } else { - // curl_reset doesn't clear these out for some reason - static $unsetValues = [ - CURLOPT_HEADERFUNCTION => null, - CURLOPT_WRITEFUNCTION => null, - CURLOPT_READFUNCTION => null, - CURLOPT_PROGRESSFUNCTION => null, - ]; - curl_setopt_array($handle, $unsetValues); - curl_reset($handle); - $this->ownedHandles[$id] = false; - } - } -} diff --git a/core/vendor/guzzlehttp/ringphp/src/Client/CurlMultiHandler.php b/core/vendor/guzzlehttp/ringphp/src/Client/CurlMultiHandler.php deleted file mode 100644 index b45f6c3..0000000 --- a/core/vendor/guzzlehttp/ringphp/src/Client/CurlMultiHandler.php +++ /dev/null @@ -1,250 +0,0 @@ -_mh = $options['mh']; - } - $this->factory = isset($options['handle_factory']) - ? $options['handle_factory'] : new CurlFactory(); - $this->selectTimeout = isset($options['select_timeout']) - ? $options['select_timeout'] : 1; - $this->maxHandles = isset($options['max_handles']) - ? $options['max_handles'] : 100; - } - - public function __get($name) - { - if ($name === '_mh') { - return $this->_mh = curl_multi_init(); - } - - throw new \BadMethodCallException(); - } - - public function __destruct() - { - // Finish any open connections before terminating the script. - if ($this->handles) { - $this->execute(); - } - - if (isset($this->_mh)) { - curl_multi_close($this->_mh); - unset($this->_mh); - } - } - - public function __invoke(array $request) - { - $factory = $this->factory; - $result = $factory($request); - $entry = [ - 'request' => $request, - 'response' => [], - 'handle' => $result[0], - 'headers' => &$result[1], - 'body' => $result[2], - 'deferred' => new Deferred(), - ]; - - $id = (int) $result[0]; - - $future = new FutureArray( - $entry['deferred']->promise(), - [$this, 'execute'], - function () use ($id) { - return $this->cancel($id); - } - ); - - $this->addRequest($entry); - - // Transfer outstanding requests if there are too many open handles. - if (count($this->handles) >= $this->maxHandles) { - $this->execute(); - } - - return $future; - } - - /** - * Runs until all outstanding connections have completed. - */ - public function execute() - { - do { - - if ($this->active && - curl_multi_select($this->_mh, $this->selectTimeout) === -1 - ) { - // Perform a usleep if a select returns -1. - // See: https://bugs.php.net/bug.php?id=61141 - usleep(250); - } - - // Add any delayed futures if needed. - if ($this->delays) { - $this->addDelays(); - } - - do { - $mrc = curl_multi_exec($this->_mh, $this->active); - } while ($mrc === CURLM_CALL_MULTI_PERFORM); - - $this->processMessages(); - - // If there are delays but no transfers, then sleep for a bit. - if (!$this->active && $this->delays) { - usleep(500); - } - - } while ($this->active || $this->handles); - } - - private function addRequest(array &$entry) - { - $id = (int) $entry['handle']; - $this->handles[$id] = $entry; - - // If the request is a delay, then add the reques to the curl multi - // pool only after the specified delay. - if (isset($entry['request']['client']['delay'])) { - $this->delays[$id] = microtime(true) + ($entry['request']['client']['delay'] / 1000); - } elseif (empty($entry['request']['future'])) { - curl_multi_add_handle($this->_mh, $entry['handle']); - } else { - curl_multi_add_handle($this->_mh, $entry['handle']); - // "lazy" futures are only sent once the pool has many requests. - if ($entry['request']['future'] !== 'lazy') { - do { - $mrc = curl_multi_exec($this->_mh, $this->active); - } while ($mrc === CURLM_CALL_MULTI_PERFORM); - $this->processMessages(); - } - } - } - - private function removeProcessed($id) - { - if (isset($this->handles[$id])) { - curl_multi_remove_handle( - $this->_mh, - $this->handles[$id]['handle'] - ); - curl_close($this->handles[$id]['handle']); - unset($this->handles[$id], $this->delays[$id]); - } - } - - /** - * Cancels a handle from sending and removes references to it. - * - * @param int $id Handle ID to cancel and remove. - * - * @return bool True on success, false on failure. - */ - private function cancel($id) - { - // Cannot cancel if it has been processed. - if (!isset($this->handles[$id])) { - return false; - } - - $handle = $this->handles[$id]['handle']; - unset($this->delays[$id], $this->handles[$id]); - curl_multi_remove_handle($this->_mh, $handle); - curl_close($handle); - - return true; - } - - private function addDelays() - { - $currentTime = microtime(true); - - foreach ($this->delays as $id => $delay) { - if ($currentTime >= $delay) { - unset($this->delays[$id]); - curl_multi_add_handle( - $this->_mh, - $this->handles[$id]['handle'] - ); - } - } - } - - private function processMessages() - { - while ($done = curl_multi_info_read($this->_mh)) { - $id = (int) $done['handle']; - - if (!isset($this->handles[$id])) { - // Probably was cancelled. - continue; - } - - $entry = $this->handles[$id]; - $entry['response']['transfer_stats'] = curl_getinfo($done['handle']); - - if ($done['result'] !== CURLM_OK) { - $entry['response']['curl']['errno'] = $done['result']; - if (function_exists('curl_strerror')) { - $entry['response']['curl']['error'] = curl_strerror($done['result']); - } - } - - $result = CurlFactory::createResponse( - $this, - $entry['request'], - $entry['response'], - $entry['headers'], - $entry['body'] - ); - - $this->removeProcessed($id); - $entry['deferred']->resolve($result); - } - } -} diff --git a/core/vendor/guzzlehttp/ringphp/src/Client/Middleware.php b/core/vendor/guzzlehttp/ringphp/src/Client/Middleware.php deleted file mode 100644 index 6fa7318..0000000 --- a/core/vendor/guzzlehttp/ringphp/src/Client/Middleware.php +++ /dev/null @@ -1,58 +0,0 @@ -result = $result; - } - - public function __invoke(array $request) - { - Core::doSleep($request); - $response = is_callable($this->result) - ? call_user_func($this->result, $request) - : $this->result; - - if (is_array($response)) { - $response = new CompletedFutureArray($response + [ - 'status' => null, - 'body' => null, - 'headers' => [], - 'reason' => null, - 'effective_url' => null, - ]); - } elseif (!$response instanceof FutureArrayInterface) { - throw new \InvalidArgumentException( - 'Response must be an array or FutureArrayInterface. Found ' - . Core::describeType($request) - ); - } - - return $response; - } -} diff --git a/core/vendor/guzzlehttp/ringphp/src/Client/StreamHandler.php b/core/vendor/guzzlehttp/ringphp/src/Client/StreamHandler.php deleted file mode 100644 index 855aad7..0000000 --- a/core/vendor/guzzlehttp/ringphp/src/Client/StreamHandler.php +++ /dev/null @@ -1,412 +0,0 @@ -options = $options; - } - - public function __invoke(array $request) - { - $url = Core::url($request); - Core::doSleep($request); - - try { - // Does not support the expect header. - $request = Core::removeHeader($request, 'Expect'); - $stream = $this->createStream($url, $request); - return $this->createResponse($request, $url, $stream); - } catch (RingException $e) { - return $this->createErrorResponse($url, $e); - } - } - - private function createResponse(array $request, $url, $stream) - { - $hdrs = $this->lastHeaders; - $this->lastHeaders = null; - $parts = explode(' ', array_shift($hdrs), 3); - $response = [ - 'status' => $parts[1], - 'reason' => isset($parts[2]) ? $parts[2] : null, - 'headers' => Core::headersFromLines($hdrs), - 'effective_url' => $url, - ]; - - $stream = $this->checkDecode($request, $response, $stream); - - // If not streaming, then drain the response into a stream. - if (empty($request['client']['stream'])) { - $dest = isset($request['client']['save_to']) - ? $request['client']['save_to'] - : fopen('php://temp', 'r+'); - $stream = $this->drain($stream, $dest); - } - - $response['body'] = $stream; - - return new CompletedFutureArray($response); - } - - private function checkDecode(array $request, array $response, $stream) - { - // Automatically decode responses when instructed. - if (!empty($request['client']['decode_content'])) { - switch (Core::firstHeader($response, 'Content-Encoding', true)) { - case 'gzip': - case 'deflate': - $stream = new InflateStream(Stream::factory($stream)); - break; - } - } - - return $stream; - } - - /** - * Drains the stream into the "save_to" client option. - * - * @param resource $stream - * @param string|resource|StreamInterface $dest - * - * @return Stream - * @throws \RuntimeException when the save_to option is invalid. - */ - private function drain($stream, $dest) - { - if (is_resource($stream)) { - if (!is_resource($dest)) { - $stream = Stream::factory($stream); - } else { - stream_copy_to_stream($stream, $dest); - fclose($stream); - rewind($dest); - return $dest; - } - } - - // Stream the response into the destination stream - $dest = is_string($dest) - ? new Stream(Utils::open($dest, 'r+')) - : Stream::factory($dest); - - Utils::copyToStream($stream, $dest); - $dest->seek(0); - $stream->close(); - - return $dest; - } - - /** - * Creates an error response for the given stream. - * - * @param string $url - * @param RingException $e - * - * @return array - */ - private function createErrorResponse($url, RingException $e) - { - // Determine if the error was a networking error. - $message = $e->getMessage(); - - // This list can probably get more comprehensive. - if (strpos($message, 'getaddrinfo') // DNS lookup failed - || strpos($message, 'Connection refused') - ) { - $e = new ConnectException($e->getMessage(), 0, $e); - } - - return new CompletedFutureArray([ - 'status' => null, - 'body' => null, - 'headers' => [], - 'effective_url' => $url, - 'error' => $e - ]); - } - - /** - * Create a resource and check to ensure it was created successfully - * - * @param callable $callback Callable that returns stream resource - * - * @return resource - * @throws \RuntimeException on error - */ - private function createResource(callable $callback) - { - $errors = null; - set_error_handler(function ($_, $msg, $file, $line) use (&$errors) { - $errors[] = [ - 'message' => $msg, - 'file' => $file, - 'line' => $line - ]; - return true; - }); - - $resource = $callback(); - restore_error_handler(); - - if (!$resource) { - $message = 'Error creating resource: '; - foreach ($errors as $err) { - foreach ($err as $key => $value) { - $message .= "[$key] $value" . PHP_EOL; - } - } - throw new RingException(trim($message)); - } - - return $resource; - } - - private function createStream($url, array $request) - { - static $methods; - if (!$methods) { - $methods = array_flip(get_class_methods(__CLASS__)); - } - - // HTTP/1.1 streams using the PHP stream wrapper require a - // Connection: close header - if ((!isset($request['version']) || $request['version'] == '1.1') - && !Core::hasHeader($request, 'Connection') - ) { - $request['headers']['Connection'] = ['close']; - } - - // Ensure SSL is verified by default - if (!isset($request['client']['verify'])) { - $request['client']['verify'] = true; - } - - $params = []; - $options = $this->getDefaultOptions($request); - - if (isset($request['client'])) { - foreach ($request['client'] as $key => $value) { - $method = "add_{$key}"; - if (isset($methods[$method])) { - $this->{$method}($request, $options, $value, $params); - } - } - } - - return $this->createStreamResource( - $url, - $request, - $options, - $this->createContext($request, $options, $params) - ); - } - - private function getDefaultOptions(array $request) - { - $headers = ""; - foreach ($request['headers'] as $name => $value) { - foreach ((array) $value as $val) { - $headers .= "$name: $val\r\n"; - } - } - - $context = [ - 'http' => [ - 'method' => $request['http_method'], - 'header' => $headers, - 'protocol_version' => isset($request['version']) ? $request['version'] : 1.1, - 'ignore_errors' => true, - 'follow_location' => 0, - ], - ]; - - $body = Core::body($request); - if (isset($body)) { - $context['http']['content'] = $body; - // Prevent the HTTP handler from adding a Content-Type header. - if (!Core::hasHeader($request, 'Content-Type')) { - $context['http']['header'] .= "Content-Type:\r\n"; - } - } - - $context['http']['header'] = rtrim($context['http']['header']); - - return $context; - } - - private function add_proxy(array $request, &$options, $value, &$params) - { - if (!is_array($value)) { - $options['http']['proxy'] = $value; - } else { - $scheme = isset($request['scheme']) ? $request['scheme'] : 'http'; - if (isset($value[$scheme])) { - $options['http']['proxy'] = $value[$scheme]; - } - } - } - - private function add_timeout(array $request, &$options, $value, &$params) - { - $options['http']['timeout'] = $value; - } - - private function add_verify(array $request, &$options, $value, &$params) - { - if ($value === true) { - // PHP 5.6 or greater will find the system cert by default. When - // < 5.6, use the Guzzle bundled cacert. - if (PHP_VERSION_ID < 50600) { - $options['ssl']['cafile'] = ClientUtils::getDefaultCaBundle(); - } - } elseif (is_string($value)) { - $options['ssl']['cafile'] = $value; - if (!file_exists($value)) { - throw new RingException("SSL CA bundle not found: $value"); - } - } elseif ($value === false) { - $options['ssl']['verify_peer'] = false; - return; - } else { - throw new RingException('Invalid verify request option'); - } - - $options['ssl']['verify_peer'] = true; - $options['ssl']['allow_self_signed'] = true; - } - - private function add_cert(array $request, &$options, $value, &$params) - { - if (is_array($value)) { - $options['ssl']['passphrase'] = $value[1]; - $value = $value[0]; - } - - if (!file_exists($value)) { - throw new RingException("SSL certificate not found: {$value}"); - } - - $options['ssl']['local_cert'] = $value; - } - - private function add_progress(array $request, &$options, $value, &$params) - { - $fn = function ($code, $_1, $_2, $_3, $transferred, $total) use ($value) { - if ($code == STREAM_NOTIFY_PROGRESS) { - $value($total, $transferred, null, null); - } - }; - - // Wrap the existing function if needed. - $params['notification'] = isset($params['notification']) - ? Core::callArray([$params['notification'], $fn]) - : $fn; - } - - private function add_debug(array $request, &$options, $value, &$params) - { - if ($value === false) { - return; - } - - static $map = [ - STREAM_NOTIFY_CONNECT => 'CONNECT', - STREAM_NOTIFY_AUTH_REQUIRED => 'AUTH_REQUIRED', - STREAM_NOTIFY_AUTH_RESULT => 'AUTH_RESULT', - STREAM_NOTIFY_MIME_TYPE_IS => 'MIME_TYPE_IS', - STREAM_NOTIFY_FILE_SIZE_IS => 'FILE_SIZE_IS', - STREAM_NOTIFY_REDIRECTED => 'REDIRECTED', - STREAM_NOTIFY_PROGRESS => 'PROGRESS', - STREAM_NOTIFY_FAILURE => 'FAILURE', - STREAM_NOTIFY_COMPLETED => 'COMPLETED', - STREAM_NOTIFY_RESOLVE => 'RESOLVE', - ]; - - static $args = ['severity', 'message', 'message_code', - 'bytes_transferred', 'bytes_max']; - - $value = Core::getDebugResource($value); - $ident = $request['http_method'] . ' ' . Core::url($request); - $fn = function () use ($ident, $value, $map, $args) { - $passed = func_get_args(); - $code = array_shift($passed); - fprintf($value, '<%s> [%s] ', $ident, $map[$code]); - foreach (array_filter($passed) as $i => $v) { - fwrite($value, $args[$i] . ': "' . $v . '" '); - } - fwrite($value, "\n"); - }; - - // Wrap the existing function if needed. - $params['notification'] = isset($params['notification']) - ? Core::callArray([$params['notification'], $fn]) - : $fn; - } - - private function applyCustomOptions(array $request, array &$options) - { - if (!isset($request['client']['stream_context'])) { - return; - } - - if (!is_array($request['client']['stream_context'])) { - throw new RingException('stream_context must be an array'); - } - - $options = array_replace_recursive( - $options, - $request['client']['stream_context'] - ); - } - - private function createContext(array $request, array $options, array $params) - { - $this->applyCustomOptions($request, $options); - return $this->createResource( - function () use ($request, $options, $params) { - return stream_context_create($options, $params); - }, - $request, - $options - ); - } - - private function createStreamResource( - $url, - array $request, - array $options, - $context - ) { - return $this->createResource( - function () use ($url, $context) { - if (false === strpos($url, 'http')) { - trigger_error("URL is invalid: {$url}", E_USER_WARNING); - return null; - } - $resource = fopen($url, 'r', null, $context); - $this->lastHeaders = $http_response_header; - return $resource; - }, - $request, - $options - ); - } -} diff --git a/core/vendor/guzzlehttp/ringphp/src/Core.php b/core/vendor/guzzlehttp/ringphp/src/Core.php deleted file mode 100644 index dd7d1a0..0000000 --- a/core/vendor/guzzlehttp/ringphp/src/Core.php +++ /dev/null @@ -1,364 +0,0 @@ - $value) { - if (!strcasecmp($name, $header)) { - $result = array_merge($result, $value); - } - } - } - - return $result; - } - - /** - * Gets a header value from a message as a string or null - * - * This method searches through the "headers" key of a message for a header - * using a case-insensitive search. The lines of the header are imploded - * using commas into a single string return value. - * - * @param array $message Request or response hash. - * @param string $header Header to retrieve - * - * @return string|null Returns the header string if found, or null if not. - */ - public static function header($message, $header) - { - $match = self::headerLines($message, $header); - return $match ? implode(', ', $match) : null; - } - - /** - * Returns the first header value from a message as a string or null. If - * a header line contains multiple values separated by a comma, then this - * function will return the first value in the list. - * - * @param array $message Request or response hash. - * @param string $header Header to retrieve - * - * @return string|null Returns the value as a string if found. - */ - public static function firstHeader($message, $header) - { - if (!empty($message['headers'])) { - foreach ($message['headers'] as $name => $value) { - if (!strcasecmp($name, $header)) { - // Return the match itself if it is a single value. - $pos = strpos($value[0], ','); - return $pos ? substr($value[0], 0, $pos) : $value[0]; - } - } - } - - return null; - } - - /** - * Returns true if a message has the provided case-insensitive header. - * - * @param array $message Request or response hash. - * @param string $header Header to check - * - * @return bool - */ - public static function hasHeader($message, $header) - { - if (!empty($message['headers'])) { - foreach ($message['headers'] as $name => $value) { - if (!strcasecmp($name, $header)) { - return true; - } - } - } - - return false; - } - - /** - * Parses an array of header lines into an associative array of headers. - * - * @param array $lines Header lines array of strings in the following - * format: "Name: Value" - * @return array - */ - public static function headersFromLines($lines) - { - $headers = []; - - foreach ($lines as $line) { - $parts = explode(':', $line, 2); - $headers[trim($parts[0])][] = isset($parts[1]) - ? trim($parts[1]) - : null; - } - - return $headers; - } - - /** - * Removes a header from a message using a case-insensitive comparison. - * - * @param array $message Message that contains 'headers' - * @param string $header Header to remove - * - * @return array - */ - public static function removeHeader(array $message, $header) - { - if (isset($message['headers'])) { - foreach (array_keys($message['headers']) as $key) { - if (!strcasecmp($header, $key)) { - unset($message['headers'][$key]); - } - } - } - - return $message; - } - - /** - * Replaces any existing case insensitive headers with the given value. - * - * @param array $message Message that contains 'headers' - * @param string $header Header to set. - * @param array $value Value to set. - * - * @return array - */ - public static function setHeader(array $message, $header, array $value) - { - $message = self::removeHeader($message, $header); - $message['headers'][$header] = $value; - - return $message; - } - - /** - * Creates a URL string from a request. - * - * If the "url" key is present on the request, it is returned, otherwise - * the url is built up based on the scheme, host, uri, and query_string - * request values. - * - * @param array $request Request to get the URL from - * - * @return string Returns the request URL as a string. - * @throws \InvalidArgumentException if no Host header is present. - */ - public static function url(array $request) - { - if (isset($request['url'])) { - return $request['url']; - } - - $uri = (isset($request['scheme']) - ? $request['scheme'] : 'http') . '://'; - - if ($host = self::header($request, 'host')) { - $uri .= $host; - } else { - throw new \InvalidArgumentException('No Host header was provided'); - } - - if (isset($request['uri'])) { - $uri .= $request['uri']; - } - - if (isset($request['query_string'])) { - $uri .= '?' . $request['query_string']; - } - - return $uri; - } - - /** - * Reads the body of a message into a string. - * - * @param array|FutureArrayInterface $message Array containing a "body" key - * - * @return null|string Returns the body as a string or null if not set. - * @throws \InvalidArgumentException if a request body is invalid. - */ - public static function body($message) - { - if (!isset($message['body'])) { - return null; - } - - if ($message['body'] instanceof StreamInterface) { - return (string) $message['body']; - } - - switch (gettype($message['body'])) { - case 'string': - return $message['body']; - case 'resource': - return stream_get_contents($message['body']); - case 'object': - if ($message['body'] instanceof \Iterator) { - return implode('', iterator_to_array($message['body'])); - } elseif (method_exists($message['body'], '__toString')) { - return (string) $message['body']; - } - default: - throw new \InvalidArgumentException('Invalid request body: ' - . self::describeType($message['body'])); - } - } - - /** - * Rewind the body of the provided message if possible. - * - * @param array $message Message that contains a 'body' field. - * - * @return bool Returns true on success, false on failure - */ - public static function rewindBody($message) - { - if ($message['body'] instanceof StreamInterface) { - return $message['body']->seek(0); - } - - if ($message['body'] instanceof \Generator) { - return false; - } - - if ($message['body'] instanceof \Iterator) { - $message['body']->rewind(); - return true; - } - - if (is_resource($message['body'])) { - return rewind($message['body']); - } - - return is_string($message['body']) - || (is_object($message['body']) - && method_exists($message['body'], '__toString')); - } - - /** - * Debug function used to describe the provided value type and class. - * - * @param mixed $input - * - * @return string Returns a string containing the type of the variable and - * if a class is provided, the class name. - */ - public static function describeType($input) - { - switch (gettype($input)) { - case 'object': - return 'object(' . get_class($input) . ')'; - case 'array': - return 'array(' . count($input) . ')'; - default: - ob_start(); - var_dump($input); - // normalize float vs double - return str_replace('double(', 'float(', rtrim(ob_get_clean())); - } - } - - /** - * Sleep for the specified amount of time specified in the request's - * ['client']['delay'] option if present. - * - * This function should only be used when a non-blocking sleep is not - * possible. - * - * @param array $request Request to sleep - */ - public static function doSleep(array $request) - { - if (isset($request['client']['delay'])) { - usleep($request['client']['delay'] * 1000); - } - } - - /** - * Returns a proxied future that modifies the dereferenced value of another - * future using a promise. - * - * @param FutureArrayInterface $future Future to wrap with a new future - * @param callable $onFulfilled Invoked when the future fulfilled - * @param callable $onRejected Invoked when the future rejected - * @param callable $onProgress Invoked when the future progresses - * - * @return FutureArray - */ - public static function proxy( - FutureArrayInterface $future, - callable $onFulfilled = null, - callable $onRejected = null, - callable $onProgress = null - ) { - return new FutureArray( - $future->then($onFulfilled, $onRejected, $onProgress), - [$future, 'wait'], - [$future, 'cancel'] - ); - } - - /** - * Returns a debug stream based on the provided variable. - * - * @param mixed $value Optional value - * - * @return resource - */ - public static function getDebugResource($value = null) - { - if (is_resource($value)) { - return $value; - } elseif (defined('STDOUT')) { - return STDOUT; - } else { - return fopen('php://output', 'w'); - } - } -} diff --git a/core/vendor/guzzlehttp/ringphp/src/Exception/CancelledException.php b/core/vendor/guzzlehttp/ringphp/src/Exception/CancelledException.php deleted file mode 100644 index 95b353a..0000000 --- a/core/vendor/guzzlehttp/ringphp/src/Exception/CancelledException.php +++ /dev/null @@ -1,7 +0,0 @@ -wrappedPromise = $promise; - $this->waitfn = $wait; - $this->cancelfn = $cancel; - } - - public function wait() - { - if (!$this->isRealized) { - $this->addShadow(); - if (!$this->isRealized && $this->waitfn) { - $this->invokeWait(); - } - if (!$this->isRealized) { - $this->error = new RingException('Waiting did not resolve future'); - } - } - - if ($this->error) { - throw $this->error; - } - - return $this->result; - } - - public function promise() - { - return $this->wrappedPromise; - } - - public function then( - callable $onFulfilled = null, - callable $onRejected = null, - callable $onProgress = null - ) { - return $this->wrappedPromise->then($onFulfilled, $onRejected, $onProgress); - } - - public function cancel() - { - if (!$this->isRealized) { - $cancelfn = $this->cancelfn; - $this->waitfn = $this->cancelfn = null; - $this->isRealized = true; - $this->error = new CancelledFutureAccessException(); - if ($cancelfn) { - $cancelfn($this); - } - } - } - - private function addShadow() - { - // Get the result and error when the promise is resolved. Note that - // calling this function might trigger the resolution immediately. - $this->wrappedPromise->then( - function ($value) { - $this->isRealized = true; - $this->result = $value; - $this->waitfn = $this->cancelfn = null; - }, - function ($error) { - $this->isRealized = true; - $this->error = $error; - $this->waitfn = $this->cancelfn = null; - } - ); - } - - private function invokeWait() - { - try { - $wait = $this->waitfn; - $this->waitfn = null; - $wait(); - } catch (\Exception $e) { - // Defer can throw to reject. - $this->error = $e; - $this->isRealized = true; - } - } -} diff --git a/core/vendor/guzzlehttp/ringphp/src/Future/CompletedFutureArray.php b/core/vendor/guzzlehttp/ringphp/src/Future/CompletedFutureArray.php deleted file mode 100644 index 0a90c93..0000000 --- a/core/vendor/guzzlehttp/ringphp/src/Future/CompletedFutureArray.php +++ /dev/null @@ -1,43 +0,0 @@ -result[$offset]); - } - - public function offsetGet($offset) - { - return $this->result[$offset]; - } - - public function offsetSet($offset, $value) - { - $this->result[$offset] = $value; - } - - public function offsetUnset($offset) - { - unset($this->result[$offset]); - } - - public function count() - { - return count($this->result); - } - - public function getIterator() - { - return new \ArrayIterator($this->result); - } -} diff --git a/core/vendor/guzzlehttp/ringphp/src/Future/CompletedFutureValue.php b/core/vendor/guzzlehttp/ringphp/src/Future/CompletedFutureValue.php deleted file mode 100644 index 0d25af7..0000000 --- a/core/vendor/guzzlehttp/ringphp/src/Future/CompletedFutureValue.php +++ /dev/null @@ -1,57 +0,0 @@ -result = $result; - $this->error = $e; - } - - public function wait() - { - if ($this->error) { - throw $this->error; - } - - return $this->result; - } - - public function cancel() {} - - public function promise() - { - if (!$this->cachedPromise) { - $this->cachedPromise = $this->error - ? new RejectedPromise($this->error) - : new FulfilledPromise($this->result); - } - - return $this->cachedPromise; - } - - public function then( - callable $onFulfilled = null, - callable $onRejected = null, - callable $onProgress = null - ) { - return $this->promise()->then($onFulfilled, $onRejected, $onProgress); - } -} diff --git a/core/vendor/guzzlehttp/ringphp/src/Future/FutureArray.php b/core/vendor/guzzlehttp/ringphp/src/Future/FutureArray.php deleted file mode 100644 index 3d64c96..0000000 --- a/core/vendor/guzzlehttp/ringphp/src/Future/FutureArray.php +++ /dev/null @@ -1,40 +0,0 @@ -_value[$offset]); - } - - public function offsetGet($offset) - { - return $this->_value[$offset]; - } - - public function offsetSet($offset, $value) - { - $this->_value[$offset] = $value; - } - - public function offsetUnset($offset) - { - unset($this->_value[$offset]); - } - - public function count() - { - return count($this->_value); - } - - public function getIterator() - { - return new \ArrayIterator($this->_value); - } -} diff --git a/core/vendor/guzzlehttp/ringphp/src/Future/FutureArrayInterface.php b/core/vendor/guzzlehttp/ringphp/src/Future/FutureArrayInterface.php deleted file mode 100644 index 58f5f73..0000000 --- a/core/vendor/guzzlehttp/ringphp/src/Future/FutureArrayInterface.php +++ /dev/null @@ -1,11 +0,0 @@ -_value = $this->wait(); - } -} diff --git a/core/vendor/guzzlehttp/ringphp/tests/Client/CurlFactoryTest.php b/core/vendor/guzzlehttp/ringphp/tests/Client/CurlFactoryTest.php deleted file mode 100644 index 0f787c9..0000000 --- a/core/vendor/guzzlehttp/ringphp/tests/Client/CurlFactoryTest.php +++ /dev/null @@ -1,792 +0,0 @@ - 200, - 'headers' => [ - 'Foo' => ['Bar'], - 'Baz' => ['bam'], - 'Content-Length' => [2], - ], - 'body' => 'hi', - ]]); - - $stream = Stream::factory(); - - $request = [ - 'http_method' => 'PUT', - 'headers' => [ - 'host' => [Server::$url], - 'Hi' => [' 123'], - ], - 'body' => 'testing', - 'client' => ['save_to' => $stream], - ]; - - $f = new CurlFactory(); - $result = $f($request); - $this->assertInternalType('array', $result); - $this->assertCount(3, $result); - $this->assertInternalType('resource', $result[0]); - $this->assertInternalType('array', $result[1]); - $this->assertSame($stream, $result[2]); - curl_close($result[0]); - - $this->assertEquals('PUT', $_SERVER['_curl'][CURLOPT_CUSTOMREQUEST]); - $this->assertEquals( - 'http://http://127.0.0.1:8125/', - $_SERVER['_curl'][CURLOPT_URL] - ); - // Sends via post fields when the request is small enough - $this->assertEquals('testing', $_SERVER['_curl'][CURLOPT_POSTFIELDS]); - $this->assertEquals(0, $_SERVER['_curl'][CURLOPT_RETURNTRANSFER]); - $this->assertEquals(0, $_SERVER['_curl'][CURLOPT_HEADER]); - $this->assertEquals(150, $_SERVER['_curl'][CURLOPT_CONNECTTIMEOUT]); - $this->assertInstanceOf('Closure', $_SERVER['_curl'][CURLOPT_HEADERFUNCTION]); - - if (defined('CURLOPT_PROTOCOLS')) { - $this->assertEquals( - CURLPROTO_HTTP | CURLPROTO_HTTPS, - $_SERVER['_curl'][CURLOPT_PROTOCOLS] - ); - } - - $this->assertContains('Expect:', $_SERVER['_curl'][CURLOPT_HTTPHEADER]); - $this->assertContains('Accept:', $_SERVER['_curl'][CURLOPT_HTTPHEADER]); - $this->assertContains('Content-Type:', $_SERVER['_curl'][CURLOPT_HTTPHEADER]); - $this->assertContains('Hi: 123', $_SERVER['_curl'][CURLOPT_HTTPHEADER]); - $this->assertContains('host: http://127.0.0.1:8125/', $_SERVER['_curl'][CURLOPT_HTTPHEADER]); - } - - public function testSendsHeadRequests() - { - Server::flush(); - Server::enqueue([['status' => 200]]); - $a = new CurlMultiHandler(); - $response = $a([ - 'http_method' => 'HEAD', - 'headers' => ['host' => [Server::$host]], - ]); - $response->wait(); - $this->assertEquals(true, $_SERVER['_curl'][CURLOPT_NOBODY]); - $checks = [CURLOPT_WRITEFUNCTION, CURLOPT_READFUNCTION, CURLOPT_FILE, CURLOPT_INFILE]; - foreach ($checks as $check) { - $this->assertArrayNotHasKey($check, $_SERVER['_curl']); - } - $this->assertEquals('HEAD', Server::received()[0]['http_method']); - } - - public function testCanAddCustomCurlOptions() - { - Server::flush(); - Server::enqueue([['status' => 200]]); - $a = new CurlMultiHandler(); - $a([ - 'http_method' => 'GET', - 'headers' => ['host' => [Server::$host]], - 'client' => ['curl' => [CURLOPT_LOW_SPEED_LIMIT => 10]], - ]); - $this->assertEquals(10, $_SERVER['_curl'][CURLOPT_LOW_SPEED_LIMIT]); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage SSL CA bundle not found: /does/not/exist - */ - public function testValidatesVerify() - { - $f = new CurlFactory(); - $f([ - 'http_method' => 'GET', - 'headers' => ['host' => ['foo.com']], - 'client' => ['verify' => '/does/not/exist'], - ]); - } - - public function testCanSetVerifyToFile() - { - $f = new CurlFactory(); - $f([ - 'http_method' => 'GET', - 'headers' => ['host' => ['foo.com']], - 'client' => ['verify' => __FILE__], - ]); - $this->assertEquals(__FILE__, $_SERVER['_curl'][CURLOPT_CAINFO]); - $this->assertEquals(2, $_SERVER['_curl'][CURLOPT_SSL_VERIFYHOST]); - $this->assertEquals(true, $_SERVER['_curl'][CURLOPT_SSL_VERIFYPEER]); - } - - public function testAddsVerifyAsTrue() - { - $f = new CurlFactory(); - $f([ - 'http_method' => 'GET', - 'headers' => ['host' => ['foo.com']], - 'client' => ['verify' => true], - ]); - $this->assertEquals(2, $_SERVER['_curl'][CURLOPT_SSL_VERIFYHOST]); - $this->assertEquals(true, $_SERVER['_curl'][CURLOPT_SSL_VERIFYPEER]); - $this->assertArrayNotHasKey(CURLOPT_CAINFO, $_SERVER['_curl']); - } - - public function testCanDisableVerify() - { - $f = new CurlFactory(); - $f([ - 'http_method' => 'GET', - 'headers' => ['host' => ['foo.com']], - 'client' => ['verify' => false], - ]); - $this->assertEquals(0, $_SERVER['_curl'][CURLOPT_SSL_VERIFYHOST]); - $this->assertEquals(false, $_SERVER['_curl'][CURLOPT_SSL_VERIFYPEER]); - } - - public function testAddsProxy() - { - $f = new CurlFactory(); - $f([ - 'http_method' => 'GET', - 'headers' => ['host' => ['foo.com']], - 'client' => ['proxy' => 'http://bar.com'], - ]); - $this->assertEquals('http://bar.com', $_SERVER['_curl'][CURLOPT_PROXY]); - } - - public function testAddsViaScheme() - { - $f = new CurlFactory(); - $f([ - 'http_method' => 'GET', - 'scheme' => 'http', - 'headers' => ['host' => ['foo.com']], - 'client' => [ - 'proxy' => ['http' => 'http://bar.com', 'https' => 'https://t'], - ], - ]); - $this->assertEquals('http://bar.com', $_SERVER['_curl'][CURLOPT_PROXY]); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage SSL private key not found: /does/not/exist - */ - public function testValidatesSslKey() - { - $f = new CurlFactory(); - $f([ - 'http_method' => 'GET', - 'headers' => ['host' => ['foo.com']], - 'client' => ['ssl_key' => '/does/not/exist'], - ]); - } - - public function testAddsSslKey() - { - $f = new CurlFactory(); - $f([ - 'http_method' => 'GET', - 'headers' => ['host' => ['foo.com']], - 'client' => ['ssl_key' => __FILE__], - ]); - $this->assertEquals(__FILE__, $_SERVER['_curl'][CURLOPT_SSLKEY]); - } - - public function testAddsSslKeyWithPassword() - { - $f = new CurlFactory(); - $f([ - 'http_method' => 'GET', - 'headers' => ['host' => ['foo.com']], - 'client' => ['ssl_key' => [__FILE__, 'test']], - ]); - $this->assertEquals(__FILE__, $_SERVER['_curl'][CURLOPT_SSLKEY]); - $this->assertEquals('test', $_SERVER['_curl'][CURLOPT_SSLKEYPASSWD]); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage SSL certificate not found: /does/not/exist - */ - public function testValidatesCert() - { - $f = new CurlFactory(); - $f([ - 'http_method' => 'GET', - 'headers' => ['host' => ['foo.com']], - 'client' => ['cert' => '/does/not/exist'], - ]); - } - - public function testAddsCert() - { - $f = new CurlFactory(); - $f([ - 'http_method' => 'GET', - 'headers' => ['host' => ['foo.com']], - 'client' => ['cert' => __FILE__], - ]); - $this->assertEquals(__FILE__, $_SERVER['_curl'][CURLOPT_SSLCERT]); - } - - public function testAddsCertWithPassword() - { - $f = new CurlFactory(); - $f([ - 'http_method' => 'GET', - 'headers' => ['host' => ['foo.com']], - 'client' => ['cert' => [__FILE__, 'test']], - ]); - $this->assertEquals(__FILE__, $_SERVER['_curl'][CURLOPT_SSLCERT]); - $this->assertEquals('test', $_SERVER['_curl'][CURLOPT_SSLCERTPASSWD]); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage progress client option must be callable - */ - public function testValidatesProgress() - { - $f = new CurlFactory(); - $f([ - 'http_method' => 'GET', - 'headers' => ['host' => ['foo.com']], - 'client' => ['progress' => 'foo'], - ]); - } - - public function testEmitsDebugInfoToStream() - { - $res = fopen('php://memory', 'r+'); - Server::flush(); - Server::enqueue([['status' => 200]]); - $a = new CurlMultiHandler(); - $response = $a([ - 'http_method' => 'HEAD', - 'headers' => ['host' => [Server::$host]], - 'client' => ['debug' => $res], - ]); - $response->wait(); - rewind($res); - $output = str_replace("\r", '', stream_get_contents($res)); - $this->assertContains( - "> HEAD / HTTP/1.1\nhost: 127.0.0.1:8125\n\n", - $output - ); - $this->assertContains("< HTTP/1.1 200", $output); - fclose($res); - } - - public function testEmitsProgressToFunction() - { - Server::flush(); - Server::enqueue([['status' => 200]]); - $a = new CurlMultiHandler(); - $called = []; - $response = $a([ - 'http_method' => 'HEAD', - 'headers' => ['host' => [Server::$host]], - 'client' => [ - 'progress' => function () use (&$called) { - $called[] = func_get_args(); - }, - ], - ]); - $response->wait(); - $this->assertNotEmpty($called); - foreach ($called as $call) { - $this->assertCount(4, $call); - } - } - - private function addDecodeResponse($withEncoding = true) - { - $content = gzencode('test'); - $response = [ - 'status' => 200, - 'reason' => 'OK', - 'headers' => ['Content-Length' => [strlen($content)]], - 'body' => $content, - ]; - - if ($withEncoding) { - $response['headers']['Content-Encoding'] = ['gzip']; - } - - Server::flush(); - Server::enqueue([$response]); - - return $content; - } - - public function testDecodesGzippedResponses() - { - $this->addDecodeResponse(); - $handler = new CurlMultiHandler(); - $response = $handler([ - 'http_method' => 'GET', - 'headers' => ['host' => [Server::$host]], - 'client' => ['decode_content' => true], - ]); - $response->wait(); - $this->assertEquals('test', Core::body($response)); - $this->assertEquals('', $_SERVER['_curl'][CURLOPT_ENCODING]); - $sent = Server::received()[0]; - $this->assertNull(Core::header($sent, 'Accept-Encoding')); - } - - public function testDecodesGzippedResponsesWithHeader() - { - $this->addDecodeResponse(); - $handler = new CurlMultiHandler(); - $response = $handler([ - 'http_method' => 'GET', - 'headers' => [ - 'host' => [Server::$host], - 'Accept-Encoding' => ['gzip'], - ], - 'client' => ['decode_content' => true], - ]); - $response->wait(); - $this->assertEquals('gzip', $_SERVER['_curl'][CURLOPT_ENCODING]); - $sent = Server::received()[0]; - $this->assertEquals('gzip', Core::header($sent, 'Accept-Encoding')); - $this->assertEquals('test', Core::body($response)); - } - - public function testDoesNotForceDecode() - { - $content = $this->addDecodeResponse(); - $handler = new CurlMultiHandler(); - $response = $handler([ - 'http_method' => 'GET', - 'headers' => ['host' => [Server::$host]], - 'client' => ['decode_content' => false], - ]); - $response->wait(); - $sent = Server::received()[0]; - $this->assertNull(Core::header($sent, 'Accept-Encoding')); - $this->assertEquals($content, Core::body($response)); - } - - public function testProtocolVersion() - { - Server::flush(); - Server::enqueue([['status' => 200]]); - $a = new CurlMultiHandler(); - $a([ - 'http_method' => 'GET', - 'headers' => ['host' => [Server::$host]], - 'version' => 1.0, - ]); - $this->assertEquals(CURL_HTTP_VERSION_1_0, $_SERVER['_curl'][CURLOPT_HTTP_VERSION]); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testValidatesSaveTo() - { - $handler = new CurlMultiHandler(); - $handler([ - 'http_method' => 'GET', - 'headers' => ['host' => [Server::$host]], - 'client' => ['save_to' => true], - ]); - } - - public function testSavesToStream() - { - $stream = fopen('php://memory', 'r+'); - $this->addDecodeResponse(); - $handler = new CurlMultiHandler(); - $response = $handler([ - 'http_method' => 'GET', - 'headers' => ['host' => [Server::$host]], - 'client' => [ - 'decode_content' => true, - 'save_to' => $stream, - ], - ]); - $response->wait(); - rewind($stream); - $this->assertEquals('test', stream_get_contents($stream)); - } - - public function testSavesToGuzzleStream() - { - $stream = Stream::factory(); - $this->addDecodeResponse(); - $handler = new CurlMultiHandler(); - $response = $handler([ - 'http_method' => 'GET', - 'headers' => ['host' => [Server::$host]], - 'client' => [ - 'decode_content' => true, - 'save_to' => $stream, - ], - ]); - $response->wait(); - $this->assertEquals('test', (string) $stream); - } - - public function testSavesToFileOnDisk() - { - $tmpfile = tempnam(sys_get_temp_dir(), 'testfile'); - $this->addDecodeResponse(); - $handler = new CurlMultiHandler(); - $response = $handler([ - 'http_method' => 'GET', - 'headers' => ['host' => [Server::$host]], - 'client' => [ - 'decode_content' => true, - 'save_to' => $tmpfile, - ], - ]); - $response->wait(); - $this->assertEquals('test', file_get_contents($tmpfile)); - unlink($tmpfile); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testValidatesBody() - { - $handler = new CurlMultiHandler(); - $handler([ - 'http_method' => 'GET', - 'headers' => ['host' => [Server::$host]], - 'body' => false, - ]); - } - - public function testAddsLargePayloadFromStreamWithNoSizeUsingChunked() - { - $stream = Stream::factory('foo'); - $stream = FnStream::decorate($stream, [ - 'getSize' => function () { - return null; - } - ]); - $this->addDecodeResponse(); - $handler = new CurlMultiHandler(); - $response = $handler([ - 'http_method' => 'GET', - 'headers' => ['host' => [Server::$host]], - 'body' => $stream, - ]); - $response->wait(); - $sent = Server::received()[0]; - $this->assertEquals('chunked', Core::header($sent, 'Transfer-Encoding')); - $this->assertNull(Core::header($sent, 'Content-Length')); - $this->assertEquals('foo', $sent['body']); - } - - public function testAddsPayloadFromIterator() - { - $iter = new \ArrayIterator(['f', 'o', 'o']); - $this->addDecodeResponse(); - $handler = new CurlMultiHandler(); - $response = $handler([ - 'http_method' => 'GET', - 'headers' => ['host' => [Server::$host]], - 'body' => $iter, - ]); - $response->wait(); - $sent = Server::received()[0]; - $this->assertEquals('chunked', Core::header($sent, 'Transfer-Encoding')); - $this->assertNull(Core::header($sent, 'Content-Length')); - $this->assertEquals('foo', $sent['body']); - } - - public function testAddsPayloadFromResource() - { - $res = fopen('php://memory', 'r+'); - $data = str_repeat('.', 1000000); - fwrite($res, $data); - rewind($res); - $this->addDecodeResponse(); - $handler = new CurlMultiHandler(); - $response = $handler([ - 'http_method' => 'GET', - 'headers' => [ - 'host' => [Server::$host], - 'content-length' => [1000000], - ], - 'body' => $res, - ]); - $response->wait(); - $sent = Server::received()[0]; - $this->assertNull(Core::header($sent, 'Transfer-Encoding')); - $this->assertEquals(1000000, Core::header($sent, 'Content-Length')); - $this->assertEquals($data, $sent['body']); - } - - public function testAddsContentLengthFromStream() - { - $stream = Stream::factory('foo'); - $this->addDecodeResponse(); - $handler = new CurlMultiHandler(); - $response = $handler([ - 'http_method' => 'GET', - 'headers' => ['host' => [Server::$host]], - 'body' => $stream, - ]); - $response->wait(); - $sent = Server::received()[0]; - $this->assertEquals(3, Core::header($sent, 'Content-Length')); - $this->assertNull(Core::header($sent, 'Transfer-Encoding')); - $this->assertEquals('foo', $sent['body']); - } - - public function testDoesNotAddMultipleContentLengthHeaders() - { - $this->addDecodeResponse(); - $handler = new CurlMultiHandler(); - $response = $handler([ - 'http_method' => 'GET', - 'headers' => [ - 'host' => [Server::$host], - 'content-length' => [3], - ], - 'body' => 'foo', - ]); - $response->wait(); - $sent = Server::received()[0]; - $this->assertEquals(3, Core::header($sent, 'Content-Length')); - $this->assertNull(Core::header($sent, 'Transfer-Encoding')); - $this->assertEquals('foo', $sent['body']); - } - - public function testSendsPostWithNoBodyOrDefaultContentType() - { - Server::flush(); - Server::enqueue([['status' => 200]]); - $handler = new CurlMultiHandler(); - $response = $handler([ - 'http_method' => 'POST', - 'uri' => '/', - 'headers' => ['host' => [Server::$host]], - ]); - $response->wait(); - $received = Server::received()[0]; - $this->assertEquals('POST', $received['http_method']); - $this->assertNull(Core::header($received, 'content-type')); - $this->assertSame('0', Core::firstHeader($received, 'content-length')); - } - - public function testFailsWhenNoResponseAndNoBody() - { - $res = CurlFactory::createResponse(function () {}, [], [], [], null); - $this->assertInstanceOf('GuzzleHttp\Ring\Exception\RingException', $res['error']); - $this->assertContains( - 'No response was received for a request with no body', - $res['error']->getMessage() - ); - } - - public function testFailsWhenCannotRewindRetry() - { - $res = CurlFactory::createResponse(function () {}, [ - 'body' => new NoSeekStream(Stream::factory('foo')) - ], [], [], null); - $this->assertInstanceOf('GuzzleHttp\Ring\Exception\RingException', $res['error']); - $this->assertContains( - 'rewind the request body failed', - $res['error']->getMessage() - ); - } - - public function testRetriesWhenBodyCanBeRewound() - { - $callHandler = $called = false; - $res = CurlFactory::createResponse(function () use (&$callHandler) { - $callHandler = true; - return ['status' => 200]; - }, [ - 'body' => FnStream::decorate(Stream::factory('test'), [ - 'seek' => function () use (&$called) { - $called = true; - return true; - } - ]) - ], [], [], null); - - $this->assertTrue($callHandler); - $this->assertTrue($called); - $this->assertEquals('200', $res['status']); - } - - public function testFailsWhenRetryMoreThanThreeTimes() - { - $call = 0; - $mock = new MockHandler(function (array $request) use (&$mock, &$call) { - $call++; - return CurlFactory::createResponse($mock, $request, [], [], null); - }); - $response = $mock([ - 'http_method' => 'GET', - 'body' => 'test', - ]); - $this->assertEquals(3, $call); - $this->assertArrayHasKey('error', $response); - $this->assertContains( - 'The cURL request was retried 3 times', - $response['error']->getMessage() - ); - } - - public function testHandles100Continue() - { - Server::flush(); - Server::enqueue([ - [ - 'status' => '200', - 'reason' => 'OK', - 'headers' => [ - 'Test' => ['Hello'], - 'Content-Length' => ['4'], - ], - 'body' => 'test', - ], - ]); - - $request = [ - 'http_method' => 'PUT', - 'headers' => [ - 'Host' => [Server::$host], - 'Expect' => ['100-Continue'], - ], - 'body' => 'test', - ]; - - $handler = new CurlMultiHandler(); - $response = $handler($request)->wait(); - $this->assertEquals(200, $response['status']); - $this->assertEquals('OK', $response['reason']); - $this->assertEquals(['Hello'], $response['headers']['Test']); - $this->assertEquals(['4'], $response['headers']['Content-Length']); - $this->assertEquals('test', Core::body($response)); - } - - public function testCreatesConnectException() - { - $m = new \ReflectionMethod('GuzzleHttp\Ring\Client\CurlFactory', 'createErrorResponse'); - $m->setAccessible(true); - $response = $m->invoke( - null, - function () {}, - [], - [ - 'err_message' => 'foo', - 'curl' => [ - 'errno' => CURLE_COULDNT_CONNECT, - ] - ] - ); - $this->assertInstanceOf('GuzzleHttp\Ring\Exception\ConnectException', $response['error']); - } - - public function testParsesLastResponseOnly() - { - $response1 = [ - 'status' => 301, - 'headers' => [ - 'Content-Length' => ['0'], - 'Location' => ['/foo'] - ] - ]; - - $response2 = [ - 'status' => 200, - 'headers' => [ - 'Content-Length' => ['0'], - 'Foo' => ['bar'] - ] - ]; - - Server::flush(); - Server::enqueue([$response1, $response2]); - - $a = new CurlMultiHandler(); - $response = $a([ - 'http_method' => 'GET', - 'headers' => ['Host' => [Server::$host]], - 'client' => [ - 'curl' => [ - CURLOPT_FOLLOWLOCATION => true - ] - ] - ])->wait(); - - $this->assertEquals(1, $response['transfer_stats']['redirect_count']); - $this->assertEquals('http://127.0.0.1:8125/foo', $response['effective_url']); - $this->assertEquals(['bar'], $response['headers']['Foo']); - $this->assertEquals(200, $response['status']); - $this->assertFalse(Core::hasHeader($response, 'Location')); - } - - public function testMaintainsMultiHeaderOrder() - { - Server::flush(); - Server::enqueue([ - [ - 'status' => 200, - 'headers' => [ - 'Content-Length' => ['0'], - 'Foo' => ['a', 'b'], - 'foo' => ['c', 'd'], - ] - ] - ]); - - $a = new CurlMultiHandler(); - $response = $a([ - 'http_method' => 'GET', - 'headers' => ['Host' => [Server::$host]] - ])->wait(); - - $this->assertEquals( - ['a', 'b', 'c', 'd'], - Core::headerLines($response, 'Foo') - ); - } -} - -} diff --git a/core/vendor/guzzlehttp/ringphp/tests/Client/CurlHandlerTest.php b/core/vendor/guzzlehttp/ringphp/tests/Client/CurlHandlerTest.php deleted file mode 100644 index ba03b8c..0000000 --- a/core/vendor/guzzlehttp/ringphp/tests/Client/CurlHandlerTest.php +++ /dev/null @@ -1,96 +0,0 @@ -markTestSkipped('curl_reset() is not available'); - } - } - - protected function getHandler($factory = null, $options = []) - { - return new CurlHandler($options); - } - - public function testCanSetMaxHandles() - { - $a = new CurlHandler(['max_handles' => 10]); - $this->assertEquals(10, $this->readAttribute($a, 'maxHandles')); - } - - public function testCreatesCurlErrors() - { - $handler = new CurlHandler(); - $response = $handler([ - 'http_method' => 'GET', - 'uri' => '/', - 'headers' => ['host' => ['localhost:123']], - 'client' => ['timeout' => 0.001, 'connect_timeout' => 0.001], - ]); - $this->assertNull($response['status']); - $this->assertNull($response['reason']); - $this->assertEquals([], $response['headers']); - $this->assertInstanceOf( - 'GuzzleHttp\Ring\Exception\RingException', - $response['error'] - ); - - $this->assertEquals( - 1, - preg_match('/^cURL error \d+: .*$/', $response['error']->getMessage()) - ); - } - - public function testReleasesAdditionalEasyHandles() - { - Server::flush(); - $response = [ - 'status' => 200, - 'headers' => ['Content-Length' => [4]], - 'body' => 'test', - ]; - - Server::enqueue([$response, $response, $response, $response]); - $a = new CurlHandler(['max_handles' => 2]); - - $fn = function () use (&$calls, $a, &$fn) { - if (++$calls < 4) { - $a([ - 'http_method' => 'GET', - 'headers' => ['host' => [Server::$host]], - 'client' => ['progress' => $fn], - ]); - } - }; - - $request = [ - 'http_method' => 'GET', - 'headers' => ['host' => [Server::$host]], - 'client' => [ - 'progress' => $fn, - ], - ]; - - $a($request); - $this->assertCount(2, $this->readAttribute($a, 'handles')); - } - - public function testReusesHandles() - { - Server::flush(); - $response = ['status' => 200]; - Server::enqueue([$response, $response]); - $a = new CurlHandler(); - $request = [ - 'http_method' => 'GET', - 'headers' => ['host' => [Server::$host]], - ]; - $a($request); - $a($request); - } -} diff --git a/core/vendor/guzzlehttp/ringphp/tests/Client/CurlMultiHandlerTest.php b/core/vendor/guzzlehttp/ringphp/tests/Client/CurlMultiHandlerTest.php deleted file mode 100644 index 9228f1c..0000000 --- a/core/vendor/guzzlehttp/ringphp/tests/Client/CurlMultiHandlerTest.php +++ /dev/null @@ -1,165 +0,0 @@ - 200]]); - $a = new CurlMultiHandler(); - $response = $a([ - 'http_method' => 'GET', - 'headers' => ['host' => [Server::$host]], - ]); - $this->assertInstanceOf('GuzzleHttp\Ring\Future\FutureArray', $response); - $this->assertEquals(200, $response['status']); - $this->assertArrayHasKey('transfer_stats', $response); - $realUrl = trim($response['transfer_stats']['url'], '/'); - $this->assertEquals(trim(Server::$url, '/'), $realUrl); - $this->assertArrayHasKey('effective_url', $response); - $this->assertEquals( - trim(Server::$url, '/'), - trim($response['effective_url'], '/') - ); - } - - public function testCreatesErrorResponses() - { - $url = 'http://localhost:123/'; - $a = new CurlMultiHandler(); - $response = $a([ - 'http_method' => 'GET', - 'headers' => ['host' => ['localhost:123']], - ]); - $this->assertInstanceOf('GuzzleHttp\Ring\Future\FutureArray', $response); - $this->assertNull($response['status']); - $this->assertNull($response['reason']); - $this->assertEquals([], $response['headers']); - $this->assertArrayHasKey('error', $response); - $this->assertContains('cURL error ', $response['error']->getMessage()); - $this->assertArrayHasKey('transfer_stats', $response); - $this->assertEquals( - trim($url, '/'), - trim($response['transfer_stats']['url'], '/') - ); - $this->assertArrayHasKey('effective_url', $response); - $this->assertEquals( - trim($url, '/'), - trim($response['effective_url'], '/') - ); - } - - public function testSendsFuturesWhenDestructed() - { - Server::enqueue([['status' => 200]]); - $a = new CurlMultiHandler(); - $response = $a([ - 'http_method' => 'GET', - 'headers' => ['host' => [Server::$host]], - ]); - $this->assertInstanceOf('GuzzleHttp\Ring\Future\FutureArray', $response); - $a->__destruct(); - $this->assertEquals(200, $response['status']); - } - - public function testCanSetMaxHandles() - { - $a = new CurlMultiHandler(['max_handles' => 2]); - $this->assertEquals(2, $this->readAttribute($a, 'maxHandles')); - } - - public function testCanSetSelectTimeout() - { - $a = new CurlMultiHandler(['select_timeout' => 2]); - $this->assertEquals(2, $this->readAttribute($a, 'selectTimeout')); - } - - public function testSendsFuturesWhenMaxHandlesIsReached() - { - $request = [ - 'http_method' => 'PUT', - 'headers' => ['host' => [Server::$host]], - 'future' => 'lazy', // passing this to control the test - ]; - $response = ['status' => 200]; - Server::flush(); - Server::enqueue([$response, $response, $response]); - $a = new CurlMultiHandler(['max_handles' => 3]); - for ($i = 0; $i < 5; $i++) { - $responses[] = $a($request); - } - $this->assertCount(3, Server::received()); - $responses[3]->cancel(); - $responses[4]->cancel(); - } - - public function testCanCancel() - { - Server::flush(); - $response = ['status' => 200]; - Server::enqueue(array_fill_keys(range(0, 10), $response)); - $a = new CurlMultiHandler(); - $responses = []; - - for ($i = 0; $i < 10; $i++) { - $response = $a([ - 'http_method' => 'GET', - 'headers' => ['host' => [Server::$host]], - 'future' => 'lazy', - ]); - $response->cancel(); - $responses[] = $response; - } - - $this->assertCount(0, Server::received()); - - foreach ($responses as $response) { - $this->assertTrue($this->readAttribute($response, 'isRealized')); - } - } - - public function testCannotCancelFinished() - { - Server::flush(); - Server::enqueue([['status' => 200]]); - $a = new CurlMultiHandler(); - $response = $a([ - 'http_method' => 'GET', - 'headers' => ['host' => [Server::$host]], - ]); - $response->wait(); - $response->cancel(); - } - - public function testDelaysInParallel() - { - Server::flush(); - Server::enqueue([['status' => 200]]); - $a = new CurlMultiHandler(); - $expected = microtime(true) + (100 / 1000); - $response = $a([ - 'http_method' => 'GET', - 'headers' => ['host' => [Server::$host]], - 'client' => ['delay' => 100], - ]); - $response->wait(); - $this->assertGreaterThanOrEqual($expected, microtime(true)); - } - - public function testSendsNonLazyFutures() - { - $request = [ - 'http_method' => 'GET', - 'headers' => ['host' => [Server::$host]], - 'future' => true, - ]; - Server::flush(); - Server::enqueue([['status' => 202]]); - $a = new CurlMultiHandler(); - $response = $a($request); - $this->assertInstanceOf('GuzzleHttp\Ring\Future\FutureArray', $response); - $this->assertEquals(202, $response['status']); - } -} diff --git a/core/vendor/guzzlehttp/ringphp/tests/Client/MiddlewareTest.php b/core/vendor/guzzlehttp/ringphp/tests/Client/MiddlewareTest.php deleted file mode 100644 index a47bb30..0000000 --- a/core/vendor/guzzlehttp/ringphp/tests/Client/MiddlewareTest.php +++ /dev/null @@ -1,65 +0,0 @@ - 200]); - $calledA = false; - $a = function (array $req) use (&$calledA, $future) { - $calledA = true; - return $future; - }; - $calledB = false; - $b = function (array $req) use (&$calledB) { $calledB = true; }; - $s = Middleware::wrapFuture($a, $b); - $s([]); - $this->assertTrue($calledA); - $this->assertFalse($calledB); - } - - public function testFutureCallsStreamingHandler() - { - $future = new CompletedFutureArray(['status' => 200]); - $calledA = false; - $a = function (array $req) use (&$calledA) { $calledA = true; }; - $calledB = false; - $b = function (array $req) use (&$calledB, $future) { - $calledB = true; - return $future; - }; - $s = Middleware::wrapFuture($a, $b); - $result = $s(['client' => ['future' => true]]); - $this->assertFalse($calledA); - $this->assertTrue($calledB); - $this->assertSame($future, $result); - } - - public function testStreamingCallsDefaultHandler() - { - $calledA = false; - $a = function (array $req) use (&$calledA) { $calledA = true; }; - $calledB = false; - $b = function (array $req) use (&$calledB) { $calledB = true; }; - $s = Middleware::wrapStreaming($a, $b); - $s([]); - $this->assertTrue($calledA); - $this->assertFalse($calledB); - } - - public function testStreamingCallsStreamingHandler() - { - $calledA = false; - $a = function (array $req) use (&$calledA) { $calledA = true; }; - $calledB = false; - $b = function (array $req) use (&$calledB) { $calledB = true; }; - $s = Middleware::wrapStreaming($a, $b); - $s(['client' => ['stream' => true]]); - $this->assertFalse($calledA); - $this->assertTrue($calledB); - } -} diff --git a/core/vendor/guzzlehttp/ringphp/tests/Client/MockHandlerTest.php b/core/vendor/guzzlehttp/ringphp/tests/Client/MockHandlerTest.php deleted file mode 100644 index 26bcd6c..0000000 --- a/core/vendor/guzzlehttp/ringphp/tests/Client/MockHandlerTest.php +++ /dev/null @@ -1,86 +0,0 @@ - 200]); - $response = $mock([]); - $this->assertEquals(200, $response['status']); - $this->assertEquals([], $response['headers']); - $this->assertNull($response['body']); - $this->assertNull($response['reason']); - $this->assertNull($response['effective_url']); - } - - public function testReturnsFutures() - { - $deferred = new Deferred(); - $future = new FutureArray( - $deferred->promise(), - function () use ($deferred) { - $deferred->resolve(['status' => 200]); - } - ); - $mock = new MockHandler($future); - $response = $mock([]); - $this->assertInstanceOf('GuzzleHttp\Ring\Future\FutureArray', $response); - $this->assertEquals(200, $response['status']); - } - - public function testReturnsFuturesWithThenCall() - { - $deferred = new Deferred(); - $future = new FutureArray( - $deferred->promise(), - function () use ($deferred) { - $deferred->resolve(['status' => 200]); - } - ); - $mock = new MockHandler($future); - $response = $mock([]); - $this->assertInstanceOf('GuzzleHttp\Ring\Future\FutureArray', $response); - $this->assertEquals(200, $response['status']); - $req = null; - $promise = $response->then(function ($value) use (&$req) { - $req = $value; - $this->assertEquals(200, $req['status']); - }); - $this->assertInstanceOf('React\Promise\PromiseInterface', $promise); - $this->assertEquals(200, $req['status']); - } - - public function testReturnsFuturesAndProxiesCancel() - { - $c = null; - $deferred = new Deferred(); - $future = new FutureArray( - $deferred->promise(), - function () {}, - function () use (&$c) { - $c = true; - return true; - } - ); - $mock = new MockHandler($future); - $response = $mock([]); - $this->assertInstanceOf('GuzzleHttp\Ring\Future\FutureArray', $response); - $response->cancel(); - $this->assertTrue($c); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Response must be an array or FutureArrayInterface. Found - */ - public function testEnsuresMockIsValid() - { - $mock = new MockHandler('foo'); - $mock([]); - } -} diff --git a/core/vendor/guzzlehttp/ringphp/tests/Client/Server.php b/core/vendor/guzzlehttp/ringphp/tests/Client/Server.php deleted file mode 100644 index 14665a5..0000000 --- a/core/vendor/guzzlehttp/ringphp/tests/Client/Server.php +++ /dev/null @@ -1,183 +0,0 @@ - [], 'reason' => '', 'body' => '']; - $data[] = $response; - } - - self::send('PUT', '/guzzle-server/responses', json_encode($data)); - } - - /** - * Get all of the received requests as a RingPHP request structure. - * - * @return array - * @throws \RuntimeException - */ - public static function received() - { - if (!self::$started) { - return []; - } - - $response = self::send('GET', '/guzzle-server/requests'); - $body = Core::body($response); - $result = json_decode($body, true); - if ($result === false) { - throw new \RuntimeException('Error decoding response: ' - . json_last_error()); - } - - foreach ($result as &$res) { - if (isset($res['uri'])) { - $res['resource'] = $res['uri']; - } - if (isset($res['query_string'])) { - $res['resource'] .= '?' . $res['query_string']; - } - if (!isset($res['resource'])) { - $res['resource'] = ''; - } - // Ensure that headers are all arrays - if (isset($res['headers'])) { - foreach ($res['headers'] as &$h) { - $h = (array) $h; - } - unset($h); - } - } - - unset($res); - return $result; - } - - /** - * Stop running the node.js server - */ - public static function stop() - { - if (self::$started) { - self::send('DELETE', '/guzzle-server'); - } - - self::$started = false; - } - - public static function wait($maxTries = 20) - { - $tries = 0; - while (!self::isListening() && ++$tries < $maxTries) { - usleep(100000); - } - - if (!self::isListening()) { - throw new \RuntimeException('Unable to contact node.js server'); - } - } - - public static function start() - { - if (self::$started) { - return; - } - - try { - self::wait(); - } catch (\Exception $e) { - exec('node ' . __DIR__ . \DIRECTORY_SEPARATOR . 'server.js ' - . self::$port . ' >> /tmp/server.log 2>&1 &'); - self::wait(); - } - - self::$started = true; - } - - private static function isListening() - { - $response = self::send('GET', '/guzzle-server/perf', null, [ - 'connect_timeout' => 1, - 'timeout' => 1 - ]); - - return !isset($response['error']); - } - - private static function send( - $method, - $path, - $body = null, - array $client = [] - ) { - $handler = new StreamHandler(); - - $request = [ - 'http_method' => $method, - 'uri' => $path, - 'request_port' => 8125, - 'headers' => ['host' => ['127.0.0.1:8125']], - 'body' => $body, - 'client' => $client, - ]; - - if ($body) { - $request['headers']['content-length'] = [strlen($body)]; - } - - return $handler($request); - } -} diff --git a/core/vendor/guzzlehttp/ringphp/tests/Client/StreamHandlerTest.php b/core/vendor/guzzlehttp/ringphp/tests/Client/StreamHandlerTest.php deleted file mode 100644 index 7549a83..0000000 --- a/core/vendor/guzzlehttp/ringphp/tests/Client/StreamHandlerTest.php +++ /dev/null @@ -1,479 +0,0 @@ -queueRes(); - $handler = new StreamHandler(); - $response = $handler([ - 'http_method' => 'GET', - 'uri' => '/', - 'headers' => [ - 'host' => [Server::$host], - 'Foo' => ['Bar'], - ], - ]); - - $this->assertEquals(200, $response['status']); - $this->assertEquals('OK', $response['reason']); - $this->assertEquals(['Bar'], $response['headers']['Foo']); - $this->assertEquals(['8'], $response['headers']['Content-Length']); - $this->assertEquals('hi there', Core::body($response)); - - $sent = Server::received()[0]; - $this->assertEquals('GET', $sent['http_method']); - $this->assertEquals('/', $sent['resource']); - $this->assertEquals(['127.0.0.1:8125'], $sent['headers']['host']); - $this->assertEquals('Bar', Core::header($sent, 'foo')); - } - - public function testAddsErrorToResponse() - { - $handler = new StreamHandler(); - $result = $handler([ - 'http_method' => 'GET', - 'headers' => ['host' => ['localhost:123']], - 'client' => ['timeout' => 0.01], - ]); - $this->assertInstanceOf( - 'GuzzleHttp\Ring\Future\CompletedFutureArray', - $result - ); - $this->assertNull($result['status']); - $this->assertNull($result['body']); - $this->assertEquals([], $result['headers']); - $this->assertInstanceOf( - 'GuzzleHttp\Ring\Exception\RingException', - $result['error'] - ); - } - - public function testEnsuresTheHttpProtocol() - { - $handler = new StreamHandler(); - $result = $handler([ - 'http_method' => 'GET', - 'url' => 'ftp://localhost:123', - ]); - $this->assertArrayHasKey('error', $result); - $this->assertContains( - 'URL is invalid: ftp://localhost:123', - $result['error']->getMessage() - ); - } - - public function testStreamAttributeKeepsStreamOpen() - { - $this->queueRes(); - $handler = new StreamHandler(); - $response = $handler([ - 'http_method' => 'PUT', - 'uri' => '/foo', - 'query_string' => 'baz=bar', - 'headers' => [ - 'host' => [Server::$host], - 'Foo' => ['Bar'], - ], - 'body' => 'test', - 'client' => ['stream' => true], - ]); - - $this->assertEquals(200, $response['status']); - $this->assertEquals('OK', $response['reason']); - $this->assertEquals('8', Core::header($response, 'Content-Length')); - $body = $response['body']; - $this->assertTrue(is_resource($body)); - $this->assertEquals('http', stream_get_meta_data($body)['wrapper_type']); - $this->assertEquals('hi there', stream_get_contents($body)); - fclose($body); - $sent = Server::received()[0]; - $this->assertEquals('PUT', $sent['http_method']); - $this->assertEquals('/foo', $sent['uri']); - $this->assertEquals('baz=bar', $sent['query_string']); - $this->assertEquals('/foo?baz=bar', $sent['resource']); - $this->assertEquals('127.0.0.1:8125', Core::header($sent, 'host')); - $this->assertEquals('Bar', Core::header($sent, 'foo')); - } - - public function testDrainsResponseIntoTempStream() - { - $this->queueRes(); - $handler = new StreamHandler(); - $response = $handler([ - 'http_method' => 'GET', - 'uri' => '/', - 'headers' => ['host' => [Server::$host]], - ]); - $body = $response['body']; - $this->assertEquals('php://temp', stream_get_meta_data($body)['uri']); - $this->assertEquals('hi', fread($body, 2)); - fclose($body); - } - - public function testDrainsResponseIntoSaveToBody() - { - $r = fopen('php://temp', 'r+'); - $this->queueRes(); - $handler = new StreamHandler(); - $response = $handler([ - 'http_method' => 'GET', - 'uri' => '/', - 'headers' => ['host' => [Server::$host]], - 'client' => ['save_to' => $r], - ]); - $body = $response['body']; - $this->assertEquals('php://temp', stream_get_meta_data($body)['uri']); - $this->assertEquals('hi', fread($body, 2)); - $this->assertEquals(' there', stream_get_contents($r)); - fclose($r); - } - - public function testDrainsResponseIntoSaveToBodyAtPath() - { - $tmpfname = tempnam('/tmp', 'save_to_path'); - $this->queueRes(); - $handler = new StreamHandler(); - $response = $handler([ - 'http_method' => 'GET', - 'uri' => '/', - 'headers' => ['host' => [Server::$host]], - 'client' => ['save_to' => $tmpfname], - ]); - $body = $response['body']; - $this->assertInstanceOf('GuzzleHttp\Stream\StreamInterface', $body); - $this->assertEquals($tmpfname, $body->getMetadata('uri')); - $this->assertEquals('hi', $body->read(2)); - $body->close(); - unlink($tmpfname); - } - - public function testAutomaticallyDecompressGzip() - { - Server::flush(); - $content = gzencode('test'); - Server::enqueue([ - [ - 'status' => 200, - 'reason' => 'OK', - 'headers' => [ - 'Content-Encoding' => ['gzip'], - 'Content-Length' => [strlen($content)], - ], - 'body' => $content, - ], - ]); - - $handler = new StreamHandler(); - $response = $handler([ - 'http_method' => 'GET', - 'headers' => ['host' => [Server::$host]], - 'uri' => '/', - 'client' => ['decode_content' => true], - ]); - $this->assertEquals('test', Core::body($response)); - } - - public function testDoesNotForceGzipDecode() - { - Server::flush(); - $content = gzencode('test'); - Server::enqueue([ - [ - 'status' => 200, - 'reason' => 'OK', - 'headers' => [ - 'Content-Encoding' => ['gzip'], - 'Content-Length' => [strlen($content)], - ], - 'body' => $content, - ], - ]); - - $handler = new StreamHandler(); - $response = $handler([ - 'http_method' => 'GET', - 'headers' => ['host' => [Server::$host]], - 'uri' => '/', - 'client' => ['stream' => true, 'decode_content' => false], - ]); - $this->assertSame($content, Core::body($response)); - } - - public function testProtocolVersion() - { - $this->queueRes(); - $handler = new StreamHandler(); - $handler([ - 'http_method' => 'GET', - 'uri' => '/', - 'headers' => ['host' => [Server::$host]], - 'version' => 1.0, - ]); - - $this->assertEquals(1.0, Server::received()[0]['version']); - } - - protected function getSendResult(array $opts) - { - $this->queueRes(); - $handler = new StreamHandler(); - $opts['stream'] = true; - return $handler([ - 'http_method' => 'GET', - 'uri' => '/', - 'headers' => ['host' => [Server::$host]], - 'client' => $opts, - ]); - } - - public function testAddsProxy() - { - $res = $this->getSendResult(['stream' => true, 'proxy' => '127.0.0.1:8125']); - $opts = stream_context_get_options($res['body']); - $this->assertEquals('127.0.0.1:8125', $opts['http']['proxy']); - } - - public function testAddsTimeout() - { - $res = $this->getSendResult(['stream' => true, 'timeout' => 200]); - $opts = stream_context_get_options($res['body']); - $this->assertEquals(200, $opts['http']['timeout']); - } - - public function testVerifiesVerifyIsValidIfPath() - { - $res = $this->getSendResult(['verify' => '/does/not/exist']); - $this->assertContains( - 'SSL CA bundle not found: /does/not/exist', - (string) $res['error'] - ); - } - - public function testVerifyCanBeDisabled() - { - $res = $this->getSendResult(['verify' => false]); - $this->assertArrayNotHasKey('error', $res); - } - - public function testVerifiesCertIfValidPath() - { - $res = $this->getSendResult(['cert' => '/does/not/exist']); - $this->assertContains( - 'SSL certificate not found: /does/not/exist', - (string) $res['error'] - ); - } - - public function testVerifyCanBeSetToPath() - { - $path = $path = ClientUtils::getDefaultCaBundle(); - $res = $this->getSendResult(['verify' => $path]); - $this->assertArrayNotHasKey('error', $res); - $opts = stream_context_get_options($res['body']); - $this->assertEquals(true, $opts['ssl']['verify_peer']); - $this->assertEquals($path, $opts['ssl']['cafile']); - $this->assertTrue(file_exists($opts['ssl']['cafile'])); - } - - public function testUsesSystemDefaultBundle() - { - $path = $path = ClientUtils::getDefaultCaBundle(); - $res = $this->getSendResult(['verify' => true]); - $this->assertArrayNotHasKey('error', $res); - $opts = stream_context_get_options($res['body']); - if (PHP_VERSION_ID < 50600) { - $this->assertEquals($path, $opts['ssl']['cafile']); - } - } - - public function testEnsuresVerifyOptionIsValid() - { - $res = $this->getSendResult(['verify' => 10]); - $this->assertContains( - 'Invalid verify request option', - (string) $res['error'] - ); - } - - public function testCanSetPasswordWhenSettingCert() - { - $path = __FILE__; - $res = $this->getSendResult(['cert' => [$path, 'foo']]); - $opts = stream_context_get_options($res['body']); - $this->assertEquals($path, $opts['ssl']['local_cert']); - $this->assertEquals('foo', $opts['ssl']['passphrase']); - } - - public function testDebugAttributeWritesToStream() - { - $this->queueRes(); - $f = fopen('php://temp', 'w+'); - $this->getSendResult(['debug' => $f]); - fseek($f, 0); - $contents = stream_get_contents($f); - $this->assertContains(' [CONNECT]', $contents); - $this->assertContains(' [FILE_SIZE_IS]', $contents); - $this->assertContains(' [PROGRESS]', $contents); - } - - public function testDebugAttributeWritesStreamInfoToBuffer() - { - $called = false; - $this->queueRes(); - $buffer = fopen('php://temp', 'r+'); - $this->getSendResult([ - 'progress' => function () use (&$called) { $called = true; }, - 'debug' => $buffer, - ]); - fseek($buffer, 0); - $contents = stream_get_contents($buffer); - $this->assertContains(' [CONNECT]', $contents); - $this->assertContains(' [FILE_SIZE_IS] message: "Content-Length: 8"', $contents); - $this->assertContains(' [PROGRESS] bytes_max: "8"', $contents); - $this->assertTrue($called); - } - - public function testEmitsProgressInformation() - { - $called = []; - $this->queueRes(); - $this->getSendResult([ - 'progress' => function () use (&$called) { - $called[] = func_get_args(); - }, - ]); - $this->assertNotEmpty($called); - $this->assertEquals(8, $called[0][0]); - $this->assertEquals(0, $called[0][1]); - } - - public function testEmitsProgressInformationAndDebugInformation() - { - $called = []; - $this->queueRes(); - $buffer = fopen('php://memory', 'w+'); - $this->getSendResult([ - 'debug' => $buffer, - 'progress' => function () use (&$called) { - $called[] = func_get_args(); - }, - ]); - $this->assertNotEmpty($called); - $this->assertEquals(8, $called[0][0]); - $this->assertEquals(0, $called[0][1]); - rewind($buffer); - $this->assertNotEmpty(stream_get_contents($buffer)); - fclose($buffer); - } - - public function testAddsProxyByProtocol() - { - $url = str_replace('http', 'tcp', Server::$url); - $res = $this->getSendResult(['proxy' => ['http' => $url]]); - $opts = stream_context_get_options($res['body']); - $this->assertEquals($url, $opts['http']['proxy']); - } - - public function testPerformsShallowMergeOfCustomContextOptions() - { - $res = $this->getSendResult([ - 'stream_context' => [ - 'http' => [ - 'request_fulluri' => true, - 'method' => 'HEAD', - ], - 'socket' => [ - 'bindto' => '127.0.0.1:0', - ], - 'ssl' => [ - 'verify_peer' => false, - ], - ], - ]); - - $opts = stream_context_get_options($res['body']); - $this->assertEquals('HEAD', $opts['http']['method']); - $this->assertTrue($opts['http']['request_fulluri']); - $this->assertFalse($opts['ssl']['verify_peer']); - $this->assertEquals('127.0.0.1:0', $opts['socket']['bindto']); - } - - public function testEnsuresThatStreamContextIsAnArray() - { - $res = $this->getSendResult(['stream_context' => 'foo']); - $this->assertContains( - 'stream_context must be an array', - (string) $res['error'] - ); - } - - public function testDoesNotAddContentTypeByDefault() - { - $this->queueRes(); - $handler = new StreamHandler(); - $handler([ - 'http_method' => 'PUT', - 'uri' => '/', - 'headers' => ['host' => [Server::$host], 'content-length' => [3]], - 'body' => 'foo', - ]); - $req = Server::received()[0]; - $this->assertEquals('', Core::header($req, 'Content-Type')); - $this->assertEquals(3, Core::header($req, 'Content-Length')); - } - - private function queueRes() - { - Server::flush(); - Server::enqueue([ - [ - 'status' => 200, - 'reason' => 'OK', - 'headers' => [ - 'Foo' => ['Bar'], - 'Content-Length' => [8], - ], - 'body' => 'hi there', - ], - ]); - } - - public function testSupports100Continue() - { - Server::flush(); - Server::enqueue([ - [ - 'status' => '200', - 'reason' => 'OK', - 'headers' => [ - 'Test' => ['Hello'], - 'Content-Length' => ['4'], - ], - 'body' => 'test', - ], - ]); - - $request = [ - 'http_method' => 'PUT', - 'headers' => [ - 'Host' => [Server::$host], - 'Expect' => ['100-Continue'], - ], - 'body' => 'test', - ]; - - $handler = new StreamHandler(); - $response = $handler($request); - $this->assertEquals(200, $response['status']); - $this->assertEquals('OK', $response['reason']); - $this->assertEquals(['Hello'], $response['headers']['Test']); - $this->assertEquals(['4'], $response['headers']['Content-Length']); - $this->assertEquals('test', Core::body($response)); - } -} diff --git a/core/vendor/guzzlehttp/ringphp/tests/Client/server.js b/core/vendor/guzzlehttp/ringphp/tests/Client/server.js deleted file mode 100644 index 6a03e33..0000000 --- a/core/vendor/guzzlehttp/ringphp/tests/Client/server.js +++ /dev/null @@ -1,241 +0,0 @@ -/** - * Guzzle node.js test server to return queued responses to HTTP requests and - * expose a RESTful API for enqueueing responses and retrieving the requests - * that have been received. - * - * - Delete all requests that have been received: - * > DELETE /guzzle-server/requests - * > Host: 127.0.0.1:8125 - * - * - Enqueue responses - * > PUT /guzzle-server/responses - * > Host: 127.0.0.1:8125 - * > - * > [{'status': 200, 'reason': 'OK', 'headers': {}, 'body': '' }] - * - * - Get the received requests - * > GET /guzzle-server/requests - * > Host: 127.0.0.1:8125 - * - * < HTTP/1.1 200 OK - * < - * < [{'http_method': 'GET', 'uri': '/', 'headers': {}, 'body': 'string'}] - * - * - Attempt access to the secure area - * > GET /secure/by-digest/qop-auth/guzzle-server/requests - * > Host: 127.0.0.1:8125 - * - * < HTTP/1.1 401 Unauthorized - * < WWW-Authenticate: Digest realm="Digest Test", qop="auth", nonce="0796e98e1aeef43141fab2a66bf4521a", algorithm="MD5", stale="false" - * < - * < 401 Unauthorized - * - * - Shutdown the server - * > DELETE /guzzle-server - * > Host: 127.0.0.1:8125 - * - * @package Guzzle PHP - * @license See the LICENSE file that was distributed with this source code. - */ - -var http = require('http'); -var url = require('url'); - -/** - * Guzzle node.js server - * @class - */ -var GuzzleServer = function(port, log) { - - this.port = port; - this.log = log; - this.responses = []; - this.requests = []; - var that = this; - - var md5 = function(input) { - var crypto = require('crypto'); - var hasher = crypto.createHash('md5'); - hasher.update(input); - return hasher.digest('hex'); - } - - /** - * Node.js HTTP server authentication module. - * - * It is only initialized on demand (by loadAuthentifier). This avoids - * requiring the dependency to http-auth on standard operations, and the - * performance hit at startup. - */ - var auth; - - /** - * Provides authentication handlers (Basic, Digest). - */ - var loadAuthentifier = function(type, options) { - var typeId = type; - if (type == 'digest') { - typeId += '.'+(options && options.qop ? options.qop : 'none'); - } - if (!loadAuthentifier[typeId]) { - if (!auth) { - try { - auth = require('http-auth'); - } catch (e) { - if (e.code == 'MODULE_NOT_FOUND') { - return; - } - } - } - switch (type) { - case 'digest': - var digestParams = { - realm: 'Digest Test', - login: 'me', - password: 'test' - }; - if (options && options.qop) { - digestParams.qop = options.qop; - } - loadAuthentifier[typeId] = auth.digest(digestParams, function(username, callback) { - callback(md5(digestParams.login + ':' + digestParams.realm + ':' + digestParams.password)); - }); - break - } - } - return loadAuthentifier[typeId]; - }; - - var firewallRequest = function(request, req, res, requestHandlerCallback) { - var securedAreaUriParts = request.uri.match(/^\/secure\/by-(digest)(\/qop-([^\/]*))?(\/.*)$/); - if (securedAreaUriParts) { - var authentifier = loadAuthentifier(securedAreaUriParts[1], { qop: securedAreaUriParts[2] }); - if (!authentifier) { - res.writeHead(501, 'HTTP authentication not implemented', { 'Content-Length': 0 }); - res.end(); - return; - } - authentifier.check(req, res, function(req, res) { - req.url = securedAreaUriParts[4]; - requestHandlerCallback(request, req, res); - }); - } else { - requestHandlerCallback(request, req, res); - } - }; - - var controlRequest = function(request, req, res) { - if (req.url == '/guzzle-server/perf') { - res.writeHead(200, 'OK', {'Content-Length': 16}); - res.end('Body of response'); - } else if (req.method == 'DELETE') { - if (req.url == '/guzzle-server/requests') { - // Clear the received requests - that.requests = []; - res.writeHead(200, 'OK', { 'Content-Length': 0 }); - res.end(); - if (that.log) { - console.log('Flushing requests'); - } - } else if (req.url == '/guzzle-server') { - // Shutdown the server - res.writeHead(200, 'OK', { 'Content-Length': 0, 'Connection': 'close' }); - res.end(); - if (that.log) { - console.log('Shutting down'); - } - that.server.close(); - } - } else if (req.method == 'GET') { - if (req.url === '/guzzle-server/requests') { - if (that.log) { - console.log('Sending received requests'); - } - // Get received requests - var body = JSON.stringify(that.requests); - res.writeHead(200, 'OK', { 'Content-Length': body.length }); - res.end(body); - } - } else if (req.method == 'PUT' && req.url == '/guzzle-server/responses') { - if (that.log) { - console.log('Adding responses...'); - } - if (!request.body) { - if (that.log) { - console.log('No response data was provided'); - } - res.writeHead(400, 'NO RESPONSES IN REQUEST', { 'Content-Length': 0 }); - } else { - that.responses = eval('(' + request.body + ')'); - for (var i = 0; i < that.responses.length; i++) { - if (that.responses[i].body) { - that.responses[i].body = new Buffer(that.responses[i].body, 'base64'); - } - } - if (that.log) { - console.log(that.responses); - } - res.writeHead(200, 'OK', { 'Content-Length': 0 }); - } - res.end(); - } - }; - - var receivedRequest = function(request, req, res) { - if (req.url.indexOf('/guzzle-server') === 0) { - controlRequest(request, req, res); - } else if (req.url.indexOf('/guzzle-server') == -1 && !that.responses.length) { - res.writeHead(500); - res.end('No responses in queue'); - } else { - if (that.log) { - console.log('Returning response from queue and adding request'); - } - that.requests.push(request); - var response = that.responses.shift(); - res.writeHead(response.status, response.reason, response.headers); - res.end(response.body); - } - }; - - this.start = function() { - - that.server = http.createServer(function(req, res) { - - var parts = url.parse(req.url, false); - var request = { - http_method: req.method, - scheme: parts.scheme, - uri: parts.pathname, - query_string: parts.query, - headers: req.headers, - version: req.httpVersion, - body: '' - }; - - // Receive each chunk of the request body - req.addListener('data', function(chunk) { - request.body += chunk; - }); - - // Called when the request completes - req.addListener('end', function() { - firewallRequest(request, req, res, receivedRequest); - }); - }); - - that.server.listen(this.port, '127.0.0.1'); - - if (this.log) { - console.log('Server running at http://127.0.0.1:8125/'); - } - }; -}; - -// Get the port from the arguments -port = process.argv.length >= 3 ? process.argv[2] : 8125; -log = process.argv.length >= 4 ? process.argv[3] : false; - -// Start the server -server = new GuzzleServer(port, log); -server.start(); diff --git a/core/vendor/guzzlehttp/ringphp/tests/CoreTest.php b/core/vendor/guzzlehttp/ringphp/tests/CoreTest.php deleted file mode 100644 index 49522f2..0000000 --- a/core/vendor/guzzlehttp/ringphp/tests/CoreTest.php +++ /dev/null @@ -1,336 +0,0 @@ -assertNull(Core::header([], 'Foo')); - $this->assertNull(Core::firstHeader([], 'Foo')); - } - - public function testChecksIfHasHeader() - { - $message = [ - 'headers' => [ - 'Foo' => ['Bar', 'Baz'], - 'foo' => ['hello'], - 'bar' => ['1'] - ] - ]; - $this->assertTrue(Core::hasHeader($message, 'Foo')); - $this->assertTrue(Core::hasHeader($message, 'foo')); - $this->assertTrue(Core::hasHeader($message, 'FoO')); - $this->assertTrue(Core::hasHeader($message, 'bar')); - $this->assertFalse(Core::hasHeader($message, 'barr')); - } - - public function testReturnsFirstHeaderWhenSimple() - { - $this->assertEquals('Bar', Core::firstHeader([ - 'headers' => ['Foo' => ['Bar', 'Baz']], - ], 'Foo')); - } - - public function testReturnsFirstHeaderWhenMultiplePerLine() - { - $this->assertEquals('Bar', Core::firstHeader([ - 'headers' => ['Foo' => ['Bar, Baz']], - ], 'Foo')); - } - - public function testExtractsCaseInsensitiveHeader() - { - $this->assertEquals( - 'hello', - Core::header(['headers' => ['foo' => ['hello']]], 'FoO') - ); - } - - public function testExtractsCaseInsensitiveHeaderLines() - { - $this->assertEquals( - ['a', 'b', 'c', 'd'], - Core::headerLines([ - 'headers' => [ - 'foo' => ['a', 'b'], - 'Foo' => ['c', 'd'] - ] - ], 'foo') - ); - } - - public function testExtractsHeaderLines() - { - $this->assertEquals( - ['bar', 'baz'], - Core::headerLines([ - 'headers' => [ - 'Foo' => ['bar', 'baz'], - ], - ], 'Foo') - ); - } - - public function testExtractsHeaderAsString() - { - $this->assertEquals( - 'bar, baz', - Core::header([ - 'headers' => [ - 'Foo' => ['bar', 'baz'], - ], - ], 'Foo', true) - ); - } - - public function testReturnsNullWhenHeaderNotFound() - { - $this->assertNull(Core::header(['headers' => []], 'Foo')); - } - - public function testRemovesHeaders() - { - $message = [ - 'headers' => [ - 'foo' => ['bar'], - 'Foo' => ['bam'], - 'baz' => ['123'], - ], - ]; - - $this->assertSame($message, Core::removeHeader($message, 'bam')); - $this->assertEquals([ - 'headers' => ['baz' => ['123']], - ], Core::removeHeader($message, 'foo')); - } - - public function testCreatesUrl() - { - $req = [ - 'scheme' => 'http', - 'headers' => ['host' => ['foo.com']], - 'uri' => '/', - ]; - - $this->assertEquals('http://foo.com/', Core::url($req)); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage No Host header was provided - */ - public function testEnsuresHostIsAvailableWhenCreatingUrls() - { - Core::url([]); - } - - public function testCreatesUrlWithQueryString() - { - $req = [ - 'scheme' => 'http', - 'headers' => ['host' => ['foo.com']], - 'uri' => '/', - 'query_string' => 'foo=baz', - ]; - - $this->assertEquals('http://foo.com/?foo=baz', Core::url($req)); - } - - public function testUsesUrlIfSet() - { - $req = ['url' => 'http://foo.com']; - $this->assertEquals('http://foo.com', Core::url($req)); - } - - public function testReturnsNullWhenNoBody() - { - $this->assertNull(Core::body([])); - } - - public function testReturnsStreamAsString() - { - $this->assertEquals( - 'foo', - Core::body(['body' => Stream::factory('foo')]) - ); - } - - public function testReturnsString() - { - $this->assertEquals('foo', Core::body(['body' => 'foo'])); - } - - public function testReturnsResourceContent() - { - $r = fopen('php://memory', 'w+'); - fwrite($r, 'foo'); - rewind($r); - $this->assertEquals('foo', Core::body(['body' => $r])); - fclose($r); - } - - public function testReturnsIteratorContent() - { - $a = new \ArrayIterator(['a', 'b', 'cd', '']); - $this->assertEquals('abcd', Core::body(['body' => $a])); - } - - public function testReturnsObjectToString() - { - $this->assertEquals('foo', Core::body(['body' => new StrClass])); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testEnsuresBodyIsValid() - { - Core::body(['body' => false]); - } - - public function testParsesHeadersFromLines() - { - $lines = ['Foo: bar', 'Foo: baz', 'Abc: 123', 'Def: a, b']; - $this->assertEquals([ - 'Foo' => ['bar', 'baz'], - 'Abc' => ['123'], - 'Def' => ['a, b'], - ], Core::headersFromLines($lines)); - } - - public function testParsesHeadersFromLinesWithMultipleLines() - { - $lines = ['Foo: bar', 'Foo: baz', 'Foo: 123']; - $this->assertEquals([ - 'Foo' => ['bar', 'baz', '123'], - ], Core::headersFromLines($lines)); - } - - public function testCreatesArrayCallFunctions() - { - $called = []; - $a = function ($a, $b) use (&$called) { - $called['a'] = func_get_args(); - }; - $b = function ($a, $b) use (&$called) { - $called['b'] = func_get_args(); - }; - $c = Core::callArray([$a, $b]); - $c(1, 2); - $this->assertEquals([1, 2], $called['a']); - $this->assertEquals([1, 2], $called['b']); - } - - public function testRewindsGuzzleStreams() - { - $str = Stream::factory('foo'); - $this->assertTrue(Core::rewindBody(['body' => $str])); - } - - public function testRewindsStreams() - { - $str = Stream::factory('foo')->detach(); - $this->assertTrue(Core::rewindBody(['body' => $str])); - } - - public function testRewindsIterators() - { - $iter = new \ArrayIterator(['foo']); - $this->assertTrue(Core::rewindBody(['body' => $iter])); - } - - public function testRewindsStrings() - { - $this->assertTrue(Core::rewindBody(['body' => 'hi'])); - } - - public function testRewindsToStrings() - { - $this->assertTrue(Core::rewindBody(['body' => new StrClass()])); - } - - public function typeProvider() - { - return [ - ['foo', 'string(3) "foo"'], - [true, 'bool(true)'], - [false, 'bool(false)'], - [10, 'int(10)'], - [1.0, 'float(1)'], - [new StrClass(), 'object(GuzzleHttp\Tests\Ring\StrClass)'], - [['foo'], 'array(1)'] - ]; - } - - /** - * @dataProvider typeProvider - */ - public function testDescribesType($input, $output) - { - $this->assertEquals($output, Core::describeType($input)); - } - - public function testDoesSleep() - { - $t = microtime(true); - $expected = $t + (100 / 1000); - Core::doSleep(['client' => ['delay' => 100]]); - $this->assertGreaterThanOrEqual($expected, microtime(true)); - } - - public function testProxiesFuture() - { - $f = new CompletedFutureArray(['status' => 200]); - $res = null; - $proxied = Core::proxy($f, function ($value) use (&$res) { - $value['foo'] = 'bar'; - $res = $value; - return $value; - }); - $this->assertNotSame($f, $proxied); - $this->assertEquals(200, $f->wait()['status']); - $this->assertArrayNotHasKey('foo', $f->wait()); - $this->assertEquals('bar', $proxied->wait()['foo']); - $this->assertEquals(200, $proxied->wait()['status']); - } - - public function testProxiesDeferredFuture() - { - $d = new Deferred(); - $f = new FutureArray($d->promise()); - $f2 = Core::proxy($f); - $d->resolve(['foo' => 'bar']); - $this->assertEquals('bar', $f['foo']); - $this->assertEquals('bar', $f2['foo']); - } - - public function testProxiesDeferredFutureFailure() - { - $d = new Deferred(); - $f = new FutureArray($d->promise()); - $f2 = Core::proxy($f); - $d->reject(new \Exception('foo')); - try { - $f2['hello?']; - $this->fail('did not throw'); - } catch (\Exception $e) { - $this->assertEquals('foo', $e->getMessage()); - } - - } -} - -final class StrClass -{ - public function __toString() - { - return 'foo'; - } -} diff --git a/core/vendor/guzzlehttp/ringphp/tests/Future/CompletedFutureArrayTest.php b/core/vendor/guzzlehttp/ringphp/tests/Future/CompletedFutureArrayTest.php deleted file mode 100644 index 82d7efb..0000000 --- a/core/vendor/guzzlehttp/ringphp/tests/Future/CompletedFutureArrayTest.php +++ /dev/null @@ -1,21 +0,0 @@ - 'bar']); - $this->assertEquals('bar', $f['foo']); - $this->assertFalse(isset($f['baz'])); - $f['abc'] = '123'; - $this->assertTrue(isset($f['abc'])); - $this->assertEquals(['foo' => 'bar', 'abc' => '123'], iterator_to_array($f)); - $this->assertEquals(2, count($f)); - unset($f['abc']); - $this->assertEquals(1, count($f)); - $this->assertEquals(['foo' => 'bar'], iterator_to_array($f)); - } -} diff --git a/core/vendor/guzzlehttp/ringphp/tests/Future/CompletedFutureValueTest.php b/core/vendor/guzzlehttp/ringphp/tests/Future/CompletedFutureValueTest.php deleted file mode 100644 index 6ded40d..0000000 --- a/core/vendor/guzzlehttp/ringphp/tests/Future/CompletedFutureValueTest.php +++ /dev/null @@ -1,46 +0,0 @@ -assertEquals('hi', $f->wait()); - $f->cancel(); - - $a = null; - $f->then(function ($v) use (&$a) { - $a = $v; - }); - $this->assertSame('hi', $a); - } - - public function testThrows() - { - $ex = new \Exception('foo'); - $f = new CompletedFutureValue(null, $ex); - $f->cancel(); - try { - $f->wait(); - $this->fail('did not throw'); - } catch (\Exception $e) { - $this->assertSame($e, $ex); - } - } - - public function testMarksAsCancelled() - { - $ex = new CancelledFutureAccessException(); - $f = new CompletedFutureValue(null, $ex); - try { - $f->wait(); - $this->fail('did not throw'); - } catch (\Exception $e) { - $this->assertSame($e, $ex); - } - } -} diff --git a/core/vendor/guzzlehttp/ringphp/tests/Future/FutureArrayTest.php b/core/vendor/guzzlehttp/ringphp/tests/Future/FutureArrayTest.php deleted file mode 100644 index 0e09f5a..0000000 --- a/core/vendor/guzzlehttp/ringphp/tests/Future/FutureArrayTest.php +++ /dev/null @@ -1,56 +0,0 @@ -promise(), - function () use (&$c, $deferred) { - $c = true; - $deferred->resolve(['status' => 200]); - } - ); - $this->assertFalse($c); - $this->assertFalse($this->readAttribute($f, 'isRealized')); - $this->assertEquals(200, $f['status']); - $this->assertTrue($c); - } - - public function testActsLikeArray() - { - $deferred = new Deferred(); - $f = new FutureArray( - $deferred->promise(), - function () use (&$c, $deferred) { - $deferred->resolve(['status' => 200]); - } - ); - - $this->assertTrue(isset($f['status'])); - $this->assertEquals(200, $f['status']); - $this->assertEquals(['status' => 200], $f->wait()); - $this->assertEquals(1, count($f)); - $f['baz'] = 10; - $this->assertEquals(10, $f['baz']); - unset($f['baz']); - $this->assertFalse(isset($f['baz'])); - $this->assertEquals(['status' => 200], iterator_to_array($f)); - } - - /** - * @expectedException \RuntimeException - */ - public function testThrowsWhenAccessingInvalidProperty() - { - $deferred = new Deferred(); - $f = new FutureArray($deferred->promise(), function () {}); - $f->foo; - } -} diff --git a/core/vendor/guzzlehttp/ringphp/tests/Future/FutureValueTest.php b/core/vendor/guzzlehttp/ringphp/tests/Future/FutureValueTest.php deleted file mode 100644 index d59c543..0000000 --- a/core/vendor/guzzlehttp/ringphp/tests/Future/FutureValueTest.php +++ /dev/null @@ -1,109 +0,0 @@ -promise(), - function () use ($deferred, &$called) { - $called++; - $deferred->resolve('foo'); - } - ); - - $this->assertEquals('foo', $f->wait()); - $this->assertEquals(1, $called); - $this->assertEquals('foo', $f->wait()); - $this->assertEquals(1, $called); - $f->cancel(); - $this->assertTrue($this->readAttribute($f, 'isRealized')); - } - - /** - * @expectedException \GuzzleHttp\Ring\Exception\CancelledFutureAccessException - */ - public function testThrowsWhenAccessingCancelled() - { - $f = new FutureValue( - (new Deferred())->promise(), - function () {}, - function () { return true; } - ); - $f->cancel(); - $f->wait(); - } - - /** - * @expectedException \OutOfBoundsException - */ - public function testThrowsWhenDerefFailure() - { - $called = false; - $deferred = new Deferred(); - $f = new FutureValue( - $deferred->promise(), - function () use(&$called) { - $called = true; - } - ); - $deferred->reject(new \OutOfBoundsException()); - $f->wait(); - $this->assertFalse($called); - } - - /** - * @expectedException \GuzzleHttp\Ring\Exception\RingException - * @expectedExceptionMessage Waiting did not resolve future - */ - public function testThrowsWhenDerefDoesNotResolve() - { - $deferred = new Deferred(); - $f = new FutureValue( - $deferred->promise(), - function () use(&$called) { - $called = true; - } - ); - $f->wait(); - } - - public function testThrowingCancelledFutureAccessExceptionCancels() - { - $deferred = new Deferred(); - $f = new FutureValue( - $deferred->promise(), - function () use ($deferred) { - throw new CancelledFutureAccessException(); - } - ); - try { - $f->wait(); - $this->fail('did not throw'); - } catch (CancelledFutureAccessException $e) {} - } - - /** - * @expectedException \Exception - * @expectedExceptionMessage foo - */ - public function testThrowingExceptionInDerefMarksAsFailed() - { - $deferred = new Deferred(); - $f = new FutureValue( - $deferred->promise(), - function () { - throw new \Exception('foo'); - } - ); - $f->wait(); - } -} diff --git a/core/vendor/guzzlehttp/ringphp/tests/bootstrap.php b/core/vendor/guzzlehttp/ringphp/tests/bootstrap.php deleted file mode 100644 index 017610f..0000000 --- a/core/vendor/guzzlehttp/ringphp/tests/bootstrap.php +++ /dev/null @@ -1,11 +0,0 @@ - - -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/core/vendor/guzzlehttp/streams/Makefile b/core/vendor/guzzlehttp/streams/Makefile deleted file mode 100644 index f4d4284..0000000 --- a/core/vendor/guzzlehttp/streams/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -all: clean coverage - -release: tag - git push origin --tags - -tag: - chag tag --sign --debug CHANGELOG.rst - -test: - vendor/bin/phpunit - -coverage: - vendor/bin/phpunit --coverage-html=artifacts/coverage - -view-coverage: - open artifacts/coverage/index.html - -clean: - rm -rf artifacts/* diff --git a/core/vendor/guzzlehttp/streams/README.rst b/core/vendor/guzzlehttp/streams/README.rst deleted file mode 100644 index baff63b..0000000 --- a/core/vendor/guzzlehttp/streams/README.rst +++ /dev/null @@ -1,36 +0,0 @@ -============== -Guzzle Streams -============== - -Provides a simple abstraction over streams of data. - -This library is used in `Guzzle 5 `_, and is -(currently) compatible with the WIP PSR-7. - -Installation -============ - -This package can be installed easily using `Composer `_. -Simply add the following to the composer.json file at the root of your project: - -.. code-block:: javascript - - { - "require": { - "guzzlehttp/streams": "~3.0" - } - } - -Then install your dependencies using ``composer.phar install``. - -Documentation -============= - -The documentation for this package can be found on the main Guzzle website at -http://docs.guzzlephp.org/en/guzzle4/streams.html. - -Testing -======= - -This library is tested using PHPUnit. You'll need to install the dependencies -using `Composer `_ then run ``make test``. diff --git a/core/vendor/guzzlehttp/streams/composer.json b/core/vendor/guzzlehttp/streams/composer.json deleted file mode 100644 index 6d70343..0000000 --- a/core/vendor/guzzlehttp/streams/composer.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "guzzlehttp/streams", - "description": "Provides a simple abstraction over streams of data", - "homepage": "http://guzzlephp.org/", - "keywords": ["stream", "guzzle"], - "license": "MIT", - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "require": { - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "autoload": { - "psr-4": { "GuzzleHttp\\Stream\\": "src/" } - }, - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - } -} diff --git a/core/vendor/guzzlehttp/streams/phpunit.xml.dist b/core/vendor/guzzlehttp/streams/phpunit.xml.dist deleted file mode 100644 index 6e758c1..0000000 --- a/core/vendor/guzzlehttp/streams/phpunit.xml.dist +++ /dev/null @@ -1,17 +0,0 @@ - - - - - tests - - - - - src - - src/functions.php - - - - diff --git a/core/vendor/guzzlehttp/streams/src/AppendStream.php b/core/vendor/guzzlehttp/streams/src/AppendStream.php deleted file mode 100644 index 94bda71..0000000 --- a/core/vendor/guzzlehttp/streams/src/AppendStream.php +++ /dev/null @@ -1,220 +0,0 @@ -addStream($stream); - } - } - - public function __toString() - { - try { - $this->seek(0); - return $this->getContents(); - } catch (\Exception $e) { - return ''; - } - } - - /** - * Add a stream to the AppendStream - * - * @param StreamInterface $stream Stream to append. Must be readable. - * - * @throws \InvalidArgumentException if the stream is not readable - */ - public function addStream(StreamInterface $stream) - { - if (!$stream->isReadable()) { - throw new \InvalidArgumentException('Each stream must be readable'); - } - - // The stream is only seekable if all streams are seekable - if (!$stream->isSeekable()) { - $this->seekable = false; - } - - $this->streams[] = $stream; - } - - public function getContents() - { - return Utils::copyToString($this); - } - - /** - * Closes each attached stream. - * - * {@inheritdoc} - */ - public function close() - { - $this->pos = $this->current = 0; - - foreach ($this->streams as $stream) { - $stream->close(); - } - - $this->streams = []; - } - - /** - * Detaches each attached stream - * - * {@inheritdoc} - */ - public function detach() - { - $this->close(); - $this->detached = true; - } - - public function attach($stream) - { - throw new CannotAttachException(); - } - - public function tell() - { - return $this->pos; - } - - /** - * Tries to calculate the size by adding the size of each stream. - * - * If any of the streams do not return a valid number, then the size of the - * append stream cannot be determined and null is returned. - * - * {@inheritdoc} - */ - public function getSize() - { - $size = 0; - - foreach ($this->streams as $stream) { - $s = $stream->getSize(); - if ($s === null) { - return null; - } - $size += $s; - } - - return $size; - } - - public function eof() - { - return !$this->streams || - ($this->current >= count($this->streams) - 1 && - $this->streams[$this->current]->eof()); - } - - /** - * Attempts to seek to the given position. Only supports SEEK_SET. - * - * {@inheritdoc} - */ - public function seek($offset, $whence = SEEK_SET) - { - if (!$this->seekable || $whence !== SEEK_SET) { - return false; - } - - $success = true; - $this->pos = $this->current = 0; - - // Rewind each stream - foreach ($this->streams as $stream) { - if (!$stream->seek(0)) { - $success = false; - } - } - - if (!$success) { - return false; - } - - // Seek to the actual position by reading from each stream - while ($this->pos < $offset && !$this->eof()) { - $this->read(min(8096, $offset - $this->pos)); - } - - return $this->pos == $offset; - } - - /** - * Reads from all of the appended streams until the length is met or EOF. - * - * {@inheritdoc} - */ - public function read($length) - { - $buffer = ''; - $total = count($this->streams) - 1; - $remaining = $length; - - while ($remaining > 0) { - // Progress to the next stream if needed. - if ($this->streams[$this->current]->eof()) { - if ($this->current == $total) { - break; - } - $this->current++; - } - $buffer .= $this->streams[$this->current]->read($remaining); - $remaining = $length - strlen($buffer); - } - - $this->pos += strlen($buffer); - - return $buffer; - } - - public function isReadable() - { - return true; - } - - public function isWritable() - { - return false; - } - - public function isSeekable() - { - return $this->seekable; - } - - public function write($string) - { - return false; - } - - public function getMetadata($key = null) - { - return $key ? null : []; - } -} diff --git a/core/vendor/guzzlehttp/streams/src/AsyncReadStream.php b/core/vendor/guzzlehttp/streams/src/AsyncReadStream.php deleted file mode 100644 index 25ad960..0000000 --- a/core/vendor/guzzlehttp/streams/src/AsyncReadStream.php +++ /dev/null @@ -1,207 +0,0 @@ -isReadable() || !$buffer->isWritable()) { - throw new \InvalidArgumentException( - 'Buffer must be readable and writable' - ); - } - - if (isset($config['size'])) { - $this->size = $config['size']; - } - - static $callables = ['pump', 'drain']; - foreach ($callables as $check) { - if (isset($config[$check])) { - if (!is_callable($config[$check])) { - throw new \InvalidArgumentException( - $check . ' must be callable' - ); - } - $this->{$check} = $config[$check]; - } - } - - $this->hwm = $buffer->getMetadata('hwm'); - - // Cannot drain when there's no high water mark. - if ($this->hwm === null) { - $this->drain = null; - } - - $this->stream = $buffer; - } - - /** - * Factory method used to create new async stream and an underlying buffer - * if no buffer is provided. - * - * This function accepts the same options as AsyncReadStream::__construct, - * but added the following key value pairs: - * - * - buffer: (StreamInterface) Buffer used to buffer data. If none is - * provided, a default buffer is created. - * - hwm: (int) High water mark to use if a buffer is created on your - * behalf. - * - max_buffer: (int) If provided, wraps the utilized buffer in a - * DroppingStream decorator to ensure that buffer does not exceed a given - * length. When exceeded, the stream will begin dropping data. Set the - * max_buffer to 0, to use a NullStream which does not store data. - * - write: (callable) A function that is invoked when data is written - * to the underlying buffer. The function accepts the buffer as the first - * argument, and the data being written as the second. The function MUST - * return the number of bytes that were written or false to let writers - * know to slow down. - * - drain: (callable) See constructor documentation. - * - pump: (callable) See constructor documentation. - * - * @param array $options Associative array of options. - * - * @return array Returns an array containing the buffer used to buffer - * data, followed by the ready to use AsyncReadStream object. - */ - public static function create(array $options = []) - { - $maxBuffer = isset($options['max_buffer']) - ? $options['max_buffer'] - : null; - - if ($maxBuffer === 0) { - $buffer = new NullStream(); - } elseif (isset($options['buffer'])) { - $buffer = $options['buffer']; - } else { - $hwm = isset($options['hwm']) ? $options['hwm'] : 16384; - $buffer = new BufferStream($hwm); - } - - if ($maxBuffer > 0) { - $buffer = new DroppingStream($buffer, $options['max_buffer']); - } - - // Call the on_write callback if an on_write function was provided. - if (isset($options['write'])) { - $onWrite = $options['write']; - $buffer = FnStream::decorate($buffer, [ - 'write' => function ($string) use ($buffer, $onWrite) { - $result = $buffer->write($string); - $onWrite($buffer, $string); - return $result; - } - ]); - } - - return [$buffer, new self($buffer, $options)]; - } - - public function getSize() - { - return $this->size; - } - - public function isWritable() - { - return false; - } - - public function write($string) - { - return false; - } - - public function read($length) - { - if (!$this->needsDrain && $this->drain) { - $this->needsDrain = $this->stream->getSize() >= $this->hwm; - } - - $result = $this->stream->read($length); - - // If we need to drain, then drain when the buffer is empty. - if ($this->needsDrain && $this->stream->getSize() === 0) { - $this->needsDrain = false; - $drainFn = $this->drain; - $drainFn($this->stream); - } - - $resultLen = strlen($result); - - // If a pump was provided, the buffer is still open, and not enough - // data was given, then block until the data is provided. - if ($this->pump && $resultLen < $length) { - $pumpFn = $this->pump; - $result .= $pumpFn($length - $resultLen); - } - - return $result; - } -} diff --git a/core/vendor/guzzlehttp/streams/src/BufferStream.php b/core/vendor/guzzlehttp/streams/src/BufferStream.php deleted file mode 100644 index 0fffbd6..0000000 --- a/core/vendor/guzzlehttp/streams/src/BufferStream.php +++ /dev/null @@ -1,138 +0,0 @@ -hwm = $hwm; - } - - public function __toString() - { - return $this->getContents(); - } - - public function getContents() - { - $buffer = $this->buffer; - $this->buffer = ''; - - return $buffer; - } - - public function close() - { - $this->buffer = ''; - } - - public function detach() - { - $this->close(); - } - - public function attach($stream) - { - throw new CannotAttachException(); - } - - public function getSize() - { - return strlen($this->buffer); - } - - public function isReadable() - { - return true; - } - - public function isWritable() - { - return true; - } - - public function isSeekable() - { - return false; - } - - public function seek($offset, $whence = SEEK_SET) - { - return false; - } - - public function eof() - { - return strlen($this->buffer) === 0; - } - - public function tell() - { - return false; - } - - /** - * Reads data from the buffer. - */ - public function read($length) - { - $currentLength = strlen($this->buffer); - - if ($length >= $currentLength) { - // No need to slice the buffer because we don't have enough data. - $result = $this->buffer; - $this->buffer = ''; - } else { - // Slice up the result to provide a subset of the buffer. - $result = substr($this->buffer, 0, $length); - $this->buffer = substr($this->buffer, $length); - } - - return $result; - } - - /** - * Writes data to the buffer. - */ - public function write($string) - { - $this->buffer .= $string; - - if (strlen($this->buffer) >= $this->hwm) { - return false; - } - - return strlen($string); - } - - public function getMetadata($key = null) - { - if ($key == 'hwm') { - return $this->hwm; - } - - return $key ? null : []; - } -} diff --git a/core/vendor/guzzlehttp/streams/src/CachingStream.php b/core/vendor/guzzlehttp/streams/src/CachingStream.php deleted file mode 100644 index 60bb905..0000000 --- a/core/vendor/guzzlehttp/streams/src/CachingStream.php +++ /dev/null @@ -1,122 +0,0 @@ -remoteStream = $stream; - $this->stream = $target ?: new Stream(fopen('php://temp', 'r+')); - } - - public function getSize() - { - return max($this->stream->getSize(), $this->remoteStream->getSize()); - } - - /** - * {@inheritdoc} - * @throws SeekException When seeking with SEEK_END or when seeking - * past the total size of the buffer stream - */ - public function seek($offset, $whence = SEEK_SET) - { - if ($whence == SEEK_SET) { - $byte = $offset; - } elseif ($whence == SEEK_CUR) { - $byte = $offset + $this->tell(); - } else { - return false; - } - - // You cannot skip ahead past where you've read from the remote stream - if ($byte > $this->stream->getSize()) { - throw new SeekException( - $this, - $byte, - sprintf('Cannot seek to byte %d when the buffered stream only' - . ' contains %d bytes', $byte, $this->stream->getSize()) - ); - } - - return $this->stream->seek($byte); - } - - public function read($length) - { - // Perform a regular read on any previously read data from the buffer - $data = $this->stream->read($length); - $remaining = $length - strlen($data); - - // More data was requested so read from the remote stream - if ($remaining) { - // If data was written to the buffer in a position that would have - // been filled from the remote stream, then we must skip bytes on - // the remote stream to emulate overwriting bytes from that - // position. This mimics the behavior of other PHP stream wrappers. - $remoteData = $this->remoteStream->read( - $remaining + $this->skipReadBytes - ); - - if ($this->skipReadBytes) { - $len = strlen($remoteData); - $remoteData = substr($remoteData, $this->skipReadBytes); - $this->skipReadBytes = max(0, $this->skipReadBytes - $len); - } - - $data .= $remoteData; - $this->stream->write($remoteData); - } - - return $data; - } - - public function write($string) - { - // When appending to the end of the currently read stream, you'll want - // to skip bytes from being read from the remote stream to emulate - // other stream wrappers. Basically replacing bytes of data of a fixed - // length. - $overflow = (strlen($string) + $this->tell()) - $this->remoteStream->tell(); - if ($overflow > 0) { - $this->skipReadBytes += $overflow; - } - - return $this->stream->write($string); - } - - public function eof() - { - return $this->stream->eof() && $this->remoteStream->eof(); - } - - /** - * Close both the remote stream and buffer stream - */ - public function close() - { - $this->remoteStream->close() && $this->stream->close(); - } -} diff --git a/core/vendor/guzzlehttp/streams/src/DroppingStream.php b/core/vendor/guzzlehttp/streams/src/DroppingStream.php deleted file mode 100644 index 56ee80c..0000000 --- a/core/vendor/guzzlehttp/streams/src/DroppingStream.php +++ /dev/null @@ -1,42 +0,0 @@ -stream = $stream; - $this->maxLength = $maxLength; - } - - public function write($string) - { - $diff = $this->maxLength - $this->stream->getSize(); - - // Begin returning false when the underlying stream is too large. - if ($diff <= 0) { - return false; - } - - // Write the stream or a subset of the stream if needed. - if (strlen($string) < $diff) { - return $this->stream->write($string); - } - - $this->stream->write(substr($string, 0, $diff)); - - return false; - } -} diff --git a/core/vendor/guzzlehttp/streams/src/Exception/CannotAttachException.php b/core/vendor/guzzlehttp/streams/src/Exception/CannotAttachException.php deleted file mode 100644 index e631b9f..0000000 --- a/core/vendor/guzzlehttp/streams/src/Exception/CannotAttachException.php +++ /dev/null @@ -1,4 +0,0 @@ -stream = $stream; - $msg = $msg ?: 'Could not seek the stream to position ' . $pos; - parent::__construct($msg); - } - - /** - * @return StreamInterface - */ - public function getStream() - { - return $this->stream; - } -} diff --git a/core/vendor/guzzlehttp/streams/src/FnStream.php b/core/vendor/guzzlehttp/streams/src/FnStream.php deleted file mode 100644 index 6b5872d..0000000 --- a/core/vendor/guzzlehttp/streams/src/FnStream.php +++ /dev/null @@ -1,147 +0,0 @@ -methods = $methods; - - // Create the functions on the class - foreach ($methods as $name => $fn) { - $this->{'_fn_' . $name} = $fn; - } - } - - /** - * Lazily determine which methods are not implemented. - * @throws \BadMethodCallException - */ - public function __get($name) - { - throw new \BadMethodCallException(str_replace('_fn_', '', $name) - . '() is not implemented in the FnStream'); - } - - /** - * The close method is called on the underlying stream only if possible. - */ - public function __destruct() - { - if (isset($this->_fn_close)) { - call_user_func($this->_fn_close); - } - } - - /** - * Adds custom functionality to an underlying stream by intercepting - * specific method calls. - * - * @param StreamInterface $stream Stream to decorate - * @param array $methods Hash of method name to a closure - * - * @return FnStream - */ - public static function decorate(StreamInterface $stream, array $methods) - { - // If any of the required methods were not provided, then simply - // proxy to the decorated stream. - foreach (array_diff(self::$slots, array_keys($methods)) as $diff) { - $methods[$diff] = [$stream, $diff]; - } - - return new self($methods); - } - - public function __toString() - { - return call_user_func($this->_fn___toString); - } - - public function close() - { - return call_user_func($this->_fn_close); - } - - public function detach() - { - return call_user_func($this->_fn_detach); - } - - public function attach($stream) - { - return call_user_func($this->_fn_attach, $stream); - } - - public function getSize() - { - return call_user_func($this->_fn_getSize); - } - - public function tell() - { - return call_user_func($this->_fn_tell); - } - - public function eof() - { - return call_user_func($this->_fn_eof); - } - - public function isSeekable() - { - return call_user_func($this->_fn_isSeekable); - } - - public function seek($offset, $whence = SEEK_SET) - { - return call_user_func($this->_fn_seek, $offset, $whence); - } - - public function isWritable() - { - return call_user_func($this->_fn_isWritable); - } - - public function write($string) - { - return call_user_func($this->_fn_write, $string); - } - - public function isReadable() - { - return call_user_func($this->_fn_isReadable); - } - - public function read($length) - { - return call_user_func($this->_fn_read, $length); - } - - public function getContents() - { - return call_user_func($this->_fn_getContents); - } - - public function getMetadata($key = null) - { - return call_user_func($this->_fn_getMetadata, $key); - } -} diff --git a/core/vendor/guzzlehttp/streams/src/GuzzleStreamWrapper.php b/core/vendor/guzzlehttp/streams/src/GuzzleStreamWrapper.php deleted file mode 100644 index 4d049a6..0000000 --- a/core/vendor/guzzlehttp/streams/src/GuzzleStreamWrapper.php +++ /dev/null @@ -1,117 +0,0 @@ -isReadable()) { - $mode = $stream->isWritable() ? 'r+' : 'r'; - } elseif ($stream->isWritable()) { - $mode = 'w'; - } else { - throw new \InvalidArgumentException('The stream must be readable, ' - . 'writable, or both.'); - } - - return fopen('guzzle://stream', $mode, null, stream_context_create([ - 'guzzle' => ['stream' => $stream] - ])); - } - - /** - * Registers the stream wrapper if needed - */ - public static function register() - { - if (!in_array('guzzle', stream_get_wrappers())) { - stream_wrapper_register('guzzle', __CLASS__); - } - } - - public function stream_open($path, $mode, $options, &$opened_path) - { - $options = stream_context_get_options($this->context); - - if (!isset($options['guzzle']['stream'])) { - return false; - } - - $this->mode = $mode; - $this->stream = $options['guzzle']['stream']; - - return true; - } - - public function stream_read($count) - { - return $this->stream->read($count); - } - - public function stream_write($data) - { - return (int) $this->stream->write($data); - } - - public function stream_tell() - { - return $this->stream->tell(); - } - - public function stream_eof() - { - return $this->stream->eof(); - } - - public function stream_seek($offset, $whence) - { - return $this->stream->seek($offset, $whence); - } - - public function stream_stat() - { - static $modeMap = [ - 'r' => 33060, - 'r+' => 33206, - 'w' => 33188 - ]; - - return [ - 'dev' => 0, - 'ino' => 0, - 'mode' => $modeMap[$this->mode], - 'nlink' => 0, - 'uid' => 0, - 'gid' => 0, - 'rdev' => 0, - 'size' => $this->stream->getSize() ?: 0, - 'atime' => 0, - 'mtime' => 0, - 'ctime' => 0, - 'blksize' => 0, - 'blocks' => 0 - ]; - } -} diff --git a/core/vendor/guzzlehttp/streams/src/InflateStream.php b/core/vendor/guzzlehttp/streams/src/InflateStream.php deleted file mode 100644 index 978af21..0000000 --- a/core/vendor/guzzlehttp/streams/src/InflateStream.php +++ /dev/null @@ -1,27 +0,0 @@ -stream = new Stream($resource); - } -} diff --git a/core/vendor/guzzlehttp/streams/src/LazyOpenStream.php b/core/vendor/guzzlehttp/streams/src/LazyOpenStream.php deleted file mode 100644 index 6242ee7..0000000 --- a/core/vendor/guzzlehttp/streams/src/LazyOpenStream.php +++ /dev/null @@ -1,37 +0,0 @@ -filename = $filename; - $this->mode = $mode; - } - - /** - * Creates the underlying stream lazily when required. - * - * @return StreamInterface - */ - protected function createStream() - { - return Stream::factory(Utils::open($this->filename, $this->mode)); - } -} diff --git a/core/vendor/guzzlehttp/streams/src/LimitStream.php b/core/vendor/guzzlehttp/streams/src/LimitStream.php deleted file mode 100644 index e9fad98..0000000 --- a/core/vendor/guzzlehttp/streams/src/LimitStream.php +++ /dev/null @@ -1,161 +0,0 @@ -stream = $stream; - $this->setLimit($limit); - $this->setOffset($offset); - } - - public function eof() - { - // Always return true if the underlying stream is EOF - if ($this->stream->eof()) { - return true; - } - - // No limit and the underlying stream is not at EOF - if ($this->limit == -1) { - return false; - } - - $tell = $this->stream->tell(); - if ($tell === false) { - return false; - } - - return $tell >= $this->offset + $this->limit; - } - - /** - * Returns the size of the limited subset of data - * {@inheritdoc} - */ - public function getSize() - { - if (null === ($length = $this->stream->getSize())) { - return null; - } elseif ($this->limit == -1) { - return $length - $this->offset; - } else { - return min($this->limit, $length - $this->offset); - } - } - - /** - * Allow for a bounded seek on the read limited stream - * {@inheritdoc} - */ - public function seek($offset, $whence = SEEK_SET) - { - if ($whence !== SEEK_SET || $offset < 0) { - return false; - } - - $offset += $this->offset; - - if ($this->limit !== -1) { - if ($offset > $this->offset + $this->limit) { - $offset = $this->offset + $this->limit; - } - } - - return $this->stream->seek($offset); - } - - /** - * Give a relative tell() - * {@inheritdoc} - */ - public function tell() - { - return $this->stream->tell() - $this->offset; - } - - /** - * Set the offset to start limiting from - * - * @param int $offset Offset to seek to and begin byte limiting from - * - * @return self - * @throws SeekException - */ - public function setOffset($offset) - { - $current = $this->stream->tell(); - - if ($current !== $offset) { - // If the stream cannot seek to the offset position, then read to it - if (!$this->stream->seek($offset)) { - if ($current > $offset) { - throw new SeekException($this, $offset); - } else { - $this->stream->read($offset - $current); - } - } - } - - $this->offset = $offset; - - return $this; - } - - /** - * Set the limit of bytes that the decorator allows to be read from the - * stream. - * - * @param int $limit Number of bytes to allow to be read from the stream. - * Use -1 for no limit. - * @return self - */ - public function setLimit($limit) - { - $this->limit = $limit; - - return $this; - } - - public function read($length) - { - if ($this->limit == -1) { - return $this->stream->read($length); - } - - // Check if the current position is less than the total allowed - // bytes + original offset - $remaining = ($this->offset + $this->limit) - $this->stream->tell(); - if ($remaining > 0) { - // Only return the amount of requested data, ensuring that the byte - // limit is not exceeded - return $this->stream->read(min($remaining, $length)); - } else { - return false; - } - } -} diff --git a/core/vendor/guzzlehttp/streams/src/MetadataStreamInterface.php b/core/vendor/guzzlehttp/streams/src/MetadataStreamInterface.php deleted file mode 100644 index c1433ad..0000000 --- a/core/vendor/guzzlehttp/streams/src/MetadataStreamInterface.php +++ /dev/null @@ -1,11 +0,0 @@ -stream->attach($stream); - } -} diff --git a/core/vendor/guzzlehttp/streams/src/NullStream.php b/core/vendor/guzzlehttp/streams/src/NullStream.php deleted file mode 100644 index 41ee776..0000000 --- a/core/vendor/guzzlehttp/streams/src/NullStream.php +++ /dev/null @@ -1,78 +0,0 @@ -source = $source; - $this->size = isset($options['size']) ? $options['size'] : null; - $this->metadata = isset($options['metadata']) ? $options['metadata'] : []; - $this->buffer = new BufferStream(); - } - - public function __toString() - { - return Utils::copyToString($this); - } - - public function close() - { - $this->detach(); - } - - public function detach() - { - $this->tellPos = false; - $this->source = null; - } - - public function attach($stream) - { - throw new CannotAttachException(); - } - - public function getSize() - { - return $this->size; - } - - public function tell() - { - return $this->tellPos; - } - - public function eof() - { - return !$this->source; - } - - public function isSeekable() - { - return false; - } - - public function seek($offset, $whence = SEEK_SET) - { - return false; - } - - public function isWritable() - { - return false; - } - - public function write($string) - { - return false; - } - - public function isReadable() - { - return true; - } - - public function read($length) - { - $data = $this->buffer->read($length); - $readLen = strlen($data); - $this->tellPos += $readLen; - $remaining = $length - $readLen; - - if ($remaining) { - $this->pump($remaining); - $data .= $this->buffer->read($remaining); - $this->tellPos += strlen($data) - $readLen; - } - - return $data; - } - - public function getContents() - { - $result = ''; - while (!$this->eof()) { - $result .= $this->read(1000000); - } - - return $result; - } - - public function getMetadata($key = null) - { - if (!$key) { - return $this->metadata; - } - - return isset($this->metadata[$key]) ? $this->metadata[$key] : null; - } - - private function pump($length) - { - if ($this->source) { - do { - $data = call_user_func($this->source, $length); - if ($data === false || $data === null) { - $this->source = null; - return; - } - $this->buffer->write($data); - $length -= strlen($data); - } while ($length > 0); - } - } -} diff --git a/core/vendor/guzzlehttp/streams/src/Stream.php b/core/vendor/guzzlehttp/streams/src/Stream.php deleted file mode 100644 index 7adbc5e..0000000 --- a/core/vendor/guzzlehttp/streams/src/Stream.php +++ /dev/null @@ -1,261 +0,0 @@ - [ - 'r' => true, 'w+' => true, 'r+' => true, 'x+' => true, 'c+' => true, - 'rb' => true, 'w+b' => true, 'r+b' => true, 'x+b' => true, - 'c+b' => true, 'rt' => true, 'w+t' => true, 'r+t' => true, - 'x+t' => true, 'c+t' => true, 'a+' => true - ], - 'write' => [ - 'w' => true, 'w+' => true, 'rw' => true, 'r+' => true, 'x+' => true, - 'c+' => true, 'wb' => true, 'w+b' => true, 'r+b' => true, - 'x+b' => true, 'c+b' => true, 'w+t' => true, 'r+t' => true, - 'x+t' => true, 'c+t' => true, 'a' => true, 'a+' => true - ] - ]; - - /** - * Create a new stream based on the input type. - * - * This factory accepts the same associative array of options as described - * in the constructor. - * - * @param resource|string|StreamInterface $resource Entity body data - * @param array $options Additional options - * - * @return Stream - * @throws \InvalidArgumentException if the $resource arg is not valid. - */ - public static function factory($resource = '', array $options = []) - { - $type = gettype($resource); - - if ($type == 'string') { - $stream = fopen('php://temp', 'r+'); - if ($resource !== '') { - fwrite($stream, $resource); - fseek($stream, 0); - } - return new self($stream, $options); - } - - if ($type == 'resource') { - return new self($resource, $options); - } - - if ($resource instanceof StreamInterface) { - return $resource; - } - - if ($type == 'object' && method_exists($resource, '__toString')) { - return self::factory((string) $resource, $options); - } - - if (is_callable($resource)) { - return new PumpStream($resource, $options); - } - - if ($resource instanceof \Iterator) { - return new PumpStream(function () use ($resource) { - if (!$resource->valid()) { - return false; - } - $result = $resource->current(); - $resource->next(); - return $result; - }, $options); - } - - throw new \InvalidArgumentException('Invalid resource type: ' . $type); - } - - /** - * This constructor accepts an associative array of options. - * - * - size: (int) If a read stream would otherwise have an indeterminate - * size, but the size is known due to foreknownledge, then you can - * provide that size, in bytes. - * - metadata: (array) Any additional metadata to return when the metadata - * of the stream is accessed. - * - * @param resource $stream Stream resource to wrap. - * @param array $options Associative array of options. - * - * @throws \InvalidArgumentException if the stream is not a stream resource - */ - public function __construct($stream, $options = []) - { - if (!is_resource($stream)) { - throw new \InvalidArgumentException('Stream must be a resource'); - } - - if (isset($options['size'])) { - $this->size = $options['size']; - } - - $this->customMetadata = isset($options['metadata']) - ? $options['metadata'] - : []; - - $this->attach($stream); - } - - /** - * Closes the stream when the destructed - */ - public function __destruct() - { - $this->close(); - } - - public function __toString() - { - if (!$this->stream) { - return ''; - } - - $this->seek(0); - - return (string) stream_get_contents($this->stream); - } - - public function getContents() - { - return $this->stream ? stream_get_contents($this->stream) : ''; - } - - public function close() - { - if (is_resource($this->stream)) { - fclose($this->stream); - } - - $this->detach(); - } - - public function detach() - { - $result = $this->stream; - $this->stream = $this->size = $this->uri = null; - $this->readable = $this->writable = $this->seekable = false; - - return $result; - } - - public function attach($stream) - { - $this->stream = $stream; - $meta = stream_get_meta_data($this->stream); - $this->seekable = $meta['seekable']; - $this->readable = isset(self::$readWriteHash['read'][$meta['mode']]); - $this->writable = isset(self::$readWriteHash['write'][$meta['mode']]); - $this->uri = $this->getMetadata('uri'); - } - - public function getSize() - { - if ($this->size !== null) { - return $this->size; - } - - if (!$this->stream) { - return null; - } - - // Clear the stat cache if the stream has a URI - if ($this->uri) { - clearstatcache(true, $this->uri); - } - - $stats = fstat($this->stream); - if (isset($stats['size'])) { - $this->size = $stats['size']; - return $this->size; - } - - return null; - } - - public function isReadable() - { - return $this->readable; - } - - public function isWritable() - { - return $this->writable; - } - - public function isSeekable() - { - return $this->seekable; - } - - public function eof() - { - return !$this->stream || feof($this->stream); - } - - public function tell() - { - return $this->stream ? ftell($this->stream) : false; - } - - public function setSize($size) - { - $this->size = $size; - - return $this; - } - - public function seek($offset, $whence = SEEK_SET) - { - return $this->seekable - ? fseek($this->stream, $offset, $whence) === 0 - : false; - } - - public function read($length) - { - return $this->readable ? fread($this->stream, $length) : false; - } - - public function write($string) - { - // We can't know the size after writing anything - $this->size = null; - - return $this->writable ? fwrite($this->stream, $string) : false; - } - - public function getMetadata($key = null) - { - if (!$this->stream) { - return $key ? null : []; - } elseif (!$key) { - return $this->customMetadata + stream_get_meta_data($this->stream); - } elseif (isset($this->customMetadata[$key])) { - return $this->customMetadata[$key]; - } - - $meta = stream_get_meta_data($this->stream); - - return isset($meta[$key]) ? $meta[$key] : null; - } -} diff --git a/core/vendor/guzzlehttp/streams/src/StreamDecoratorTrait.php b/core/vendor/guzzlehttp/streams/src/StreamDecoratorTrait.php deleted file mode 100644 index 39c19c5..0000000 --- a/core/vendor/guzzlehttp/streams/src/StreamDecoratorTrait.php +++ /dev/null @@ -1,143 +0,0 @@ -stream = $stream; - } - - /** - * Magic method used to create a new stream if streams are not added in - * the constructor of a decorator (e.g., LazyOpenStream). - */ - public function __get($name) - { - if ($name == 'stream') { - $this->stream = $this->createStream(); - return $this->stream; - } - - throw new \UnexpectedValueException("$name not found on class"); - } - - public function __toString() - { - try { - $this->seek(0); - return $this->getContents(); - } catch (\Exception $e) { - // Really, PHP? https://bugs.php.net/bug.php?id=53648 - trigger_error('StreamDecorator::__toString exception: ' - . (string) $e, E_USER_ERROR); - return ''; - } - } - - public function getContents() - { - return Utils::copyToString($this); - } - - /** - * Allow decorators to implement custom methods - * - * @param string $method Missing method name - * @param array $args Method arguments - * - * @return mixed - */ - public function __call($method, array $args) - { - $result = call_user_func_array(array($this->stream, $method), $args); - - // Always return the wrapped object if the result is a return $this - return $result === $this->stream ? $this : $result; - } - - public function close() - { - $this->stream->close(); - } - - public function getMetadata($key = null) - { - return $this->stream->getMetadata($key); - } - - public function detach() - { - return $this->stream->detach(); - } - - public function attach($stream) - { - throw new CannotAttachException(); - } - - public function getSize() - { - return $this->stream->getSize(); - } - - public function eof() - { - return $this->stream->eof(); - } - - public function tell() - { - return $this->stream->tell(); - } - - public function isReadable() - { - return $this->stream->isReadable(); - } - - public function isWritable() - { - return $this->stream->isWritable(); - } - - public function isSeekable() - { - return $this->stream->isSeekable(); - } - - public function seek($offset, $whence = SEEK_SET) - { - return $this->stream->seek($offset, $whence); - } - - public function read($length) - { - return $this->stream->read($length); - } - - public function write($string) - { - return $this->stream->write($string); - } - - /** - * Implement in subclasses to dynamically create streams when requested. - * - * @return StreamInterface - * @throws \BadMethodCallException - */ - protected function createStream() - { - throw new \BadMethodCallException('createStream() not implemented in ' - . get_class($this)); - } -} diff --git a/core/vendor/guzzlehttp/streams/src/StreamInterface.php b/core/vendor/guzzlehttp/streams/src/StreamInterface.php deleted file mode 100644 index fd19c6f..0000000 --- a/core/vendor/guzzlehttp/streams/src/StreamInterface.php +++ /dev/null @@ -1,159 +0,0 @@ -eof()) { - $buf = $stream->read(1048576); - if ($buf === false) { - break; - } - $buffer .= $buf; - } - return $buffer; - } - - $len = 0; - while (!$stream->eof() && $len < $maxLen) { - $buf = $stream->read($maxLen - $len); - if ($buf === false) { - break; - } - $buffer .= $buf; - $len = strlen($buffer); - } - - return $buffer; - } - - /** - * Copy the contents of a stream into another stream until the given number - * of bytes have been read. - * - * @param StreamInterface $source Stream to read from - * @param StreamInterface $dest Stream to write to - * @param int $maxLen Maximum number of bytes to read. Pass -1 - * to read the entire stream. - */ - public static function copyToStream( - StreamInterface $source, - StreamInterface $dest, - $maxLen = -1 - ) { - if ($maxLen === -1) { - while (!$source->eof()) { - if (!$dest->write($source->read(1048576))) { - break; - } - } - return; - } - - $bytes = 0; - while (!$source->eof()) { - $buf = $source->read($maxLen - $bytes); - if (!($len = strlen($buf))) { - break; - } - $bytes += $len; - $dest->write($buf); - if ($bytes == $maxLen) { - break; - } - } - } - - /** - * Calculate a hash of a Stream - * - * @param StreamInterface $stream Stream to calculate the hash for - * @param string $algo Hash algorithm (e.g. md5, crc32, etc) - * @param bool $rawOutput Whether or not to use raw output - * - * @return string Returns the hash of the stream - * @throws SeekException - */ - public static function hash( - StreamInterface $stream, - $algo, - $rawOutput = false - ) { - $pos = $stream->tell(); - - if ($pos > 0 && !$stream->seek(0)) { - throw new SeekException($stream); - } - - $ctx = hash_init($algo); - while (!$stream->eof()) { - hash_update($ctx, $stream->read(1048576)); - } - - $out = hash_final($ctx, (bool) $rawOutput); - $stream->seek($pos); - - return $out; - } - - /** - * Read a line from the stream up to the maximum allowed buffer length - * - * @param StreamInterface $stream Stream to read from - * @param int $maxLength Maximum buffer length - * - * @return string|bool - */ - public static function readline(StreamInterface $stream, $maxLength = null) - { - $buffer = ''; - $size = 0; - - while (!$stream->eof()) { - if (false === ($byte = $stream->read(1))) { - return $buffer; - } - $buffer .= $byte; - // Break when a new line is found or the max length - 1 is reached - if ($byte == PHP_EOL || ++$size == $maxLength - 1) { - break; - } - } - - return $buffer; - } - - /** - * Alias of GuzzleHttp\Stream\Stream::factory. - * - * @param mixed $resource Resource to create - * @param array $options Associative array of stream options defined in - * {@see \GuzzleHttp\Stream\Stream::__construct} - * - * @return StreamInterface - * - * @see GuzzleHttp\Stream\Stream::factory - * @see GuzzleHttp\Stream\Stream::__construct - */ - public static function create($resource, array $options = []) - { - return Stream::factory($resource, $options); - } -} diff --git a/core/vendor/guzzlehttp/streams/tests/AppendStreamTest.php b/core/vendor/guzzlehttp/streams/tests/AppendStreamTest.php deleted file mode 100644 index 78798d9..0000000 --- a/core/vendor/guzzlehttp/streams/tests/AppendStreamTest.php +++ /dev/null @@ -1,178 +0,0 @@ -getMockBuilder('GuzzleHttp\Stream\StreamInterface') - ->setMethods(['isReadable']) - ->getMockForAbstractClass(); - $s->expects($this->once()) - ->method('isReadable') - ->will($this->returnValue(false)); - $a->addStream($s); - } - - public function testValidatesSeekType() - { - $a = new AppendStream(); - $this->assertFalse($a->seek(100, SEEK_CUR)); - } - - public function testTriesToRewindOnSeek() - { - $a = new AppendStream(); - $s = $this->getMockBuilder('GuzzleHttp\Stream\StreamInterface') - ->setMethods(['isReadable', 'seek', 'isSeekable']) - ->getMockForAbstractClass(); - $s->expects($this->once()) - ->method('isReadable') - ->will($this->returnValue(true)); - $s->expects($this->once()) - ->method('isSeekable') - ->will($this->returnValue(true)); - $s->expects($this->once()) - ->method('seek') - ->will($this->returnValue(false)); - $a->addStream($s); - $this->assertFalse($a->seek(10)); - } - - public function testSeeksToPositionByReading() - { - $a = new AppendStream([ - Stream::factory('foo'), - Stream::factory('bar'), - Stream::factory('baz'), - ]); - - $this->assertTrue($a->seek(3)); - $this->assertEquals(3, $a->tell()); - $this->assertEquals('bar', $a->read(3)); - $a->seek(6); - $this->assertEquals(6, $a->tell()); - $this->assertEquals('baz', $a->read(3)); - } - - public function testDetachesEachStream() - { - $s1 = Stream::factory('foo'); - $s2 = Stream::factory('foo'); - $a = new AppendStream([$s1, $s2]); - $this->assertSame('foofoo', (string) $a); - $a->detach(); - $this->assertSame('', (string) $a); - $this->assertSame(0, $a->getSize()); - } - - public function testClosesEachStream() - { - $s1 = Stream::factory('foo'); - $a = new AppendStream([$s1]); - $a->close(); - $this->assertSame('', (string) $a); - } - - public function testIsNotWritable() - { - $a = new AppendStream([Stream::factory('foo')]); - $this->assertFalse($a->isWritable()); - $this->assertTrue($a->isSeekable()); - $this->assertTrue($a->isReadable()); - $this->assertFalse($a->write('foo')); - } - - public function testDoesNotNeedStreams() - { - $a = new AppendStream(); - $this->assertEquals('', (string) $a); - } - - public function testCanReadFromMultipleStreams() - { - $a = new AppendStream([ - Stream::factory('foo'), - Stream::factory('bar'), - Stream::factory('baz'), - ]); - $this->assertFalse($a->eof()); - $this->assertSame(0, $a->tell()); - $this->assertEquals('foo', $a->read(3)); - $this->assertEquals('bar', $a->read(3)); - $this->assertEquals('baz', $a->read(3)); - $this->assertTrue($a->eof()); - $this->assertSame(9, $a->tell()); - $this->assertEquals('foobarbaz', (string) $a); - } - - public function testCanDetermineSizeFromMultipleStreams() - { - $a = new AppendStream([ - Stream::factory('foo'), - Stream::factory('bar') - ]); - $this->assertEquals(6, $a->getSize()); - - $s = $this->getMockBuilder('GuzzleHttp\Stream\StreamInterface') - ->setMethods(['isSeekable', 'isReadable']) - ->getMockForAbstractClass(); - $s->expects($this->once()) - ->method('isSeekable') - ->will($this->returnValue(null)); - $s->expects($this->once()) - ->method('isReadable') - ->will($this->returnValue(true)); - $a->addStream($s); - $this->assertNull($a->getSize()); - } - - public function testCatchesExceptionsWhenCastingToString() - { - $s = $this->getMockBuilder('GuzzleHttp\Stream\StreamInterface') - ->setMethods(['read', 'isReadable', 'eof']) - ->getMockForAbstractClass(); - $s->expects($this->once()) - ->method('read') - ->will($this->throwException(new \RuntimeException('foo'))); - $s->expects($this->once()) - ->method('isReadable') - ->will($this->returnValue(true)); - $s->expects($this->any()) - ->method('eof') - ->will($this->returnValue(false)); - $a = new AppendStream([$s]); - $this->assertFalse($a->eof()); - $this->assertSame('', (string) $a); - } - - public function testCanDetach() - { - $s = new AppendStream(); - $s->detach(); - } - - public function testReturnsEmptyMetadata() - { - $s = new AppendStream(); - $this->assertEquals([], $s->getMetadata()); - $this->assertNull($s->getMetadata('foo')); - } - - /** - * @expectedException \GuzzleHttp\Stream\Exception\CannotAttachException - */ - public function testCannotAttach() - { - $p = new AppendStream(); - $p->attach('a'); - } -} diff --git a/core/vendor/guzzlehttp/streams/tests/AsyncReadStreamTest.php b/core/vendor/guzzlehttp/streams/tests/AsyncReadStreamTest.php deleted file mode 100644 index 8c78995..0000000 --- a/core/vendor/guzzlehttp/streams/tests/AsyncReadStreamTest.php +++ /dev/null @@ -1,186 +0,0 @@ - function () { return false; }] - )); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Buffer must be readable and writable - */ - public function testValidatesWritableBuffer() - { - new AsyncReadStream(FnStream::decorate( - Stream::factory(), - ['isWritable' => function () { return false; }] - )); - } - - public function testValidatesHwmMetadata() - { - $a = new AsyncReadStream(Stream::factory(), [ - 'drain' => function() {} - ]); - $this->assertNull($this->readAttribute($a, 'drain')); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage pump must be callable - */ - public function testValidatesPumpIsCallable() - { - new AsyncReadStream(new BufferStream(), ['pump' => true]); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage drain must be callable - */ - public function testValidatesDrainIsCallable() - { - new AsyncReadStream(new BufferStream(), ['drain' => true]); - } - - public function testCanInitialize() - { - $buffer = new BufferStream(); - $a = new AsyncReadStream($buffer, [ - 'size' => 10, - 'drain' => function () {}, - 'pump' => function () {}, - ]); - $this->assertSame($buffer, $this->readAttribute($a, 'stream')); - $this->assertTrue(is_callable($this->readAttribute($a, 'drain'))); - $this->assertTrue(is_callable($this->readAttribute($a, 'pump'))); - $this->assertTrue($a->isReadable()); - $this->assertFalse($a->isSeekable()); - $this->assertFalse($a->isWritable()); - $this->assertFalse($a->write('foo')); - $this->assertEquals(10, $a->getSize()); - } - - public function testReadsFromBufferWithNoDrainOrPump() - { - $buffer = new BufferStream(); - $a = new AsyncReadStream($buffer); - $buffer->write('foo'); - $this->assertNull($a->getSize()); - $this->assertEquals('foo', $a->read(10)); - $this->assertEquals('', $a->read(10)); - } - - public function testCallsPumpForMoreDataWhenRequested() - { - $called = 0; - $buffer = new BufferStream(); - $a = new AsyncReadStream($buffer, [ - 'pump' => function ($size) use (&$called) { - $called++; - return str_repeat('.', $size); - } - ]); - $buffer->write('foobar'); - $this->assertEquals('foo', $a->read(3)); - $this->assertEquals(0, $called); - $this->assertEquals('bar.....', $a->read(8)); - $this->assertEquals(1, $called); - $this->assertEquals('..', $a->read(2)); - $this->assertEquals(2, $called); - } - - public function testCallsDrainWhenNeeded() - { - $called = 0; - $buffer = new BufferStream(5); - $a = new AsyncReadStream($buffer, [ - 'drain' => function (BufferStream $b) use (&$called, $buffer) { - $this->assertSame($b, $buffer); - $called++; - } - ]); - - $buffer->write('foobar'); - $this->assertEquals(6, $buffer->getSize()); - $this->assertEquals(0, $called); - - $a->read(3); - $this->assertTrue($this->readAttribute($a, 'needsDrain')); - $this->assertEquals(3, $buffer->getSize()); - $this->assertEquals(0, $called); - - $a->read(3); - $this->assertEquals(0, $buffer->getSize()); - $this->assertFalse($this->readAttribute($a, 'needsDrain')); - $this->assertEquals(1, $called); - } - - public function testCreatesBufferWithNoConfig() - { - list($buffer, $async) = AsyncReadStream::create(); - $this->assertInstanceOf('GuzzleHttp\Stream\BufferStream', $buffer); - $this->assertInstanceOf('GuzzleHttp\Stream\AsyncReadStream', $async); - } - - public function testCreatesBufferWithSpecifiedBuffer() - { - $buf = new BufferStream(); - list($buffer, $async) = AsyncReadStream::create(['buffer' => $buf]); - $this->assertSame($buf, $buffer); - $this->assertInstanceOf('GuzzleHttp\Stream\AsyncReadStream', $async); - } - - public function testCreatesNullStream() - { - list($buffer, $async) = AsyncReadStream::create(['max_buffer' => 0]); - $this->assertInstanceOf('GuzzleHttp\Stream\NullStream', $buffer); - $this->assertInstanceOf('GuzzleHttp\Stream\AsyncReadStream', $async); - } - - public function testCreatesDroppingStream() - { - list($buffer, $async) = AsyncReadStream::create(['max_buffer' => 5]); - $this->assertInstanceOf('GuzzleHttp\Stream\DroppingStream', $buffer); - $this->assertInstanceOf('GuzzleHttp\Stream\AsyncReadStream', $async); - $buffer->write('12345678910'); - $this->assertEquals(5, $buffer->getSize()); - } - - public function testCreatesOnWriteStream() - { - $c = 0; - $b = new BufferStream(); - list($buffer, $async) = AsyncReadStream::create([ - 'buffer' => $b, - 'write' => function (BufferStream $buf, $data) use (&$c, $b) { - $this->assertSame($buf, $b); - $this->assertEquals('foo', $data); - $c++; - } - ]); - $this->assertInstanceOf('GuzzleHttp\Stream\FnStream', $buffer); - $this->assertInstanceOf('GuzzleHttp\Stream\AsyncReadStream', $async); - $this->assertEquals(0, $c); - $this->assertEquals(3, $buffer->write('foo')); - $this->assertEquals(1, $c); - $this->assertEquals(3, $buffer->write('foo')); - $this->assertEquals(2, $c); - $this->assertEquals('foofoo', (string) $buffer); - } -} diff --git a/core/vendor/guzzlehttp/streams/tests/BufferStreamTest.php b/core/vendor/guzzlehttp/streams/tests/BufferStreamTest.php deleted file mode 100644 index f9bfea2..0000000 --- a/core/vendor/guzzlehttp/streams/tests/BufferStreamTest.php +++ /dev/null @@ -1,69 +0,0 @@ -assertTrue($b->isReadable()); - $this->assertTrue($b->isWritable()); - $this->assertFalse($b->isSeekable()); - $this->assertEquals(null, $b->getMetadata('foo')); - $this->assertEquals(10, $b->getMetadata('hwm')); - $this->assertEquals([], $b->getMetadata()); - } - - public function testRemovesReadDataFromBuffer() - { - $b = new BufferStream(); - $this->assertEquals(3, $b->write('foo')); - $this->assertEquals(3, $b->getSize()); - $this->assertFalse($b->eof()); - $this->assertEquals('foo', $b->read(10)); - $this->assertTrue($b->eof()); - $this->assertEquals('', $b->read(10)); - } - - public function testCanCastToStringOrGetContents() - { - $b = new BufferStream(); - $b->write('foo'); - $b->write('baz'); - $this->assertEquals('foo', $b->read(3)); - $b->write('bar'); - $this->assertEquals('bazbar', (string) $b); - $this->assertFalse($b->tell()); - } - - public function testDetachClearsBuffer() - { - $b = new BufferStream(); - $b->write('foo'); - $b->detach(); - $this->assertEquals(0, $b->tell()); - $this->assertTrue($b->eof()); - $this->assertEquals(3, $b->write('abc')); - $this->assertEquals('abc', $b->read(10)); - } - - public function testExceedingHighwaterMarkReturnsFalseButStillBuffers() - { - $b = new BufferStream(5); - $this->assertEquals(3, $b->write('hi ')); - $this->assertFalse($b->write('hello')); - $this->assertEquals('hi hello', (string) $b); - $this->assertEquals(4, $b->write('test')); - } - - /** - * @expectedException \GuzzleHttp\Stream\Exception\CannotAttachException - */ - public function testCannotAttach() - { - $p = new BufferStream(); - $p->attach('a'); - } -} diff --git a/core/vendor/guzzlehttp/streams/tests/CachingStreamTest.php b/core/vendor/guzzlehttp/streams/tests/CachingStreamTest.php deleted file mode 100644 index ea969b3..0000000 --- a/core/vendor/guzzlehttp/streams/tests/CachingStreamTest.php +++ /dev/null @@ -1,136 +0,0 @@ -decorated = Stream::factory('testing'); - $this->body = new CachingStream($this->decorated); - } - - public function tearDown() - { - $this->decorated->close(); - $this->body->close(); - } - - public function testUsesRemoteSizeIfPossible() - { - $body = Stream::factory('test'); - $caching = new CachingStream($body); - $this->assertEquals(4, $caching->getSize()); - } - - /** - * @expectedException \RuntimeException - * @expectedExceptionMessage Cannot seek to byte 10 - */ - public function testCannotSeekPastWhatHasBeenRead() - { - $this->body->seek(10); - } - - public function testCannotUseSeekEnd() - { - $this->assertFalse($this->body->seek(2, SEEK_END)); - } - - public function testRewindUsesSeek() - { - $a = Stream::factory('foo'); - $d = $this->getMockBuilder('GuzzleHttp\Stream\CachingStream') - ->setMethods(array('seek')) - ->setConstructorArgs(array($a)) - ->getMock(); - $d->expects($this->once()) - ->method('seek') - ->with(0) - ->will($this->returnValue(true)); - $d->seek(0); - } - - public function testCanSeekToReadBytes() - { - $this->assertEquals('te', $this->body->read(2)); - $this->body->seek(0); - $this->assertEquals('test', $this->body->read(4)); - $this->assertEquals(4, $this->body->tell()); - $this->body->seek(2); - $this->assertEquals(2, $this->body->tell()); - $this->body->seek(2, SEEK_CUR); - $this->assertEquals(4, $this->body->tell()); - $this->assertEquals('ing', $this->body->read(3)); - } - - public function testWritesToBufferStream() - { - $this->body->read(2); - $this->body->write('hi'); - $this->body->seek(0); - $this->assertEquals('tehiing', (string) $this->body); - } - - public function testSkipsOverwrittenBytes() - { - $decorated = Stream::factory( - implode("\n", array_map(function ($n) { - return str_pad($n, 4, '0', STR_PAD_LEFT); - }, range(0, 25))) - ); - - $body = new CachingStream($decorated); - - $this->assertEquals("0000\n", Utils::readline($body)); - $this->assertEquals("0001\n", Utils::readline($body)); - // Write over part of the body yet to be read, so skip some bytes - $this->assertEquals(5, $body->write("TEST\n")); - $this->assertEquals(5, $this->readAttribute($body, 'skipReadBytes')); - // Read, which skips bytes, then reads - $this->assertEquals("0003\n", Utils::readline($body)); - $this->assertEquals(0, $this->readAttribute($body, 'skipReadBytes')); - $this->assertEquals("0004\n", Utils::readline($body)); - $this->assertEquals("0005\n", Utils::readline($body)); - - // Overwrite part of the cached body (so don't skip any bytes) - $body->seek(5); - $this->assertEquals(5, $body->write("ABCD\n")); - $this->assertEquals(0, $this->readAttribute($body, 'skipReadBytes')); - $this->assertEquals("TEST\n", Utils::readline($body)); - $this->assertEquals("0003\n", Utils::readline($body)); - $this->assertEquals("0004\n", Utils::readline($body)); - $this->assertEquals("0005\n", Utils::readline($body)); - $this->assertEquals("0006\n", Utils::readline($body)); - $this->assertEquals(5, $body->write("1234\n")); - $this->assertEquals(5, $this->readAttribute($body, 'skipReadBytes')); - - // Seek to 0 and ensure the overwritten bit is replaced - $body->seek(0); - $this->assertEquals("0000\nABCD\nTEST\n0003\n0004\n0005\n0006\n1234\n0008\n0009\n", $body->read(50)); - - // Ensure that casting it to a string does not include the bit that was overwritten - $this->assertContains("0000\nABCD\nTEST\n0003\n0004\n0005\n0006\n1234\n0008\n0009\n", (string) $body); - } - - public function testClosesBothStreams() - { - $s = fopen('php://temp', 'r'); - $a = Stream::factory($s); - $d = new CachingStream($a); - $d->close(); - $this->assertFalse(is_resource($s)); - } -} diff --git a/core/vendor/guzzlehttp/streams/tests/DroppingStreamTest.php b/core/vendor/guzzlehttp/streams/tests/DroppingStreamTest.php deleted file mode 100644 index bb2cb22..0000000 --- a/core/vendor/guzzlehttp/streams/tests/DroppingStreamTest.php +++ /dev/null @@ -1,26 +0,0 @@ -assertEquals(3, $drop->write('hel')); - $this->assertFalse($drop->write('lo')); - $this->assertEquals(5, $drop->getSize()); - $this->assertEquals('hello', $drop->read(5)); - $this->assertEquals(0, $drop->getSize()); - $drop->write('12345678910'); - $this->assertEquals(5, $stream->getSize()); - $this->assertEquals(5, $drop->getSize()); - $this->assertEquals('12345', (string) $drop); - $this->assertEquals(0, $drop->getSize()); - $drop->write('hello'); - $this->assertFalse($drop->write('test')); - } -} diff --git a/core/vendor/guzzlehttp/streams/tests/Exception/SeekExceptionTest.php b/core/vendor/guzzlehttp/streams/tests/Exception/SeekExceptionTest.php deleted file mode 100644 index fd8cd1a..0000000 --- a/core/vendor/guzzlehttp/streams/tests/Exception/SeekExceptionTest.php +++ /dev/null @@ -1,16 +0,0 @@ -assertSame($s, $e->getStream()); - $this->assertContains('10', $e->getMessage()); - } -} diff --git a/core/vendor/guzzlehttp/streams/tests/FnStreamTest.php b/core/vendor/guzzlehttp/streams/tests/FnStreamTest.php deleted file mode 100644 index 6cc336b..0000000 --- a/core/vendor/guzzlehttp/streams/tests/FnStreamTest.php +++ /dev/null @@ -1,89 +0,0 @@ -seek(1); - } - - public function testProxiesToFunction() - { - $s = new FnStream([ - 'read' => function ($len) { - $this->assertEquals(3, $len); - return 'foo'; - } - ]); - - $this->assertEquals('foo', $s->read(3)); - } - - public function testCanCloseOnDestruct() - { - $called = false; - $s = new FnStream([ - 'close' => function () use (&$called) { - $called = true; - } - ]); - unset($s); - $this->assertTrue($called); - } - - public function testDoesNotRequireClose() - { - $s = new FnStream([]); - unset($s); - } - - public function testDecoratesStream() - { - $a = Stream::factory('foo'); - $b = FnStream::decorate($a, []); - $this->assertEquals(3, $b->getSize()); - $this->assertEquals($b->isWritable(), true); - $this->assertEquals($b->isReadable(), true); - $this->assertEquals($b->isSeekable(), true); - $this->assertEquals($b->read(3), 'foo'); - $this->assertEquals($b->tell(), 3); - $this->assertEquals($a->tell(), 3); - $this->assertEquals($b->eof(), true); - $this->assertEquals($a->eof(), true); - $b->seek(0); - $this->assertEquals('foo', (string) $b); - $b->seek(0); - $this->assertEquals('foo', $b->getContents()); - $this->assertEquals($a->getMetadata(), $b->getMetadata()); - $b->seek(0, SEEK_END); - $b->write('bar'); - $this->assertEquals('foobar', (string) $b); - $this->assertInternalType('resource', $b->detach()); - $b->close(); - } - - public function testDecoratesWithCustomizations() - { - $called = false; - $a = Stream::factory('foo'); - $b = FnStream::decorate($a, [ - 'read' => function ($len) use (&$called, $a) { - $called = true; - return $a->read($len); - } - ]); - $this->assertEquals('foo', $b->read(3)); - $this->assertTrue($called); - } -} diff --git a/core/vendor/guzzlehttp/streams/tests/GuzzleStreamWrapperTest.php b/core/vendor/guzzlehttp/streams/tests/GuzzleStreamWrapperTest.php deleted file mode 100644 index 33c3ecc..0000000 --- a/core/vendor/guzzlehttp/streams/tests/GuzzleStreamWrapperTest.php +++ /dev/null @@ -1,99 +0,0 @@ -assertSame('foo', fread($handle, 3)); - $this->assertSame(3, ftell($handle)); - $this->assertSame(3, fwrite($handle, 'bar')); - $this->assertSame(0, fseek($handle, 0)); - $this->assertSame('foobar', fread($handle, 6)); - $this->assertTrue(feof($handle)); - - // This fails on HHVM for some reason - if (!defined('HHVM_VERSION')) { - $this->assertEquals([ - 'dev' => 0, - 'ino' => 0, - 'mode' => 33206, - 'nlink' => 0, - 'uid' => 0, - 'gid' => 0, - 'rdev' => 0, - 'size' => 6, - 'atime' => 0, - 'mtime' => 0, - 'ctime' => 0, - 'blksize' => 0, - 'blocks' => 0, - 0 => 0, - 1 => 0, - 2 => 33206, - 3 => 0, - 4 => 0, - 5 => 0, - 6 => 0, - 7 => 6, - 8 => 0, - 9 => 0, - 10 => 0, - 11 => 0, - 12 => 0, - ], fstat($handle)); - } - - $this->assertTrue(fclose($handle)); - $this->assertSame('foobar', (string) $stream); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testValidatesStream() - { - $stream = $this->getMockBuilder('GuzzleHttp\Stream\StreamInterface') - ->setMethods(['isReadable', 'isWritable']) - ->getMockForAbstractClass(); - $stream->expects($this->once()) - ->method('isReadable') - ->will($this->returnValue(false)); - $stream->expects($this->once()) - ->method('isWritable') - ->will($this->returnValue(false)); - GuzzleStreamWrapper::getResource($stream); - } - - /** - * @expectedException \PHPUnit_Framework_Error_Warning - */ - public function testReturnsFalseWhenStreamDoesNotExist() - { - fopen('guzzle://foo', 'r'); - } - - public function testCanOpenReadonlyStream() - { - $stream = $this->getMockBuilder('GuzzleHttp\Stream\StreamInterface') - ->setMethods(['isReadable', 'isWritable']) - ->getMockForAbstractClass(); - $stream->expects($this->once()) - ->method('isReadable') - ->will($this->returnValue(false)); - $stream->expects($this->once()) - ->method('isWritable') - ->will($this->returnValue(true)); - $r = GuzzleStreamWrapper::getResource($stream); - $this->assertInternalType('resource', $r); - fclose($r); - } -} diff --git a/core/vendor/guzzlehttp/streams/tests/InflateStreamTest.php b/core/vendor/guzzlehttp/streams/tests/InflateStreamTest.php deleted file mode 100644 index ead9356..0000000 --- a/core/vendor/guzzlehttp/streams/tests/InflateStreamTest.php +++ /dev/null @@ -1,16 +0,0 @@ -assertEquals('test', (string) $b); - } -} diff --git a/core/vendor/guzzlehttp/streams/tests/LazyOpenStreamTest.php b/core/vendor/guzzlehttp/streams/tests/LazyOpenStreamTest.php deleted file mode 100644 index 79e0078..0000000 --- a/core/vendor/guzzlehttp/streams/tests/LazyOpenStreamTest.php +++ /dev/null @@ -1,64 +0,0 @@ -fname = tempnam('/tmp', 'tfile'); - - if (file_exists($this->fname)) { - unlink($this->fname); - } - } - - public function tearDown() - { - if (file_exists($this->fname)) { - unlink($this->fname); - } - } - - public function testOpensLazily() - { - $l = new LazyOpenStream($this->fname, 'w+'); - $l->write('foo'); - $this->assertInternalType('array', $l->getMetadata()); - $this->assertFileExists($this->fname); - $this->assertEquals('foo', file_get_contents($this->fname)); - $this->assertEquals('foo', (string) $l); - } - - public function testProxiesToFile() - { - file_put_contents($this->fname, 'foo'); - $l = new LazyOpenStream($this->fname, 'r'); - $this->assertEquals('foo', $l->read(4)); - $this->assertTrue($l->eof()); - $this->assertEquals(3, $l->tell()); - $this->assertTrue($l->isReadable()); - $this->assertTrue($l->isSeekable()); - $this->assertFalse($l->isWritable()); - $l->seek(1); - $this->assertEquals('oo', $l->getContents()); - $this->assertEquals('foo', (string) $l); - $this->assertEquals(3, $l->getSize()); - $this->assertInternalType('array', $l->getMetadata()); - $l->close(); - } - - public function testDetachesUnderlyingStream() - { - file_put_contents($this->fname, 'foo'); - $l = new LazyOpenStream($this->fname, 'r'); - $r = $l->detach(); - $this->assertInternalType('resource', $r); - fseek($r, 0); - $this->assertEquals('foo', stream_get_contents($r)); - fclose($r); - } -} diff --git a/core/vendor/guzzlehttp/streams/tests/LimitStreamTest.php b/core/vendor/guzzlehttp/streams/tests/LimitStreamTest.php deleted file mode 100644 index efb1dc5..0000000 --- a/core/vendor/guzzlehttp/streams/tests/LimitStreamTest.php +++ /dev/null @@ -1,133 +0,0 @@ -decorated = Stream::factory(fopen(__FILE__, 'r')); - $this->body = new LimitStream($this->decorated, 10, 3); - } - - public function testReturnsSubset() - { - $body = new LimitStream(Stream::factory('foo'), -1, 1); - $this->assertEquals('oo', (string) $body); - $this->assertTrue($body->eof()); - $body->seek(0); - $this->assertFalse($body->eof()); - $this->assertEquals('oo', $body->read(100)); - $this->assertTrue($body->eof()); - } - - public function testReturnsSubsetWhenCastToString() - { - $body = Stream::factory('foo_baz_bar'); - $limited = new LimitStream($body, 3, 4); - $this->assertEquals('baz', (string) $limited); - } - - public function testReturnsSubsetOfEmptyBodyWhenCastToString() - { - $body = Stream::factory(''); - $limited = new LimitStream($body, 0, 10); - $this->assertEquals('', (string) $limited); - } - - public function testSeeksWhenConstructed() - { - $this->assertEquals(0, $this->body->tell()); - $this->assertEquals(3, $this->decorated->tell()); - } - - public function testAllowsBoundedSeek() - { - $this->assertEquals(true, $this->body->seek(100)); - $this->assertEquals(10, $this->body->tell()); - $this->assertEquals(13, $this->decorated->tell()); - $this->assertEquals(true, $this->body->seek(0)); - $this->assertEquals(0, $this->body->tell()); - $this->assertEquals(3, $this->decorated->tell()); - $this->assertEquals(false, $this->body->seek(-10)); - $this->assertEquals(0, $this->body->tell()); - $this->assertEquals(3, $this->decorated->tell()); - $this->assertEquals(true, $this->body->seek(5)); - $this->assertEquals(5, $this->body->tell()); - $this->assertEquals(8, $this->decorated->tell()); - $this->assertEquals(false, $this->body->seek(1000, SEEK_END)); - } - - public function testReadsOnlySubsetOfData() - { - $data = $this->body->read(100); - $this->assertEquals(10, strlen($data)); - $this->assertFalse($this->body->read(1000)); - - $this->body->setOffset(10); - $newData = $this->body->read(100); - $this->assertEquals(10, strlen($newData)); - $this->assertNotSame($data, $newData); - } - - /** - * @expectedException \GuzzleHttp\Stream\Exception\SeekException - * @expectedExceptionMessage Could not seek the stream to position 2 - */ - public function testThrowsWhenCurrentGreaterThanOffsetSeek() - { - $a = Stream::factory('foo_bar'); - $b = new NoSeekStream($a); - $c = new LimitStream($b); - $a->getContents(); - $c->setOffset(2); - } - - public function testClaimsConsumedWhenReadLimitIsReached() - { - $this->assertFalse($this->body->eof()); - $this->body->read(1000); - $this->assertTrue($this->body->eof()); - } - - public function testContentLengthIsBounded() - { - $this->assertEquals(10, $this->body->getSize()); - } - - public function testGetContentsIsBasedOnSubset() - { - $body = new LimitStream(Stream::factory('foobazbar'), 3, 3); - $this->assertEquals('baz', $body->getContents()); - } - - public function testReturnsNullIfSizeCannotBeDetermined() - { - $a = new FnStream([ - 'getSize' => function () { return null; }, - 'tell' => function () { return 0; }, - ]); - $b = new LimitStream($a); - $this->assertNull($b->getSize()); - } - - public function testLengthLessOffsetWhenNoLimitSize() - { - $a = Stream::factory('foo_bar'); - $b = new LimitStream($a, -1, 4); - $this->assertEquals(3, $b->getSize()); - } -} diff --git a/core/vendor/guzzlehttp/streams/tests/NoSeekStreamTest.php b/core/vendor/guzzlehttp/streams/tests/NoSeekStreamTest.php deleted file mode 100644 index 21b7c6d..0000000 --- a/core/vendor/guzzlehttp/streams/tests/NoSeekStreamTest.php +++ /dev/null @@ -1,41 +0,0 @@ -getMockBuilder('GuzzleHttp\Stream\StreamInterface') - ->setMethods(['isSeekable', 'seek']) - ->getMockForAbstractClass(); - $s->expects($this->never())->method('seek'); - $s->expects($this->never())->method('isSeekable'); - $wrapped = new NoSeekStream($s); - $this->assertFalse($wrapped->isSeekable()); - $this->assertFalse($wrapped->seek(2)); - } - - public function testHandlesClose() - { - $s = Stream::factory('foo'); - $wrapped = new NoSeekStream($s); - $wrapped->close(); - $this->assertFalse($wrapped->write('foo')); - } - - public function testCanAttach() - { - $s1 = Stream::factory('foo'); - $s2 = Stream::factory('bar'); - $wrapped = new NoSeekStream($s1); - $wrapped->attach($s2->detach()); - $this->assertEquals('bar', (string) $wrapped); - } -} diff --git a/core/vendor/guzzlehttp/streams/tests/NullStreamTest.php b/core/vendor/guzzlehttp/streams/tests/NullStreamTest.php deleted file mode 100644 index 8e41431..0000000 --- a/core/vendor/guzzlehttp/streams/tests/NullStreamTest.php +++ /dev/null @@ -1,39 +0,0 @@ -assertEquals('', $b->read(10)); - $this->assertEquals(4, $b->write('test')); - $this->assertEquals('', (string) $b); - $this->assertNull($b->getMetadata('a')); - $this->assertEquals([], $b->getMetadata()); - $this->assertEquals(0, $b->getSize()); - $this->assertEquals('', $b->getContents()); - $this->assertEquals(0, $b->tell()); - - $this->assertTrue($b->isReadable()); - $this->assertTrue($b->isWritable()); - $this->assertTrue($b->isSeekable()); - $this->assertFalse($b->seek(10)); - - $this->assertTrue($b->eof()); - $b->detach(); - $this->assertTrue($b->eof()); - $b->close(); - } - - /** - * @expectedException \GuzzleHttp\Stream\Exception\CannotAttachException - */ - public function testCannotAttach() - { - $p = new NullStream(); - $p->attach('a'); - } -} diff --git a/core/vendor/guzzlehttp/streams/tests/PumpStreamTest.php b/core/vendor/guzzlehttp/streams/tests/PumpStreamTest.php deleted file mode 100644 index 2d20ce9..0000000 --- a/core/vendor/guzzlehttp/streams/tests/PumpStreamTest.php +++ /dev/null @@ -1,77 +0,0 @@ - ['foo' => 'bar'], - 'size' => 100 - ]); - - $this->assertEquals('bar', $p->getMetadata('foo')); - $this->assertEquals(['foo' => 'bar'], $p->getMetadata()); - $this->assertEquals(100, $p->getSize()); - } - - public function testCanReadFromCallable() - { - $p = Stream::factory(function ($size) { - return 'a'; - }); - $this->assertEquals('a', $p->read(1)); - $this->assertEquals(1, $p->tell()); - $this->assertEquals('aaaaa', $p->read(5)); - $this->assertEquals(6, $p->tell()); - } - - public function testStoresExcessDataInBuffer() - { - $called = []; - $p = Stream::factory(function ($size) use (&$called) { - $called[] = $size; - return 'abcdef'; - }); - $this->assertEquals('a', $p->read(1)); - $this->assertEquals('b', $p->read(1)); - $this->assertEquals('cdef', $p->read(4)); - $this->assertEquals('abcdefabc', $p->read(9)); - $this->assertEquals([1, 9, 3], $called); - } - - public function testInifiniteStreamWrappedInLimitStream() - { - $p = Stream::factory(function () { return 'a'; }); - $s = new LimitStream($p, 5); - $this->assertEquals('aaaaa', (string) $s); - } - - public function testDescribesCapabilities() - { - $p = Stream::factory(function () {}); - $this->assertTrue($p->isReadable()); - $this->assertFalse($p->isSeekable()); - $this->assertFalse($p->isWritable()); - $this->assertNull($p->getSize()); - $this->assertFalse($p->write('aa')); - $this->assertEquals('', $p->getContents()); - $this->assertEquals('', (string) $p); - $p->close(); - $this->assertEquals('', $p->read(10)); - $this->assertTrue($p->eof()); - } - - /** - * @expectedException \GuzzleHttp\Stream\Exception\CannotAttachException - */ - public function testCannotAttach() - { - $p = Stream::factory(function () {}); - $p->attach('a'); - } -} diff --git a/core/vendor/guzzlehttp/streams/tests/StreamDecoratorTraitTest.php b/core/vendor/guzzlehttp/streams/tests/StreamDecoratorTraitTest.php deleted file mode 100644 index 2ba79ad..0000000 --- a/core/vendor/guzzlehttp/streams/tests/StreamDecoratorTraitTest.php +++ /dev/null @@ -1,147 +0,0 @@ -c = fopen('php://temp', 'r+'); - fwrite($this->c, 'foo'); - fseek($this->c, 0); - $this->a = Stream::factory($this->c); - $this->b = new Str($this->a); - } - - public function testCatchesExceptionsWhenCastingToString() - { - $s = $this->getMockBuilder('GuzzleHttp\Stream\StreamInterface') - ->setMethods(['read']) - ->getMockForAbstractClass(); - $s->expects($this->once()) - ->method('read') - ->will($this->throwException(new \Exception('foo'))); - $msg = ''; - set_error_handler(function ($errNo, $str) use (&$msg) { $msg = $str; }); - echo new Str($s); - restore_error_handler(); - $this->assertContains('foo', $msg); - } - - public function testToString() - { - $this->assertEquals('foo', (string) $this->b); - } - - public function testHasSize() - { - $this->assertEquals(3, $this->b->getSize()); - $this->assertSame($this->b, $this->b->setSize(2)); - $this->assertEquals(2, $this->b->getSize()); - } - - public function testReads() - { - $this->assertEquals('foo', $this->b->read(10)); - } - - public function testCheckMethods() - { - $this->assertEquals($this->a->isReadable(), $this->b->isReadable()); - $this->assertEquals($this->a->isWritable(), $this->b->isWritable()); - $this->assertEquals($this->a->isSeekable(), $this->b->isSeekable()); - } - - public function testSeeksAndTells() - { - $this->assertTrue($this->b->seek(1)); - $this->assertEquals(1, $this->a->tell()); - $this->assertEquals(1, $this->b->tell()); - $this->assertTrue($this->b->seek(0)); - $this->assertEquals(0, $this->a->tell()); - $this->assertEquals(0, $this->b->tell()); - $this->assertTrue($this->b->seek(0, SEEK_END)); - $this->assertEquals(3, $this->a->tell()); - $this->assertEquals(3, $this->b->tell()); - } - - public function testGetsContents() - { - $this->assertEquals('foo', $this->b->getContents()); - $this->assertEquals('', $this->b->getContents()); - $this->b->seek(1); - $this->assertEquals('oo', $this->b->getContents(1)); - } - - public function testCloses() - { - $this->b->close(); - $this->assertFalse(is_resource($this->c)); - } - - public function testDetaches() - { - $this->b->detach(); - $this->assertFalse($this->b->isReadable()); - } - - /** - * @expectedException \GuzzleHttp\Stream\Exception\CannotAttachException - */ - public function testCannotAttachByDefault() - { - $this->b->attach('a'); - } - - public function testWrapsMetadata() - { - $this->assertSame($this->b->getMetadata(), $this->a->getMetadata()); - $this->assertSame($this->b->getMetadata('uri'), $this->a->getMetadata('uri')); - } - - public function testWrapsWrites() - { - $this->b->seek(0, SEEK_END); - $this->b->write('foo'); - $this->assertEquals('foofoo', (string) $this->a); - } - - /** - * @expectedException \UnexpectedValueException - */ - public function testThrowsWithInvalidGetter() - { - $this->b->foo; - } - - /** - * @expectedException \BadMethodCallException - */ - public function testThrowsWhenGetterNotImplemented() - { - $s = new BadStream(); - $s->stream; - } -} - -class BadStream -{ - use StreamDecoratorTrait; - - public function __construct() {} -} diff --git a/core/vendor/guzzlehttp/streams/tests/StreamTest.php b/core/vendor/guzzlehttp/streams/tests/StreamTest.php deleted file mode 100644 index 2985bfb..0000000 --- a/core/vendor/guzzlehttp/streams/tests/StreamTest.php +++ /dev/null @@ -1,252 +0,0 @@ -assertTrue($stream->isReadable()); - $this->assertTrue($stream->isWritable()); - $this->assertTrue($stream->isSeekable()); - $this->assertEquals('php://temp', $stream->getMetadata('uri')); - $this->assertInternalType('array', $stream->getMetadata()); - $this->assertEquals(4, $stream->getSize()); - $this->assertFalse($stream->eof()); - $stream->close(); - } - - public function testStreamClosesHandleOnDestruct() - { - $handle = fopen('php://temp', 'r'); - $stream = new Stream($handle); - unset($stream); - $this->assertFalse(is_resource($handle)); - } - - public function testConvertsToString() - { - $handle = fopen('php://temp', 'w+'); - fwrite($handle, 'data'); - $stream = new Stream($handle); - $this->assertEquals('data', (string) $stream); - $this->assertEquals('data', (string) $stream); - $stream->close(); - } - - public function testGetsContents() - { - $handle = fopen('php://temp', 'w+'); - fwrite($handle, 'data'); - $stream = new Stream($handle); - $this->assertEquals('', $stream->getContents()); - $stream->seek(0); - $this->assertEquals('data', $stream->getContents()); - $this->assertEquals('', $stream->getContents()); - } - - public function testChecksEof() - { - $handle = fopen('php://temp', 'w+'); - fwrite($handle, 'data'); - $stream = new Stream($handle); - $this->assertFalse($stream->eof()); - $stream->read(4); - $this->assertTrue($stream->eof()); - $stream->close(); - } - - public function testAllowsSettingManualSize() - { - $handle = fopen('php://temp', 'w+'); - fwrite($handle, 'data'); - $stream = new Stream($handle); - $stream->setSize(10); - $this->assertEquals(10, $stream->getSize()); - $stream->close(); - } - - public function testGetSize() - { - $size = filesize(__FILE__); - $handle = fopen(__FILE__, 'r'); - $stream = new Stream($handle); - $this->assertEquals($size, $stream->getSize()); - // Load from cache - $this->assertEquals($size, $stream->getSize()); - $stream->close(); - } - - public function testEnsuresSizeIsConsistent() - { - $h = fopen('php://temp', 'w+'); - $this->assertEquals(3, fwrite($h, 'foo')); - $stream = new Stream($h); - $this->assertEquals(3, $stream->getSize()); - $this->assertEquals(4, $stream->write('test')); - $this->assertEquals(7, $stream->getSize()); - $this->assertEquals(7, $stream->getSize()); - $stream->close(); - } - - public function testProvidesStreamPosition() - { - $handle = fopen('php://temp', 'w+'); - $stream = new Stream($handle); - $this->assertEquals(0, $stream->tell()); - $stream->write('foo'); - $this->assertEquals(3, $stream->tell()); - $stream->seek(1); - $this->assertEquals(1, $stream->tell()); - $this->assertSame(ftell($handle), $stream->tell()); - $stream->close(); - } - - public function testKeepsPositionOfResource() - { - $h = fopen(__FILE__, 'r'); - fseek($h, 10); - $stream = Stream::factory($h); - $this->assertEquals(10, $stream->tell()); - $stream->close(); - } - - public function testCanDetachAndAttachStream() - { - $r = fopen('php://temp', 'w+'); - $stream = new Stream($r); - $stream->write('foo'); - $this->assertTrue($stream->isReadable()); - $this->assertSame($r, $stream->detach()); - $this->assertNull($stream->detach()); - - $this->assertFalse($stream->isReadable()); - $this->assertFalse($stream->read(10)); - $this->assertFalse($stream->isWritable()); - $this->assertFalse($stream->write('bar')); - $this->assertFalse($stream->isSeekable()); - $this->assertFalse($stream->seek(10)); - $this->assertFalse($stream->tell()); - $this->assertTrue($stream->eof()); - $this->assertNull($stream->getSize()); - $this->assertSame('', (string) $stream); - $this->assertSame('', $stream->getContents()); - - $stream->attach($r); - $stream->seek(0); - $this->assertEquals('foo', $stream->getContents()); - $this->assertTrue($stream->isReadable()); - $this->assertTrue($stream->isWritable()); - $this->assertTrue($stream->isSeekable()); - - $stream->close(); - } - - public function testCloseClearProperties() - { - $handle = fopen('php://temp', 'r+'); - $stream = new Stream($handle); - $stream->close(); - - $this->assertEmpty($stream->getMetadata()); - $this->assertFalse($stream->isSeekable()); - $this->assertFalse($stream->isReadable()); - $this->assertFalse($stream->isWritable()); - $this->assertNull($stream->getSize()); - } - - public function testCreatesWithFactory() - { - $stream = Stream::factory('foo'); - $this->assertInstanceOf('GuzzleHttp\Stream\Stream', $stream); - $this->assertEquals('foo', $stream->getContents()); - $stream->close(); - } - - public function testFactoryCreatesFromEmptyString() - { - $s = Stream::factory(); - $this->assertInstanceOf('GuzzleHttp\Stream\Stream', $s); - } - - public function testFactoryCreatesFromResource() - { - $r = fopen(__FILE__, 'r'); - $s = Stream::factory($r); - $this->assertInstanceOf('GuzzleHttp\Stream\Stream', $s); - $this->assertSame(file_get_contents(__FILE__), (string) $s); - } - - public function testFactoryCreatesFromObjectWithToString() - { - $r = new HasToString(); - $s = Stream::factory($r); - $this->assertInstanceOf('GuzzleHttp\Stream\Stream', $s); - $this->assertEquals('foo', (string) $s); - } - - public function testCreatePassesThrough() - { - $s = Stream::factory('foo'); - $this->assertSame($s, Stream::factory($s)); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testThrowsExceptionForUnknown() - { - Stream::factory(new \stdClass()); - } - - public function testReturnsCustomMetadata() - { - $s = Stream::factory('foo', ['metadata' => ['hwm' => 3]]); - $this->assertEquals(3, $s->getMetadata('hwm')); - $this->assertArrayHasKey('hwm', $s->getMetadata()); - } - - public function testCanSetSize() - { - $s = Stream::factory('', ['size' => 10]); - $this->assertEquals(10, $s->getSize()); - } - - public function testCanCreateIteratorBasedStream() - { - $a = new \ArrayIterator(['foo', 'bar', '123']); - $p = Stream::factory($a); - $this->assertInstanceOf('GuzzleHttp\Stream\PumpStream', $p); - $this->assertEquals('foo', $p->read(3)); - $this->assertFalse($p->eof()); - $this->assertEquals('b', $p->read(1)); - $this->assertEquals('a', $p->read(1)); - $this->assertEquals('r12', $p->read(3)); - $this->assertFalse($p->eof()); - $this->assertEquals('3', $p->getContents()); - $this->assertTrue($p->eof()); - $this->assertEquals(9, $p->tell()); - } -} - -class HasToString -{ - public function __toString() { - return 'foo'; - } -} diff --git a/core/vendor/guzzlehttp/streams/tests/UtilsTest.php b/core/vendor/guzzlehttp/streams/tests/UtilsTest.php deleted file mode 100644 index 6e3e3b2..0000000 --- a/core/vendor/guzzlehttp/streams/tests/UtilsTest.php +++ /dev/null @@ -1,155 +0,0 @@ -assertEquals('foobaz', Utils::copyToString($s)); - $s->seek(0); - $this->assertEquals('foo', Utils::copyToString($s, 3)); - $this->assertEquals('baz', Utils::copyToString($s, 3)); - $this->assertEquals('', Utils::copyToString($s)); - } - - public function testCopiesToStringStopsWhenReadFails() - { - $s1 = Stream::factory('foobaz'); - $s1 = FnStream::decorate($s1, [ - 'read' => function () { - return false; - } - ]); - $result = Utils::copyToString($s1); - $this->assertEquals('', $result); - } - - public function testCopiesToStream() - { - $s1 = Stream::factory('foobaz'); - $s2 = Stream::factory(''); - Utils::copyToStream($s1, $s2); - $this->assertEquals('foobaz', (string) $s2); - $s2 = Stream::factory(''); - $s1->seek(0); - Utils::copyToStream($s1, $s2, 3); - $this->assertEquals('foo', (string) $s2); - Utils::copyToStream($s1, $s2, 3); - $this->assertEquals('foobaz', (string) $s2); - } - - public function testStopsCopyToStreamWhenWriteFails() - { - $s1 = Stream::factory('foobaz'); - $s2 = Stream::factory(''); - $s2 = FnStream::decorate($s2, ['write' => function () { return 0; }]); - Utils::copyToStream($s1, $s2); - $this->assertEquals('', (string) $s2); - } - - public function testStopsCopyToSteamWhenWriteFailsWithMaxLen() - { - $s1 = Stream::factory('foobaz'); - $s2 = Stream::factory(''); - $s2 = FnStream::decorate($s2, ['write' => function () { return 0; }]); - Utils::copyToStream($s1, $s2, 10); - $this->assertEquals('', (string) $s2); - } - - public function testStopsCopyToSteamWhenReadFailsWithMaxLen() - { - $s1 = Stream::factory('foobaz'); - $s1 = FnStream::decorate($s1, ['read' => function () { return ''; }]); - $s2 = Stream::factory(''); - Utils::copyToStream($s1, $s2, 10); - $this->assertEquals('', (string) $s2); - } - - public function testReadsLines() - { - $s = Stream::factory("foo\nbaz\nbar"); - $this->assertEquals("foo\n", Utils::readline($s)); - $this->assertEquals("baz\n", Utils::readline($s)); - $this->assertEquals("bar", Utils::readline($s)); - } - - public function testReadsLinesUpToMaxLength() - { - $s = Stream::factory("12345\n"); - $this->assertEquals("123", Utils::readline($s, 4)); - $this->assertEquals("45\n", Utils::readline($s)); - } - - public function testReadsLineUntilFalseReturnedFromRead() - { - $s = $this->getMockBuilder('GuzzleHttp\Stream\Stream') - ->setMethods(['read', 'eof']) - ->disableOriginalConstructor() - ->getMock(); - $s->expects($this->exactly(2)) - ->method('read') - ->will($this->returnCallback(function () { - static $c = false; - if ($c) { - return false; - } - $c = true; - return 'h'; - })); - $s->expects($this->exactly(2)) - ->method('eof') - ->will($this->returnValue(false)); - $this->assertEquals("h", Utils::readline($s)); - } - - public function testCalculatesHash() - { - $s = Stream::factory('foobazbar'); - $this->assertEquals(md5('foobazbar'), Utils::hash($s, 'md5')); - } - - /** - * @expectedException \GuzzleHttp\Stream\Exception\SeekException - */ - public function testCalculatesHashThrowsWhenSeekFails() - { - $s = new NoSeekStream(Stream::factory('foobazbar')); - $s->read(2); - Utils::hash($s, 'md5'); - } - - public function testCalculatesHashSeeksToOriginalPosition() - { - $s = Stream::factory('foobazbar'); - $s->seek(4); - $this->assertEquals(md5('foobazbar'), Utils::hash($s, 'md5')); - $this->assertEquals(4, $s->tell()); - } - - public function testOpensFilesSuccessfully() - { - $r = Utils::open(__FILE__, 'r'); - $this->assertInternalType('resource', $r); - fclose($r); - } - - /** - * @expectedException \RuntimeException - * @expectedExceptionMessage Unable to open /path/to/does/not/exist using mode r - */ - public function testThrowsExceptionNotWarning() - { - Utils::open('/path/to/does/not/exist', 'r'); - } - - public function testProxiesToFactory() - { - $this->assertEquals('foo', (string) Utils::create('foo')); - } -} diff --git a/core/vendor/masterminds/html5/.gitignore b/core/vendor/masterminds/html5/.gitignore deleted file mode 100644 index f9ead4a..0000000 --- a/core/vendor/masterminds/html5/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -vendor/ -scratch.php -composer.lock -build/ \ No newline at end of file diff --git a/core/vendor/masterminds/html5/.travis.yml b/core/vendor/masterminds/html5/.travis.yml deleted file mode 100644 index 5b31d71..0000000 --- a/core/vendor/masterminds/html5/.travis.yml +++ /dev/null @@ -1,28 +0,0 @@ -language: php - -# Setting sudo access to false will let Travis CI use containers rather than -# VMs to run the tests. For more details see: -# - http://docs.travis-ci.com/user/workers/container-based-infrastructure/ -# - http://docs.travis-ci.com/user/workers/standard-infrastructure/ -sudo: false - -php: - - 5.3 - - 5.4 - - 5.5 - - 5.6 - - hhvm - -notifications: - irc: "irc.freenode.net#masterminds" - -before_script: - - composer self-update - - composer install --dev - -script: - - mkdir -p build/logs - - ./vendor/bin/phpunit -c phpunit.xml.dist - -after_script: - - php vendor/bin/coveralls -v diff --git a/core/vendor/masterminds/html5/CREDITS b/core/vendor/masterminds/html5/CREDITS deleted file mode 100644 index 59c87a2..0000000 --- a/core/vendor/masterminds/html5/CREDITS +++ /dev/null @@ -1,11 +0,0 @@ -Matt Butcher [technosophos] (lead) -Matt Farina [mattfarina] (lead) -Asmir Mustafic [goetas] (contributor) -Edward Z. Yang [ezyang] (contributor) -Geoffrey Sneddon [gsnedders] (contributor) -Kukhar Vasily [ngreduce] (contributor) -Rune Christensen [MrElectronic] (contributor) -Mišo Belica [miso-belica] (contributor) -Asmir Mustafic [goetas] (contributor) -KITAITI Makoto [KitaitiMakoto] (contributor) -Jacob Floyd [cognifloyd] (contributor) diff --git a/core/vendor/masterminds/html5/LICENSE.txt b/core/vendor/masterminds/html5/LICENSE.txt deleted file mode 100644 index 93d60ed..0000000 --- a/core/vendor/masterminds/html5/LICENSE.txt +++ /dev/null @@ -1,66 +0,0 @@ -## HTML5-PHP License - -Copyright (c) 2013 The Authors of HTML5-PHP - -Matt Butcher - mattbutcher@google.com -Matt Farina - matt@mattfarina.com -Asmir Mustafic - goetas@gmail.com - -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. - -## HTML5Lib License - -Portions of this are based on html5lib's PHP version, which was a -sub-project of html5lib. The following is the list of contributors from -html5lib: - -html5lib: - -Copyright (c) 2006-2009 The Authors - -Contributors: -James Graham - jg307@cam.ac.uk -Anne van Kesteren - annevankesteren@gmail.com -Lachlan Hunt - lachlan.hunt@lachy.id.au -Matt McDonald - kanashii@kanashii.ca -Sam Ruby - rubys@intertwingly.net -Ian Hickson (Google) - ian@hixie.ch -Thomas Broyer - t.broyer@ltgt.net -Jacques Distler - distler@golem.ph.utexas.edu -Henri Sivonen - hsivonen@iki.fi -Adam Barth - abarth@webkit.org -Eric Seidel - eric@webkit.org -The Mozilla Foundation (contributions from Henri Sivonen since 2008) -David Flanagan (Mozilla) - dflanagan@mozilla.com - -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/core/vendor/masterminds/html5/README.md b/core/vendor/masterminds/html5/README.md deleted file mode 100644 index db2abb7..0000000 --- a/core/vendor/masterminds/html5/README.md +++ /dev/null @@ -1,253 +0,0 @@ -# HTML5-PHP - -The need for an HTML5 parser in PHP is clear. This project initially -began with the seemingly abandoned `html5lib` project [original source](https://code.google.com/p/html5lib/source/checkout). -But after some initial refactoring work, we began a new parser. - -- An HTML5 serializer -- Support for PHP namespaces -- Composer support -- Event-based (SAX-like) parser -- DOM tree builder -- Interoperability with QueryPath [[in progress](https://github.com/technosophos/querypath/issues/114)] -- Runs on **PHP** 5.3.0 or newer and **HHVM** 3.2 or newer - -[![Build Status](https://travis-ci.org/Masterminds/html5-php.png?branch=master)](https://travis-ci.org/Masterminds/html5-php) [![Latest Stable Version](https://poser.pugx.org/masterminds/html5/v/stable.png)](https://packagist.org/packages/masterminds/html5) [![Coverage Status](https://coveralls.io/repos/Masterminds/html5-php/badge.png?branch=master)](https://coveralls.io/r/Masterminds/html5-php?branch=master) - -## Installation - -Install HTML5-PHP using [composer](http://getcomposer.org/). - -To install, add `masterminds/html5` to your `composer.json` file: - -``` -{ - "require" : { - "masterminds/html5": "2.*" - }, -} -``` - -(You may substitute `2.*` for a more specific release tag, of -course.) - -From there, use the `composer install` or `composer update` commands to -install. - -## Basic Usage - -HTML5-PHP has a high-level API and a low-level API. - -Here is how you use the high-level `HTML5` library API: - -```php - - - TEST - - -

    Hello World

    -

    This is a test of the HTML5 parser.

    - - -HERE; - -// Parse the document. $dom is a DOMDocument. -$html5 = new HTML5(); -$dom = $html5->loadHTML($html); - -// Render it as HTML5: -print $html5->saveHTML($dom); - -// Or save it to a file: -$html5->save($dom, 'out.html'); - -?> -``` - -The `$dom` created by the parser is a full `DOMDocument` object. And the -`save()` and `saveHTML()` methods will take any DOMDocument. - -### Options - -It is possible to pass in an array of configuration options when loading -an HTML5 document. - -```php -// An associative array of options -$options = array( - 'option_name' => 'option_value', -); - -// Provide the options to the constructor -$html5 = new HTML5($options); - -$dom = $html5->loadHTML($html); -``` - -The following options are supported: - -* `encode_entities` (boolean): Indicates that the serializer should aggressively - encode characters as entities. Without this, it only encodes the bare - minimum. -* `disable_html_ns` (boolean): Prevents the parser from automatically - assigning the HTML5 namespace to the DOM document. This is for - non-namespace aware DOM tools. -* `target_doc` (\DOMDocument): A DOM document that will be used as the - destination for the parsed nodes. -* `implicit_namespaces` (array): An assoc array of namespaces that should be - used by the parser. Name is tag prefix, value is NS URI. - -## The Low-Level API - -This library provides the following low-level APIs that you can use to -create more customized HTML5 tools: - -- An `InputStream` abstraction that can work with different kinds of -input source (not just files and strings). -- A SAX-like event-based parser that you can hook into for special kinds -of parsing. -- A flexible error-reporting mechanism that can be tuned to document -syntax checking. -- A DOM implementation that uses PHP's built-in DOM library. - -The unit tests exercise each piece of the API, and every public function -is well-documented. - -### Parser Design - -The parser is designed as follows: - -- The `InputStream` portion handles direct I/O. -- The `Scanner` handles scanning on behalf of the parser. -- The `Tokenizer` requests data off of the scanner, parses it, clasifies -it, and sends it to an `EventHandler`. It is a *recursive descent parser.* -- The `EventHandler` receives notifications and data for each specific -semantic event that occurs during tokenization. -- The `DOMBuilder` is an `EventHandler` that listens for tokenizing -events and builds a document tree (`DOMDocument`) based on the events. - -### Serializer Design - -The serializer takes a data structure (the `DOMDocument`) and transforms -it into a character representation -- an HTML5 document. - -The serializer is broken into three parts: - -- The `OutputRules` contain the rules to turn DOM elements into strings. The -rules are an implementation of the interface `RulesInterface` allowing for -different rule sets to be used. -- The `Traverser`, which is a special-purpose tree walker. It visits -each node node in the tree and uses the `OutputRules` to transform the node -into a string. -- `HTML5` manages the `Traverser` and stores the resultant data -in the correct place. - -The serializer (`save()`, `saveHTML()`) follows the -[section 8.9 of the HTML 5.0 spec](http://www.w3.org/TR/2012/CR-html5-20121217/syntax.html#serializing-html-fragments). -So tags are serialized according to these rules: - -- A tag with children: <foo>CHILDREN</foo> -- A tag that cannot have content: <foo> (no closing tag) -- A tag that could have content, but doesn't: <foo></foo> - -## Known Issues (Or, Things We Designed Against the Spec) - -Please check the issue queue for a full list, but the following are -issues known issues that are not presently on the roadmap: - -- Namespaces: HTML5 only [supports a selected list of namespaces](http://www.w3.org/TR/html5/infrastructure.html#namespaces) - and they do not operate in the same way as XML namespaces. A `:` has no special - meaning. - By default the parser does not support XML style namespaces via `:`; - to enable the XML namespaces see the [XML Namespaces section](#xml-namespaces) -- Scripts: This parser does not contain a JavaScript or a CSS - interpreter. While one may be supplied, not all features will be - supported. -- Rentrance: The current parser is not re-entrant. (Thus you can't pause - the parser to modify the HTML string mid-parse.) -- Validation: The current tree builder is **not** a validating parser. - While it will correct some HTML, it does not check that the HTML - conforms to the standard. (Should you wish, you can build a validating - parser by extending DOMTree or building your own EventHandler - implementation.) - * There is limited support for insertion modes. - * Some autocorrection is done automatically. - * Per the spec, many legacy tags are admitted and correctly handled, - even though they are technically not part of HTML5. -- Attribute names and values: Due to the implementation details of the - PHP implementation of DOM, attribute names that do not follow the - XML 1.0 standard are not inserted into the DOM. (Effectively, they - are ignored.) If you've got a clever fix for this, jump in! -- Processor Instructions: The HTML5 spec does not allow processor - instructions. We do. Since this is a server-side library, we think - this is useful. And that means, dear reader, that in some cases you - can parse the HTML from a mixed PHP/HTML document. This, however, - is an incidental feature, not a core feature. -- HTML manifests: Unsupported. -- PLAINTEXT: Unsupported. -- Adoption Agency Algorithm: Not yet implemented. (8.2.5.4.7) - -##XML Namespaces - -To use XML style namespaces you have to configure well the main `HTML5` instance. - -```php -use Masterminds\HTML5; -$html = new HTML5(array( - "xmlNamespaces" => true -)); - -$dom = $html->loadHTML(''); - -$dom->documentElement->namespaceURI; // http://www.example.com - -``` - -You can also add some default prefixes that will not require the namespace declaration, -but it's elements will be namespaced. - -```php -use Masterminds\HTML5; -$html = new HTML5(array( - "implicitNamespaces"=>array( - "t"=>"http://www.example.com" - ) -)); - -$dom = $html->loadHTML(''); - -$dom->documentElement->namespaceURI; // http://www.example.com - -``` - -## Thanks to... - -The dedicated (and patient) contributors of patches small and large, -who have already made this library better.See the CREDITS file for -a list of contributors. - -We owe a huge debt of gratitude to the original authors of html5lib. - -While not much of the orignal parser remains, we learned a lot from -reading the html5lib library. And some pieces remain here. In -particular, much of the UTF-8 and Unicode handling is derived from the -html5lib project. - -## License - -This software is released under the MIT license. The original html5lib -library was also released under the MIT license. - -See LICENSE.txt - -Certain files contain copyright assertions by specific individuals -involved with html5lib. Those have been retained where appropriate. diff --git a/core/vendor/masterminds/html5/RELEASE.md b/core/vendor/masterminds/html5/RELEASE.md deleted file mode 100644 index 36d1630..0000000 --- a/core/vendor/masterminds/html5/RELEASE.md +++ /dev/null @@ -1,60 +0,0 @@ -# Release Notes - -2.1.0 (2015-02-01) -- #74: Added `disable_html_ns` and `target_doc` dom parsing options -- Unified option names -- #73: Fixed alphabet, ß now can be detected -- #75 and #76: Allow whitespace in RCDATA tags -- #77: Fixed parsing blunder for json embeds -- #72: Add options to HTML methods - -2.0.2 (2014-12-17) -- #50: empty document handling -- #63: tags with strange capitalization -- #65: dashes and underscores as allowed characters in tag names -- #68: Fixed issue with non-inline elements inside inline containers - -2.0.1 (2014-09-23) -- #59: Fixed issue parsing some fragments. -- #56: Incorrectly saw 0 as empty string -- Sami as new documentation generator - -2.0.0 (2014-07-28) -- #53: Improved boolean attributes handling -- #52: Facebook HHVM compatibility -- #48: Adopted PSR-2 as coding standard -- #47: Moved everything to Masterminds namespace -- #45: Added custom namespaces -- #44: Added support to XML-style namespaces -- #37: Refactored HTML5 class removing static methods - -1.0.5 (2014-06-10) -- #38: Set the dev-master branch as the 1.0.x branch for composer (goetas) -- #34: Tests use PSR-4 for autoloading. (goetas) -- #40, #41: Fix entity handling in RCDATA sections. (KitaitiMakoto) -- #32: Fixed issue where wharacter references were being incorrectly encoded in style tags. - -1.0.4 (2014-04-29) -- #30/#31 Don't throw an exception for invalid tag names. - -1.0.3 (2014-02-28) -- #23 and #29: Ignore attributes with illegal chars in name for the PHP DOM. - -1.0.2 (2014-02-12) -- #23: Handle missing tag close in attribute list. -- #25: Fixed text escaping in the serializer (HTML% 8.3). -- #27: Fixed tests on Windows: changed "\n" -> PHP_EOL. -- #28: Fixed infinite loop for char "&" in unquoted attribute in parser. -- #26: Updated tag name case handling to deal with uppercase usage. -- #24: Newlines and tabs are allowed inside quoted attributes (HTML5 8.2.4). -- Fixed Travis CI testing. - -1.0.1 (2013-11-07) -- CDATA encoding is improved. (Non-standard; Issue #19) -- Some parser rules were not returning the new current element. (Issue #20) -- Added, to the README, details on code test coverage and to packagist version. -- Fixed processor instructions. -- Improved test coverage and documentation coverage. - -1.0.0 (2013-10-02) -- Initial release. diff --git a/core/vendor/masterminds/html5/UPGRADING.md b/core/vendor/masterminds/html5/UPGRADING.md deleted file mode 100644 index e3e562d..0000000 --- a/core/vendor/masterminds/html5/UPGRADING.md +++ /dev/null @@ -1,21 +0,0 @@ -From 1.x to 2.x -================= - -- All classes uses `Masterminds` namespace. -- All public static methods has been removed from `HTML5` class and the general API to access the HTML5 functionalities has changed. - - Before: - - $dom = \HTML5::loadHTML('....'); - \HTML5::saveHTML($dom); - - After: - - use Masterminds\HTML5; - - $html5 = new HTML5(); - - $dom = $html5->loadHTML('....'); - echo $html5->saveHTML($dom); - - diff --git a/core/vendor/masterminds/html5/bin/entities.php b/core/vendor/masterminds/html5/bin/entities.php deleted file mode 100644 index 0fbd6ec..0000000 --- a/core/vendor/masterminds/html5/bin/entities.php +++ /dev/null @@ -1,26 +0,0 @@ - $obj) { - $sname = substr($name, 1, -1); - $table[$sname] = $obj->characters; -} - -print '=5.3.0" - }, - "require-dev": { - "satooshi/php-coveralls": "0.6.*", - "phpunit/phpunit" : "4.*", - "sami/sami": "~2.0" - }, - "autoload": { - "psr-4": {"Masterminds\\": "src"} - }, - "autoload-dev": { - "psr-4": {"Masterminds\\HTML5\\Tests\\": "test/HTML5"} - }, - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - } -} diff --git a/core/vendor/masterminds/html5/example.php b/core/vendor/masterminds/html5/example.php deleted file mode 100644 index 5e3b25f..0000000 --- a/core/vendor/masterminds/html5/example.php +++ /dev/null @@ -1,33 +0,0 @@ - - - TEST - - - - -
    -

    Hello World

    This is a test of the HTML5 parser.

    -
    - & Nobody nowhere. -
    - TEST - - © - -HERE; - -$html5 = new HTML5(); -$dom = $html5->loadHTML($html); - -print "Converting to HTML 5\n"; - -$html5->save($dom, fopen("php://stdin", 'w')); diff --git a/core/vendor/masterminds/html5/phpunit.xml.dist b/core/vendor/masterminds/html5/phpunit.xml.dist deleted file mode 100644 index b42903a..0000000 --- a/core/vendor/masterminds/html5/phpunit.xml.dist +++ /dev/null @@ -1,30 +0,0 @@ - - - - - test/HTML5/ - - - - - systemlib.phpreflection_hni - src/HTML5/Parser/InputStream.php - src/HTML5/Serializer/RulesInterface.php - src/HTML5/Entities.php - src/HTML5/Serializer/HTML5Entities.php - - - - - - - diff --git a/core/vendor/masterminds/html5/sami.php b/core/vendor/masterminds/html5/sami.php deleted file mode 100644 index d0dd80b..0000000 --- a/core/vendor/masterminds/html5/sami.php +++ /dev/null @@ -1,10 +0,0 @@ - 'HTML5-PHP API', - 'build_dir' => __DIR__.'/build/apidoc', - 'cache_dir' => __DIR__.'/build/sami-cache', - 'default_opened_level' => 1, -)); \ No newline at end of file diff --git a/core/vendor/masterminds/html5/src/HTML5.php b/core/vendor/masterminds/html5/src/HTML5.php deleted file mode 100644 index 1c46c2b..0000000 --- a/core/vendor/masterminds/html5/src/HTML5.php +++ /dev/null @@ -1,250 +0,0 @@ - false - ); - - protected $errors = array(); - - public function __construct(array $options = array()) - { - $this->options = array_merge($this->options, $options); - } - - /** - * Get the default options. - * - * @return array The default options. - */ - public function getOptions() - { - return $this->options; - } - - /** - * Load and parse an HTML file. - * - * This will apply the HTML5 parser, which is tolerant of many - * varieties of HTML, including XHTML 1, HTML 4, and well-formed HTML - * 3. Note that in these cases, not all of the old data will be - * preserved. For example, XHTML's XML declaration will be removed. - * - * The rules governing parsing are set out in the HTML 5 spec. - * - * @param string $file - * The path to the file to parse. If this is a resource, it is - * assumed to be an open stream whose pointer is set to the first - * byte of input. - * @param array $options - * Configuration options when parsing the HTML - * @return \DOMDocument A DOM document. These object type is defined by the libxml - * library, and should have been included with your version of PHP. - */ - public function load($file, array $options = array()) - { - // Handle the case where file is a resource. - if (is_resource($file)) { - // FIXME: We need a StreamInputStream class. - return $this->loadHTML(stream_get_contents($file), $options); - } - - $input = new FileInputStream($file); - - return $this->parse($input, $options); - } - - /** - * Parse a HTML Document from a string. - * - * Take a string of HTML 5 (or earlier) and parse it into a - * DOMDocument. - * - * @param string $string - * A html5 document as a string. - * @param array $options - * Configuration options when parsing the HTML - * @return \DOMDocument A DOM document. DOM is part of libxml, which is included with - * almost all distribtions of PHP. - */ - public function loadHTML($string, array $options = array()) - { - $input = new StringInputStream($string); - - return $this->parse($input, $options); - } - - /** - * Convenience function to load an HTML file. - * - * This is here to provide backwards compatibility with the - * PHP DOM implementation. It simply calls load(). - * - * @param string $file - * The path to the file to parse. If this is a resource, it is - * assumed to be an open stream whose pointer is set to the first - * byte of input. - * @param array $options - * Configuration options when parsing the HTML - * - * @return \DOMDocument A DOM document. These object type is defined by the libxml - * library, and should have been included with your version of PHP. - */ - public function loadHTMLFile($file, array $options = array()) - { - return $this->load($file, $options); - } - - /** - * Parse a HTML fragment from a string. - * - * @param string $string - * The html5 fragment as a string. - * @param array $options - * Configuration options when parsing the HTML - * - * @return \DOMDocumentFragment A DOM fragment. The DOM is part of libxml, which is included with - * almost all distributions of PHP. - */ - public function loadHTMLFragment($string, array $options = array()) - { - $input = new StringInputStream($string); - - return $this->parseFragment($input, $options); - } - - /** - * Return all errors encountered into parsing phase - * - * @return array - */ - public function getErrors() - { - return $this->errors; - } - - /** - * Return true it some errors were encountered into parsing phase - * - * @return bool - */ - public function hasErrors() - { - return count($this->errors) > 0; - } - - /** - * Parse an input stream. - * - * Lower-level loading function. This requires an input stream instead - * of a string, file, or resource. - */ - public function parse(\Masterminds\HTML5\Parser\InputStream $input, array $options = array()) - { - $this->errors = array(); - $events = new DOMTreeBuilder(false, array_merge($this->getOptions(), $options)); - $scanner = new Scanner($input); - $parser = new Tokenizer($scanner, $events); - - $parser->parse(); - $this->errors = $events->getErrors(); - - return $events->document(); - } - - /** - * Parse an input stream where the stream is a fragment. - * - * Lower-level loading function. This requires an input stream instead - * of a string, file, or resource. - */ - public function parseFragment(\Masterminds\HTML5\Parser\InputStream $input, array $options = array()) - { - $events = new DOMTreeBuilder(true, array_merge($this->getOptions(), $options)); - $scanner = new Scanner($input); - $parser = new Tokenizer($scanner, $events); - - $parser->parse(); - $this->errors = $events->getErrors(); - - return $events->fragment(); - } - - /** - * Save a DOM into a given file as HTML5. - * - * @param mixed $dom - * The DOM to be serialized. - * @param string $file - * The filename to be written. - * @param array $options - * Configuration options when serializing the DOM. These include: - * - encode_entities: Text written to the output is escaped by default and not all - * entities are encoded. If this is set to true all entities will be encoded. - * Defaults to false. - */ - public function save($dom, $file, $options = array()) - { - $close = true; - if (is_resource($file)) { - $stream = $file; - $close = false; - } else { - $stream = fopen($file, 'w'); - } - $options = array_merge($this->getOptions(), $options); - $rules = new OutputRules($stream, $options); - $trav = new Traverser($dom, $stream, $rules, $options); - - $trav->walk(); - - if ($close) { - fclose($stream); - } - } - - /** - * Convert a DOM into an HTML5 string. - * - * @param mixed $dom - * The DOM to be serialized. - * @param array $options - * Configuration options when serializing the DOM. These include: - * - encode_entities: Text written to the output is escaped by default and not all - * entities are encoded. If this is set to true all entities will be encoded. - * Defaults to false. - * - * @return string A HTML5 documented generated from the DOM. - */ - public function saveHTML($dom, $options = array()) - { - $stream = fopen('php://temp', 'w'); - $this->save($dom, $stream, array_merge($this->getOptions(), $options)); - - return stream_get_contents($stream, - 1, 0); - } -} diff --git a/core/vendor/masterminds/html5/src/HTML5/Elements.php b/core/vendor/masterminds/html5/src/HTML5/Elements.php deleted file mode 100644 index 6cf72aa..0000000 --- a/core/vendor/masterminds/html5/src/HTML5/Elements.php +++ /dev/null @@ -1,634 +0,0 @@ - 1, - "abbr" => 1, - "address" => 89, // NORMAL | VOID_TAG | AUTOCLOSE_P | BLOCK_TAG - "area" => 9, // NORMAL | VOID_TAG - "article" => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG - "aside" => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG - "audio" => 65, // NORMAL | BLOCK_TAG - "b" => 1, - "base" => 9, // NORMAL | VOID_TAG - "bdi" => 1, - "bdo" => 1, - "blockquote" => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG - "body" => 1, - "br" => 9, // NORMAL | VOID_TAG - "button" => 1, - "canvas" => 65, // NORMAL | BLOCK_TAG - "caption" => 1, - "cite" => 1, - "code" => 1, - "col" => 9, // NORMAL | VOID_TAG - "colgroup" => 1, - "command" => 9, // NORMAL | VOID_TAG - // "data" => 1, // This is highly experimental and only part of the whatwg spec (not w3c). See https://developer.mozilla.org/en-US/docs/HTML/Element/data - "datalist" => 1, - "dd" => 65, // NORMAL | BLOCK_TAG - "del" => 1, - "details" => 17, // NORMAL | AUTOCLOSE_P, - "dfn" => 1, - "dialog" => 17, // NORMAL | AUTOCLOSE_P, - "div" => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG - "dl" => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG - "dt" => 1, - "em" => 1, - "embed" => 9, // NORMAL | VOID_TAG - "fieldset" => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG - "figcaption" => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG - "figure" => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG - "footer" => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG - "form" => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG - "h1" => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG - "h2" => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG - "h3" => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG - "h4" => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG - "h5" => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG - "h6" => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG - "head" => 1, - "header" => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG - "hgroup" => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG - "hr" => 73, // NORMAL | VOID_TAG - "html" => 1, - "i" => 1, - "iframe" => 3, // NORMAL | TEXT_RAW - "img" => 9, // NORMAL | VOID_TAG - "input" => 9, // NORMAL | VOID_TAG - "kbd" => 1, - "ins" => 1, - "keygen" => 9, // NORMAL | VOID_TAG - "label" => 1, - "legend" => 1, - "li" => 1, - "link" => 9, // NORMAL | VOID_TAG - "map" => 1, - "mark" => 1, - "menu" => 17, // NORMAL | AUTOCLOSE_P, - "meta" => 9, // NORMAL | VOID_TAG - "meter" => 1, - "nav" => 17, // NORMAL | AUTOCLOSE_P, - "noscript" => 67, // NORMAL | TEXT_RAW | BLOCK_TAG - "object" => 1, - "ol" => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG - "optgroup" => 1, - "option" => 1, - "output" => 65, // NORMAL | BLOCK_TAG - "p" => 209, // NORMAL | AUTOCLOSE_P | BLOCK_TAG | BLOCK_ONLY_INLINE - "param" => 9, // NORMAL | VOID_TAG - "pre" => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG - "progress" => 1, - "q" => 1, - "rp" => 1, - "rt" => 1, - "ruby" => 1, - "s" => 1, - "samp" => 1, - "script" => 3, // NORMAL | TEXT_RAW - "section" => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG - "select" => 1, - "small" => 1, - "source" => 9, // NORMAL | VOID_TAG - "span" => 1, - "strong" => 1, - "style" => 3, // NORMAL | TEXT_RAW - "sub" => 1, - "summary" => 17, // NORMAL | AUTOCLOSE_P, - "sup" => 1, - "table" => 65, // NORMAL | BLOCK_TAG - "tbody" => 1, - "td" => 1, - "textarea" => 5, // NORMAL | TEXT_RCDATA - "tfoot" => 65, // NORMAL | BLOCK_TAG - "th" => 1, - "thead" => 1, - "time" => 1, - "title" => 5, // NORMAL | TEXT_RCDATA - "tr" => 1, - "track" => 9, // NORMAL | VOID_TAG - "u" => 1, - "ul" => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG - "var" => 1, - "video" => 65, // NORMAL | BLOCK_TAG - "wbr" => 9, // NORMAL | VOID_TAG - - // Legacy? - 'basefont' => 8, // VOID_TAG - 'bgsound' => 8, // VOID_TAG - 'noframes' => 2, // RAW_TEXT - 'frame' => 9, // NORMAL | VOID_TAG - 'frameset' => 1, - 'center' => 16, - 'dir' => 16, - 'listing' => 16, // AUTOCLOSE_P - 'plaintext' => 48, // AUTOCLOSE_P | TEXT_PLAINTEXT - 'applet' => 0, - 'marquee' => 0, - 'isindex' => 8, // VOID_TAG - 'xmp' => 20, // AUTOCLOSE_P | VOID_TAG | RAW_TEXT - 'noembed' => 2 // RAW_TEXT - ); - - /** - * The MathML elements. - * See http://www.w3.org/wiki/MathML/Elements. - * - * In our case we are only concerned with presentation MathML and not content - * MathML. There is a nice list of this subset at https://developer.mozilla.org/en-US/docs/MathML/Element. - * - * @var array - */ - public static $mathml = array( - "maction" => 1, - "maligngroup" => 1, - "malignmark" => 1, - "math" => 1, - "menclose" => 1, - "merror" => 1, - "mfenced" => 1, - "mfrac" => 1, - "mglyph" => 1, - "mi" => 1, - "mlabeledtr" => 1, - "mlongdiv" => 1, - "mmultiscripts" => 1, - "mn" => 1, - "mo" => 1, - "mover" => 1, - "mpadded" => 1, - "mphantom" => 1, - "mroot" => 1, - "mrow" => 1, - "ms" => 1, - "mscarries" => 1, - "mscarry" => 1, - "msgroup" => 1, - "msline" => 1, - "mspace" => 1, - "msqrt" => 1, - "msrow" => 1, - "mstack" => 1, - "mstyle" => 1, - "msub" => 1, - "msup" => 1, - "msubsup" => 1, - "mtable" => 1, - "mtd" => 1, - "mtext" => 1, - "mtr" => 1, - "munder" => 1, - "munderover" => 1 - ); - - /** - * The svg elements. - * - * The Mozilla documentation has a good list at https://developer.mozilla.org/en-US/docs/SVG/Element. - * The w3c list appears to be lacking in some areas like filter effect elements. - * That list can be found at http://www.w3.org/wiki/SVG/Elements. - * - * Note, FireFox appears to do a better job rendering filter effects than chrome. - * While they are in the spec I'm not sure how widely implemented they are. - * - * @var array - */ - public static $svg = array( - "a" => 1, - "altGlyph" => 1, - "altGlyphDef" => 1, - "altGlyphItem" => 1, - "animate" => 1, - "animateColor" => 1, - "animateMotion" => 1, - "animateTransform" => 1, - "circle" => 1, - "clipPath" => 1, - "color-profile" => 1, - "cursor" => 1, - "defs" => 1, - "desc" => 1, - "ellipse" => 1, - "feBlend" => 1, - "feColorMatrix" => 1, - "feComponentTransfer" => 1, - "feComposite" => 1, - "feConvolveMatrix" => 1, - "feDiffuseLighting" => 1, - "feDisplacementMap" => 1, - "feDistantLight" => 1, - "feFlood" => 1, - "feFuncA" => 1, - "feFuncB" => 1, - "feFuncG" => 1, - "feFuncR" => 1, - "feGaussianBlur" => 1, - "feImage" => 1, - "feMerge" => 1, - "feMergeNode" => 1, - "feMorphology" => 1, - "feOffset" => 1, - "fePointLight" => 1, - "feSpecularLighting" => 1, - "feSpotLight" => 1, - "feTile" => 1, - "feTurbulence" => 1, - "filter" => 1, - "font" => 1, - "font-face" => 1, - "font-face-format" => 1, - "font-face-name" => 1, - "font-face-src" => 1, - "font-face-uri" => 1, - "foreignObject" => 1, - "g" => 1, - "glyph" => 1, - "glyphRef" => 1, - "hkern" => 1, - "image" => 1, - "line" => 1, - "linearGradient" => 1, - "marker" => 1, - "mask" => 1, - "metadata" => 1, - "missing-glyph" => 1, - "mpath" => 1, - "path" => 1, - "pattern" => 1, - "polygon" => 1, - "polyline" => 1, - "radialGradient" => 1, - "rect" => 1, - "script" => 3, // NORMAL | RAW_TEXT - "set" => 1, - "stop" => 1, - "style" => 3, // NORMAL | RAW_TEXT - "svg" => 1, - "switch" => 1, - "symbol" => 1, - "text" => 1, - "textPath" => 1, - "title" => 1, - "tref" => 1, - "tspan" => 1, - "use" => 1, - "view" => 1, - "vkern" => 1 - ); - - /** - * Some attributes in SVG are case sensetitive. - * - * This map contains key/value pairs with the key as the lowercase attribute - * name and the value with the correct casing. - */ - public static $svgCaseSensitiveAttributeMap = array( - 'attributename' => 'attributeName', - 'attributetype' => 'attributeType', - 'basefrequency' => 'baseFrequency', - 'baseprofile' => 'baseProfile', - 'calcmode' => 'calcMode', - 'clippathunits' => 'clipPathUnits', - 'contentscripttype' => 'contentScriptType', - 'contentstyletype' => 'contentStyleType', - 'diffuseconstant' => 'diffuseConstant', - 'edgemode' => 'edgeMode', - 'externalresourcesrequired' => 'externalResourcesRequired', - 'filterres' => 'filterRes', - 'filterunits' => 'filterUnits', - 'glyphref' => 'glyphRef', - 'gradienttransform' => 'gradientTransform', - 'gradientunits' => 'gradientUnits', - 'kernelmatrix' => 'kernelMatrix', - 'kernelunitlength' => 'kernelUnitLength', - 'keypoints' => 'keyPoints', - 'keysplines' => 'keySplines', - 'keytimes' => 'keyTimes', - 'lengthadjust' => 'lengthAdjust', - 'limitingconeangle' => 'limitingConeAngle', - 'markerheight' => 'markerHeight', - 'markerunits' => 'markerUnits', - 'markerwidth' => 'markerWidth', - 'maskcontentunits' => 'maskContentUnits', - 'maskunits' => 'maskUnits', - 'numoctaves' => 'numOctaves', - 'pathlength' => 'pathLength', - 'patterncontentunits' => 'patternContentUnits', - 'patterntransform' => 'patternTransform', - 'patternunits' => 'patternUnits', - 'pointsatx' => 'pointsAtX', - 'pointsaty' => 'pointsAtY', - 'pointsatz' => 'pointsAtZ', - 'preservealpha' => 'preserveAlpha', - 'preserveaspectratio' => 'preserveAspectRatio', - 'primitiveunits' => 'primitiveUnits', - 'refx' => 'refX', - 'refy' => 'refY', - 'repeatcount' => 'repeatCount', - 'repeatdur' => 'repeatDur', - 'requiredextensions' => 'requiredExtensions', - 'requiredfeatures' => 'requiredFeatures', - 'specularconstant' => 'specularConstant', - 'specularexponent' => 'specularExponent', - 'spreadmethod' => 'spreadMethod', - 'startoffset' => 'startOffset', - 'stddeviation' => 'stdDeviation', - 'stitchtiles' => 'stitchTiles', - 'surfacescale' => 'surfaceScale', - 'systemlanguage' => 'systemLanguage', - 'tablevalues' => 'tableValues', - 'targetx' => 'targetX', - 'targety' => 'targetY', - 'textlength' => 'textLength', - 'viewbox' => 'viewBox', - 'viewtarget' => 'viewTarget', - 'xchannelselector' => 'xChannelSelector', - 'ychannelselector' => 'yChannelSelector', - 'zoomandpan' => 'zoomAndPan' - ); - - /** - * Some SVG elements are case sensetitive. - * This map contains these. - * - * The map contains key/value store of the name is lowercase as the keys and - * the correct casing as the value. - */ - public static $svgCaseSensitiveElementMap = array( - 'altglyph' => 'altGlyph', - 'altglyphdef' => 'altGlyphDef', - 'altglyphitem' => 'altGlyphItem', - 'animatecolor' => 'animateColor', - 'animatemotion' => 'animateMotion', - 'animatetransform' => 'animateTransform', - 'clippath' => 'clipPath', - 'feblend' => 'feBlend', - 'fecolormatrix' => 'feColorMatrix', - 'fecomponenttransfer' => 'feComponentTransfer', - 'fecomposite' => 'feComposite', - 'feconvolvematrix' => 'feConvolveMatrix', - 'fediffuselighting' => 'feDiffuseLighting', - 'fedisplacementmap' => 'feDisplacementMap', - 'fedistantlight' => 'feDistantLight', - 'feflood' => 'feFlood', - 'fefunca' => 'feFuncA', - 'fefuncb' => 'feFuncB', - 'fefuncg' => 'feFuncG', - 'fefuncr' => 'feFuncR', - 'fegaussianblur' => 'feGaussianBlur', - 'feimage' => 'feImage', - 'femerge' => 'feMerge', - 'femergenode' => 'feMergeNode', - 'femorphology' => 'feMorphology', - 'feoffset' => 'feOffset', - 'fepointlight' => 'fePointLight', - 'fespecularlighting' => 'feSpecularLighting', - 'fespotlight' => 'feSpotLight', - 'fetile' => 'feTile', - 'feturbulence' => 'feTurbulence', - 'foreignobject' => 'foreignObject', - 'glyphref' => 'glyphRef', - 'lineargradient' => 'linearGradient', - 'radialgradient' => 'radialGradient', - 'textpath' => 'textPath' - ); - - /** - * Check whether the given element meets the given criterion. - * - * Example: - * - * Elements::isA('script', Elements::TEXT_RAW); // Returns true. - * - * Elements::isA('script', Elements::TEXT_RCDATA); // Returns false. - * - * @param string $name - * The element name. - * @param int $mask - * One of the constants on this class. - * @return boolean true if the element matches the mask, false otherwise. - */ - public static function isA($name, $mask) - { - if (! static::isElement($name)) { - return false; - } - - return (static::element($name) & $mask) == $mask; - } - - /** - * Test if an element is a valid html5 element. - * - * @param string $name - * The name of the element. - * - * @return bool True if a html5 element and false otherwise. - */ - public static function isHtml5Element($name) - { - // html5 element names are case insensetitive. Forcing lowercase for the check. - // Do we need this check or will all data passed here already be lowercase? - return isset(static::$html5[strtolower($name)]); - } - - /** - * Test if an element name is a valid MathML presentation element. - * - * @param string $name - * The name of the element. - * - * @return bool True if a MathML name and false otherwise. - */ - public static function isMathMLElement($name) - { - // MathML is case-sensetitive unlike html5 elements. - return isset(static::$mathml[$name]); - } - - /** - * Test if an element is a valid SVG element. - * - * @param string $name - * The name of the element. - * - * @return boolean True if a SVG element and false otherise. - */ - public static function isSvgElement($name) - { - // SVG is case-sensetitive unlike html5 elements. - return isset(static::$svg[$name]); - } - - /** - * Is an element name valid in an html5 document. - * - * This includes html5 elements along with other allowed embedded content - * such as svg and mathml. - * - * @param string $name - * The name of the element. - * - * @return bool True if valid and false otherwise. - */ - public static function isElement($name) - { - return static::isHtml5Element($name) || static::isMathMLElement($name) || static::isSvgElement($name); - } - - /** - * Get the element mask for the given element name. - * - * @param string $name - * The name of the element. - * - * @return int The element mask. - */ - public static function element($name) - { - if (isset(static::$html5[$name])) { - return static::$html5[$name]; - } - if (isset(static::$svg[$name])) { - return static::$svg[$name]; - } - if (isset(static::$mathml[$name])) { - return static::$mathml[$name]; - } - - return false; - } - - /** - * Normalize a SVG element name to its proper case and form. - * - * @param string $name - * The name of the element. - * - * @return string The normalized form of the element name. - */ - public static function normalizeSvgElement($name) - { - $name = strtolower($name); - if (isset(static::$svgCaseSensitiveElementMap[$name])) { - $name = static::$svgCaseSensitiveElementMap[$name]; - } - - return $name; - } - - /** - * Normalize a SVG attribute name to its proper case and form. - * - * @param string $name - * The name of the attribute. - * - * @return string The normalized form of the attribute name. - */ - public static function normalizeSvgAttribute($name) - { - $name = strtolower($name); - if (isset(static::$svgCaseSensitiveAttributeMap[$name])) { - $name = static::$svgCaseSensitiveAttributeMap[$name]; - } - - return $name; - } - - /** - * Normalize a MathML attribute name to its proper case and form. - * - * Note, all MathML element names are lowercase. - * - * @param string $name - * The name of the attribute. - * - * @return string The normalized form of the attribute name. - */ - public static function normalizeMathMlAttribute($name) - { - $name = strtolower($name); - - // Only one attribute has a mixed case form for MathML. - if ($name == 'definitionurl') { - $name = 'definitionURL'; - } - - return $name; - } -} diff --git a/core/vendor/masterminds/html5/src/HTML5/Entities.php b/core/vendor/masterminds/html5/src/HTML5/Entities.php deleted file mode 100644 index 2e605d6..0000000 --- a/core/vendor/masterminds/html5/src/HTML5/Entities.php +++ /dev/null @@ -1,2236 +0,0 @@ - 'Á', - 'Aacut' => 'Á', - 'aacute' => 'á', - 'aacut' => 'á', - 'Abreve' => 'Ă', - 'abreve' => 'ă', - 'ac' => '∾', - 'acd' => '∿', - 'acE' => '∾̳', - 'Acirc' => 'Â', - 'Acir' => 'Â', - 'acirc' => 'â', - 'acir' => 'â', - 'acute' => '´', - 'acut' => '´', - 'Acy' => 'А', - 'acy' => 'а', - 'AElig' => 'Æ', - 'AEli' => 'Æ', - 'aelig' => 'æ', - 'aeli' => 'æ', - 'af' => '⁡', - 'Afr' => '𝔄', - 'afr' => '𝔞', - 'Agrave' => 'À', - 'Agrav' => 'À', - 'agrave' => 'à', - 'agrav' => 'à', - 'alefsym' => 'ℵ', - 'aleph' => 'ℵ', - 'Alpha' => 'Α', - 'alpha' => 'α', - 'Amacr' => 'Ā', - 'amacr' => 'ā', - 'amalg' => '⨿', - 'AMP' => '&', - 'AM' => '&', - 'amp' => '&', - 'am' => '&', - 'And' => '⩓', - 'and' => '∧', - 'andand' => '⩕', - 'andd' => '⩜', - 'andslope' => '⩘', - 'andv' => '⩚', - 'ang' => '∠', - 'ange' => '⦤', - 'angle' => '∠', - 'angmsd' => '∡', - 'angmsdaa' => '⦨', - 'angmsdab' => '⦩', - 'angmsdac' => '⦪', - 'angmsdad' => '⦫', - 'angmsdae' => '⦬', - 'angmsdaf' => '⦭', - 'angmsdag' => '⦮', - 'angmsdah' => '⦯', - 'angrt' => '∟', - 'angrtvb' => '⊾', - 'angrtvbd' => '⦝', - 'angsph' => '∢', - 'angst' => 'Å', - 'angzarr' => '⍼', - 'Aogon' => 'Ą', - 'aogon' => 'ą', - 'Aopf' => '𝔸', - 'aopf' => '𝕒', - 'ap' => '≈', - 'apacir' => '⩯', - 'apE' => '⩰', - 'ape' => '≊', - 'apid' => '≋', - 'apos' => '\'', - 'ApplyFunction' => '⁡', - 'approx' => '≈', - 'approxeq' => '≊', - 'Aring' => 'Å', - 'Arin' => 'Å', - 'aring' => 'å', - 'arin' => 'å', - 'Ascr' => '𝒜', - 'ascr' => '𝒶', - 'Assign' => '≔', - 'ast' => '*', - 'asymp' => '≈', - 'asympeq' => '≍', - 'Atilde' => 'Ã', - 'Atild' => 'Ã', - 'atilde' => 'ã', - 'atild' => 'ã', - 'Auml' => 'Ä', - 'Aum' => 'Ä', - 'auml' => 'ä', - 'aum' => 'ä', - 'awconint' => '∳', - 'awint' => '⨑', - 'backcong' => '≌', - 'backepsilon' => '϶', - 'backprime' => '‵', - 'backsim' => '∽', - 'backsimeq' => '⋍', - 'Backslash' => '∖', - 'Barv' => '⫧', - 'barvee' => '⊽', - 'Barwed' => '⌆', - 'barwed' => '⌅', - 'barwedge' => '⌅', - 'bbrk' => '⎵', - 'bbrktbrk' => '⎶', - 'bcong' => '≌', - 'Bcy' => 'Б', - 'bcy' => 'б', - 'bdquo' => '„', - 'becaus' => '∵', - 'Because' => '∵', - 'because' => '∵', - 'bemptyv' => '⦰', - 'bepsi' => '϶', - 'bernou' => 'ℬ', - 'Bernoullis' => 'ℬ', - 'Beta' => 'Β', - 'beta' => 'β', - 'beth' => 'ℶ', - 'between' => '≬', - 'Bfr' => '𝔅', - 'bfr' => '𝔟', - 'bigcap' => '⋂', - 'bigcirc' => '◯', - 'bigcup' => '⋃', - 'bigodot' => '⨀', - 'bigoplus' => '⨁', - 'bigotimes' => '⨂', - 'bigsqcup' => '⨆', - 'bigstar' => '★', - 'bigtriangledown' => '▽', - 'bigtriangleup' => '△', - 'biguplus' => '⨄', - 'bigvee' => '⋁', - 'bigwedge' => '⋀', - 'bkarow' => '⤍', - 'blacklozenge' => '⧫', - 'blacksquare' => '▪', - 'blacktriangle' => '▴', - 'blacktriangledown' => '▾', - 'blacktriangleleft' => '◂', - 'blacktriangleright' => '▸', - 'blank' => '␣', - 'blk12' => '▒', - 'blk14' => '░', - 'blk34' => '▓', - 'block' => '█', - 'bne' => '=⃥', - 'bnequiv' => '≡⃥', - 'bNot' => '⫭', - 'bnot' => '⌐', - 'Bopf' => '𝔹', - 'bopf' => '𝕓', - 'bot' => '⊥', - 'bottom' => '⊥', - 'bowtie' => '⋈', - 'boxbox' => '⧉', - 'boxDL' => '╗', - 'boxDl' => '╖', - 'boxdL' => '╕', - 'boxdl' => '┐', - 'boxDR' => '╔', - 'boxDr' => '╓', - 'boxdR' => '╒', - 'boxdr' => '┌', - 'boxH' => '═', - 'boxh' => '─', - 'boxHD' => '╦', - 'boxHd' => '╤', - 'boxhD' => '╥', - 'boxhd' => '┬', - 'boxHU' => '╩', - 'boxHu' => '╧', - 'boxhU' => '╨', - 'boxhu' => '┴', - 'boxminus' => '⊟', - 'boxplus' => '⊞', - 'boxtimes' => '⊠', - 'boxUL' => '╝', - 'boxUl' => '╜', - 'boxuL' => '╛', - 'boxul' => '┘', - 'boxUR' => '╚', - 'boxUr' => '╙', - 'boxuR' => '╘', - 'boxur' => '└', - 'boxV' => '║', - 'boxv' => '│', - 'boxVH' => '╬', - 'boxVh' => '╫', - 'boxvH' => '╪', - 'boxvh' => '┼', - 'boxVL' => '╣', - 'boxVl' => '╢', - 'boxvL' => '╡', - 'boxvl' => '┤', - 'boxVR' => '╠', - 'boxVr' => '╟', - 'boxvR' => '╞', - 'boxvr' => '├', - 'bprime' => '‵', - 'Breve' => '˘', - 'breve' => '˘', - 'brvbar' => '¦', - 'brvba' => '¦', - 'Bscr' => 'ℬ', - 'bscr' => '𝒷', - 'bsemi' => '⁏', - 'bsim' => '∽', - 'bsime' => '⋍', - 'bsol' => '\\', - 'bsolb' => '⧅', - 'bsolhsub' => '⟈', - 'bull' => '•', - 'bullet' => '•', - 'bump' => '≎', - 'bumpE' => '⪮', - 'bumpe' => '≏', - 'Bumpeq' => '≎', - 'bumpeq' => '≏', - 'Cacute' => 'Ć', - 'cacute' => 'ć', - 'Cap' => '⋒', - 'cap' => '∩', - 'capand' => '⩄', - 'capbrcup' => '⩉', - 'capcap' => '⩋', - 'capcup' => '⩇', - 'capdot' => '⩀', - 'CapitalDifferentialD' => 'ⅅ', - 'caps' => '∩︀', - 'caret' => '⁁', - 'caron' => 'ˇ', - 'Cayleys' => 'ℭ', - 'ccaps' => '⩍', - 'Ccaron' => 'Č', - 'ccaron' => 'č', - 'Ccedil' => 'Ç', - 'Ccedi' => 'Ç', - 'ccedil' => 'ç', - 'ccedi' => 'ç', - 'Ccirc' => 'Ĉ', - 'ccirc' => 'ĉ', - 'Cconint' => '∰', - 'ccups' => '⩌', - 'ccupssm' => '⩐', - 'Cdot' => 'Ċ', - 'cdot' => 'ċ', - 'cedil' => '¸', - 'cedi' => '¸', - 'Cedilla' => '¸', - 'cemptyv' => '⦲', - 'cent' => '¢', - 'cen' => '¢', - 'CenterDot' => '·', - 'centerdot' => '·', - 'Cfr' => 'ℭ', - 'cfr' => '𝔠', - 'CHcy' => 'Ч', - 'chcy' => 'ч', - 'check' => '✓', - 'checkmark' => '✓', - 'Chi' => 'Χ', - 'chi' => 'χ', - 'cir' => '○', - 'circ' => 'ˆ', - 'circeq' => '≗', - 'circlearrowleft' => '↺', - 'circlearrowright' => '↻', - 'circledast' => '⊛', - 'circledcirc' => '⊚', - 'circleddash' => '⊝', - 'CircleDot' => '⊙', - 'circledR' => '®', - 'circledS' => 'Ⓢ', - 'CircleMinus' => '⊖', - 'CirclePlus' => '⊕', - 'CircleTimes' => '⊗', - 'cirE' => '⧃', - 'cire' => '≗', - 'cirfnint' => '⨐', - 'cirmid' => '⫯', - 'cirscir' => '⧂', - 'ClockwiseContourIntegral' => '∲', - 'CloseCurlyDoubleQuote' => '”', - 'CloseCurlyQuote' => '’', - 'clubs' => '♣', - 'clubsuit' => '♣', - 'Colon' => '∷', - 'colon' => ':', - 'Colone' => '⩴', - 'colone' => '≔', - 'coloneq' => '≔', - 'comma' => ',', - 'commat' => '@', - 'comp' => '∁', - 'compfn' => '∘', - 'complement' => '∁', - 'complexes' => 'ℂ', - 'cong' => '≅', - 'congdot' => '⩭', - 'Congruent' => '≡', - 'Conint' => '∯', - 'conint' => '∮', - 'ContourIntegral' => '∮', - 'Copf' => 'ℂ', - 'copf' => '𝕔', - 'coprod' => '∐', - 'Coproduct' => '∐', - 'COPY' => '©', - 'COP' => '©', - 'copy' => '©', - 'cop' => '©', - 'copysr' => '℗', - 'CounterClockwiseContourIntegral' => '∳', - 'crarr' => '↵', - 'Cross' => '⨯', - 'cross' => '✗', - 'Cscr' => '𝒞', - 'cscr' => '𝒸', - 'csub' => '⫏', - 'csube' => '⫑', - 'csup' => '⫐', - 'csupe' => '⫒', - 'ctdot' => '⋯', - 'cudarrl' => '⤸', - 'cudarrr' => '⤵', - 'cuepr' => '⋞', - 'cuesc' => '⋟', - 'cularr' => '↶', - 'cularrp' => '⤽', - 'Cup' => '⋓', - 'cup' => '∪', - 'cupbrcap' => '⩈', - 'CupCap' => '≍', - 'cupcap' => '⩆', - 'cupcup' => '⩊', - 'cupdot' => '⊍', - 'cupor' => '⩅', - 'cups' => '∪︀', - 'curarr' => '↷', - 'curarrm' => '⤼', - 'curlyeqprec' => '⋞', - 'curlyeqsucc' => '⋟', - 'curlyvee' => '⋎', - 'curlywedge' => '⋏', - 'curren' => '¤', - 'curre' => '¤', - 'curvearrowleft' => '↶', - 'curvearrowright' => '↷', - 'cuvee' => '⋎', - 'cuwed' => '⋏', - 'cwconint' => '∲', - 'cwint' => '∱', - 'cylcty' => '⌭', - 'Dagger' => '‡', - 'dagger' => '†', - 'daleth' => 'ℸ', - 'Darr' => '↡', - 'dArr' => '⇓', - 'darr' => '↓', - 'dash' => '‐', - 'Dashv' => '⫤', - 'dashv' => '⊣', - 'dbkarow' => '⤏', - 'dblac' => '˝', - 'Dcaron' => 'Ď', - 'dcaron' => 'ď', - 'Dcy' => 'Д', - 'dcy' => 'д', - 'DD' => 'ⅅ', - 'dd' => 'ⅆ', - 'ddagger' => '‡', - 'ddarr' => '⇊', - 'DDotrahd' => '⤑', - 'ddotseq' => '⩷', - 'deg' => '°', - 'de' => '°', - 'Del' => '∇', - 'Delta' => 'Δ', - 'delta' => 'δ', - 'demptyv' => '⦱', - 'dfisht' => '⥿', - 'Dfr' => '𝔇', - 'dfr' => '𝔡', - 'dHar' => '⥥', - 'dharl' => '⇃', - 'dharr' => '⇂', - 'DiacriticalAcute' => '´', - 'DiacriticalDot' => '˙', - 'DiacriticalDoubleAcute' => '˝', - 'DiacriticalGrave' => '`', - 'DiacriticalTilde' => '˜', - 'diam' => '⋄', - 'Diamond' => '⋄', - 'diamond' => '⋄', - 'diamondsuit' => '♦', - 'diams' => '♦', - 'die' => '¨', - 'DifferentialD' => 'ⅆ', - 'digamma' => 'ϝ', - 'disin' => '⋲', - 'div' => '÷', - 'divide' => '÷', - 'divid' => '÷', - 'divideontimes' => '⋇', - 'divonx' => '⋇', - 'DJcy' => 'Ђ', - 'djcy' => 'ђ', - 'dlcorn' => '⌞', - 'dlcrop' => '⌍', - 'dollar' => '$', - 'Dopf' => '𝔻', - 'dopf' => '𝕕', - 'Dot' => '¨', - 'dot' => '˙', - 'DotDot' => '⃜', - 'doteq' => '≐', - 'doteqdot' => '≑', - 'DotEqual' => '≐', - 'dotminus' => '∸', - 'dotplus' => '∔', - 'dotsquare' => '⊡', - 'doublebarwedge' => '⌆', - 'DoubleContourIntegral' => '∯', - 'DoubleDot' => '¨', - 'DoubleDownArrow' => '⇓', - 'DoubleLeftArrow' => '⇐', - 'DoubleLeftRightArrow' => '⇔', - 'DoubleLeftTee' => '⫤', - 'DoubleLongLeftArrow' => '⟸', - 'DoubleLongLeftRightArrow' => '⟺', - 'DoubleLongRightArrow' => '⟹', - 'DoubleRightArrow' => '⇒', - 'DoubleRightTee' => '⊨', - 'DoubleUpArrow' => '⇑', - 'DoubleUpDownArrow' => '⇕', - 'DoubleVerticalBar' => '∥', - 'DownArrow' => '↓', - 'Downarrow' => '⇓', - 'downarrow' => '↓', - 'DownArrowBar' => '⤓', - 'DownArrowUpArrow' => '⇵', - 'DownBreve' => '̑', - 'downdownarrows' => '⇊', - 'downharpoonleft' => '⇃', - 'downharpoonright' => '⇂', - 'DownLeftRightVector' => '⥐', - 'DownLeftTeeVector' => '⥞', - 'DownLeftVector' => '↽', - 'DownLeftVectorBar' => '⥖', - 'DownRightTeeVector' => '⥟', - 'DownRightVector' => '⇁', - 'DownRightVectorBar' => '⥗', - 'DownTee' => '⊤', - 'DownTeeArrow' => '↧', - 'drbkarow' => '⤐', - 'drcorn' => '⌟', - 'drcrop' => '⌌', - 'Dscr' => '𝒟', - 'dscr' => '𝒹', - 'DScy' => 'Ѕ', - 'dscy' => 'ѕ', - 'dsol' => '⧶', - 'Dstrok' => 'Đ', - 'dstrok' => 'đ', - 'dtdot' => '⋱', - 'dtri' => '▿', - 'dtrif' => '▾', - 'duarr' => '⇵', - 'duhar' => '⥯', - 'dwangle' => '⦦', - 'DZcy' => 'Џ', - 'dzcy' => 'џ', - 'dzigrarr' => '⟿', - 'Eacute' => 'É', - 'Eacut' => 'É', - 'eacute' => 'é', - 'eacut' => 'é', - 'easter' => '⩮', - 'Ecaron' => 'Ě', - 'ecaron' => 'ě', - 'ecir' => 'ê', - 'Ecirc' => 'Ê', - 'Ecir' => 'Ê', - 'ecirc' => 'ê', - 'ecolon' => '≕', - 'Ecy' => 'Э', - 'ecy' => 'э', - 'eDDot' => '⩷', - 'Edot' => 'Ė', - 'eDot' => '≑', - 'edot' => 'ė', - 'ee' => 'ⅇ', - 'efDot' => '≒', - 'Efr' => '𝔈', - 'efr' => '𝔢', - 'eg' => '⪚', - 'Egrave' => 'È', - 'Egrav' => 'È', - 'egrave' => 'è', - 'egrav' => 'è', - 'egs' => '⪖', - 'egsdot' => '⪘', - 'el' => '⪙', - 'Element' => '∈', - 'elinters' => '⏧', - 'ell' => 'ℓ', - 'els' => '⪕', - 'elsdot' => '⪗', - 'Emacr' => 'Ē', - 'emacr' => 'ē', - 'empty' => '∅', - 'emptyset' => '∅', - 'EmptySmallSquare' => '◻', - 'emptyv' => '∅', - 'EmptyVerySmallSquare' => '▫', - 'emsp' => ' ', - 'emsp13' => ' ', - 'emsp14' => ' ', - 'ENG' => 'Ŋ', - 'eng' => 'ŋ', - 'ensp' => ' ', - 'Eogon' => 'Ę', - 'eogon' => 'ę', - 'Eopf' => '𝔼', - 'eopf' => '𝕖', - 'epar' => '⋕', - 'eparsl' => '⧣', - 'eplus' => '⩱', - 'epsi' => 'ε', - 'Epsilon' => 'Ε', - 'epsilon' => 'ε', - 'epsiv' => 'ϵ', - 'eqcirc' => '≖', - 'eqcolon' => '≕', - 'eqsim' => '≂', - 'eqslantgtr' => '⪖', - 'eqslantless' => '⪕', - 'Equal' => '⩵', - 'equals' => '=', - 'EqualTilde' => '≂', - 'equest' => '≟', - 'Equilibrium' => '⇌', - 'equiv' => '≡', - 'equivDD' => '⩸', - 'eqvparsl' => '⧥', - 'erarr' => '⥱', - 'erDot' => '≓', - 'Escr' => 'ℰ', - 'escr' => 'ℯ', - 'esdot' => '≐', - 'Esim' => '⩳', - 'esim' => '≂', - 'Eta' => 'Η', - 'eta' => 'η', - 'ETH' => 'Ð', - 'ET' => 'Ð', - 'eth' => 'ð', - 'et' => 'ð', - 'Euml' => 'Ë', - 'Eum' => 'Ë', - 'euml' => 'ë', - 'eum' => 'ë', - 'euro' => '€', - 'excl' => '!', - 'exist' => '∃', - 'Exists' => '∃', - 'expectation' => 'ℰ', - 'ExponentialE' => 'ⅇ', - 'exponentiale' => 'ⅇ', - 'fallingdotseq' => '≒', - 'Fcy' => 'Ф', - 'fcy' => 'ф', - 'female' => '♀', - 'ffilig' => 'ffi', - 'fflig' => 'ff', - 'ffllig' => 'ffl', - 'Ffr' => '𝔉', - 'ffr' => '𝔣', - 'filig' => 'fi', - 'FilledSmallSquare' => '◼', - 'FilledVerySmallSquare' => '▪', - 'fjlig' => 'fj', - 'flat' => '♭', - 'fllig' => 'fl', - 'fltns' => '▱', - 'fnof' => 'ƒ', - 'Fopf' => '𝔽', - 'fopf' => '𝕗', - 'ForAll' => '∀', - 'forall' => '∀', - 'fork' => '⋔', - 'forkv' => '⫙', - 'Fouriertrf' => 'ℱ', - 'fpartint' => '⨍', - 'frac12' => '½', - 'frac1' => '¼', - 'frac13' => '⅓', - 'frac14' => '¼', - 'frac15' => '⅕', - 'frac16' => '⅙', - 'frac18' => '⅛', - 'frac23' => '⅔', - 'frac25' => '⅖', - 'frac34' => '¾', - 'frac3' => '¾', - 'frac35' => '⅗', - 'frac38' => '⅜', - 'frac45' => '⅘', - 'frac56' => '⅚', - 'frac58' => '⅝', - 'frac78' => '⅞', - 'frasl' => '⁄', - 'frown' => '⌢', - 'Fscr' => 'ℱ', - 'fscr' => '𝒻', - 'gacute' => 'ǵ', - 'Gamma' => 'Γ', - 'gamma' => 'γ', - 'Gammad' => 'Ϝ', - 'gammad' => 'ϝ', - 'gap' => '⪆', - 'Gbreve' => 'Ğ', - 'gbreve' => 'ğ', - 'Gcedil' => 'Ģ', - 'Gcirc' => 'Ĝ', - 'gcirc' => 'ĝ', - 'Gcy' => 'Г', - 'gcy' => 'г', - 'Gdot' => 'Ġ', - 'gdot' => 'ġ', - 'gE' => '≧', - 'ge' => '≥', - 'gEl' => '⪌', - 'gel' => '⋛', - 'geq' => '≥', - 'geqq' => '≧', - 'geqslant' => '⩾', - 'ges' => '⩾', - 'gescc' => '⪩', - 'gesdot' => '⪀', - 'gesdoto' => '⪂', - 'gesdotol' => '⪄', - 'gesl' => '⋛︀', - 'gesles' => '⪔', - 'Gfr' => '𝔊', - 'gfr' => '𝔤', - 'Gg' => '⋙', - 'gg' => '≫', - 'ggg' => '⋙', - 'gimel' => 'ℷ', - 'GJcy' => 'Ѓ', - 'gjcy' => 'ѓ', - 'gl' => '≷', - 'gla' => '⪥', - 'glE' => '⪒', - 'glj' => '⪤', - 'gnap' => '⪊', - 'gnapprox' => '⪊', - 'gnE' => '≩', - 'gne' => '⪈', - 'gneq' => '⪈', - 'gneqq' => '≩', - 'gnsim' => '⋧', - 'Gopf' => '𝔾', - 'gopf' => '𝕘', - 'grave' => '`', - 'GreaterEqual' => '≥', - 'GreaterEqualLess' => '⋛', - 'GreaterFullEqual' => '≧', - 'GreaterGreater' => '⪢', - 'GreaterLess' => '≷', - 'GreaterSlantEqual' => '⩾', - 'GreaterTilde' => '≳', - 'Gscr' => '𝒢', - 'gscr' => 'ℊ', - 'gsim' => '≳', - 'gsime' => '⪎', - 'gsiml' => '⪐', - 'GT' => '>', - 'G' => '>', - 'Gt' => '≫', - 'gt' => '>', - 'g' => '>', - 'gtcc' => '⪧', - 'gtcir' => '⩺', - 'gtdot' => '⋗', - 'gtlPar' => '⦕', - 'gtquest' => '⩼', - 'gtrapprox' => '⪆', - 'gtrarr' => '⥸', - 'gtrdot' => '⋗', - 'gtreqless' => '⋛', - 'gtreqqless' => '⪌', - 'gtrless' => '≷', - 'gtrsim' => '≳', - 'gvertneqq' => '≩︀', - 'gvnE' => '≩︀', - 'Hacek' => 'ˇ', - 'hairsp' => ' ', - 'half' => '½', - 'hamilt' => 'ℋ', - 'HARDcy' => 'Ъ', - 'hardcy' => 'ъ', - 'hArr' => '⇔', - 'harr' => '↔', - 'harrcir' => '⥈', - 'harrw' => '↭', - 'Hat' => '^', - 'hbar' => 'ℏ', - 'Hcirc' => 'Ĥ', - 'hcirc' => 'ĥ', - 'hearts' => '♥', - 'heartsuit' => '♥', - 'hellip' => '…', - 'hercon' => '⊹', - 'Hfr' => 'ℌ', - 'hfr' => '𝔥', - 'HilbertSpace' => 'ℋ', - 'hksearow' => '⤥', - 'hkswarow' => '⤦', - 'hoarr' => '⇿', - 'homtht' => '∻', - 'hookleftarrow' => '↩', - 'hookrightarrow' => '↪', - 'Hopf' => 'ℍ', - 'hopf' => '𝕙', - 'horbar' => '―', - 'HorizontalLine' => '─', - 'Hscr' => 'ℋ', - 'hscr' => '𝒽', - 'hslash' => 'ℏ', - 'Hstrok' => 'Ħ', - 'hstrok' => 'ħ', - 'HumpDownHump' => '≎', - 'HumpEqual' => '≏', - 'hybull' => '⁃', - 'hyphen' => '‐', - 'Iacute' => 'Í', - 'Iacut' => 'Í', - 'iacute' => 'í', - 'iacut' => 'í', - 'ic' => '⁣', - 'Icirc' => 'Î', - 'Icir' => 'Î', - 'icirc' => 'î', - 'icir' => 'î', - 'Icy' => 'И', - 'icy' => 'и', - 'Idot' => 'İ', - 'IEcy' => 'Е', - 'iecy' => 'е', - 'iexcl' => '¡', - 'iexc' => '¡', - 'iff' => '⇔', - 'Ifr' => 'ℑ', - 'ifr' => '𝔦', - 'Igrave' => 'Ì', - 'Igrav' => 'Ì', - 'igrave' => 'ì', - 'igrav' => 'ì', - 'ii' => 'ⅈ', - 'iiiint' => '⨌', - 'iiint' => '∭', - 'iinfin' => '⧜', - 'iiota' => '℩', - 'IJlig' => 'IJ', - 'ijlig' => 'ij', - 'Im' => 'ℑ', - 'Imacr' => 'Ī', - 'imacr' => 'ī', - 'image' => 'ℑ', - 'ImaginaryI' => 'ⅈ', - 'imagline' => 'ℐ', - 'imagpart' => 'ℑ', - 'imath' => 'ı', - 'imof' => '⊷', - 'imped' => 'Ƶ', - 'Implies' => '⇒', - 'in' => '∈', - 'incare' => '℅', - 'infin' => '∞', - 'infintie' => '⧝', - 'inodot' => 'ı', - 'Int' => '∬', - 'int' => '∫', - 'intcal' => '⊺', - 'integers' => 'ℤ', - 'Integral' => '∫', - 'intercal' => '⊺', - 'Intersection' => '⋂', - 'intlarhk' => '⨗', - 'intprod' => '⨼', - 'InvisibleComma' => '⁣', - 'InvisibleTimes' => '⁢', - 'IOcy' => 'Ё', - 'iocy' => 'ё', - 'Iogon' => 'Į', - 'iogon' => 'į', - 'Iopf' => '𝕀', - 'iopf' => '𝕚', - 'Iota' => 'Ι', - 'iota' => 'ι', - 'iprod' => '⨼', - 'iquest' => '¿', - 'iques' => '¿', - 'Iscr' => 'ℐ', - 'iscr' => '𝒾', - 'isin' => '∈', - 'isindot' => '⋵', - 'isinE' => '⋹', - 'isins' => '⋴', - 'isinsv' => '⋳', - 'isinv' => '∈', - 'it' => '⁢', - 'Itilde' => 'Ĩ', - 'itilde' => 'ĩ', - 'Iukcy' => 'І', - 'iukcy' => 'і', - 'Iuml' => 'Ï', - 'Ium' => 'Ï', - 'iuml' => 'ï', - 'ium' => 'ï', - 'Jcirc' => 'Ĵ', - 'jcirc' => 'ĵ', - 'Jcy' => 'Й', - 'jcy' => 'й', - 'Jfr' => '𝔍', - 'jfr' => '𝔧', - 'jmath' => 'ȷ', - 'Jopf' => '𝕁', - 'jopf' => '𝕛', - 'Jscr' => '𝒥', - 'jscr' => '𝒿', - 'Jsercy' => 'Ј', - 'jsercy' => 'ј', - 'Jukcy' => 'Є', - 'jukcy' => 'є', - 'Kappa' => 'Κ', - 'kappa' => 'κ', - 'kappav' => 'ϰ', - 'Kcedil' => 'Ķ', - 'kcedil' => 'ķ', - 'Kcy' => 'К', - 'kcy' => 'к', - 'Kfr' => '𝔎', - 'kfr' => '𝔨', - 'kgreen' => 'ĸ', - 'KHcy' => 'Х', - 'khcy' => 'х', - 'KJcy' => 'Ќ', - 'kjcy' => 'ќ', - 'Kopf' => '𝕂', - 'kopf' => '𝕜', - 'Kscr' => '𝒦', - 'kscr' => '𝓀', - 'lAarr' => '⇚', - 'Lacute' => 'Ĺ', - 'lacute' => 'ĺ', - 'laemptyv' => '⦴', - 'lagran' => 'ℒ', - 'Lambda' => 'Λ', - 'lambda' => 'λ', - 'Lang' => '⟪', - 'lang' => '⟨', - 'langd' => '⦑', - 'langle' => '⟨', - 'lap' => '⪅', - 'Laplacetrf' => 'ℒ', - 'laquo' => '«', - 'laqu' => '«', - 'Larr' => '↞', - 'lArr' => '⇐', - 'larr' => '←', - 'larrb' => '⇤', - 'larrbfs' => '⤟', - 'larrfs' => '⤝', - 'larrhk' => '↩', - 'larrlp' => '↫', - 'larrpl' => '⤹', - 'larrsim' => '⥳', - 'larrtl' => '↢', - 'lat' => '⪫', - 'lAtail' => '⤛', - 'latail' => '⤙', - 'late' => '⪭', - 'lates' => '⪭︀', - 'lBarr' => '⤎', - 'lbarr' => '⤌', - 'lbbrk' => '❲', - 'lbrace' => '{', - 'lbrack' => '[', - 'lbrke' => '⦋', - 'lbrksld' => '⦏', - 'lbrkslu' => '⦍', - 'Lcaron' => 'Ľ', - 'lcaron' => 'ľ', - 'Lcedil' => 'Ļ', - 'lcedil' => 'ļ', - 'lceil' => '⌈', - 'lcub' => '{', - 'Lcy' => 'Л', - 'lcy' => 'л', - 'ldca' => '⤶', - 'ldquo' => '“', - 'ldquor' => '„', - 'ldrdhar' => '⥧', - 'ldrushar' => '⥋', - 'ldsh' => '↲', - 'lE' => '≦', - 'le' => '≤', - 'LeftAngleBracket' => '⟨', - 'LeftArrow' => '←', - 'Leftarrow' => '⇐', - 'leftarrow' => '←', - 'LeftArrowBar' => '⇤', - 'LeftArrowRightArrow' => '⇆', - 'leftarrowtail' => '↢', - 'LeftCeiling' => '⌈', - 'LeftDoubleBracket' => '⟦', - 'LeftDownTeeVector' => '⥡', - 'LeftDownVector' => '⇃', - 'LeftDownVectorBar' => '⥙', - 'LeftFloor' => '⌊', - 'leftharpoondown' => '↽', - 'leftharpoonup' => '↼', - 'leftleftarrows' => '⇇', - 'LeftRightArrow' => '↔', - 'Leftrightarrow' => '⇔', - 'leftrightarrow' => '↔', - 'leftrightarrows' => '⇆', - 'leftrightharpoons' => '⇋', - 'leftrightsquigarrow' => '↭', - 'LeftRightVector' => '⥎', - 'LeftTee' => '⊣', - 'LeftTeeArrow' => '↤', - 'LeftTeeVector' => '⥚', - 'leftthreetimes' => '⋋', - 'LeftTriangle' => '⊲', - 'LeftTriangleBar' => '⧏', - 'LeftTriangleEqual' => '⊴', - 'LeftUpDownVector' => '⥑', - 'LeftUpTeeVector' => '⥠', - 'LeftUpVector' => '↿', - 'LeftUpVectorBar' => '⥘', - 'LeftVector' => '↼', - 'LeftVectorBar' => '⥒', - 'lEg' => '⪋', - 'leg' => '⋚', - 'leq' => '≤', - 'leqq' => '≦', - 'leqslant' => '⩽', - 'les' => '⩽', - 'lescc' => '⪨', - 'lesdot' => '⩿', - 'lesdoto' => '⪁', - 'lesdotor' => '⪃', - 'lesg' => '⋚︀', - 'lesges' => '⪓', - 'lessapprox' => '⪅', - 'lessdot' => '⋖', - 'lesseqgtr' => '⋚', - 'lesseqqgtr' => '⪋', - 'LessEqualGreater' => '⋚', - 'LessFullEqual' => '≦', - 'LessGreater' => '≶', - 'lessgtr' => '≶', - 'LessLess' => '⪡', - 'lesssim' => '≲', - 'LessSlantEqual' => '⩽', - 'LessTilde' => '≲', - 'lfisht' => '⥼', - 'lfloor' => '⌊', - 'Lfr' => '𝔏', - 'lfr' => '𝔩', - 'lg' => '≶', - 'lgE' => '⪑', - 'lHar' => '⥢', - 'lhard' => '↽', - 'lharu' => '↼', - 'lharul' => '⥪', - 'lhblk' => '▄', - 'LJcy' => 'Љ', - 'ljcy' => 'љ', - 'Ll' => '⋘', - 'll' => '≪', - 'llarr' => '⇇', - 'llcorner' => '⌞', - 'Lleftarrow' => '⇚', - 'llhard' => '⥫', - 'lltri' => '◺', - 'Lmidot' => 'Ŀ', - 'lmidot' => 'ŀ', - 'lmoust' => '⎰', - 'lmoustache' => '⎰', - 'lnap' => '⪉', - 'lnapprox' => '⪉', - 'lnE' => '≨', - 'lne' => '⪇', - 'lneq' => '⪇', - 'lneqq' => '≨', - 'lnsim' => '⋦', - 'loang' => '⟬', - 'loarr' => '⇽', - 'lobrk' => '⟦', - 'LongLeftArrow' => '⟵', - 'Longleftarrow' => '⟸', - 'longleftarrow' => '⟵', - 'LongLeftRightArrow' => '⟷', - 'Longleftrightarrow' => '⟺', - 'longleftrightarrow' => '⟷', - 'longmapsto' => '⟼', - 'LongRightArrow' => '⟶', - 'Longrightarrow' => '⟹', - 'longrightarrow' => '⟶', - 'looparrowleft' => '↫', - 'looparrowright' => '↬', - 'lopar' => '⦅', - 'Lopf' => '𝕃', - 'lopf' => '𝕝', - 'loplus' => '⨭', - 'lotimes' => '⨴', - 'lowast' => '∗', - 'lowbar' => '_', - 'LowerLeftArrow' => '↙', - 'LowerRightArrow' => '↘', - 'loz' => '◊', - 'lozenge' => '◊', - 'lozf' => '⧫', - 'lpar' => '(', - 'lparlt' => '⦓', - 'lrarr' => '⇆', - 'lrcorner' => '⌟', - 'lrhar' => '⇋', - 'lrhard' => '⥭', - 'lrm' => '‎', - 'lrtri' => '⊿', - 'lsaquo' => '‹', - 'Lscr' => 'ℒ', - 'lscr' => '𝓁', - 'Lsh' => '↰', - 'lsh' => '↰', - 'lsim' => '≲', - 'lsime' => '⪍', - 'lsimg' => '⪏', - 'lsqb' => '[', - 'lsquo' => '‘', - 'lsquor' => '‚', - 'Lstrok' => 'Ł', - 'lstrok' => 'ł', - 'LT' => '<', - 'L' => '<', - 'Lt' => '≪', - 'lt' => '<', - 'l' => '<', - 'ltcc' => '⪦', - 'ltcir' => '⩹', - 'ltdot' => '⋖', - 'lthree' => '⋋', - 'ltimes' => '⋉', - 'ltlarr' => '⥶', - 'ltquest' => '⩻', - 'ltri' => '◃', - 'ltrie' => '⊴', - 'ltrif' => '◂', - 'ltrPar' => '⦖', - 'lurdshar' => '⥊', - 'luruhar' => '⥦', - 'lvertneqq' => '≨︀', - 'lvnE' => '≨︀', - 'macr' => '¯', - 'mac' => '¯', - 'male' => '♂', - 'malt' => '✠', - 'maltese' => '✠', - 'Map' => '⤅', - 'map' => '↦', - 'mapsto' => '↦', - 'mapstodown' => '↧', - 'mapstoleft' => '↤', - 'mapstoup' => '↥', - 'marker' => '▮', - 'mcomma' => '⨩', - 'Mcy' => 'М', - 'mcy' => 'м', - 'mdash' => '—', - 'mDDot' => '∺', - 'measuredangle' => '∡', - 'MediumSpace' => ' ', - 'Mellintrf' => 'ℳ', - 'Mfr' => '𝔐', - 'mfr' => '𝔪', - 'mho' => '℧', - 'micro' => 'µ', - 'micr' => 'µ', - 'mid' => '∣', - 'midast' => '*', - 'midcir' => '⫰', - 'middot' => '·', - 'middo' => '·', - 'minus' => '−', - 'minusb' => '⊟', - 'minusd' => '∸', - 'minusdu' => '⨪', - 'MinusPlus' => '∓', - 'mlcp' => '⫛', - 'mldr' => '…', - 'mnplus' => '∓', - 'models' => '⊧', - 'Mopf' => '𝕄', - 'mopf' => '𝕞', - 'mp' => '∓', - 'Mscr' => 'ℳ', - 'mscr' => '𝓂', - 'mstpos' => '∾', - 'Mu' => 'Μ', - 'mu' => 'μ', - 'multimap' => '⊸', - 'mumap' => '⊸', - 'nabla' => '∇', - 'Nacute' => 'Ń', - 'nacute' => 'ń', - 'nang' => '∠⃒', - 'nap' => '≉', - 'napE' => '⩰̸', - 'napid' => '≋̸', - 'napos' => 'ʼn', - 'napprox' => '≉', - 'natur' => '♮', - 'natural' => '♮', - 'naturals' => 'ℕ', - 'nbsp' => ' ', - 'nbs' => ' ', - 'nbump' => '≎̸', - 'nbumpe' => '≏̸', - 'ncap' => '⩃', - 'Ncaron' => 'Ň', - 'ncaron' => 'ň', - 'Ncedil' => 'Ņ', - 'ncedil' => 'ņ', - 'ncong' => '≇', - 'ncongdot' => '⩭̸', - 'ncup' => '⩂', - 'Ncy' => 'Н', - 'ncy' => 'н', - 'ndash' => '–', - 'ne' => '≠', - 'nearhk' => '⤤', - 'neArr' => '⇗', - 'nearr' => '↗', - 'nearrow' => '↗', - 'nedot' => '≐̸', - 'NegativeMediumSpace' => '​', - 'NegativeThickSpace' => '​', - 'NegativeThinSpace' => '​', - 'NegativeVeryThinSpace' => '​', - 'nequiv' => '≢', - 'nesear' => '⤨', - 'nesim' => '≂̸', - 'NestedGreaterGreater' => '≫', - 'NestedLessLess' => '≪', - 'NewLine' => ' -', - 'nexist' => '∄', - 'nexists' => '∄', - 'Nfr' => '𝔑', - 'nfr' => '𝔫', - 'ngE' => '≧̸', - 'nge' => '≱', - 'ngeq' => '≱', - 'ngeqq' => '≧̸', - 'ngeqslant' => '⩾̸', - 'nges' => '⩾̸', - 'nGg' => '⋙̸', - 'ngsim' => '≵', - 'nGt' => '≫⃒', - 'ngt' => '≯', - 'ngtr' => '≯', - 'nGtv' => '≫̸', - 'nhArr' => '⇎', - 'nharr' => '↮', - 'nhpar' => '⫲', - 'ni' => '∋', - 'nis' => '⋼', - 'nisd' => '⋺', - 'niv' => '∋', - 'NJcy' => 'Њ', - 'njcy' => 'њ', - 'nlArr' => '⇍', - 'nlarr' => '↚', - 'nldr' => '‥', - 'nlE' => '≦̸', - 'nle' => '≰', - 'nLeftarrow' => '⇍', - 'nleftarrow' => '↚', - 'nLeftrightarrow' => '⇎', - 'nleftrightarrow' => '↮', - 'nleq' => '≰', - 'nleqq' => '≦̸', - 'nleqslant' => '⩽̸', - 'nles' => '⩽̸', - 'nless' => '≮', - 'nLl' => '⋘̸', - 'nlsim' => '≴', - 'nLt' => '≪⃒', - 'nlt' => '≮', - 'nltri' => '⋪', - 'nltrie' => '⋬', - 'nLtv' => '≪̸', - 'nmid' => '∤', - 'NoBreak' => '⁠', - 'NonBreakingSpace' => ' ', - 'Nopf' => 'ℕ', - 'nopf' => '𝕟', - 'Not' => '⫬', - 'not' => '¬', - 'no' => '¬', - 'NotCongruent' => '≢', - 'NotCupCap' => '≭', - 'NotDoubleVerticalBar' => '∦', - 'NotElement' => '∉', - 'NotEqual' => '≠', - 'NotEqualTilde' => '≂̸', - 'NotExists' => '∄', - 'NotGreater' => '≯', - 'NotGreaterEqual' => '≱', - 'NotGreaterFullEqual' => '≧̸', - 'NotGreaterGreater' => '≫̸', - 'NotGreaterLess' => '≹', - 'NotGreaterSlantEqual' => '⩾̸', - 'NotGreaterTilde' => '≵', - 'NotHumpDownHump' => '≎̸', - 'NotHumpEqual' => '≏̸', - 'notin' => '∉', - 'notindot' => '⋵̸', - 'notinE' => '⋹̸', - 'notinva' => '∉', - 'notinvb' => '⋷', - 'notinvc' => '⋶', - 'NotLeftTriangle' => '⋪', - 'NotLeftTriangleBar' => '⧏̸', - 'NotLeftTriangleEqual' => '⋬', - 'NotLess' => '≮', - 'NotLessEqual' => '≰', - 'NotLessGreater' => '≸', - 'NotLessLess' => '≪̸', - 'NotLessSlantEqual' => '⩽̸', - 'NotLessTilde' => '≴', - 'NotNestedGreaterGreater' => '⪢̸', - 'NotNestedLessLess' => '⪡̸', - 'notni' => '∌', - 'notniva' => '∌', - 'notnivb' => '⋾', - 'notnivc' => '⋽', - 'NotPrecedes' => '⊀', - 'NotPrecedesEqual' => '⪯̸', - 'NotPrecedesSlantEqual' => '⋠', - 'NotReverseElement' => '∌', - 'NotRightTriangle' => '⋫', - 'NotRightTriangleBar' => '⧐̸', - 'NotRightTriangleEqual' => '⋭', - 'NotSquareSubset' => '⊏̸', - 'NotSquareSubsetEqual' => '⋢', - 'NotSquareSuperset' => '⊐̸', - 'NotSquareSupersetEqual' => '⋣', - 'NotSubset' => '⊂⃒', - 'NotSubsetEqual' => '⊈', - 'NotSucceeds' => '⊁', - 'NotSucceedsEqual' => '⪰̸', - 'NotSucceedsSlantEqual' => '⋡', - 'NotSucceedsTilde' => '≿̸', - 'NotSuperset' => '⊃⃒', - 'NotSupersetEqual' => '⊉', - 'NotTilde' => '≁', - 'NotTildeEqual' => '≄', - 'NotTildeFullEqual' => '≇', - 'NotTildeTilde' => '≉', - 'NotVerticalBar' => '∤', - 'npar' => '∦', - 'nparallel' => '∦', - 'nparsl' => '⫽⃥', - 'npart' => '∂̸', - 'npolint' => '⨔', - 'npr' => '⊀', - 'nprcue' => '⋠', - 'npre' => '⪯̸', - 'nprec' => '⊀', - 'npreceq' => '⪯̸', - 'nrArr' => '⇏', - 'nrarr' => '↛', - 'nrarrc' => '⤳̸', - 'nrarrw' => '↝̸', - 'nRightarrow' => '⇏', - 'nrightarrow' => '↛', - 'nrtri' => '⋫', - 'nrtrie' => '⋭', - 'nsc' => '⊁', - 'nsccue' => '⋡', - 'nsce' => '⪰̸', - 'Nscr' => '𝒩', - 'nscr' => '𝓃', - 'nshortmid' => '∤', - 'nshortparallel' => '∦', - 'nsim' => '≁', - 'nsime' => '≄', - 'nsimeq' => '≄', - 'nsmid' => '∤', - 'nspar' => '∦', - 'nsqsube' => '⋢', - 'nsqsupe' => '⋣', - 'nsub' => '⊄', - 'nsubE' => '⫅̸', - 'nsube' => '⊈', - 'nsubset' => '⊂⃒', - 'nsubseteq' => '⊈', - 'nsubseteqq' => '⫅̸', - 'nsucc' => '⊁', - 'nsucceq' => '⪰̸', - 'nsup' => '⊅', - 'nsupE' => '⫆̸', - 'nsupe' => '⊉', - 'nsupset' => '⊃⃒', - 'nsupseteq' => '⊉', - 'nsupseteqq' => '⫆̸', - 'ntgl' => '≹', - 'Ntilde' => 'Ñ', - 'Ntild' => 'Ñ', - 'ntilde' => 'ñ', - 'ntild' => 'ñ', - 'ntlg' => '≸', - 'ntriangleleft' => '⋪', - 'ntrianglelefteq' => '⋬', - 'ntriangleright' => '⋫', - 'ntrianglerighteq' => '⋭', - 'Nu' => 'Ν', - 'nu' => 'ν', - 'num' => '#', - 'numero' => '№', - 'numsp' => ' ', - 'nvap' => '≍⃒', - 'nVDash' => '⊯', - 'nVdash' => '⊮', - 'nvDash' => '⊭', - 'nvdash' => '⊬', - 'nvge' => '≥⃒', - 'nvgt' => '>⃒', - 'nvHarr' => '⤄', - 'nvinfin' => '⧞', - 'nvlArr' => '⤂', - 'nvle' => '≤⃒', - 'nvlt' => '<⃒', - 'nvltrie' => '⊴⃒', - 'nvrArr' => '⤃', - 'nvrtrie' => '⊵⃒', - 'nvsim' => '∼⃒', - 'nwarhk' => '⤣', - 'nwArr' => '⇖', - 'nwarr' => '↖', - 'nwarrow' => '↖', - 'nwnear' => '⤧', - 'Oacute' => 'Ó', - 'Oacut' => 'Ó', - 'oacute' => 'ó', - 'oacut' => 'ó', - 'oast' => '⊛', - 'ocir' => 'ô', - 'Ocirc' => 'Ô', - 'Ocir' => 'Ô', - 'ocirc' => 'ô', - 'Ocy' => 'О', - 'ocy' => 'о', - 'odash' => '⊝', - 'Odblac' => 'Ő', - 'odblac' => 'ő', - 'odiv' => '⨸', - 'odot' => '⊙', - 'odsold' => '⦼', - 'OElig' => 'Œ', - 'oelig' => 'œ', - 'ofcir' => '⦿', - 'Ofr' => '𝔒', - 'ofr' => '𝔬', - 'ogon' => '˛', - 'Ograve' => 'Ò', - 'Ograv' => 'Ò', - 'ograve' => 'ò', - 'ograv' => 'ò', - 'ogt' => '⧁', - 'ohbar' => '⦵', - 'ohm' => 'Ω', - 'oint' => '∮', - 'olarr' => '↺', - 'olcir' => '⦾', - 'olcross' => '⦻', - 'oline' => '‾', - 'olt' => '⧀', - 'Omacr' => 'Ō', - 'omacr' => 'ō', - 'Omega' => 'Ω', - 'omega' => 'ω', - 'Omicron' => 'Ο', - 'omicron' => 'ο', - 'omid' => '⦶', - 'ominus' => '⊖', - 'Oopf' => '𝕆', - 'oopf' => '𝕠', - 'opar' => '⦷', - 'OpenCurlyDoubleQuote' => '“', - 'OpenCurlyQuote' => '‘', - 'operp' => '⦹', - 'oplus' => '⊕', - 'Or' => '⩔', - 'or' => '∨', - 'orarr' => '↻', - 'ord' => 'º', - 'order' => 'ℴ', - 'orderof' => 'ℴ', - 'ordf' => 'ª', - 'ordm' => 'º', - 'origof' => '⊶', - 'oror' => '⩖', - 'orslope' => '⩗', - 'orv' => '⩛', - 'oS' => 'Ⓢ', - 'Oscr' => '𝒪', - 'oscr' => 'ℴ', - 'Oslash' => 'Ø', - 'Oslas' => 'Ø', - 'oslash' => 'ø', - 'oslas' => 'ø', - 'osol' => '⊘', - 'Otilde' => 'Õ', - 'Otild' => 'Õ', - 'otilde' => 'õ', - 'otild' => 'õ', - 'Otimes' => '⨷', - 'otimes' => '⊗', - 'otimesas' => '⨶', - 'Ouml' => 'Ö', - 'Oum' => 'Ö', - 'ouml' => 'ö', - 'oum' => 'ö', - 'ovbar' => '⌽', - 'OverBar' => '‾', - 'OverBrace' => '⏞', - 'OverBracket' => '⎴', - 'OverParenthesis' => '⏜', - 'par' => '¶', - 'para' => '¶', - 'parallel' => '∥', - 'parsim' => '⫳', - 'parsl' => '⫽', - 'part' => '∂', - 'PartialD' => '∂', - 'Pcy' => 'П', - 'pcy' => 'п', - 'percnt' => '%', - 'period' => '.', - 'permil' => '‰', - 'perp' => '⊥', - 'pertenk' => '‱', - 'Pfr' => '𝔓', - 'pfr' => '𝔭', - 'Phi' => 'Φ', - 'phi' => 'φ', - 'phiv' => 'ϕ', - 'phmmat' => 'ℳ', - 'phone' => '☎', - 'Pi' => 'Π', - 'pi' => 'π', - 'pitchfork' => '⋔', - 'piv' => 'ϖ', - 'planck' => 'ℏ', - 'planckh' => 'ℎ', - 'plankv' => 'ℏ', - 'plus' => '+', - 'plusacir' => '⨣', - 'plusb' => '⊞', - 'pluscir' => '⨢', - 'plusdo' => '∔', - 'plusdu' => '⨥', - 'pluse' => '⩲', - 'PlusMinus' => '±', - 'plusmn' => '±', - 'plusm' => '±', - 'plussim' => '⨦', - 'plustwo' => '⨧', - 'pm' => '±', - 'Poincareplane' => 'ℌ', - 'pointint' => '⨕', - 'Popf' => 'ℙ', - 'popf' => '𝕡', - 'pound' => '£', - 'poun' => '£', - 'Pr' => '⪻', - 'pr' => '≺', - 'prap' => '⪷', - 'prcue' => '≼', - 'prE' => '⪳', - 'pre' => '⪯', - 'prec' => '≺', - 'precapprox' => '⪷', - 'preccurlyeq' => '≼', - 'Precedes' => '≺', - 'PrecedesEqual' => '⪯', - 'PrecedesSlantEqual' => '≼', - 'PrecedesTilde' => '≾', - 'preceq' => '⪯', - 'precnapprox' => '⪹', - 'precneqq' => '⪵', - 'precnsim' => '⋨', - 'precsim' => '≾', - 'Prime' => '″', - 'prime' => '′', - 'primes' => 'ℙ', - 'prnap' => '⪹', - 'prnE' => '⪵', - 'prnsim' => '⋨', - 'prod' => '∏', - 'Product' => '∏', - 'profalar' => '⌮', - 'profline' => '⌒', - 'profsurf' => '⌓', - 'prop' => '∝', - 'Proportion' => '∷', - 'Proportional' => '∝', - 'propto' => '∝', - 'prsim' => '≾', - 'prurel' => '⊰', - 'Pscr' => '𝒫', - 'pscr' => '𝓅', - 'Psi' => 'Ψ', - 'psi' => 'ψ', - 'puncsp' => ' ', - 'Qfr' => '𝔔', - 'qfr' => '𝔮', - 'qint' => '⨌', - 'Qopf' => 'ℚ', - 'qopf' => '𝕢', - 'qprime' => '⁗', - 'Qscr' => '𝒬', - 'qscr' => '𝓆', - 'quaternions' => 'ℍ', - 'quatint' => '⨖', - 'quest' => '?', - 'questeq' => '≟', - 'QUOT' => '"', - 'QUO' => '"', - 'quot' => '"', - 'quo' => '"', - 'rAarr' => '⇛', - 'race' => '∽̱', - 'Racute' => 'Ŕ', - 'racute' => 'ŕ', - 'radic' => '√', - 'raemptyv' => '⦳', - 'Rang' => '⟫', - 'rang' => '⟩', - 'rangd' => '⦒', - 'range' => '⦥', - 'rangle' => '⟩', - 'raquo' => '»', - 'raqu' => '»', - 'Rarr' => '↠', - 'rArr' => '⇒', - 'rarr' => '→', - 'rarrap' => '⥵', - 'rarrb' => '⇥', - 'rarrbfs' => '⤠', - 'rarrc' => '⤳', - 'rarrfs' => '⤞', - 'rarrhk' => '↪', - 'rarrlp' => '↬', - 'rarrpl' => '⥅', - 'rarrsim' => '⥴', - 'Rarrtl' => '⤖', - 'rarrtl' => '↣', - 'rarrw' => '↝', - 'rAtail' => '⤜', - 'ratail' => '⤚', - 'ratio' => '∶', - 'rationals' => 'ℚ', - 'RBarr' => '⤐', - 'rBarr' => '⤏', - 'rbarr' => '⤍', - 'rbbrk' => '❳', - 'rbrace' => '}', - 'rbrack' => ']', - 'rbrke' => '⦌', - 'rbrksld' => '⦎', - 'rbrkslu' => '⦐', - 'Rcaron' => 'Ř', - 'rcaron' => 'ř', - 'Rcedil' => 'Ŗ', - 'rcedil' => 'ŗ', - 'rceil' => '⌉', - 'rcub' => '}', - 'Rcy' => 'Р', - 'rcy' => 'р', - 'rdca' => '⤷', - 'rdldhar' => '⥩', - 'rdquo' => '”', - 'rdquor' => '”', - 'rdsh' => '↳', - 'Re' => 'ℜ', - 'real' => 'ℜ', - 'realine' => 'ℛ', - 'realpart' => 'ℜ', - 'reals' => 'ℝ', - 'rect' => '▭', - 'REG' => '®', - 'RE' => '®', - 'reg' => '®', - 're' => '®', - 'ReverseElement' => '∋', - 'ReverseEquilibrium' => '⇋', - 'ReverseUpEquilibrium' => '⥯', - 'rfisht' => '⥽', - 'rfloor' => '⌋', - 'Rfr' => 'ℜ', - 'rfr' => '𝔯', - 'rHar' => '⥤', - 'rhard' => '⇁', - 'rharu' => '⇀', - 'rharul' => '⥬', - 'Rho' => 'Ρ', - 'rho' => 'ρ', - 'rhov' => 'ϱ', - 'RightAngleBracket' => '⟩', - 'RightArrow' => '→', - 'Rightarrow' => '⇒', - 'rightarrow' => '→', - 'RightArrowBar' => '⇥', - 'RightArrowLeftArrow' => '⇄', - 'rightarrowtail' => '↣', - 'RightCeiling' => '⌉', - 'RightDoubleBracket' => '⟧', - 'RightDownTeeVector' => '⥝', - 'RightDownVector' => '⇂', - 'RightDownVectorBar' => '⥕', - 'RightFloor' => '⌋', - 'rightharpoondown' => '⇁', - 'rightharpoonup' => '⇀', - 'rightleftarrows' => '⇄', - 'rightleftharpoons' => '⇌', - 'rightrightarrows' => '⇉', - 'rightsquigarrow' => '↝', - 'RightTee' => '⊢', - 'RightTeeArrow' => '↦', - 'RightTeeVector' => '⥛', - 'rightthreetimes' => '⋌', - 'RightTriangle' => '⊳', - 'RightTriangleBar' => '⧐', - 'RightTriangleEqual' => '⊵', - 'RightUpDownVector' => '⥏', - 'RightUpTeeVector' => '⥜', - 'RightUpVector' => '↾', - 'RightUpVectorBar' => '⥔', - 'RightVector' => '⇀', - 'RightVectorBar' => '⥓', - 'ring' => '˚', - 'risingdotseq' => '≓', - 'rlarr' => '⇄', - 'rlhar' => '⇌', - 'rlm' => '‏', - 'rmoust' => '⎱', - 'rmoustache' => '⎱', - 'rnmid' => '⫮', - 'roang' => '⟭', - 'roarr' => '⇾', - 'robrk' => '⟧', - 'ropar' => '⦆', - 'Ropf' => 'ℝ', - 'ropf' => '𝕣', - 'roplus' => '⨮', - 'rotimes' => '⨵', - 'RoundImplies' => '⥰', - 'rpar' => ')', - 'rpargt' => '⦔', - 'rppolint' => '⨒', - 'rrarr' => '⇉', - 'Rrightarrow' => '⇛', - 'rsaquo' => '›', - 'Rscr' => 'ℛ', - 'rscr' => '𝓇', - 'Rsh' => '↱', - 'rsh' => '↱', - 'rsqb' => ']', - 'rsquo' => '’', - 'rsquor' => '’', - 'rthree' => '⋌', - 'rtimes' => '⋊', - 'rtri' => '▹', - 'rtrie' => '⊵', - 'rtrif' => '▸', - 'rtriltri' => '⧎', - 'RuleDelayed' => '⧴', - 'ruluhar' => '⥨', - 'rx' => '℞', - 'Sacute' => 'Ś', - 'sacute' => 'ś', - 'sbquo' => '‚', - 'Sc' => '⪼', - 'sc' => '≻', - 'scap' => '⪸', - 'Scaron' => 'Š', - 'scaron' => 'š', - 'sccue' => '≽', - 'scE' => '⪴', - 'sce' => '⪰', - 'Scedil' => 'Ş', - 'scedil' => 'ş', - 'Scirc' => 'Ŝ', - 'scirc' => 'ŝ', - 'scnap' => '⪺', - 'scnE' => '⪶', - 'scnsim' => '⋩', - 'scpolint' => '⨓', - 'scsim' => '≿', - 'Scy' => 'С', - 'scy' => 'с', - 'sdot' => '⋅', - 'sdotb' => '⊡', - 'sdote' => '⩦', - 'searhk' => '⤥', - 'seArr' => '⇘', - 'searr' => '↘', - 'searrow' => '↘', - 'sect' => '§', - 'sec' => '§', - 'semi' => ';', - 'seswar' => '⤩', - 'setminus' => '∖', - 'setmn' => '∖', - 'sext' => '✶', - 'Sfr' => '𝔖', - 'sfr' => '𝔰', - 'sfrown' => '⌢', - 'sharp' => '♯', - 'SHCHcy' => 'Щ', - 'shchcy' => 'щ', - 'SHcy' => 'Ш', - 'shcy' => 'ш', - 'ShortDownArrow' => '↓', - 'ShortLeftArrow' => '←', - 'shortmid' => '∣', - 'shortparallel' => '∥', - 'ShortRightArrow' => '→', - 'ShortUpArrow' => '↑', - 'shy' => '­', - 'sh' => '­', - 'Sigma' => 'Σ', - 'sigma' => 'σ', - 'sigmaf' => 'ς', - 'sigmav' => 'ς', - 'sim' => '∼', - 'simdot' => '⩪', - 'sime' => '≃', - 'simeq' => '≃', - 'simg' => '⪞', - 'simgE' => '⪠', - 'siml' => '⪝', - 'simlE' => '⪟', - 'simne' => '≆', - 'simplus' => '⨤', - 'simrarr' => '⥲', - 'slarr' => '←', - 'SmallCircle' => '∘', - 'smallsetminus' => '∖', - 'smashp' => '⨳', - 'smeparsl' => '⧤', - 'smid' => '∣', - 'smile' => '⌣', - 'smt' => '⪪', - 'smte' => '⪬', - 'smtes' => '⪬︀', - 'SOFTcy' => 'Ь', - 'softcy' => 'ь', - 'sol' => '/', - 'solb' => '⧄', - 'solbar' => '⌿', - 'Sopf' => '𝕊', - 'sopf' => '𝕤', - 'spades' => '♠', - 'spadesuit' => '♠', - 'spar' => '∥', - 'sqcap' => '⊓', - 'sqcaps' => '⊓︀', - 'sqcup' => '⊔', - 'sqcups' => '⊔︀', - 'Sqrt' => '√', - 'sqsub' => '⊏', - 'sqsube' => '⊑', - 'sqsubset' => '⊏', - 'sqsubseteq' => '⊑', - 'sqsup' => '⊐', - 'sqsupe' => '⊒', - 'sqsupset' => '⊐', - 'sqsupseteq' => '⊒', - 'squ' => '□', - 'Square' => '□', - 'square' => '□', - 'SquareIntersection' => '⊓', - 'SquareSubset' => '⊏', - 'SquareSubsetEqual' => '⊑', - 'SquareSuperset' => '⊐', - 'SquareSupersetEqual' => '⊒', - 'SquareUnion' => '⊔', - 'squarf' => '▪', - 'squf' => '▪', - 'srarr' => '→', - 'Sscr' => '𝒮', - 'sscr' => '𝓈', - 'ssetmn' => '∖', - 'ssmile' => '⌣', - 'sstarf' => '⋆', - 'Star' => '⋆', - 'star' => '☆', - 'starf' => '★', - 'straightepsilon' => 'ϵ', - 'straightphi' => 'ϕ', - 'strns' => '¯', - 'Sub' => '⋐', - 'sub' => '⊂', - 'subdot' => '⪽', - 'subE' => '⫅', - 'sube' => '⊆', - 'subedot' => '⫃', - 'submult' => '⫁', - 'subnE' => '⫋', - 'subne' => '⊊', - 'subplus' => '⪿', - 'subrarr' => '⥹', - 'Subset' => '⋐', - 'subset' => '⊂', - 'subseteq' => '⊆', - 'subseteqq' => '⫅', - 'SubsetEqual' => '⊆', - 'subsetneq' => '⊊', - 'subsetneqq' => '⫋', - 'subsim' => '⫇', - 'subsub' => '⫕', - 'subsup' => '⫓', - 'succ' => '≻', - 'succapprox' => '⪸', - 'succcurlyeq' => '≽', - 'Succeeds' => '≻', - 'SucceedsEqual' => '⪰', - 'SucceedsSlantEqual' => '≽', - 'SucceedsTilde' => '≿', - 'succeq' => '⪰', - 'succnapprox' => '⪺', - 'succneqq' => '⪶', - 'succnsim' => '⋩', - 'succsim' => '≿', - 'SuchThat' => '∋', - 'Sum' => '∑', - 'sum' => '∑', - 'sung' => '♪', - 'Sup' => '⋑', - 'sup' => '³', - 'sup1' => '¹', - 'sup2' => '²', - 'sup3' => '³', - 'supdot' => '⪾', - 'supdsub' => '⫘', - 'supE' => '⫆', - 'supe' => '⊇', - 'supedot' => '⫄', - 'Superset' => '⊃', - 'SupersetEqual' => '⊇', - 'suphsol' => '⟉', - 'suphsub' => '⫗', - 'suplarr' => '⥻', - 'supmult' => '⫂', - 'supnE' => '⫌', - 'supne' => '⊋', - 'supplus' => '⫀', - 'Supset' => '⋑', - 'supset' => '⊃', - 'supseteq' => '⊇', - 'supseteqq' => '⫆', - 'supsetneq' => '⊋', - 'supsetneqq' => '⫌', - 'supsim' => '⫈', - 'supsub' => '⫔', - 'supsup' => '⫖', - 'swarhk' => '⤦', - 'swArr' => '⇙', - 'swarr' => '↙', - 'swarrow' => '↙', - 'swnwar' => '⤪', - 'szlig' => 'ß', - 'szli' => 'ß', - 'Tab' => ' ', - 'target' => '⌖', - 'Tau' => 'Τ', - 'tau' => 'τ', - 'tbrk' => '⎴', - 'Tcaron' => 'Ť', - 'tcaron' => 'ť', - 'Tcedil' => 'Ţ', - 'tcedil' => 'ţ', - 'Tcy' => 'Т', - 'tcy' => 'т', - 'tdot' => '⃛', - 'telrec' => '⌕', - 'Tfr' => '𝔗', - 'tfr' => '𝔱', - 'there4' => '∴', - 'Therefore' => '∴', - 'therefore' => '∴', - 'Theta' => 'Θ', - 'theta' => 'θ', - 'thetasym' => 'ϑ', - 'thetav' => 'ϑ', - 'thickapprox' => '≈', - 'thicksim' => '∼', - 'ThickSpace' => '  ', - 'thinsp' => ' ', - 'ThinSpace' => ' ', - 'thkap' => '≈', - 'thksim' => '∼', - 'THORN' => 'Þ', - 'THOR' => 'Þ', - 'thorn' => 'þ', - 'thor' => 'þ', - 'Tilde' => '∼', - 'tilde' => '˜', - 'TildeEqual' => '≃', - 'TildeFullEqual' => '≅', - 'TildeTilde' => '≈', - 'times' => '×', - 'time' => '×', - 'timesb' => '⊠', - 'timesbar' => '⨱', - 'timesd' => '⨰', - 'tint' => '∭', - 'toea' => '⤨', - 'top' => '⊤', - 'topbot' => '⌶', - 'topcir' => '⫱', - 'Topf' => '𝕋', - 'topf' => '𝕥', - 'topfork' => '⫚', - 'tosa' => '⤩', - 'tprime' => '‴', - 'TRADE' => '™', - 'trade' => '™', - 'triangle' => '▵', - 'triangledown' => '▿', - 'triangleleft' => '◃', - 'trianglelefteq' => '⊴', - 'triangleq' => '≜', - 'triangleright' => '▹', - 'trianglerighteq' => '⊵', - 'tridot' => '◬', - 'trie' => '≜', - 'triminus' => '⨺', - 'TripleDot' => '⃛', - 'triplus' => '⨹', - 'trisb' => '⧍', - 'tritime' => '⨻', - 'trpezium' => '⏢', - 'Tscr' => '𝒯', - 'tscr' => '𝓉', - 'TScy' => 'Ц', - 'tscy' => 'ц', - 'TSHcy' => 'Ћ', - 'tshcy' => 'ћ', - 'Tstrok' => 'Ŧ', - 'tstrok' => 'ŧ', - 'twixt' => '≬', - 'twoheadleftarrow' => '↞', - 'twoheadrightarrow' => '↠', - 'Uacute' => 'Ú', - 'Uacut' => 'Ú', - 'uacute' => 'ú', - 'uacut' => 'ú', - 'Uarr' => '↟', - 'uArr' => '⇑', - 'uarr' => '↑', - 'Uarrocir' => '⥉', - 'Ubrcy' => 'Ў', - 'ubrcy' => 'ў', - 'Ubreve' => 'Ŭ', - 'ubreve' => 'ŭ', - 'Ucirc' => 'Û', - 'Ucir' => 'Û', - 'ucirc' => 'û', - 'ucir' => 'û', - 'Ucy' => 'У', - 'ucy' => 'у', - 'udarr' => '⇅', - 'Udblac' => 'Ű', - 'udblac' => 'ű', - 'udhar' => '⥮', - 'ufisht' => '⥾', - 'Ufr' => '𝔘', - 'ufr' => '𝔲', - 'Ugrave' => 'Ù', - 'Ugrav' => 'Ù', - 'ugrave' => 'ù', - 'ugrav' => 'ù', - 'uHar' => '⥣', - 'uharl' => '↿', - 'uharr' => '↾', - 'uhblk' => '▀', - 'ulcorn' => '⌜', - 'ulcorner' => '⌜', - 'ulcrop' => '⌏', - 'ultri' => '◸', - 'Umacr' => 'Ū', - 'umacr' => 'ū', - 'uml' => '¨', - 'um' => '¨', - 'UnderBar' => '_', - 'UnderBrace' => '⏟', - 'UnderBracket' => '⎵', - 'UnderParenthesis' => '⏝', - 'Union' => '⋃', - 'UnionPlus' => '⊎', - 'Uogon' => 'Ų', - 'uogon' => 'ų', - 'Uopf' => '𝕌', - 'uopf' => '𝕦', - 'UpArrow' => '↑', - 'Uparrow' => '⇑', - 'uparrow' => '↑', - 'UpArrowBar' => '⤒', - 'UpArrowDownArrow' => '⇅', - 'UpDownArrow' => '↕', - 'Updownarrow' => '⇕', - 'updownarrow' => '↕', - 'UpEquilibrium' => '⥮', - 'upharpoonleft' => '↿', - 'upharpoonright' => '↾', - 'uplus' => '⊎', - 'UpperLeftArrow' => '↖', - 'UpperRightArrow' => '↗', - 'Upsi' => 'ϒ', - 'upsi' => 'υ', - 'upsih' => 'ϒ', - 'Upsilon' => 'Υ', - 'upsilon' => 'υ', - 'UpTee' => '⊥', - 'UpTeeArrow' => '↥', - 'upuparrows' => '⇈', - 'urcorn' => '⌝', - 'urcorner' => '⌝', - 'urcrop' => '⌎', - 'Uring' => 'Ů', - 'uring' => 'ů', - 'urtri' => '◹', - 'Uscr' => '𝒰', - 'uscr' => '𝓊', - 'utdot' => '⋰', - 'Utilde' => 'Ũ', - 'utilde' => 'ũ', - 'utri' => '▵', - 'utrif' => '▴', - 'uuarr' => '⇈', - 'Uuml' => 'Ü', - 'Uum' => 'Ü', - 'uuml' => 'ü', - 'uum' => 'ü', - 'uwangle' => '⦧', - 'vangrt' => '⦜', - 'varepsilon' => 'ϵ', - 'varkappa' => 'ϰ', - 'varnothing' => '∅', - 'varphi' => 'ϕ', - 'varpi' => 'ϖ', - 'varpropto' => '∝', - 'vArr' => '⇕', - 'varr' => '↕', - 'varrho' => 'ϱ', - 'varsigma' => 'ς', - 'varsubsetneq' => '⊊︀', - 'varsubsetneqq' => '⫋︀', - 'varsupsetneq' => '⊋︀', - 'varsupsetneqq' => '⫌︀', - 'vartheta' => 'ϑ', - 'vartriangleleft' => '⊲', - 'vartriangleright' => '⊳', - 'Vbar' => '⫫', - 'vBar' => '⫨', - 'vBarv' => '⫩', - 'Vcy' => 'В', - 'vcy' => 'в', - 'VDash' => '⊫', - 'Vdash' => '⊩', - 'vDash' => '⊨', - 'vdash' => '⊢', - 'Vdashl' => '⫦', - 'Vee' => '⋁', - 'vee' => '∨', - 'veebar' => '⊻', - 'veeeq' => '≚', - 'vellip' => '⋮', - 'Verbar' => '‖', - 'verbar' => '|', - 'Vert' => '‖', - 'vert' => '|', - 'VerticalBar' => '∣', - 'VerticalLine' => '|', - 'VerticalSeparator' => '❘', - 'VerticalTilde' => '≀', - 'VeryThinSpace' => ' ', - 'Vfr' => '𝔙', - 'vfr' => '𝔳', - 'vltri' => '⊲', - 'vnsub' => '⊂⃒', - 'vnsup' => '⊃⃒', - 'Vopf' => '𝕍', - 'vopf' => '𝕧', - 'vprop' => '∝', - 'vrtri' => '⊳', - 'Vscr' => '𝒱', - 'vscr' => '𝓋', - 'vsubnE' => '⫋︀', - 'vsubne' => '⊊︀', - 'vsupnE' => '⫌︀', - 'vsupne' => '⊋︀', - 'Vvdash' => '⊪', - 'vzigzag' => '⦚', - 'Wcirc' => 'Ŵ', - 'wcirc' => 'ŵ', - 'wedbar' => '⩟', - 'Wedge' => '⋀', - 'wedge' => '∧', - 'wedgeq' => '≙', - 'weierp' => '℘', - 'Wfr' => '𝔚', - 'wfr' => '𝔴', - 'Wopf' => '𝕎', - 'wopf' => '𝕨', - 'wp' => '℘', - 'wr' => '≀', - 'wreath' => '≀', - 'Wscr' => '𝒲', - 'wscr' => '𝓌', - 'xcap' => '⋂', - 'xcirc' => '◯', - 'xcup' => '⋃', - 'xdtri' => '▽', - 'Xfr' => '𝔛', - 'xfr' => '𝔵', - 'xhArr' => '⟺', - 'xharr' => '⟷', - 'Xi' => 'Ξ', - 'xi' => 'ξ', - 'xlArr' => '⟸', - 'xlarr' => '⟵', - 'xmap' => '⟼', - 'xnis' => '⋻', - 'xodot' => '⨀', - 'Xopf' => '𝕏', - 'xopf' => '𝕩', - 'xoplus' => '⨁', - 'xotime' => '⨂', - 'xrArr' => '⟹', - 'xrarr' => '⟶', - 'Xscr' => '𝒳', - 'xscr' => '𝓍', - 'xsqcup' => '⨆', - 'xuplus' => '⨄', - 'xutri' => '△', - 'xvee' => '⋁', - 'xwedge' => '⋀', - 'Yacute' => 'Ý', - 'Yacut' => 'Ý', - 'yacute' => 'ý', - 'yacut' => 'ý', - 'YAcy' => 'Я', - 'yacy' => 'я', - 'Ycirc' => 'Ŷ', - 'ycirc' => 'ŷ', - 'Ycy' => 'Ы', - 'ycy' => 'ы', - 'yen' => '¥', - 'ye' => '¥', - 'Yfr' => '𝔜', - 'yfr' => '𝔶', - 'YIcy' => 'Ї', - 'yicy' => 'ї', - 'Yopf' => '𝕐', - 'yopf' => '𝕪', - 'Yscr' => '𝒴', - 'yscr' => '𝓎', - 'YUcy' => 'Ю', - 'yucy' => 'ю', - 'Yuml' => 'Ÿ', - 'yuml' => 'ÿ', - 'yum' => 'ÿ', - 'Zacute' => 'Ź', - 'zacute' => 'ź', - 'Zcaron' => 'Ž', - 'zcaron' => 'ž', - 'Zcy' => 'З', - 'zcy' => 'з', - 'Zdot' => 'Ż', - 'zdot' => 'ż', - 'zeetrf' => 'ℨ', - 'ZeroWidthSpace' => '​', - 'Zeta' => 'Ζ', - 'zeta' => 'ζ', - 'Zfr' => 'ℨ', - 'zfr' => '𝔷', - 'ZHcy' => 'Ж', - 'zhcy' => 'ж', - 'zigrarr' => '⇝', - 'Zopf' => 'ℤ', - 'zopf' => '𝕫', - 'Zscr' => '𝒵', - 'zscr' => '𝓏', - 'zwj' => '‍', - 'zwnj' => '‌' - ); -} diff --git a/core/vendor/masterminds/html5/src/HTML5/Exception.php b/core/vendor/masterminds/html5/src/HTML5/Exception.php deleted file mode 100644 index 8f33126..0000000 --- a/core/vendor/masterminds/html5/src/HTML5/Exception.php +++ /dev/null @@ -1,9 +0,0 @@ - self::NAMESPACE_HTML, - 'svg' => self::NAMESPACE_SVG, - 'math' => self::NAMESPACE_MATHML - ); - - /** - * Holds the always available namespaces (which does not require the XMLNS declaration). - * - * @var array - */ - protected $implicitNamespaces = array( - 'xml' => self::NAMESPACE_XML, - 'xmlns' => self::NAMESPACE_XMLNS, - 'xlink' => self::NAMESPACE_XLINK - ); - - /** - * Holds a stack of currently active namespaces. - * - * @var array - */ - protected $nsStack = array(); - - /** - * Holds the number of namespaces declared by a node. - * - * @var array - */ - protected $pushes = array(); - - /** - * Defined in 8.2.5. - */ - const IM_INITIAL = 0; - - const IM_BEFORE_HTML = 1; - - const IM_BEFORE_HEAD = 2; - - const IM_IN_HEAD = 3; - - const IM_IN_HEAD_NOSCRIPT = 4; - - const IM_AFTER_HEAD = 5; - - const IM_IN_BODY = 6; - - const IM_TEXT = 7; - - const IM_IN_TABLE = 8; - - const IM_IN_TABLE_TEXT = 9; - - const IM_IN_CAPTION = 10; - - const IM_IN_COLUMN_GROUP = 11; - - const IM_IN_TABLE_BODY = 12; - - const IM_IN_ROW = 13; - - const IM_IN_CELL = 14; - - const IM_IN_SELECT = 15; - - const IM_IN_SELECT_IN_TABLE = 16; - - const IM_AFTER_BODY = 17; - - const IM_IN_FRAMESET = 18; - - const IM_AFTER_FRAMESET = 19; - - const IM_AFTER_AFTER_BODY = 20; - - const IM_AFTER_AFTER_FRAMESET = 21; - - const IM_IN_SVG = 22; - - const IM_IN_MATHML = 23; - - protected $options = array(); - - protected $stack = array(); - - protected $current; // Pointer in the tag hierarchy. - protected $doc; - - protected $frag; - - protected $processor; - - protected $insertMode = 0; - - /** - * Track if we are in an element that allows only inline child nodes - * @var string|null - */ - protected $onlyInline; - - /** - * Quirks mode is enabled by default. - * Any document that is missing the - * DT will be considered to be in quirks mode. - */ - protected $quirks = true; - - protected $errors = array(); - - public function __construct($isFragment = false, array $options = array()) - { - $this->options = $options; - - if (isset($options[self::OPT_TARGET_DOC])) { - $this->doc = $options[self::OPT_TARGET_DOC]; - } else { - $impl = new \DOMImplementation(); - // XXX: - // Create the doctype. For now, we are always creating HTML5 - // documents, and attempting to up-convert any older DTDs to HTML5. - $dt = $impl->createDocumentType('html'); - // $this->doc = \DOMImplementation::createDocument(NULL, 'html', $dt); - $this->doc = $impl->createDocument(null, null, $dt); - } - $this->errors = array(); - - $this->current = $this->doc; // ->documentElement; - - // Create a rules engine for tags. - $this->rules = new TreeBuildingRules($this->doc); - - $implicitNS = array(); - if (isset($this->options[self::OPT_IMPLICIT_NS])) { - $implicitNS = $this->options[self::OPT_IMPLICIT_NS]; - } elseif (isset($this->options["implicitNamespaces"])) { - $implicitNS = $this->options["implicitNamespaces"]; - } - - // Fill $nsStack with the defalut HTML5 namespaces, plus the "implicitNamespaces" array taken form $options - array_unshift($this->nsStack, $implicitNS + array( - '' => self::NAMESPACE_HTML - ) + $this->implicitNamespaces); - - if ($isFragment) { - $this->insertMode = static::IM_IN_BODY; - $this->frag = $this->doc->createDocumentFragment(); - $this->current = $this->frag; - } - } - - /** - * Get the document. - */ - public function document() - { - return $this->doc; - } - - /** - * Get the DOM fragment for the body. - * - * This returns a DOMNodeList because a fragment may have zero or more - * DOMNodes at its root. - * - * @see http://www.w3.org/TR/2012/CR-html5-20121217/syntax.html#concept-frag-parse-context - * - * @return \DOMFragmentDocumentFragment - */ - public function fragment() - { - return $this->frag; - } - - /** - * Provide an instruction processor. - * - * This is used for handling Processor Instructions as they are - * inserted. If omitted, PI's are inserted directly into the DOM tree. - */ - public function setInstructionProcessor(\Masterminds\HTML5\InstructionProcessor $proc) - { - $this->processor = $proc; - } - - public function doctype($name, $idType = 0, $id = null, $quirks = false) - { - // This is used solely for setting quirks mode. Currently we don't - // try to preserve the inbound DT. We convert it to HTML5. - $this->quirks = $quirks; - - if ($this->insertMode > static::IM_INITIAL) { - $this->parseError("Illegal placement of DOCTYPE tag. Ignoring: " . $name); - - return; - } - - $this->insertMode = static::IM_BEFORE_HTML; - } - - /** - * Process the start tag. - * - * @todo - XMLNS namespace handling (we need to parse, even if it's not valid) - * - XLink, MathML and SVG namespace handling - * - Omission rules: 8.1.2.4 Optional tags - */ - public function startTag($name, $attributes = array(), $selfClosing = false) - { - // fprintf(STDOUT, $name); - $lname = $this->normalizeTagName($name); - - // Make sure we have an html element. - if (! $this->doc->documentElement && $name !== 'html' && ! $this->frag) { - $this->startTag('html'); - } - - // Set quirks mode if we're at IM_INITIAL with no doctype. - if ($this->insertMode == static::IM_INITIAL) { - $this->quirks = true; - $this->parseError("No DOCTYPE specified."); - } - - // SPECIAL TAG HANDLING: - // Spec says do this, and "don't ask." - if ($name == 'image') { - $name = 'img'; - } - - // Autoclose p tags where appropriate. - if ($this->insertMode >= static::IM_IN_BODY && Elements::isA($name, Elements::AUTOCLOSE_P)) { - $this->autoclose('p'); - } - - // Set insert mode: - switch ($name) { - case 'html': - $this->insertMode = static::IM_BEFORE_HEAD; - break; - case 'head': - if ($this->insertMode > static::IM_BEFORE_HEAD) { - $this->parseError("Unexpected head tag outside of head context."); - } else { - $this->insertMode = static::IM_IN_HEAD; - } - break; - case 'body': - $this->insertMode = static::IM_IN_BODY; - break; - case 'svg': - $this->insertMode = static::IM_IN_SVG; - break; - case 'math': - $this->insertMode = static::IM_IN_MATHML; - break; - case 'noscript': - if ($this->insertMode == static::IM_IN_HEAD) { - $this->insertMode = static::IM_IN_HEAD_NOSCRIPT; - } - break; - } - - // Special case handling for SVG. - if ($this->insertMode == static::IM_IN_SVG) { - $lname = Elements::normalizeSvgElement($lname); - } - - $pushes = 0; - // when we found a tag thats appears inside $nsRoots, we have to switch the defalut namespace - if (isset($this->nsRoots[$lname]) && $this->nsStack[0][''] !== $this->nsRoots[$lname]) { - array_unshift($this->nsStack, array( - '' => $this->nsRoots[$lname] - ) + $this->nsStack[0]); - $pushes ++; - } - $needsWorkaround = false; - if (isset($this->options["xmlNamespaces"]) && $this->options["xmlNamespaces"]) { - // when xmlNamespaces is true a and we found a 'xmlns' or 'xmlns:*' attribute, we should add a new item to the $nsStack - foreach ($attributes as $aName => $aVal) { - if ($aName === 'xmlns') { - $needsWorkaround = $aVal; - array_unshift($this->nsStack, array( - '' => $aVal - ) + $this->nsStack[0]); - $pushes ++; - } elseif ((($pos = strpos($aName, ':')) ? substr($aName, 0, $pos) : '') === 'xmlns') { - array_unshift($this->nsStack, array( - substr($aName, $pos + 1) => $aVal - ) + $this->nsStack[0]); - $pushes ++; - } - } - } - - if ($this->onlyInline && Elements::isA($lname, Elements::BLOCK_TAG)) { - $this->autoclose($this->onlyInline); - $this->onlyInline = null; - } - - try { - $prefix = ($pos = strpos($lname, ':')) ? substr($lname, 0, $pos) : ''; - - - if ($needsWorkaround!==false) { - - $xml = "<$lname xmlns=\"$needsWorkaround\" ".(strlen($prefix) && isset($this->nsStack[0][$prefix])?("xmlns:$prefix=\"".$this->nsStack[0][$prefix]."\""):"")."/>"; - - $frag = new \DOMDocument('1.0', 'UTF-8'); - $frag->loadXML($xml); - - $ele = $this->doc->importNode($frag->documentElement, true); - - } else { - if (!isset($this->nsStack[0][$prefix]) || ($prefix === "" && isset($this->options[self::OPT_DISABLE_HTML_NS]) && $this->options[self::OPT_DISABLE_HTML_NS])) { - $ele = $this->doc->createElement($lname); - } else { - $ele = $this->doc->createElementNS($this->nsStack[0][$prefix], $lname); - } - } - - } catch (\DOMException $e) { - $this->parseError("Illegal tag name: <$lname>. Replaced with ."); - $ele = $this->doc->createElement('invalid'); - } - - if (Elements::isA($lname, Elements::BLOCK_ONLY_INLINE)) { - $this->onlyInline = $lname; - } - - // When we add some namespacess, we have to track them. Later, when "endElement" is invoked, we have to remove them. - // When we are on a void tag, we do not need to care about namesapce nesting. - if ($pushes > 0 && !Elements::isA($name, Elements::VOID_TAG)) { - // PHP tends to free the memory used by DOM, - // to avoid spl_object_hash collisions whe have to avoid garbage collection of $ele storing it into $pushes - // see https://bugs.php.net/bug.php?id=67459 - $this->pushes[spl_object_hash($ele)] = array($pushes, $ele); - - // SEE https://github.com/facebook/hhvm/issues/2962 - if (defined('HHVM_VERSION')) { - $ele->setAttribute('html5-php-fake-id-attribute', spl_object_hash($ele)); - } - } - - foreach ($attributes as $aName => $aVal) { - // xmlns attributes can't be set - if ($aName === 'xmlns') { - continue; - } - - if ($this->insertMode == static::IM_IN_SVG) { - $aName = Elements::normalizeSvgAttribute($aName); - } elseif ($this->insertMode == static::IM_IN_MATHML) { - $aName = Elements::normalizeMathMlAttribute($aName); - } - - try { - $prefix = ($pos = strpos($aName, ':')) ? substr($aName, 0, $pos) : false; - - if ($prefix==='xmlns') { - $ele->setAttributeNs(self::NAMESPACE_XMLNS, $aName, $aVal); - } elseif ($prefix!==false && isset($this->nsStack[0][$prefix])) { - $ele->setAttributeNs($this->nsStack[0][$prefix], $aName, $aVal); - } else { - $ele->setAttribute($aName, $aVal); - } - } catch (\DOMException $e) { - $this->parseError("Illegal attribute name for tag $name. Ignoring: $aName"); - continue; - } - - // This is necessary on a non-DTD schema, like HTML5. - if ($aName == 'id') { - $ele->setIdAttribute('id', true); - } - } - - // Some elements have special processing rules. Handle those separately. - if ($this->rules->hasRules($name) && $this->frag !== $this->current) { - $this->current = $this->rules->evaluate($ele, $this->current); - } // Otherwise, it's a standard element. - else { - $this->current->appendChild($ele); - - // XXX: Need to handle self-closing tags and unary tags. - if (! Elements::isA($name, Elements::VOID_TAG)) { - $this->current = $ele; - } - } - - // This is sort of a last-ditch attempt to correct for cases where no head/body - // elements are provided. - if ($this->insertMode <= static::IM_BEFORE_HEAD && $name != 'head' && $name != 'html') { - $this->insertMode = static::IM_IN_BODY; - } - - // When we are on a void tag, we do not need to care about namesapce nesting, - // but we have to remove the namespaces pushed to $nsStack. - if ($pushes > 0 && Elements::isA($name, Elements::VOID_TAG)) { - // remove the namespaced definded by current node - for ($i = 0; $i < $pushes; $i ++) { - array_shift($this->nsStack); - } - } - // Return the element mask, which the tokenizer can then use to set - // various processing rules. - return Elements::element($name); - } - - public function endTag($name) - { - $lname = $this->normalizeTagName($name); - - // Ignore closing tags for unary elements. - if (Elements::isA($name, Elements::VOID_TAG)) { - return; - } - - if ($this->insertMode <= static::IM_BEFORE_HTML) { - // 8.2.5.4.2 - if (in_array($name, array( - 'html', - 'br', - 'head', - 'title' - ))) { - $this->startTag('html'); - $this->endTag($name); - $this->insertMode = static::IM_BEFORE_HEAD; - - return; - } - - // Ignore the tag. - $this->parseError("Illegal closing tag at global scope."); - - return; - } - - // Special case handling for SVG. - if ($this->insertMode == static::IM_IN_SVG) { - $lname = Elements::normalizeSvgElement($lname); - } - - // See https://github.com/facebook/hhvm/issues/2962 - if (defined('HHVM_VERSION') && ($cid = $this->current->getAttribute('html5-php-fake-id-attribute'))) { - $this->current->removeAttribute('html5-php-fake-id-attribute'); - } else { - $cid = spl_object_hash($this->current); - } - - // XXX: Not sure whether we need this anymore. - // if ($name != $lname) { - // return $this->quirksTreeResolver($lname); - // } - - // XXX: HTML has no parent. What do we do, though, - // if this element appears in the wrong place? - if ($lname == 'html') { - return; - } - - // remove the namespaced definded by current node - if (isset($this->pushes[$cid])) { - for ($i = 0; $i < $this->pushes[$cid][0]; $i ++) { - array_shift($this->nsStack); - } - unset($this->pushes[$cid]); - } - - if (! $this->autoclose($lname)) { - $this->parseError('Could not find closing tag for ' . $lname); - } - - // switch ($this->insertMode) { - switch ($lname) { - case "head": - $this->insertMode = static::IM_AFTER_HEAD; - break; - case "body": - $this->insertMode = static::IM_AFTER_BODY; - break; - case "svg": - case "mathml": - $this->insertMode = static::IM_IN_BODY; - break; - } - } - - public function comment($cdata) - { - // TODO: Need to handle case where comment appears outside of the HTML tag. - $node = $this->doc->createComment($cdata); - $this->current->appendChild($node); - } - - public function text($data) - { - // XXX: Hmmm.... should we really be this strict? - if ($this->insertMode < static::IM_IN_HEAD) { - // Per '8.2.5.4.3 The "before head" insertion mode' the characters - // " \t\n\r\f" should be ignored but no mention of a parse error. This is - // practical as most documents contain these characters. Other text is not - // expected here so recording a parse error is necessary. - $dataTmp = trim($data, " \t\n\r\f"); - if (! empty($dataTmp)) { - // fprintf(STDOUT, "Unexpected insert mode: %d", $this->insertMode); - $this->parseError("Unexpected text. Ignoring: " . $dataTmp); - } - - return; - } - // fprintf(STDOUT, "Appending text %s.", $data); - $node = $this->doc->createTextNode($data); - $this->current->appendChild($node); - } - - public function eof() - { - // If the $current isn't the $root, do we need to do anything? - } - - public function parseError($msg, $line = 0, $col = 0) - { - $this->errors[] = sprintf("Line %d, Col %d: %s", $line, $col, $msg); - } - - public function getErrors() - { - return $this->errors; - } - - public function cdata($data) - { - $node = $this->doc->createCDATASection($data); - $this->current->appendChild($node); - } - - public function processingInstruction($name, $data = null) - { - // XXX: Ignore initial XML declaration, per the spec. - if ($this->insertMode == static::IM_INITIAL && 'xml' == strtolower($name)) { - return; - } - - // Important: The processor may modify the current DOM tree however - // it sees fit. - if (isset($this->processor)) { - $res = $this->processor->process($this->current, $name, $data); - if (! empty($res)) { - $this->current = $res; - } - - return; - } - - // Otherwise, this is just a dumb PI element. - $node = $this->doc->createProcessingInstruction($name, $data); - - $this->current->appendChild($node); - } - - // ========================================================================== - // UTILITIES - // ========================================================================== - - /** - * Apply normalization rules to a tag name. - * - * See sections 2.9 and 8.1.2. - * - * @param string $name - * The tag name. - * @return string The normalized tag name. - */ - protected function normalizeTagName($name) - { - /* - * Section 2.9 suggests that we should not do this. if (strpos($name, ':') !== false) { // We know from the grammar that there must be at least one other // char besides :, since : is not a legal tag start. $parts = explode(':', $name); return array_pop($parts); } - */ - return $name; - } - - protected function quirksTreeResolver($name) - { - throw new \Exception("Not implemented."); - } - - /** - * Automatically climb the tree and close the closest node with the matching $tag. - */ - protected function autoclose($tag) - { - $working = $this->current; - do { - if ($working->nodeType != XML_ELEMENT_NODE) { - return false; - } - if ($working->tagName == $tag) { - $this->current = $working->parentNode; - - return true; - } - } while ($working = $working->parentNode); - return false; - } - - /** - * Checks if the given tagname is an ancestor of the present candidate. - * - * If $this->current or anything above $this->current matches the given tag - * name, this returns true. - */ - protected function isAncestor($tagname) - { - $candidate = $this->current; - while ($candidate->nodeType === XML_ELEMENT_NODE) { - if ($candidate->tagName == $tagname) { - return true; - } - $candidate = $candidate->parentNode; - } - - return false; - } - - /** - * Returns true if the immediate parent element is of the given tagname. - */ - protected function isParent($tagname) - { - return $this->current->tagName == $tagname; - } -} \ No newline at end of file diff --git a/core/vendor/masterminds/html5/src/HTML5/Parser/EventHandler.php b/core/vendor/masterminds/html5/src/HTML5/Parser/EventHandler.php deleted file mode 100644 index 2d55347..0000000 --- a/core/vendor/masterminds/html5/src/HTML5/Parser/EventHandler.php +++ /dev/null @@ -1,122 +0,0 @@ -) - * @return numeric One of the Tokenizer::TEXTMODE_* constants. - */ - public function startTag($name, $attributes = array(), $selfClosing = false); - - /** - * An end-tag. - */ - public function endTag($name); - - /** - * A comment section (unparsed character data). - */ - public function comment($cdata); - - /** - * A unit of parsed character data. - * - * Entities in this text are *already decoded*. - */ - public function text($cdata); - - /** - * Indicates that the document has been entirely processed. - */ - public function eof(); - - /** - * Emitted when the parser encounters an error condition. - */ - public function parseError($msg, $line, $col); - - /** - * A CDATA section. - * - * @param string $data - * The unparsed character data. - */ - public function cdata($data); - - /** - * This is a holdover from the XML spec. - * - * While user agents don't get PIs, server-side does. - * - * @param string $name - * The name of the processor (e.g. 'php'). - * @param string $data - * The unparsed data. - */ - public function processingInstruction($name, $data = null); -} diff --git a/core/vendor/masterminds/html5/src/HTML5/Parser/FileInputStream.php b/core/vendor/masterminds/html5/src/HTML5/Parser/FileInputStream.php deleted file mode 100644 index e58006a..0000000 --- a/core/vendor/masterminds/html5/src/HTML5/Parser/FileInputStream.php +++ /dev/null @@ -1,32 +0,0 @@ -is = $input; - } - - /** - * Get the current position. - * - * @return int The current intiger byte position. - */ - public function position() - { - return $this->is->key(); - } - - /** - * Take a peek at the next character in the data. - * - * @return string The next character. - */ - public function peek() - { - return $this->is->peek(); - } - - /** - * Get the next character. - * - * Note: This advances the pointer. - * - * @return string The next character. - */ - public function next() - { - $this->is->next(); - if ($this->is->valid()) { - if ($this->debug) - fprintf(STDOUT, "> %s\n", $this->is->current()); - return $this->is->current(); - } - - return false; - } - - /** - * Get the current character. - * - * Note, this does not advance the pointer. - * - * @return string The current character. - */ - public function current() - { - if ($this->is->valid()) { - return $this->is->current(); - } - - return false; - } - - /** - * Silently consume N chars. - */ - public function consume($count = 1) - { - for ($i = 0; $i < $count; ++ $i) { - $this->next(); - } - } - - /** - * Unconsume some of the data. - * This moves the data pointer backwards. - * - * @param int $howMany - * The number of characters to move the pointer back. - */ - public function unconsume($howMany = 1) - { - $this->is->unconsume($howMany); - } - - /** - * Get the next group of that contains hex characters. - * - * Note, along with getting the characters the pointer in the data will be - * moved as well. - * - * @return string The next group that is hex characters. - */ - public function getHex() - { - return $this->is->charsWhile(static::CHARS_HEX); - } - - /** - * Get the next group of characters that are ASCII Alpha characters. - * - * Note, along with getting the characters the pointer in the data will be - * moved as well. - * - * @return string The next group of ASCII alpha characters. - */ - public function getAsciiAlpha() - { - return $this->is->charsWhile(static::CHARS_ALPHA); - } - - /** - * Get the next group of characters that are ASCII Alpha characters and numbers. - * - * Note, along with getting the characters the pointer in the data will be - * moved as well. - * - * @return string The next group of ASCII alpha characters and numbers. - */ - public function getAsciiAlphaNum() - { - return $this->is->charsWhile(static::CHARS_ALNUM); - } - - /** - * Get the next group of numbers. - * - * Note, along with getting the characters the pointer in the data will be - * moved as well. - * - * @return string The next group of numbers. - */ - public function getNumeric() - { - return $this->is->charsWhile('0123456789'); - } - - /** - * Consume whitespace. - * - * Whitespace in HTML5 is: formfeed, tab, newline, space. - */ - public function whitespace() - { - return $this->is->charsWhile("\n\t\f "); - } - - /** - * Returns the current line that is being consumed. - * - * @return int The current line number. - */ - public function currentLine() - { - return $this->is->currentLine(); - } - - /** - * Read chars until something in the mask is encountered. - */ - public function charsUntil($mask) - { - return $this->is->charsUntil($mask); - } - - /** - * Read chars as long as the mask matches. - */ - public function charsWhile($mask) - { - return $this->is->charsWhile($mask); - } - - /** - * Returns the current column of the current line that the tokenizer is at. - * - * Newlines are column 0. The first char after a newline is column 1. - * - * @return int The column number. - */ - public function columnOffset() - { - return $this->is->columnOffset(); - } - - /** - * Get all characters until EOF. - * - * This consumes characters until the EOF. - * - * @return int The number of characters remaining. - */ - public function remainingChars() - { - return $this->is->remainingChars(); - } -} diff --git a/core/vendor/masterminds/html5/src/HTML5/Parser/StringInputStream.php b/core/vendor/masterminds/html5/src/HTML5/Parser/StringInputStream.php deleted file mode 100644 index 4cac3c2..0000000 --- a/core/vendor/masterminds/html5/src/HTML5/Parser/StringInputStream.php +++ /dev/null @@ -1,331 +0,0 @@ - - -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. - -*/ - -// Some conventions: -// - /* */ indicates verbatim text from the HTML 5 specification -// MPB: Not sure which version of the spec. Moving from HTML5lib to -// HTML5-PHP, I have been using this version: -// http://www.w3.org/TR/2012/CR-html5-20121217/Overview.html#contents -// -// - // indicates regular comments - -class StringInputStream implements InputStream -{ - - /** - * The string data we're parsing. - */ - private $data; - - /** - * The current integer byte position we are in $data - */ - private $char; - - /** - * Length of $data; when $char === $data, we are at the end-of-file. - */ - private $EOF; - - /** - * Parse errors. - */ - public $errors = array(); - - /** - * Create a new InputStream wrapper. - * - * @param $data Data - * to parse - */ - public function __construct($data, $encoding = 'UTF-8', $debug = '') - { - $data = UTF8Utils::convertToUTF8($data, $encoding); - if ($debug) - fprintf(STDOUT, $debug, $data, strlen($data)); - - // There is good reason to question whether it makes sense to - // do this here, since most of these checks are done during - // parsing, and since this check doesn't actually *do* anything. - $this->errors = UTF8Utils::checkForIllegalCodepoints($data); - // if (!empty($e)) { - // throw new ParseError("UTF-8 encoding issues: " . implode(', ', $e)); - // } - - $data = $this->replaceLinefeeds($data); - - $this->data = $data; - $this->char = 0; - $this->EOF = strlen($data); - } - - /** - * Replace linefeed characters according to the spec. - */ - protected function replaceLinefeeds($data) - { - /* - * U+000D CARRIAGE RETURN (CR) characters and U+000A LINE FEED (LF) characters are treated specially. Any CR characters that are followed by LF characters must be removed, and any CR characters not followed by LF characters must be converted to LF characters. Thus, newlines in HTML DOMs are represented by LF characters, and there are never any CR characters in the input to the tokenization stage. - */ - $crlfTable = array( - "\0" => "\xEF\xBF\xBD", - "\r\n" => "\n", - "\r" => "\n" - ); - - return strtr($data, $crlfTable); - } - - /** - * Returns the current line that the tokenizer is at. - */ - public function currentLine() - { - if (empty($this->EOF) || $this->char == 0) { - return 1; - } - // Add one to $this->char because we want the number for the next - // byte to be processed. - return substr_count($this->data, "\n", 0, min($this->char, $this->EOF)) + 1; - } - - /** - * - * @deprecated - * - */ - public function getCurrentLine() - { - return currentLine(); - } - - /** - * Returns the current column of the current line that the tokenizer is at. - * - * Newlines are column 0. The first char after a newline is column 1. - * - * @return int The column number. - */ - public function columnOffset() - { - // Short circuit for the first char. - if ($this->char == 0) { - return 0; - } - // strrpos is weird, and the offset needs to be negative for what we - // want (i.e., the last \n before $this->char). This needs to not have - // one (to make it point to the next character, the one we want the - // position of) added to it because strrpos's behaviour includes the - // final offset byte. - $backwardFrom = $this->char - 1 - strlen($this->data); - $lastLine = strrpos($this->data, "\n", $backwardFrom); - - // However, for here we want the length up until the next byte to be - // processed, so add one to the current byte ($this->char). - if ($lastLine !== false) { - $findLengthOf = substr($this->data, $lastLine + 1, $this->char - 1 - $lastLine); - } else { - // After a newline. - $findLengthOf = substr($this->data, 0, $this->char); - } - - return UTF8Utils::countChars($findLengthOf); - } - - /** - * - * @deprecated - * - */ - public function getColumnOffset() - { - return $this->columnOffset(); - } - - /** - * Get the current character. - * - * @return string The current character. - */ - public function current() - { - return $this->data[$this->char]; - } - - /** - * Advance the pointer. - * This is part of the Iterator interface. - */ - public function next() - { - $this->char ++; - } - - /** - * Rewind to the start of the string. - */ - public function rewind() - { - $this->char = 0; - } - - /** - * Is the current pointer location valid. - * - * @return bool Is the current pointer location valid. - */ - public function valid() - { - if ($this->char < $this->EOF) { - return true; - } - - return false; - } - - /** - * Get all characters until EOF. - * - * This reads to the end of the file, and sets the read marker at the - * end of the file. - * - * @note This performs bounds checking - * - * @return string Returns the remaining text. If called when the InputStream is - * already exhausted, it returns an empty string. - */ - public function remainingChars() - { - if ($this->char < $this->EOF) { - $data = substr($this->data, $this->char); - $this->char = $this->EOF; - - return $data; - } - - return ''; // false; - } - - /** - * Read to a particular match (or until $max bytes are consumed). - * - * This operates on byte sequences, not characters. - * - * Matches as far as possible until we reach a certain set of bytes - * and returns the matched substring. - * - * @param string $bytes - * Bytes to match. - * @param int $max - * Maximum number of bytes to scan. - * @return mixed Index or false if no match is found. You should use strong - * equality when checking the result, since index could be 0. - */ - public function charsUntil($bytes, $max = null) - { - if ($this->char >= $this->EOF) { - return false; - } - - if ($max === 0 || $max) { - $len = strcspn($this->data, $bytes, $this->char, $max); - } else { - $len = strcspn($this->data, $bytes, $this->char); - } - - $string = (string) substr($this->data, $this->char, $len); - $this->char += $len; - - return $string; - } - - /** - * Returns the string so long as $bytes matches. - * - * Matches as far as possible with a certain set of bytes - * and returns the matched substring. - * - * @param string $bytes - * A mask of bytes to match. If ANY byte in this mask matches the - * current char, the pointer advances and the char is part of the - * substring. - * @param int $max - * The max number of chars to read. - */ - public function charsWhile($bytes, $max = null) - { - if ($this->char >= $this->EOF) { - return false; - } - - if ($max === 0 || $max) { - $len = strspn($this->data, $bytes, $this->char, $max); - } else { - $len = strspn($this->data, $bytes, $this->char); - } - $string = (string) substr($this->data, $this->char, $len); - $this->char += $len; - - return $string; - } - - /** - * Unconsume characters. - * - * @param int $howMany - * The number of characters to unconsume. - */ - public function unconsume($howMany = 1) - { - if (($this->char - $howMany) >= 0) { - $this->char = $this->char - $howMany; - } - } - - /** - * Look ahead without moving cursor. - */ - public function peek() - { - if (($this->char + 1) <= $this->EOF) { - return $this->data[$this->char + 1]; - } - - return false; - } - - public function key() - { - return $this->char; - } -} diff --git a/core/vendor/masterminds/html5/src/HTML5/Parser/Tokenizer.php b/core/vendor/masterminds/html5/src/HTML5/Parser/Tokenizer.php deleted file mode 100644 index e00b9a2..0000000 --- a/core/vendor/masterminds/html5/src/HTML5/Parser/Tokenizer.php +++ /dev/null @@ -1,1092 +0,0 @@ -scanner = $scanner; - $this->events = $eventHandler; - } - - /** - * Begin parsing. - * - * This will begin scanning the document, tokenizing as it goes. - * Tokens are emitted into the event handler. - * - * Tokenizing will continue until the document is completely - * read. Errors are emitted into the event handler, but - * the parser will attempt to continue parsing until the - * entire input stream is read. - */ - public function parse() - { - $p = 0; - do { - $p = $this->scanner->position(); - $this->consumeData(); - - // FIXME: Add infinite loop protection. - } while ($this->carryOn); - } - - /** - * Set the text mode for the character data reader. - * - * HTML5 defines three different modes for reading text: - * - Normal: Read until a tag is encountered. - * - RCDATA: Read until a tag is encountered, but skip a few otherwise- - * special characters. - * - Raw: Read until a special closing tag is encountered (viz. pre, script) - * - * This allows those modes to be set. - * - * Normally, setting is done by the event handler via a special return code on - * startTag(), but it can also be set manually using this function. - * - * @param integer $textmode - * One of Elements::TEXT_* - * @param string $untilTag - * The tag that should stop RAW or RCDATA mode. Normal mode does not - * use this indicator. - */ - public function setTextMode($textmode, $untilTag = null) - { - $this->textMode = $textmode & (Elements::TEXT_RAW | Elements::TEXT_RCDATA); - $this->untilTag = $untilTag; - } - - /** - * Consume a character and make a move. - * HTML5 8.2.4.1 - */ - protected function consumeData() - { - // Character Ref - /* - * $this->characterReference() || $this->tagOpen() || $this->eof() || $this->characterData(); - */ - $this->characterReference(); - $this->tagOpen(); - $this->eof(); - $this->characterData(); - - return $this->carryOn; - } - - /** - * Parse anything that looks like character data. - * - * Different rules apply based on the current text mode. - * - * @see Elements::TEXT_RAW Elements::TEXT_RCDATA. - */ - protected function characterData() - { - if ($this->scanner->current() === false) { - return false; - } - switch ($this->textMode) { - case Elements::TEXT_RAW: - return $this->rawText(); - case Elements::TEXT_RCDATA: - return $this->rcdata(); - default: - $tok = $this->scanner->current(); - if (strspn($tok, "<&")) { - return false; - } - return $this->text(); - } - } - - /** - * This buffers the current token as character data. - */ - protected function text() - { - $tok = $this->scanner->current(); - - // This should never happen... - if ($tok === false) { - return false; - } - // Null - if ($tok === "\00") { - $this->parseError("Received null character."); - } - // fprintf(STDOUT, "Writing '%s'", $tok); - $this->buffer($tok); - $this->scanner->next(); - return true; - } - - /** - * Read text in RAW mode. - */ - protected function rawText() - { - if (is_null($this->untilTag)) { - return $this->text(); - } - $sequence = 'untilTag . '>'; - $txt = $this->readUntilSequence($sequence); - $this->events->text($txt); - $this->setTextMode(0); - return $this->endTag(); - } - - /** - * Read text in RCDATA mode. - */ - protected function rcdata() - { - if (is_null($this->untilTag)) { - return $this->text(); - } - $sequence = 'untilTag; - $txt = ''; - $tok = $this->scanner->current(); - - $caseSensitive = !Elements::isHtml5Element($this->untilTag); - while ($tok !== false && ! ($tok == '<' && ($this->sequenceMatches($sequence, $caseSensitive)))) { - if ($tok == '&') { - $txt .= $this->decodeCharacterReference(); - $tok = $this->scanner->current(); - } else { - $txt .= $tok; - $tok = $this->scanner->next(); - } - } - $len = strlen($sequence); - $this->scanner->consume($len); - $len += strlen($this->scanner->whitespace()); - if ($this->scanner->current() !== '>') { - $this->parseError("Unclosed RCDATA end tag"); - } - $this->scanner->unconsume($len); - $this->events->text($txt); - $this->setTextMode(0); - return $this->endTag(); - } - - /** - * If the document is read, emit an EOF event. - */ - protected function eof() - { - if ($this->scanner->current() === false) { - // fprintf(STDOUT, "EOF"); - $this->flushBuffer(); - $this->events->eof(); - $this->carryOn = false; - return true; - } - return false; - } - - /** - * Handle character references (aka entities). - * - * This version is specific to PCDATA, as it buffers data into the - * text buffer. For a generic version, see decodeCharacterReference(). - * - * HTML5 8.2.4.2 - */ - protected function characterReference() - { - $ref = $this->decodeCharacterReference(); - if ($ref !== false) { - $this->buffer($ref); - return true; - } - return false; - } - - /** - * Emit a tagStart event on encountering a tag. - * - * 8.2.4.8 - */ - protected function tagOpen() - { - if ($this->scanner->current() != '<') { - return false; - } - - // Any buffered text data can go out now. - $this->flushBuffer(); - - $this->scanner->next(); - - return $this->markupDeclaration() || $this->endTag() || $this->processingInstruction() || $this->tagName() || - /* This always returns false. */ - $this->parseError("Illegal tag opening") || $this->characterData(); - } - - /** - * Look for markup. - */ - protected function markupDeclaration() - { - if ($this->scanner->current() != '!') { - return false; - } - - $tok = $this->scanner->next(); - - // Comment: - if ($tok == '-' && $this->scanner->peek() == '-') { - $this->scanner->next(); // Consume the other '-' - $this->scanner->next(); // Next char. - return $this->comment(); - } - - elseif ($tok == 'D' || $tok == 'd') { // Doctype - return $this->doctype(''); - } - - elseif ($tok == '[') { // CDATA section - return $this->cdataSection(); - } - - // FINISH - $this->parseError("Expected . Emit an empty comment because 8.2.4.46 says to. - if ($tok == '>') { - // Parse error. Emit the comment token. - $this->parseError("Expected comment data, got '>'"); - $this->events->comment(''); - $this->scanner->next(); - return true; - } - - // Replace NULL with the replacement char. - if ($tok == "\0") { - $tok = UTF8Utils::FFFD; - } - while (! $this->isCommentEnd()) { - $comment .= $tok; - $tok = $this->scanner->next(); - } - - $this->events->comment($comment); - $this->scanner->next(); - return true; - } - - /** - * Check if the scanner has reached the end of a comment. - */ - protected function isCommentEnd() - { - // EOF - if ($this->scanner->current() === false) { - // Hit the end. - $this->parseError("Unexpected EOF in a comment."); - return true; - } - - // If it doesn't start with -, not the end. - if ($this->scanner->current() != '-') { - return false; - } - - // Advance one, and test for '->' - if ($this->scanner->next() == '-' && $this->scanner->peek() == '>') { - $this->scanner->next(); // Consume the last '>' - return true; - } - // Unread '-'; - $this->scanner->unconsume(1); - return false; - } - - /** - * Parse a DOCTYPE. - * - * Parse a DOCTYPE declaration. This method has strong bearing on whether or - * not Quirksmode is enabled on the event handler. - * - * @todo This method is a little long. Should probably refactor. - */ - protected function doctype() - { - if (strcasecmp($this->scanner->current(), 'D')) { - return false; - } - // Check that string is DOCTYPE. - $chars = $this->scanner->charsWhile("DOCTYPEdoctype"); - if (strcasecmp($chars, 'DOCTYPE')) { - $this->parseError('Expected DOCTYPE, got %s', $chars); - return $this->bogusComment('scanner->whitespace(); - $tok = $this->scanner->current(); - - // EOF: die. - if ($tok === false) { - $this->events->doctype('html5', EventHandler::DOCTYPE_NONE, '', true); - return $this->eof(); - } - - $doctypeName = ''; - - // NULL char: convert. - if ($tok === "\0") { - $this->parseError("Unexpected null character in DOCTYPE."); - $doctypeName .= UTF8::FFFD; - $tok = $this->scanner->next(); - } - - $stop = " \n\f>"; - $doctypeName = $this->scanner->charsUntil($stop); - // Lowercase ASCII, replace \0 with FFFD - $doctypeName = strtolower(strtr($doctypeName, "\0", UTF8Utils::FFFD)); - - $tok = $this->scanner->current(); - - // If false, emit a parse error, DOCTYPE, and return. - if ($tok === false) { - $this->parseError('Unexpected EOF in DOCTYPE declaration.'); - $this->events->doctype($doctypeName, EventHandler::DOCTYPE_NONE, null, true); - return true; - } - - // Short DOCTYPE, like - if ($tok == '>') { - // DOCTYPE without a name. - if (strlen($doctypeName) == 0) { - $this->parseError("Expected a DOCTYPE name. Got nothing."); - $this->events->doctype($doctypeName, 0, null, true); - $this->scanner->next(); - return true; - } - $this->events->doctype($doctypeName); - $this->scanner->next(); - return true; - } - $this->scanner->whitespace(); - - $pub = strtoupper($this->scanner->getAsciiAlpha()); - $white = strlen($this->scanner->whitespace()); - $tok = $this->scanner->current(); - - // Get ID, and flag it as pub or system. - if (($pub == 'PUBLIC' || $pub == 'SYSTEM') && $white > 0) { - // Get the sys ID. - $type = $pub == 'PUBLIC' ? EventHandler::DOCTYPE_PUBLIC : EventHandler::DOCTYPE_SYSTEM; - $id = $this->quotedString("\0>"); - if ($id === false) { - $this->events->doctype($doctypeName, $type, $pub, false); - return false; - } - - // Premature EOF. - if ($this->scanner->current() === false) { - $this->parseError("Unexpected EOF in DOCTYPE"); - $this->events->doctype($doctypeName, $type, $id, true); - return true; - } - - // Well-formed complete DOCTYPE. - $this->scanner->whitespace(); - if ($this->scanner->current() == '>') { - $this->events->doctype($doctypeName, $type, $id, false); - $this->scanner->next(); - return true; - } - - // If we get here, we have scanner->charsUntil(">"); - $this->parseError("Malformed DOCTYPE."); - $this->events->doctype($doctypeName, $type, $id, true); - $this->scanner->next(); - return true; - } - - // Else it's a bogus DOCTYPE. - // Consume to > and trash. - $this->scanner->charsUntil('>'); - - $this->parseError("Expected PUBLIC or SYSTEM. Got %s.", $pub); - $this->events->doctype($doctypeName, 0, null, true); - $this->scanner->next(); - return true; - } - - /** - * Utility for reading a quoted string. - * - * @param string $stopchars - * Characters (in addition to a close-quote) that should stop the string. - * E.g. sometimes '>' is higher precedence than '"' or "'". - * @return mixed String if one is found (quotations omitted) - */ - protected function quotedString($stopchars) - { - $tok = $this->scanner->current(); - if ($tok == '"' || $tok == "'") { - $this->scanner->next(); - $ret = $this->scanner->charsUntil($tok . $stopchars); - if ($this->scanner->current() == $tok) { - $this->scanner->next(); - } else { - // Parse error because no close quote. - $this->parseError("Expected %s, got %s", $tok, $this->scanner->current()); - } - return $ret; - } - return false; - } - - /** - * Handle a CDATA section. - */ - protected function cdataSection() - { - if ($this->scanner->current() != '[') { - return false; - } - $cdata = ''; - $this->scanner->next(); - - $chars = $this->scanner->charsWhile('CDAT'); - if ($chars != 'CDATA' || $this->scanner->current() != '[') { - $this->parseError('Expected [CDATA[, got %s', $chars); - return $this->bogusComment('scanner->next(); - do { - if ($tok === false) { - $this->parseError('Unexpected EOF inside CDATA.'); - $this->bogusComment('scanner->next(); - } while (! $this->sequenceMatches(']]>')); - - // Consume ]]> - $this->scanner->consume(3); - - $this->events->cdata($cdata); - return true; - } - - // ================================================================ - // Non-HTML5 - // ================================================================ - /** - * Handle a processing instruction. - * - * XML processing instructions are supposed to be ignored in HTML5, - * treated as "bogus comments". However, since we're not a user - * agent, we allow them. We consume until ?> and then issue a - * EventListener::processingInstruction() event. - */ - protected function processingInstruction() - { - if ($this->scanner->current() != '?') { - return false; - } - - $tok = $this->scanner->next(); - $procName = $this->scanner->getAsciiAlpha(); - $white = strlen($this->scanner->whitespace()); - - // If not a PI, send to bogusComment. - if (strlen($procName) == 0 || $white == 0 || $this->scanner->current() == false) { - $this->parseError("Expected processing instruction name, got $tok"); - $this->bogusComment('. - while (! ($this->scanner->current() == '?' && $this->scanner->peek() == '>')) { - $data .= $this->scanner->current(); - - $tok = $this->scanner->next(); - if ($tok === false) { - $this->parseError("Unexpected EOF in processing instruction."); - $this->events->processingInstruction($procName, $data); - return true; - } - } - - $this->scanner->next(); // > - $this->scanner->next(); // Next token. - $this->events->processingInstruction($procName, $data); - return true; - } - - // ================================================================ - // UTILITY FUNCTIONS - // ================================================================ - - /** - * Read from the input stream until we get to the desired sequene - * or hit the end of the input stream. - */ - protected function readUntilSequence($sequence) - { - $buffer = ''; - - // Optimization for reading larger blocks faster. - $first = substr($sequence, 0, 1); - while ($this->scanner->current() !== false) { - $buffer .= $this->scanner->charsUntil($first); - - // Stop as soon as we hit the stopping condition. - if ($this->sequenceMatches($sequence, false)) { - return $buffer; - } - $buffer .= $this->scanner->current(); - $this->scanner->next(); - } - - // If we get here, we hit the EOF. - $this->parseError("Unexpected EOF during text read."); - return $buffer; - } - - /** - * Check if upcomming chars match the given sequence. - * - * This will read the stream for the $sequence. If it's - * found, this will return true. If not, return false. - * Since this unconsumes any chars it reads, the caller - * will still need to read the next sequence, even if - * this returns true. - * - * Example: $this->sequenceMatches('') will - * see if the input stream is at the start of a - * '' string. - */ - protected function sequenceMatches($sequence, $caseSensitive = true) - { - $len = strlen($sequence); - $buffer = ''; - for ($i = 0; $i < $len; ++ $i) { - $buffer .= $this->scanner->current(); - - // EOF. Rewind and let the caller handle it. - if ($this->scanner->current() === false) { - $this->scanner->unconsume($i); - return false; - } - $this->scanner->next(); - } - - $this->scanner->unconsume($len); - return $caseSensitive ? $buffer == $sequence : strcasecmp($buffer, $sequence) === 0; - } - - /** - * Send a TEXT event with the contents of the text buffer. - * - * This emits an EventHandler::text() event with the current contents of the - * temporary text buffer. (The buffer is used to group as much PCDATA - * as we can instead of emitting lots and lots of TEXT events.) - */ - protected function flushBuffer() - { - if ($this->text === '') { - return; - } - $this->events->text($this->text); - $this->text = ''; - } - - /** - * Add text to the temporary buffer. - * - * @see flushBuffer() - */ - protected function buffer($str) - { - $this->text .= $str; - } - - /** - * Emit a parse error. - * - * A parse error always returns false because it never consumes any - * characters. - */ - protected function parseError($msg) - { - $args = func_get_args(); - - if (count($args) > 1) { - array_shift($args); - $msg = vsprintf($msg, $args); - } - - $line = $this->scanner->currentLine(); - $col = $this->scanner->columnOffset(); - $this->events->parseError($msg, $line, $col); - return false; - } - - /** - * Decode a character reference and return the string. - * - * Returns false if the entity could not be found. If $inAttribute is set - * to true, a bare & will be returned as-is. - * - * @param boolean $inAttribute - * Set to true if the text is inside of an attribute value. - * false otherwise. - */ - protected function decodeCharacterReference($inAttribute = false) - { - - // If it fails this, it's definitely not an entity. - if ($this->scanner->current() != '&') { - return false; - } - - // Next char after &. - $tok = $this->scanner->next(); - $entity = ''; - $start = $this->scanner->position(); - - if ($tok == false) { - return '&'; - } - - // These indicate not an entity. We return just - // the &. - if (strspn($tok, static::WHITE . "&<") == 1) { - // $this->scanner->next(); - return '&'; - } - - // Numeric entity - if ($tok == '#') { - $tok = $this->scanner->next(); - - // Hexidecimal encoding. - // X[0-9a-fA-F]+; - // x[0-9a-fA-F]+; - if ($tok == 'x' || $tok == 'X') { - $tok = $this->scanner->next(); // Consume x - - // Convert from hex code to char. - $hex = $this->scanner->getHex(); - if (empty($hex)) { - $this->parseError("Expected &#xHEX;, got &#x%s", $tok); - // We unconsume because we don't know what parser rules might - // be in effect for the remaining chars. For example. '&#>' - // might result in a specific parsing rule inside of tag - // contexts, while not inside of pcdata context. - $this->scanner->unconsume(2); - return '&'; - } - $entity = CharacterReference::lookupHex($hex); - } // Decimal encoding. - // [0-9]+; - else { - // Convert from decimal to char. - $numeric = $this->scanner->getNumeric(); - if ($numeric === false) { - $this->parseError("Expected &#DIGITS;, got &#%s", $tok); - $this->scanner->unconsume(2); - return '&'; - } - $entity = CharacterReference::lookupDecimal($numeric); - } - } // String entity. - else { - // Attempt to consume a string up to a ';'. - // [a-zA-Z0-9]+; - $cname = $this->scanner->getAsciiAlpha(); - $entity = CharacterReference::lookupName($cname); - if ($entity == null) { - $this->parseError("No match in entity table for '%s'", $entity); - } - } - - // The scanner has advanced the cursor for us. - $tok = $this->scanner->current(); - - // We have an entity. We're done here. - if ($tok == ';') { - $this->scanner->next(); - return $entity; - } - - // If in an attribute, then failing to match ; means unconsume the - // entire string. Otherwise, failure to match is an error. - if ($inAttribute) { - $this->scanner->unconsume($this->scanner->position() - $start); - return '&'; - } - - $this->parseError("Expected &ENTITY;, got &ENTITY%s (no trailing ;) ", $tok); - return '&' . $entity; - } -} diff --git a/core/vendor/masterminds/html5/src/HTML5/Parser/TreeBuildingRules.php b/core/vendor/masterminds/html5/src/HTML5/Parser/TreeBuildingRules.php deleted file mode 100644 index 2af3c66..0000000 --- a/core/vendor/masterminds/html5/src/HTML5/Parser/TreeBuildingRules.php +++ /dev/null @@ -1,140 +0,0 @@ - 1, - 'dd' => 1, - 'dt' => 1, - 'rt' => 1, - 'rp' => 1, - 'tr' => 1, - 'th' => 1, - 'td' => 1, - 'thead' => 1, - 'tfoot' => 1, - 'tbody' => 1, - 'table' => 1, - 'optgroup' => 1, - 'option' => 1 - ); - - /** - * Build a new rules engine. - * - * @param \DOMDocument $doc - * The DOM document to use for evaluation and modification. - */ - public function __construct($doc) - { - $this->doc = $doc; - } - - /** - * Returns true if the given tagname has special processing rules. - */ - public function hasRules($tagname) - { - return isset(static::$tags[$tagname]); - } - - /** - * Evaluate the rule for the current tag name. - * - * This may modify the existing DOM. - * - * @return \DOMElement The new Current DOM element. - */ - public function evaluate($new, $current) - { - switch ($new->tagName) { - case 'li': - return $this->handleLI($new, $current); - case 'dt': - case 'dd': - return $this->handleDT($new, $current); - case 'rt': - case 'rp': - return $this->handleRT($new, $current); - case 'optgroup': - return $this->closeIfCurrentMatches($new, $current, array( - 'optgroup' - )); - case 'option': - return $this->closeIfCurrentMatches($new, $current, array( - 'option', - 'optgroup' - )); - case 'tr': - return $this->closeIfCurrentMatches($new, $current, array( - 'tr' - )); - case 'td': - case 'th': - return $this->closeIfCurrentMatches($new, $current, array( - 'th', - 'td' - )); - case 'tbody': - case 'thead': - case 'tfoot': - case 'table': // Spec isn't explicit about this, but it's necessary. - - return $this->closeIfCurrentMatches($new, $current, array( - 'thead', - 'tfoot', - 'tbody' - )); - } - - return $current; - } - - protected function handleLI($ele, $current) - { - return $this->closeIfCurrentMatches($ele, $current, array( - 'li' - )); - } - - protected function handleDT($ele, $current) - { - return $this->closeIfCurrentMatches($ele, $current, array( - 'dt', - 'dd' - )); - } - - protected function handleRT($ele, $current) - { - return $this->closeIfCurrentMatches($ele, $current, array( - 'rt', - 'rp' - )); - } - - protected function closeIfCurrentMatches($ele, $current, $match) - { - $tname = $current->tagName; - if (in_array($current->tagName, $match)) { - $current->parentNode->appendChild($ele); - } else { - $current->appendChild($ele); - } - - return $ele; - } -} diff --git a/core/vendor/masterminds/html5/src/HTML5/Parser/UTF8Utils.php b/core/vendor/masterminds/html5/src/HTML5/Parser/UTF8Utils.php deleted file mode 100644 index d319252..0000000 --- a/core/vendor/masterminds/html5/src/HTML5/Parser/UTF8Utils.php +++ /dev/null @@ -1,171 +0,0 @@ - - -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. - -*/ -/** - * UTF-8 Utilities - */ -class UTF8Utils -{ - - /** - * The Unicode replacement character.. - */ - const FFFD = "\xEF\xBF\xBD"; - - /** - * Count the number of characters in a string. - * - * UTF-8 aware. This will try (in order) iconv, - * MB, libxml, and finally a custom counter. - * - * @todo Move this to a general utility class. - */ - public static function countChars($string) - { - // Get the length for the string we need. - if (function_exists('iconv_strlen')) { - return iconv_strlen($string, 'utf-8'); - } elseif (function_exists('mb_strlen')) { - return mb_strlen($string, 'utf-8'); - } elseif (function_exists('utf8_decode')) { - // MPB: Will this work? Won't certain decodes lead to two chars - // extrapolated out of 2-byte chars? - return strlen(utf8_decode($string)); - } - $count = count_chars($string); - // 0x80 = 0x7F - 0 + 1 (one added to get inclusive range) - // 0x33 = 0xF4 - 0x2C + 1 (one added to get inclusive range) - return array_sum(array_slice($count, 0, 0x80)) + array_sum(array_slice($count, 0xC2, 0x33)); - } - - /** - * Convert data from the given encoding to UTF-8. - * - * This has not yet been tested with charactersets other than UTF-8. - * It should work with ISO-8859-1/-13 and standard Latin Win charsets. - * - * @param string $data - * The data to convert. - * @param string $encoding - * A valid encoding. Examples: http://www.php.net/manual/en/mbstring.supported-encodings.php - */ - public static function convertToUTF8($data, $encoding = 'UTF-8') - { - /* - * From the HTML5 spec: Given an encoding, the bytes in the input stream must be converted to Unicode characters for the tokeniser, as described by the rules for that encoding, except that the leading U+FEFF BYTE ORDER MARK character, if any, must not be stripped by the encoding layer (it is stripped by the rule below). Bytes or sequences of bytes in the original byte stream that could not be converted to Unicode characters must be converted to U+FFFD REPLACEMENT CHARACTER code points. - */ - - // mb_convert_encoding is chosen over iconv because of a bug. The best - // details for the bug are on http://us1.php.net/manual/en/function.iconv.php#108643 - // which contains links to the actual but reports as well as work around - // details. - if (function_exists('mb_convert_encoding')) { - // mb library has the following behaviors: - // - UTF-16 surrogates result in false. - // - Overlongs and outside Plane 16 result in empty strings. - - // Before we run mb_convert_encoding we need to tell it what to do with - // characters it does not know. This could be different than the parent - // application executing this library so we store the value, change it - // to our needs, and then change it back when we are done. This feels - // a little excessive and it would be great if there was a better way. - $save = ini_get('mbstring.substitute_character'); - ini_set('mbstring.substitute_character', "none"); - $data = mb_convert_encoding($data, 'UTF-8', $encoding); - ini_set('mbstring.substitute_character', $save); - } // @todo Get iconv running in at least some environments if that is possible. - elseif (function_exists('iconv') && $encoding != 'auto') { - // fprintf(STDOUT, "iconv found\n"); - // iconv has the following behaviors: - // - Overlong representations are ignored. - // - Beyond Plane 16 is replaced with a lower char. - // - Incomplete sequences generate a warning. - $data = @iconv($encoding, 'UTF-8//IGNORE', $data); - } else { - // we can make a conforming native implementation - throw new Exception('Not implemented, please install mbstring or iconv'); - } - - /* - * One leading U+FEFF BYTE ORDER MARK character must be ignored if any are present. - */ - if (substr($data, 0, 3) === "\xEF\xBB\xBF") { - $data = substr($data, 3); - } - - return $data; - } - - /** - * Checks for Unicode code points that are not valid in a document. - * - * @param string $data - * A string to analyze. - * @return array An array of (string) error messages produced by the scanning. - */ - public static function checkForIllegalCodepoints($data) - { - if (! function_exists('preg_match_all')) { - throw\Exception('The PCRE library is not loaded or is not available.'); - } - - // Vestigal error handling. - $errors = array(); - - /* - * All U+0000 null characters in the input must be replaced by U+FFFD REPLACEMENT CHARACTERs. Any occurrences of such characters is a parse error. - */ - for ($i = 0, $count = substr_count($data, "\0"); $i < $count; $i ++) { - $errors[] = 'null-character'; - } - - /* - * Any occurrences of any characters in the ranges U+0001 to U+0008, U+000B, U+000E to U+001F, U+007F to U+009F, U+D800 to U+DFFF , U+FDD0 to U+FDEF, and characters U+FFFE, U+FFFF, U+1FFFE, U+1FFFF, U+2FFFE, U+2FFFF, U+3FFFE, U+3FFFF, U+4FFFE, U+4FFFF, U+5FFFE, U+5FFFF, U+6FFFE, U+6FFFF, U+7FFFE, U+7FFFF, U+8FFFE, U+8FFFF, U+9FFFE, U+9FFFF, U+AFFFE, U+AFFFF, U+BFFFE, U+BFFFF, U+CFFFE, U+CFFFF, U+DFFFE, U+DFFFF, U+EFFFE, U+EFFFF, U+FFFFE, U+FFFFF, U+10FFFE, and U+10FFFF are parse errors. (These are all control characters or permanently undefined Unicode characters.) - */ - // Check PCRE is loaded. - $count = preg_match_all( - '/(?: - [\x01-\x08\x0B\x0E-\x1F\x7F] # U+0001 to U+0008, U+000B, U+000E to U+001F and U+007F - | - \xC2[\x80-\x9F] # U+0080 to U+009F - | - \xED(?:\xA0[\x80-\xFF]|[\xA1-\xBE][\x00-\xFF]|\xBF[\x00-\xBF]) # U+D800 to U+DFFFF - | - \xEF\xB7[\x90-\xAF] # U+FDD0 to U+FDEF - | - \xEF\xBF[\xBE\xBF] # U+FFFE and U+FFFF - | - [\xF0-\xF4][\x8F-\xBF]\xBF[\xBE\xBF] # U+nFFFE and U+nFFFF (1 <= n <= 10_{16}) - )/x', $data, $matches); - for ($i = 0; $i < $count; $i ++) { - $errors[] = 'invalid-codepoint'; - } - - return $errors; - } -} diff --git a/core/vendor/masterminds/html5/src/HTML5/Serializer/HTML5Entities.php b/core/vendor/masterminds/html5/src/HTML5/Serializer/HTML5Entities.php deleted file mode 100644 index 4f90f84..0000000 --- a/core/vendor/masterminds/html5/src/HTML5/Serializer/HTML5Entities.php +++ /dev/null @@ -1,1533 +0,0 @@ - ' ', - "\n" => ' ', - '!' => '!', - '"' => '"', - '#' => '#', - '$' => '$', - '%' => '%', - '&' => '&', - '\'' => ''', - '(' => '(', - ')' => ')', - '*' => '*', - '+' => '+', - ',' => ',', - '.' => '.', - '/' => '/', - ':' => ':', - ';' => ';', - '<' => '<', - '<⃒' => '&nvlt', - '=' => '=', - '=⃥' => '&bne', - '>' => '>', - '>⃒' => '&nvgt', - '?' => '?', - '@' => '@', - '[' => '[', - '\\' => '\', - ']' => ']', - '^' => '^', - '_' => '_', - '`' => '`', - 'fj' => '&fjlig', - '{' => '{', - '|' => '|', - '}' => '}', - ' ' => ' ', - '¡' => '¡', - '¢' => '¢', - '£' => '£', - '¤' => '¤', - '¥' => '¥', - '¦' => '¦', - '§' => '§', - '¨' => '¨', - '©' => '©', - 'ª' => 'ª', - '«' => '«', - '¬' => '¬', - '­' => '­', - '®' => '®', - '¯' => '¯', - '°' => '°', - '±' => '±', - '²' => '²', - '³' => '³', - '´' => '´', - 'µ' => 'µ', - '¶' => '¶', - '·' => '·', - '¸' => '¸', - '¹' => '¹', - 'º' => 'º', - '»' => '»', - '¼' => '¼', - '½' => '½', - '¾' => '¾', - '¿' => '¿', - 'À' => 'À', - 'Á' => 'Á', - 'Â' => 'Â', - 'Ã' => 'Ã', - 'Ä' => 'Ä', - 'Å' => 'Å', - 'Æ' => 'Æ', - 'Ç' => 'Ç', - 'È' => 'È', - 'É' => 'É', - 'Ê' => 'Ê', - 'Ë' => 'Ë', - 'Ì' => 'Ì', - 'Í' => 'Í', - 'Î' => 'Î', - 'Ï' => 'Ï', - 'Ð' => 'Ð', - 'Ñ' => 'Ñ', - 'Ò' => 'Ò', - 'Ó' => 'Ó', - 'Ô' => 'Ô', - 'Õ' => 'Õ', - 'Ö' => 'Ö', - '×' => '×', - 'Ø' => 'Ø', - 'Ù' => 'Ù', - 'Ú' => 'Ú', - 'Û' => 'Û', - 'Ü' => 'Ü', - 'Ý' => 'Ý', - 'Þ' => 'Þ', - 'ß' => 'ß', - 'à' => 'à', - 'á' => 'á', - 'â' => 'â', - 'ã' => 'ã', - 'ä' => 'ä', - 'å' => 'å', - 'æ' => 'æ', - 'ç' => 'ç', - 'è' => 'è', - 'é' => 'é', - 'ê' => 'ê', - 'ë' => 'ë', - 'ì' => 'ì', - 'í' => 'í', - 'î' => 'î', - 'ï' => 'ï', - 'ð' => 'ð', - 'ñ' => 'ñ', - 'ò' => 'ò', - 'ó' => 'ó', - 'ô' => 'ô', - 'õ' => 'õ', - 'ö' => 'ö', - '÷' => '÷', - 'ø' => 'ø', - 'ù' => 'ù', - 'ú' => 'ú', - 'û' => 'û', - 'ü' => 'ü', - 'ý' => 'ý', - 'þ' => 'þ', - 'ÿ' => 'ÿ', - 'Ā' => 'Ā', - 'ā' => 'ā', - 'Ă' => 'Ă', - 'ă' => 'ă', - 'Ą' => 'Ą', - 'ą' => 'ą', - 'Ć' => 'Ć', - 'ć' => 'ć', - 'Ĉ' => 'Ĉ', - 'ĉ' => 'ĉ', - 'Ċ' => 'Ċ', - 'ċ' => 'ċ', - 'Č' => 'Č', - 'č' => 'č', - 'Ď' => 'Ď', - 'ď' => 'ď', - 'Đ' => 'Đ', - 'đ' => 'đ', - 'Ē' => 'Ē', - 'ē' => 'ē', - 'Ė' => 'Ė', - 'ė' => 'ė', - 'Ę' => 'Ę', - 'ę' => 'ę', - 'Ě' => 'Ě', - 'ě' => 'ě', - 'Ĝ' => 'Ĝ', - 'ĝ' => 'ĝ', - 'Ğ' => 'Ğ', - 'ğ' => 'ğ', - 'Ġ' => 'Ġ', - 'ġ' => 'ġ', - 'Ģ' => 'Ģ', - 'Ĥ' => 'Ĥ', - 'ĥ' => 'ĥ', - 'Ħ' => 'Ħ', - 'ħ' => 'ħ', - 'Ĩ' => 'Ĩ', - 'ĩ' => 'ĩ', - 'Ī' => 'Ī', - 'ī' => 'ī', - 'Į' => 'Į', - 'į' => 'į', - 'İ' => 'İ', - 'ı' => 'ı', - 'IJ' => 'IJ', - 'ij' => 'ij', - 'Ĵ' => 'Ĵ', - 'ĵ' => 'ĵ', - 'Ķ' => 'Ķ', - 'ķ' => 'ķ', - 'ĸ' => 'ĸ', - 'Ĺ' => 'Ĺ', - 'ĺ' => 'ĺ', - 'Ļ' => 'Ļ', - 'ļ' => 'ļ', - 'Ľ' => 'Ľ', - 'ľ' => 'ľ', - 'Ŀ' => 'Ŀ', - 'ŀ' => 'ŀ', - 'Ł' => 'Ł', - 'ł' => 'ł', - 'Ń' => 'Ń', - 'ń' => 'ń', - 'Ņ' => 'Ņ', - 'ņ' => 'ņ', - 'Ň' => 'Ň', - 'ň' => 'ň', - 'ʼn' => 'ʼn', - 'Ŋ' => 'Ŋ', - 'ŋ' => 'ŋ', - 'Ō' => 'Ō', - 'ō' => 'ō', - 'Ő' => 'Ő', - 'ő' => 'ő', - 'Œ' => 'Œ', - 'œ' => 'œ', - 'Ŕ' => 'Ŕ', - 'ŕ' => 'ŕ', - 'Ŗ' => 'Ŗ', - 'ŗ' => 'ŗ', - 'Ř' => 'Ř', - 'ř' => 'ř', - 'Ś' => 'Ś', - 'ś' => 'ś', - 'Ŝ' => 'Ŝ', - 'ŝ' => 'ŝ', - 'Ş' => 'Ş', - 'ş' => 'ş', - 'Š' => 'Š', - 'š' => 'š', - 'Ţ' => 'Ţ', - 'ţ' => 'ţ', - 'Ť' => 'Ť', - 'ť' => 'ť', - 'Ŧ' => 'Ŧ', - 'ŧ' => 'ŧ', - 'Ũ' => 'Ũ', - 'ũ' => 'ũ', - 'Ū' => 'Ū', - 'ū' => 'ū', - 'Ŭ' => 'Ŭ', - 'ŭ' => 'ŭ', - 'Ů' => 'Ů', - 'ů' => 'ů', - 'Ű' => 'Ű', - 'ű' => 'ű', - 'Ų' => 'Ų', - 'ų' => 'ų', - 'Ŵ' => 'Ŵ', - 'ŵ' => 'ŵ', - 'Ŷ' => 'Ŷ', - 'ŷ' => 'ŷ', - 'Ÿ' => 'Ÿ', - 'Ź' => 'Ź', - 'ź' => 'ź', - 'Ż' => 'Ż', - 'ż' => 'ż', - 'Ž' => 'Ž', - 'ž' => 'ž', - 'ƒ' => 'ƒ', - 'Ƶ' => 'Ƶ', - 'ǵ' => 'ǵ', - 'ȷ' => 'ȷ', - 'ˆ' => 'ˆ', - 'ˇ' => 'ˇ', - '˘' => '˘', - '˙' => '˙', - '˚' => '˚', - '˛' => '˛', - '˜' => '˜', - '˝' => '˝', - '̑' => '̑', - 'Α' => 'Α', - 'Β' => 'Β', - 'Γ' => 'Γ', - 'Δ' => 'Δ', - 'Ε' => 'Ε', - 'Ζ' => 'Ζ', - 'Η' => 'Η', - 'Θ' => 'Θ', - 'Ι' => 'Ι', - 'Κ' => 'Κ', - 'Λ' => 'Λ', - 'Μ' => 'Μ', - 'Ν' => 'Ν', - 'Ξ' => 'Ξ', - 'Ο' => 'Ο', - 'Π' => 'Π', - 'Ρ' => 'Ρ', - 'Σ' => 'Σ', - 'Τ' => 'Τ', - 'Υ' => 'Υ', - 'Φ' => 'Φ', - 'Χ' => 'Χ', - 'Ψ' => 'Ψ', - 'Ω' => 'Ω', - 'α' => 'α', - 'β' => 'β', - 'γ' => 'γ', - 'δ' => 'δ', - 'ε' => 'ε', - 'ζ' => 'ζ', - 'η' => 'η', - 'θ' => 'θ', - 'ι' => 'ι', - 'κ' => 'κ', - 'λ' => 'λ', - 'μ' => 'μ', - 'ν' => 'ν', - 'ξ' => 'ξ', - 'ο' => 'ο', - 'π' => 'π', - 'ρ' => 'ρ', - 'ς' => 'ς', - 'σ' => 'σ', - 'τ' => 'τ', - 'υ' => 'υ', - 'φ' => 'φ', - 'χ' => 'χ', - 'ψ' => 'ψ', - 'ω' => 'ω', - 'ϑ' => 'ϑ', - 'ϒ' => 'ϒ', - 'ϕ' => 'ϕ', - 'ϖ' => 'ϖ', - 'Ϝ' => 'Ϝ', - 'ϝ' => 'ϝ', - 'ϰ' => 'ϰ', - 'ϱ' => 'ϱ', - 'ϵ' => 'ϵ', - '϶' => '϶', - 'Ё' => 'Ё', - 'Ђ' => 'Ђ', - 'Ѓ' => 'Ѓ', - 'Є' => 'Є', - 'Ѕ' => 'Ѕ', - 'І' => 'І', - 'Ї' => 'Ї', - 'Ј' => 'Ј', - 'Љ' => 'Љ', - 'Њ' => 'Њ', - 'Ћ' => 'Ћ', - 'Ќ' => 'Ќ', - 'Ў' => 'Ў', - 'Џ' => 'Џ', - 'А' => 'А', - 'Б' => 'Б', - 'В' => 'В', - 'Г' => 'Г', - 'Д' => 'Д', - 'Е' => 'Е', - 'Ж' => 'Ж', - 'З' => 'З', - 'И' => 'И', - 'Й' => 'Й', - 'К' => 'К', - 'Л' => 'Л', - 'М' => 'М', - 'Н' => 'Н', - 'О' => 'О', - 'П' => 'П', - 'Р' => 'Р', - 'С' => 'С', - 'Т' => 'Т', - 'У' => 'У', - 'Ф' => 'Ф', - 'Х' => 'Х', - 'Ц' => 'Ц', - 'Ч' => 'Ч', - 'Ш' => 'Ш', - 'Щ' => 'Щ', - 'Ъ' => 'Ъ', - 'Ы' => 'Ы', - 'Ь' => 'Ь', - 'Э' => 'Э', - 'Ю' => 'Ю', - 'Я' => 'Я', - 'а' => 'а', - 'б' => 'б', - 'в' => 'в', - 'г' => 'г', - 'д' => 'д', - 'е' => 'е', - 'ж' => 'ж', - 'з' => 'з', - 'и' => 'и', - 'й' => 'й', - 'к' => 'к', - 'л' => 'л', - 'м' => 'м', - 'н' => 'н', - 'о' => 'о', - 'п' => 'п', - 'р' => 'р', - 'с' => 'с', - 'т' => 'т', - 'у' => 'у', - 'ф' => 'ф', - 'х' => 'х', - 'ц' => 'ц', - 'ч' => 'ч', - 'ш' => 'ш', - 'щ' => 'щ', - 'ъ' => 'ъ', - 'ы' => 'ы', - 'ь' => 'ь', - 'э' => 'э', - 'ю' => 'ю', - 'я' => 'я', - 'ё' => 'ё', - 'ђ' => 'ђ', - 'ѓ' => 'ѓ', - 'є' => 'є', - 'ѕ' => 'ѕ', - 'і' => 'і', - 'ї' => 'ї', - 'ј' => 'ј', - 'љ' => 'љ', - 'њ' => 'њ', - 'ћ' => 'ћ', - 'ќ' => 'ќ', - 'ў' => 'ў', - 'џ' => 'џ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - '​' => '​', - '‌' => '‌', - '‍' => '‍', - '‎' => '‎', - '‏' => '‏', - '‐' => '‐', - '–' => '–', - '—' => '—', - '―' => '―', - '‖' => '‖', - '‘' => '‘', - '’' => '’', - '‚' => '‚', - '“' => '“', - '”' => '”', - '„' => '„', - '†' => '†', - '‡' => '‡', - '•' => '•', - '‥' => '‥', - '…' => '…', - '‰' => '‰', - '‱' => '‱', - '′' => '′', - '″' => '″', - '‴' => '‴', - '‵' => '‵', - '‹' => '‹', - '›' => '›', - '‾' => '‾', - '⁁' => '⁁', - '⁃' => '⁃', - '⁄' => '⁄', - '⁏' => '⁏', - '⁗' => '⁗', - ' ' => ' ', - '  ' => '&ThickSpace', - '⁠' => '⁠', - '⁡' => '⁡', - '⁢' => '⁢', - '⁣' => '⁣', - '€' => '€', - '⃛' => '⃛', - '⃜' => '⃜', - 'ℂ' => 'ℂ', - '℅' => '℅', - 'ℊ' => 'ℊ', - 'ℋ' => 'ℋ', - 'ℌ' => 'ℌ', - 'ℍ' => 'ℍ', - 'ℎ' => 'ℎ', - 'ℏ' => 'ℏ', - 'ℐ' => 'ℐ', - 'ℑ' => 'ℑ', - 'ℒ' => 'ℒ', - 'ℓ' => 'ℓ', - 'ℕ' => 'ℕ', - '№' => '№', - '℗' => '℗', - '℘' => '℘', - 'ℙ' => 'ℙ', - 'ℚ' => 'ℚ', - 'ℛ' => 'ℛ', - 'ℜ' => 'ℜ', - 'ℝ' => 'ℝ', - '℞' => '℞', - '™' => '™', - 'ℤ' => 'ℤ', - '℧' => '℧', - 'ℨ' => 'ℨ', - '℩' => '℩', - 'ℬ' => 'ℬ', - 'ℭ' => 'ℭ', - 'ℯ' => 'ℯ', - 'ℰ' => 'ℰ', - 'ℱ' => 'ℱ', - 'ℳ' => 'ℳ', - 'ℴ' => 'ℴ', - 'ℵ' => 'ℵ', - 'ℶ' => 'ℶ', - 'ℷ' => 'ℷ', - 'ℸ' => 'ℸ', - 'ⅅ' => 'ⅅ', - 'ⅆ' => 'ⅆ', - 'ⅇ' => 'ⅇ', - 'ⅈ' => 'ⅈ', - '⅓' => '⅓', - '⅔' => '⅔', - '⅕' => '⅕', - '⅖' => '⅖', - '⅗' => '⅗', - '⅘' => '⅘', - '⅙' => '⅙', - '⅚' => '⅚', - '⅛' => '⅛', - '⅜' => '⅜', - '⅝' => '⅝', - '⅞' => '⅞', - '←' => '←', - '↑' => '↑', - '→' => '→', - '↓' => '↓', - '↔' => '↔', - '↕' => '↕', - '↖' => '↖', - '↗' => '↗', - '↘' => '↘', - '↙' => '↙', - '↚' => '↚', - '↛' => '↛', - '↝' => '↝', - '↝̸' => '&nrarrw', - '↞' => '↞', - '↟' => '↟', - '↠' => '↠', - '↡' => '↡', - '↢' => '↢', - '↣' => '↣', - '↤' => '↤', - '↥' => '↥', - '↦' => '↦', - '↧' => '↧', - '↩' => '↩', - '↪' => '↪', - '↫' => '↫', - '↬' => '↬', - '↭' => '↭', - '↮' => '↮', - '↰' => '↰', - '↱' => '↱', - '↲' => '↲', - '↳' => '↳', - '↵' => '↵', - '↶' => '↶', - '↷' => '↷', - '↺' => '↺', - '↻' => '↻', - '↼' => '↼', - '↽' => '↽', - '↾' => '↾', - '↿' => '↿', - '⇀' => '⇀', - '⇁' => '⇁', - '⇂' => '⇂', - '⇃' => '⇃', - '⇄' => '⇄', - '⇅' => '⇅', - '⇆' => '⇆', - '⇇' => '⇇', - '⇈' => '⇈', - '⇉' => '⇉', - '⇊' => '⇊', - '⇋' => '⇋', - '⇌' => '⇌', - '⇍' => '⇍', - '⇎' => '⇎', - '⇏' => '⇏', - '⇐' => '⇐', - '⇑' => '⇑', - '⇒' => '⇒', - '⇓' => '⇓', - '⇔' => '⇔', - '⇕' => '⇕', - '⇖' => '⇖', - '⇗' => '⇗', - '⇘' => '⇘', - '⇙' => '⇙', - '⇚' => '⇚', - '⇛' => '⇛', - '⇝' => '⇝', - '⇤' => '⇤', - '⇥' => '⇥', - '⇵' => '⇵', - '⇽' => '⇽', - '⇾' => '⇾', - '⇿' => '⇿', - '∀' => '∀', - '∁' => '∁', - '∂' => '∂', - '∂̸' => '&npart', - '∃' => '∃', - '∄' => '∄', - '∅' => '∅', - '∇' => '∇', - '∈' => '∈', - '∉' => '∉', - '∋' => '∋', - '∌' => '∌', - '∏' => '∏', - '∐' => '∐', - '∑' => '∑', - '−' => '−', - '∓' => '∓', - '∔' => '∔', - '∖' => '∖', - '∗' => '∗', - '∘' => '∘', - '√' => '√', - '∝' => '∝', - '∞' => '∞', - '∟' => '∟', - '∠' => '∠', - '∠⃒' => '&nang', - '∡' => '∡', - '∢' => '∢', - '∣' => '∣', - '∤' => '∤', - '∥' => '∥', - '∦' => '∦', - '∧' => '∧', - '∨' => '∨', - '∩' => '∩', - '∩︀' => '&caps', - '∪' => '∪', - '∪︀' => '&cups', - '∫' => '∫', - '∬' => '∬', - '∭' => '∭', - '∮' => '∮', - '∯' => '∯', - '∰' => '∰', - '∱' => '∱', - '∲' => '∲', - '∳' => '∳', - '∴' => '∴', - '∵' => '∵', - '∶' => '∶', - '∷' => '∷', - '∸' => '∸', - '∺' => '∺', - '∻' => '∻', - '∼' => '∼', - '∼⃒' => '&nvsim', - '∽' => '∽', - '∽̱' => '&race', - '∾' => '∾', - '∾̳' => '&acE', - '∿' => '∿', - '≀' => '≀', - '≁' => '≁', - '≂' => '≂', - '≂̸' => '&nesim', - '≃' => '≃', - '≄' => '≄', - '≅' => '≅', - '≆' => '≆', - '≇' => '≇', - '≈' => '≈', - '≉' => '≉', - '≊' => '≊', - '≋' => '≋', - '≋̸' => '&napid', - '≌' => '≌', - '≍' => '≍', - '≍⃒' => '&nvap', - '≎' => '≎', - '≎̸' => '&nbump', - '≏' => '≏', - '≏̸' => '&nbumpe', - '≐' => '≐', - '≐̸' => '&nedot', - '≑' => '≑', - '≒' => '≒', - '≓' => '≓', - '≔' => '≔', - '≕' => '≕', - '≖' => '≖', - '≗' => '≗', - '≙' => '≙', - '≚' => '≚', - '≜' => '≜', - '≟' => '≟', - '≠' => '≠', - '≡' => '≡', - '≡⃥' => '&bnequiv', - '≢' => '≢', - '≤' => '≤', - '≤⃒' => '&nvle', - '≥' => '≥', - '≥⃒' => '&nvge', - '≦' => '≦', - '≦̸' => '&nlE', - '≧' => '≧', - '≧̸' => '&NotGreaterFullEqual', - '≨' => '≨', - '≨︀' => '&lvertneqq', - '≩' => '≩', - '≩︀' => '&gvertneqq', - '≪' => '≪', - '≪̸' => '&nLtv', - '≪⃒' => '&nLt', - '≫' => '≫', - '≫̸' => '&NotGreaterGreater', - '≫⃒' => '&nGt', - '≬' => '≬', - '≭' => '≭', - '≮' => '≮', - '≯' => '≯', - '≰' => '≰', - '≱' => '≱', - '≲' => '≲', - '≳' => '≳', - '≴' => '≴', - '≵' => '≵', - '≶' => '≶', - '≷' => '≷', - '≸' => '≸', - '≹' => '≹', - '≺' => '≺', - '≻' => '≻', - '≼' => '≼', - '≽' => '≽', - '≾' => '≾', - '≿' => '≿', - '≿̸' => '&NotSucceedsTilde', - '⊀' => '⊀', - '⊁' => '⊁', - '⊂' => '⊂', - '⊂⃒' => '&vnsub', - '⊃' => '⊃', - '⊃⃒' => '&nsupset', - '⊄' => '⊄', - '⊅' => '⊅', - '⊆' => '⊆', - '⊇' => '⊇', - '⊈' => '⊈', - '⊉' => '⊉', - '⊊' => '⊊', - '⊊︀' => '&vsubne', - '⊋' => '⊋', - '⊋︀' => '&vsupne', - '⊍' => '⊍', - '⊎' => '⊎', - '⊏' => '⊏', - '⊏̸' => '&NotSquareSubset', - '⊐' => '⊐', - '⊐̸' => '&NotSquareSuperset', - '⊑' => '⊑', - '⊒' => '⊒', - '⊓' => '⊓', - '⊓︀' => '&sqcaps', - '⊔' => '⊔', - '⊔︀' => '&sqcups', - '⊕' => '⊕', - '⊖' => '⊖', - '⊗' => '⊗', - '⊘' => '⊘', - '⊙' => '⊙', - '⊚' => '⊚', - '⊛' => '⊛', - '⊝' => '⊝', - '⊞' => '⊞', - '⊟' => '⊟', - '⊠' => '⊠', - '⊡' => '⊡', - '⊢' => '⊢', - '⊣' => '⊣', - '⊤' => '⊤', - '⊥' => '⊥', - '⊧' => '⊧', - '⊨' => '⊨', - '⊩' => '⊩', - '⊪' => '⊪', - '⊫' => '⊫', - '⊬' => '⊬', - '⊭' => '⊭', - '⊮' => '⊮', - '⊯' => '⊯', - '⊰' => '⊰', - '⊲' => '⊲', - '⊳' => '⊳', - '⊴' => '⊴', - '⊴⃒' => '&nvltrie', - '⊵' => '⊵', - '⊵⃒' => '&nvrtrie', - '⊶' => '⊶', - '⊷' => '⊷', - '⊸' => '⊸', - '⊹' => '⊹', - '⊺' => '⊺', - '⊻' => '⊻', - '⊽' => '⊽', - '⊾' => '⊾', - '⊿' => '⊿', - '⋀' => '⋀', - '⋁' => '⋁', - '⋂' => '⋂', - '⋃' => '⋃', - '⋄' => '⋄', - '⋅' => '⋅', - '⋆' => '⋆', - '⋇' => '⋇', - '⋈' => '⋈', - '⋉' => '⋉', - '⋊' => '⋊', - '⋋' => '⋋', - '⋌' => '⋌', - '⋍' => '⋍', - '⋎' => '⋎', - '⋏' => '⋏', - '⋐' => '⋐', - '⋑' => '⋑', - '⋒' => '⋒', - '⋓' => '⋓', - '⋔' => '⋔', - '⋕' => '⋕', - '⋖' => '⋖', - '⋗' => '⋗', - '⋘' => '⋘', - '⋘̸' => '&nLl', - '⋙' => '⋙', - '⋙̸' => '&nGg', - '⋚' => '⋚', - '⋚︀' => '&lesg', - '⋛' => '⋛', - '⋛︀' => '&gesl', - '⋞' => '⋞', - '⋟' => '⋟', - '⋠' => '⋠', - '⋡' => '⋡', - '⋢' => '⋢', - '⋣' => '⋣', - '⋦' => '⋦', - '⋧' => '⋧', - '⋨' => '⋨', - '⋩' => '⋩', - '⋪' => '⋪', - '⋫' => '⋫', - '⋬' => '⋬', - '⋭' => '⋭', - '⋮' => '⋮', - '⋯' => '⋯', - '⋰' => '⋰', - '⋱' => '⋱', - '⋲' => '⋲', - '⋳' => '⋳', - '⋴' => '⋴', - '⋵' => '⋵', - '⋵̸' => '¬indot', - '⋶' => '⋶', - '⋷' => '⋷', - '⋹' => '⋹', - '⋹̸' => '¬inE', - '⋺' => '⋺', - '⋻' => '⋻', - '⋼' => '⋼', - '⋽' => '⋽', - '⋾' => '⋾', - '⌅' => '⌅', - '⌆' => '⌆', - '⌈' => '⌈', - '⌉' => '⌉', - '⌊' => '⌊', - '⌋' => '⌋', - '⌌' => '⌌', - '⌍' => '⌍', - '⌎' => '⌎', - '⌏' => '⌏', - '⌐' => '⌐', - '⌒' => '⌒', - '⌓' => '⌓', - '⌕' => '⌕', - '⌖' => '⌖', - '⌜' => '⌜', - '⌝' => '⌝', - '⌞' => '⌞', - '⌟' => '⌟', - '⌢' => '⌢', - '⌣' => '⌣', - '⌭' => '⌭', - '⌮' => '⌮', - '⌶' => '⌶', - '⌽' => '⌽', - '⌿' => '⌿', - '⍼' => '⍼', - '⎰' => '⎰', - '⎱' => '⎱', - '⎴' => '⎴', - '⎵' => '⎵', - '⎶' => '⎶', - '⏜' => '⏜', - '⏝' => '⏝', - '⏞' => '⏞', - '⏟' => '⏟', - '⏢' => '⏢', - '⏧' => '⏧', - '␣' => '␣', - 'Ⓢ' => 'Ⓢ', - '─' => '─', - '│' => '│', - '┌' => '┌', - '┐' => '┐', - '└' => '└', - '┘' => '┘', - '├' => '├', - '┤' => '┤', - '┬' => '┬', - '┴' => '┴', - '┼' => '┼', - '═' => '═', - '║' => '║', - '╒' => '╒', - '╓' => '╓', - '╔' => '╔', - '╕' => '╕', - '╖' => '╖', - '╗' => '╗', - '╘' => '╘', - '╙' => '╙', - '╚' => '╚', - '╛' => '╛', - '╜' => '╜', - '╝' => '╝', - '╞' => '╞', - '╟' => '╟', - '╠' => '╠', - '╡' => '╡', - '╢' => '╢', - '╣' => '╣', - '╤' => '╤', - '╥' => '╥', - '╦' => '╦', - '╧' => '╧', - '╨' => '╨', - '╩' => '╩', - '╪' => '╪', - '╫' => '╫', - '╬' => '╬', - '▀' => '▀', - '▄' => '▄', - '█' => '█', - '░' => '░', - '▒' => '▒', - '▓' => '▓', - '□' => '□', - '▪' => '▪', - '▫' => '▫', - '▭' => '▭', - '▮' => '▮', - '▱' => '▱', - '△' => '△', - '▴' => '▴', - '▵' => '▵', - '▸' => '▸', - '▹' => '▹', - '▽' => '▽', - '▾' => '▾', - '▿' => '▿', - '◂' => '◂', - '◃' => '◃', - '◊' => '◊', - '○' => '○', - '◬' => '◬', - '◯' => '◯', - '◸' => '◸', - '◹' => '◹', - '◺' => '◺', - '◻' => '◻', - '◼' => '◼', - '★' => '★', - '☆' => '☆', - '☎' => '☎', - '♀' => '♀', - '♂' => '♂', - '♠' => '♠', - '♣' => '♣', - '♥' => '♥', - '♦' => '♦', - '♪' => '♪', - '♭' => '♭', - '♮' => '♮', - '♯' => '♯', - '✓' => '✓', - '✗' => '✗', - '✠' => '✠', - '✶' => '✶', - '❘' => '❘', - '❲' => '❲', - '❳' => '❳', - '⟈' => '⟈', - '⟉' => '⟉', - '⟦' => '⟦', - '⟧' => '⟧', - '⟨' => '⟨', - '⟩' => '⟩', - '⟪' => '⟪', - '⟫' => '⟫', - '⟬' => '⟬', - '⟭' => '⟭', - '⟵' => '⟵', - '⟶' => '⟶', - '⟷' => '⟷', - '⟸' => '⟸', - '⟹' => '⟹', - '⟺' => '⟺', - '⟼' => '⟼', - '⟿' => '⟿', - '⤂' => '⤂', - '⤃' => '⤃', - '⤄' => '⤄', - '⤅' => '⤅', - '⤌' => '⤌', - '⤍' => '⤍', - '⤎' => '⤎', - '⤏' => '⤏', - '⤐' => '⤐', - '⤑' => '⤑', - '⤒' => '⤒', - '⤓' => '⤓', - '⤖' => '⤖', - '⤙' => '⤙', - '⤚' => '⤚', - '⤛' => '⤛', - '⤜' => '⤜', - '⤝' => '⤝', - '⤞' => '⤞', - '⤟' => '⤟', - '⤠' => '⤠', - '⤣' => '⤣', - '⤤' => '⤤', - '⤥' => '⤥', - '⤦' => '⤦', - '⤧' => '⤧', - '⤨' => '⤨', - '⤩' => '⤩', - '⤪' => '⤪', - '⤳' => '⤳', - '⤳̸' => '&nrarrc', - '⤵' => '⤵', - '⤶' => '⤶', - '⤷' => '⤷', - '⤸' => '⤸', - '⤹' => '⤹', - '⤼' => '⤼', - '⤽' => '⤽', - '⥅' => '⥅', - '⥈' => '⥈', - '⥉' => '⥉', - '⥊' => '⥊', - '⥋' => '⥋', - '⥎' => '⥎', - '⥏' => '⥏', - '⥐' => '⥐', - '⥑' => '⥑', - '⥒' => '⥒', - '⥓' => '⥓', - '⥔' => '⥔', - '⥕' => '⥕', - '⥖' => '⥖', - '⥗' => '⥗', - '⥘' => '⥘', - '⥙' => '⥙', - '⥚' => '⥚', - '⥛' => '⥛', - '⥜' => '⥜', - '⥝' => '⥝', - '⥞' => '⥞', - '⥟' => '⥟', - '⥠' => '⥠', - '⥡' => '⥡', - '⥢' => '⥢', - '⥣' => '⥣', - '⥤' => '⥤', - '⥥' => '⥥', - '⥦' => '⥦', - '⥧' => '⥧', - '⥨' => '⥨', - '⥩' => '⥩', - '⥪' => '⥪', - '⥫' => '⥫', - '⥬' => '⥬', - '⥭' => '⥭', - '⥮' => '⥮', - '⥯' => '⥯', - '⥰' => '⥰', - '⥱' => '⥱', - '⥲' => '⥲', - '⥳' => '⥳', - '⥴' => '⥴', - '⥵' => '⥵', - '⥶' => '⥶', - '⥸' => '⥸', - '⥹' => '⥹', - '⥻' => '⥻', - '⥼' => '⥼', - '⥽' => '⥽', - '⥾' => '⥾', - '⥿' => '⥿', - '⦅' => '⦅', - '⦆' => '⦆', - '⦋' => '⦋', - '⦌' => '⦌', - '⦍' => '⦍', - '⦎' => '⦎', - '⦏' => '⦏', - '⦐' => '⦐', - '⦑' => '⦑', - '⦒' => '⦒', - '⦓' => '⦓', - '⦔' => '⦔', - '⦕' => '⦕', - '⦖' => '⦖', - '⦚' => '⦚', - '⦜' => '⦜', - '⦝' => '⦝', - '⦤' => '⦤', - '⦥' => '⦥', - '⦦' => '⦦', - '⦧' => '⦧', - '⦨' => '⦨', - '⦩' => '⦩', - '⦪' => '⦪', - '⦫' => '⦫', - '⦬' => '⦬', - '⦭' => '⦭', - '⦮' => '⦮', - '⦯' => '⦯', - '⦰' => '⦰', - '⦱' => '⦱', - '⦲' => '⦲', - '⦳' => '⦳', - '⦴' => '⦴', - '⦵' => '⦵', - '⦶' => '⦶', - '⦷' => '⦷', - '⦹' => '⦹', - '⦻' => '⦻', - '⦼' => '⦼', - '⦾' => '⦾', - '⦿' => '⦿', - '⧀' => '⧀', - '⧁' => '⧁', - '⧂' => '⧂', - '⧃' => '⧃', - '⧄' => '⧄', - '⧅' => '⧅', - '⧉' => '⧉', - '⧍' => '⧍', - '⧎' => '⧎', - '⧏' => '⧏', - '⧏̸' => '&NotLeftTriangleBar', - '⧐' => '⧐', - '⧐̸' => '&NotRightTriangleBar', - '⧜' => '⧜', - '⧝' => '⧝', - '⧞' => '⧞', - '⧣' => '⧣', - '⧤' => '⧤', - '⧥' => '⧥', - '⧫' => '⧫', - '⧴' => '⧴', - '⧶' => '⧶', - '⨀' => '⨀', - '⨁' => '⨁', - '⨂' => '⨂', - '⨄' => '⨄', - '⨆' => '⨆', - '⨌' => '⨌', - '⨍' => '⨍', - '⨐' => '⨐', - '⨑' => '⨑', - '⨒' => '⨒', - '⨓' => '⨓', - '⨔' => '⨔', - '⨕' => '⨕', - '⨖' => '⨖', - '⨗' => '⨗', - '⨢' => '⨢', - '⨣' => '⨣', - '⨤' => '⨤', - '⨥' => '⨥', - '⨦' => '⨦', - '⨧' => '⨧', - '⨩' => '⨩', - '⨪' => '⨪', - '⨭' => '⨭', - '⨮' => '⨮', - '⨯' => '⨯', - '⨰' => '⨰', - '⨱' => '⨱', - '⨳' => '⨳', - '⨴' => '⨴', - '⨵' => '⨵', - '⨶' => '⨶', - '⨷' => '⨷', - '⨸' => '⨸', - '⨹' => '⨹', - '⨺' => '⨺', - '⨻' => '⨻', - '⨼' => '⨼', - '⨿' => '⨿', - '⩀' => '⩀', - '⩂' => '⩂', - '⩃' => '⩃', - '⩄' => '⩄', - '⩅' => '⩅', - '⩆' => '⩆', - '⩇' => '⩇', - '⩈' => '⩈', - '⩉' => '⩉', - '⩊' => '⩊', - '⩋' => '⩋', - '⩌' => '⩌', - '⩍' => '⩍', - '⩐' => '⩐', - '⩓' => '⩓', - '⩔' => '⩔', - '⩕' => '⩕', - '⩖' => '⩖', - '⩗' => '⩗', - '⩘' => '⩘', - '⩚' => '⩚', - '⩛' => '⩛', - '⩜' => '⩜', - '⩝' => '⩝', - '⩟' => '⩟', - '⩦' => '⩦', - '⩪' => '⩪', - '⩭' => '⩭', - '⩭̸' => '&ncongdot', - '⩮' => '⩮', - '⩯' => '⩯', - '⩰' => '⩰', - '⩰̸' => '&napE', - '⩱' => '⩱', - '⩲' => '⩲', - '⩳' => '⩳', - '⩴' => '⩴', - '⩵' => '⩵', - '⩷' => '⩷', - '⩸' => '⩸', - '⩹' => '⩹', - '⩺' => '⩺', - '⩻' => '⩻', - '⩼' => '⩼', - '⩽' => '⩽', - '⩽̸' => '&nles', - '⩾' => '⩾', - '⩾̸' => '&nges', - '⩿' => '⩿', - '⪀' => '⪀', - '⪁' => '⪁', - '⪂' => '⪂', - '⪃' => '⪃', - '⪄' => '⪄', - '⪅' => '⪅', - '⪆' => '⪆', - '⪇' => '⪇', - '⪈' => '⪈', - '⪉' => '⪉', - '⪊' => '⪊', - '⪋' => '⪋', - '⪌' => '⪌', - '⪍' => '⪍', - '⪎' => '⪎', - '⪏' => '⪏', - '⪐' => '⪐', - '⪑' => '⪑', - '⪒' => '⪒', - '⪓' => '⪓', - '⪔' => '⪔', - '⪕' => '⪕', - '⪖' => '⪖', - '⪗' => '⪗', - '⪘' => '⪘', - '⪙' => '⪙', - '⪚' => '⪚', - '⪝' => '⪝', - '⪞' => '⪞', - '⪟' => '⪟', - '⪠' => '⪠', - '⪡' => '⪡', - '⪡̸' => '&NotNestedLessLess', - '⪢' => '⪢', - '⪢̸' => '&NotNestedGreaterGreater', - '⪤' => '⪤', - '⪥' => '⪥', - '⪦' => '⪦', - '⪧' => '⪧', - '⪨' => '⪨', - '⪩' => '⪩', - '⪪' => '⪪', - '⪫' => '⪫', - '⪬' => '⪬', - '⪬︀' => '&smtes', - '⪭' => '⪭', - '⪭︀' => '&lates', - '⪮' => '⪮', - '⪯' => '⪯', - '⪯̸' => '&NotPrecedesEqual', - '⪰' => '⪰', - '⪰̸' => '&NotSucceedsEqual', - '⪳' => '⪳', - '⪴' => '⪴', - '⪵' => '⪵', - '⪶' => '⪶', - '⪷' => '⪷', - '⪸' => '⪸', - '⪹' => '⪹', - '⪺' => '⪺', - '⪻' => '⪻', - '⪼' => '⪼', - '⪽' => '⪽', - '⪾' => '⪾', - '⪿' => '⪿', - '⫀' => '⫀', - '⫁' => '⫁', - '⫂' => '⫂', - '⫃' => '⫃', - '⫄' => '⫄', - '⫅' => '⫅', - '⫅̸' => '&nsubE', - '⫆' => '⫆', - '⫆̸' => '&nsupseteqq', - '⫇' => '⫇', - '⫈' => '⫈', - '⫋' => '⫋', - '⫋︀' => '&vsubnE', - '⫌' => '⫌', - '⫌︀' => '&varsupsetneqq', - '⫏' => '⫏', - '⫐' => '⫐', - '⫑' => '⫑', - '⫒' => '⫒', - '⫓' => '⫓', - '⫔' => '⫔', - '⫕' => '⫕', - '⫖' => '⫖', - '⫗' => '⫗', - '⫘' => '⫘', - '⫙' => '⫙', - '⫚' => '⫚', - '⫛' => '⫛', - '⫤' => '⫤', - '⫦' => '⫦', - '⫧' => '⫧', - '⫨' => '⫨', - '⫩' => '⫩', - '⫫' => '⫫', - '⫬' => '⫬', - '⫭' => '⫭', - '⫮' => '⫮', - '⫯' => '⫯', - '⫰' => '⫰', - '⫱' => '⫱', - '⫲' => '⫲', - '⫳' => '⫳', - '⫽︀' => '&varsupsetneqq', - 'ff' => 'ff', - 'fi' => 'fi', - 'fl' => 'fl', - 'ffi' => 'ffi', - 'ffl' => 'ffl', - '𝒜' => '𝒜', - '𝒞' => '𝒞', - '𝒟' => '𝒟', - '𝒢' => '𝒢', - '𝒥' => '𝒥', - '𝒦' => '𝒦', - '𝒩' => '𝒩', - '𝒪' => '𝒪', - '𝒫' => '𝒫', - '𝒬' => '𝒬', - '𝒮' => '𝒮', - '𝒯' => '𝒯', - '𝒰' => '𝒰', - '𝒱' => '𝒱', - '𝒲' => '𝒲', - '𝒳' => '𝒳', - '𝒴' => '𝒴', - '𝒵' => '𝒵', - '𝒶' => '𝒶', - '𝒷' => '𝒷', - '𝒸' => '𝒸', - '𝒹' => '𝒹', - '𝒻' => '𝒻', - '𝒽' => '𝒽', - '𝒾' => '𝒾', - '𝒿' => '𝒿', - '𝓀' => '𝓀', - '𝓁' => '𝓁', - '𝓂' => '𝓂', - '𝓃' => '𝓃', - '𝓅' => '𝓅', - '𝓆' => '𝓆', - '𝓇' => '𝓇', - '𝓈' => '𝓈', - '𝓉' => '𝓉', - '𝓊' => '𝓊', - '𝓋' => '𝓋', - '𝓌' => '𝓌', - '𝓍' => '𝓍', - '𝓎' => '𝓎', - '𝓏' => '𝓏', - '𝔄' => '𝔄', - '𝔅' => '𝔅', - '𝔇' => '𝔇', - '𝔈' => '𝔈', - '𝔉' => '𝔉', - '𝔊' => '𝔊', - '𝔍' => '𝔍', - '𝔎' => '𝔎', - '𝔏' => '𝔏', - '𝔐' => '𝔐', - '𝔑' => '𝔑', - '𝔒' => '𝔒', - '𝔓' => '𝔓', - '𝔔' => '𝔔', - '𝔖' => '𝔖', - '𝔗' => '𝔗', - '𝔘' => '𝔘', - '𝔙' => '𝔙', - '𝔚' => '𝔚', - '𝔛' => '𝔛', - '𝔜' => '𝔜', - '𝔞' => '𝔞', - '𝔟' => '𝔟', - '𝔠' => '𝔠', - '𝔡' => '𝔡', - '𝔢' => '𝔢', - '𝔣' => '𝔣', - '𝔤' => '𝔤', - '𝔥' => '𝔥', - '𝔦' => '𝔦', - '𝔧' => '𝔧', - '𝔨' => '𝔨', - '𝔩' => '𝔩', - '𝔪' => '𝔪', - '𝔫' => '𝔫', - '𝔬' => '𝔬', - '𝔭' => '𝔭', - '𝔮' => '𝔮', - '𝔯' => '𝔯', - '𝔰' => '𝔰', - '𝔱' => '𝔱', - '𝔲' => '𝔲', - '𝔳' => '𝔳', - '𝔴' => '𝔴', - '𝔵' => '𝔵', - '𝔶' => '𝔶', - '𝔷' => '𝔷', - '𝔸' => '𝔸', - '𝔹' => '𝔹', - '𝔻' => '𝔻', - '𝔼' => '𝔼', - '𝔽' => '𝔽', - '𝔾' => '𝔾', - '𝕀' => '𝕀', - '𝕁' => '𝕁', - '𝕂' => '𝕂', - '𝕃' => '𝕃', - '𝕄' => '𝕄', - '𝕆' => '𝕆', - '𝕊' => '𝕊', - '𝕋' => '𝕋', - '𝕌' => '𝕌', - '𝕍' => '𝕍', - '𝕎' => '𝕎', - '𝕏' => '𝕏', - '𝕐' => '𝕐', - '𝕒' => '𝕒', - '𝕓' => '𝕓', - '𝕔' => '𝕔', - '𝕕' => '𝕕', - '𝕖' => '𝕖', - '𝕗' => '𝕗', - '𝕘' => '𝕘', - '𝕙' => '𝕙', - '𝕚' => '𝕚', - '𝕛' => '𝕛', - '𝕜' => '𝕜', - '𝕝' => '𝕝', - '𝕞' => '𝕞', - '𝕟' => '𝕟', - '𝕠' => '𝕠', - '𝕡' => '𝕡', - '𝕢' => '𝕢', - '𝕣' => '𝕣', - '𝕤' => '𝕤', - '𝕥' => '𝕥', - '𝕦' => '𝕦', - '𝕧' => '𝕧', - '𝕨' => '𝕨', - '𝕩' => '𝕩', - '𝕪' => '𝕪', - '𝕫' => '𝕫' - ); -} diff --git a/core/vendor/masterminds/html5/src/HTML5/Serializer/OutputRules.php b/core/vendor/masterminds/html5/src/HTML5/Serializer/OutputRules.php deleted file mode 100644 index c009698..0000000 --- a/core/vendor/masterminds/html5/src/HTML5/Serializer/OutputRules.php +++ /dev/null @@ -1,481 +0,0 @@ -'http://www.w3.org/1999/xhtml', - 'attrNamespace'=>'http://www.w3.org/1999/xhtml', - - 'nodeName'=>'img', 'nodeName'=>array('img', 'a'), - 'attrName'=>'alt', 'attrName'=>array('title', 'alt'), - - - 'prefixes'=>['xh'=>'http://www.w3.org/1999/xhtml'), - 'xpath' => "@checked[../../xh:input[@type='radio' or @type='checkbox']]", - ), - */ - array( - 'nodeNamespace'=>'http://www.w3.org/1999/xhtml', - 'attrName'=>array('alt', 'title'), - ), - - ); - - const DOCTYPE = ''; - - public function __construct($output, $options = array()) - { - if (isset($options['encode_entities'])) { - $this->encode = $options['encode_entities']; - } - - $this->outputMode = static::IM_IN_HTML; - $this->out = $output; - - // If HHVM, see https://github.com/facebook/hhvm/issues/2727 - $this->hasHTML5 = defined('ENT_HTML5') && !defined('HHVM_VERSION'); - } - public function addRule(array $rule) - { - $this->nonBooleanAttributes[] = $rule; - } - - public function setTraverser(\Masterminds\HTML5\Serializer\Traverser $traverser) - { - $this->traverser = $traverser; - - return $this; - } - - public function document($dom) - { - $this->doctype(); - if ($dom->documentElement) { - $this->traverser->node($dom->documentElement); - $this->nl(); - } - } - - protected function doctype() - { - $this->wr(static::DOCTYPE); - $this->nl(); - } - - public function element($ele) - { - $name = $ele->tagName; - - // Per spec: - // If the element has a declared namespace in the HTML, MathML or - // SVG namespaces, we use the lname instead of the tagName. - if ($this->traverser->isLocalElement($ele)) { - $name = $ele->localName; - } - - // If we are in SVG or MathML there is special handling. - // Using if/elseif instead of switch because it's faster in PHP. - if ($name == 'svg') { - $this->outputMode = static::IM_IN_SVG; - $name = Elements::normalizeSvgElement($name); - } elseif ($name == 'math') { - $this->outputMode = static::IM_IN_MATHML; - } - - $this->openTag($ele); - if (Elements::isA($name, Elements::TEXT_RAW)) { - foreach ($ele->childNodes as $child) { - $this->wr($child->data); - } - } else { - // Handle children. - if ($ele->hasChildNodes()) { - $this->traverser->children($ele->childNodes); - } - - // Close out the SVG or MathML special handling. - if ($name == 'svg' || $name == 'math') { - $this->outputMode = static::IM_IN_HTML; - } - } - - // If not unary, add a closing tag. - if (! Elements::isA($name, Elements::VOID_TAG)) { - $this->closeTag($ele); - } - } - - /** - * Write a text node. - * - * @param \DOMText $ele - * The text node to write. - */ - public function text($ele) - { - if (isset($ele->parentNode) && isset($ele->parentNode->tagName) && Elements::isA($ele->parentNode->localName, Elements::TEXT_RAW)) { - $this->wr($ele->data); - return; - } - - // FIXME: This probably needs some flags set. - $this->wr($this->enc($ele->data)); - } - - public function cdata($ele) - { - // This encodes CDATA. - $this->wr($ele->ownerDocument->saveXML($ele)); - } - - public function comment($ele) - { - // These produce identical output. - // $this->wr(''); - $this->wr($ele->ownerDocument->saveXML($ele)); - } - - public function processorInstruction($ele) - { - $this->wr('wr($ele->target) - ->wr(' ') - ->wr($ele->data) - ->wr('?>'); - } - /** - * Write the namespace attributes - * - * - * @param \DOMNode $ele - * The element being written. - */ - protected function namespaceAttrs($ele) - { - if (!$this->xpath || $this->xpath->document !== $ele->ownerDocument){ - $this->xpath = new \DOMXPath($ele->ownerDocument); - } - - foreach( $this->xpath->query('namespace::*[not(.=../../namespace::*)]', $ele ) as $nsNode ) { - if (!in_array($nsNode->nodeValue, $this->implicitNamespaces)) { - $this->wr(' ')->wr($nsNode->nodeName)->wr('="')->wr($nsNode->nodeValue)->wr('"'); - } - } - } - - /** - * Write the opening tag. - * - * Tags for HTML, MathML, and SVG are in the local name. Otherwise, use the - * qualified name (8.3). - * - * @param \DOMNode $ele - * The element being written. - */ - protected function openTag($ele) - { - $this->wr('<')->wr($this->traverser->isLocalElement($ele) ? $ele->localName : $ele->tagName); - - - $this->attrs($ele); - $this->namespaceAttrs($ele); - - - if ($this->outputMode == static::IM_IN_HTML) { - $this->wr('>'); - } // If we are not in html mode we are in SVG, MathML, or XML embedded content. - else { - if ($ele->hasChildNodes()) { - $this->wr('>'); - } // If there are no children this is self closing. - else { - $this->wr(' />'); - } - } - } - - protected function attrs($ele) - { - // FIXME: Needs support for xml, xmlns, xlink, and namespaced elements. - if (! $ele->hasAttributes()) { - return $this; - } - - // TODO: Currently, this always writes name="value", and does not do - // value-less attributes. - $map = $ele->attributes; - $len = $map->length; - for ($i = 0; $i < $len; ++ $i) { - $node = $map->item($i); - $val = $this->enc($node->value, true); - - // XXX: The spec says that we need to ensure that anything in - // the XML, XMLNS, or XLink NS's should use the canonical - // prefix. It seems that DOM does this for us already, but there - // may be exceptions. - $name = $node->name; - - // Special handling for attributes in SVG and MathML. - // Using if/elseif instead of switch because it's faster in PHP. - if ($this->outputMode == static::IM_IN_SVG) { - $name = Elements::normalizeSvgAttribute($name); - } elseif ($this->outputMode == static::IM_IN_MATHML) { - $name = Elements::normalizeMathMlAttribute($name); - } - - $this->wr(' ')->wr($name); - - if ((isset($val) && $val !== '') || $this->nonBooleanAttribute($node)) { - $this->wr('="')->wr($val)->wr('"'); - } - } - } - - - protected function nonBooleanAttribute(\DOMAttr $attr) - { - $ele = $attr->ownerElement; - foreach($this->nonBooleanAttributes as $rule){ - - if(isset($rule['nodeNamespace']) && $rule['nodeNamespace']!==$ele->namespaceURI){ - continue; - } - if(isset($rule['attNamespace']) && $rule['attNamespace']!==$attr->namespaceURI){ - continue; - } - if(isset($rule['nodeName']) && !is_array($rule['nodeName']) && $rule['nodeName']!==$ele->localName){ - continue; - } - if(isset($rule['nodeName']) && is_array($rule['nodeName']) && !in_array($ele->localName, $rule['nodeName'], true)){ - continue; - } - if(isset($rule['attrName']) && !is_array($rule['attrName']) && $rule['attrName']!==$attr->localName){ - continue; - } - if(isset($rule['attrName']) && is_array($rule['attrName']) && !in_array($attr->localName, $rule['attrName'], true)){ - continue; - } - if(isset($rule['xpath'])){ - - $xp = $this->getXPath($attr); - if(isset($rule['prefixes'])){ - foreach($rule['prefixes'] as $nsPrefix => $ns){ - $xp->registerNamespace($nsPrefix, $ns); - } - } - if(!$xp->query($rule['xpath'], $attr->ownerElement)->length){ - continue; - } - } - - return true; - } - - return false; - } - - private function getXPath(\DOMNode $node){ - if(!$this->xpath){ - $this->xpath = new \DOMXPath($node->ownerDocument); - } - return $this->xpath; - } - - /** - * Write the closing tag. - * - * Tags for HTML, MathML, and SVG are in the local name. Otherwise, use the - * qualified name (8.3). - * - * @param \DOMNode $ele - * The element being written. - */ - protected function closeTag($ele) - { - if ($this->outputMode == static::IM_IN_HTML || $ele->hasChildNodes()) { - $this->wr('wr($this->traverser->isLocalElement($ele) ? $ele->localName : $ele->tagName)->wr('>'); - } - } - - /** - * Write to the output. - * - * @param string $text - * The string to put into the output. - * - * @return \Masterminds\HTML5\Serializer\Traverser $this so it can be used in chaining. - */ - protected function wr($text) - { - fwrite($this->out, $text); - return $this; - } - - /** - * Write a new line character. - * - * @return \Masterminds\HTML5\Serializer\Traverser $this so it can be used in chaining. - */ - protected function nl() - { - fwrite($this->out, PHP_EOL); - return $this; - } - - /** - * Encode text. - * - * When encode is set to false, the default value, the text passed in is - * escaped per section 8.3 of the html5 spec. For details on how text is - * escaped see the escape() method. - * - * When encoding is set to true the text is converted to named character - * references where appropriate. Section 8.1.4 Character references of the - * html5 spec refers to using named character references. This is useful for - * characters that can't otherwise legally be used in the text. - * - * The named character references are listed in section 8.5. - * - * @see http://www.w3.org/TR/2013/CR-html5-20130806/syntax.html#named-character-references True encoding will turn all named character references into their entities. - * This includes such characters as +.# and many other common ones. By default - * encoding here will just escape &'<>". - * - * Note, PHP 5.4+ has better html5 encoding. - * - * @todo Use the Entities class in php 5.3 to have html5 entities. - * - * @param string $text - * text to encode. - * @param boolean $attribute - * True if we are encoding an attrubute, false otherwise - * - * @return string The encoded text. - */ - protected function enc($text, $attribute = false) - { - - // Escape the text rather than convert to named character references. - if (! $this->encode) { - return $this->escape($text, $attribute); - } - - // If we are in PHP 5.4+ we can use the native html5 entity functionality to - // convert the named character references. - - if ($this->hasHTML5) { - return htmlentities($text, ENT_HTML5 | ENT_SUBSTITUTE | ENT_QUOTES, 'UTF-8', false); - } // If a version earlier than 5.4 html5 entities are not entirely handled. - // This manually handles them. - else { - return strtr($text, \Masterminds\HTML5\Serializer\HTML5Entities::$map); - } - } - - /** - * Escape test. - * - * According to the html5 spec section 8.3 Serializing HTML fragments, text - * within tags that are not style, script, xmp, iframe, noembed, and noframes - * need to be properly escaped. - * - * The & should be converted to &, no breaking space unicode characters - * converted to  , when in attribute mode the " should be converted to - * ", and when not in attribute mode the < and > should be converted to - * < and >. - * - * @see http://www.w3.org/TR/2013/CR-html5-20130806/syntax.html#escapingString - * - * @param string $text - * text to escape. - * @param boolean $attribute - * True if we are escaping an attrubute, false otherwise - */ - protected function escape($text, $attribute = false) - { - - // Not using htmlspecialchars because, while it does escaping, it doesn't - // match the requirements of section 8.5. For example, it doesn't handle - // non-breaking spaces. - if ($attribute) { - $replace = array( - '"' => '"', - '&' => '&', - "\xc2\xa0" => ' ' - ); - } else { - $replace = array( - '<' => '<', - '>' => '>', - '&' => '&', - "\xc2\xa0" => ' ' - ); - } - - return strtr($text, $replace); - } -} diff --git a/core/vendor/masterminds/html5/src/HTML5/Serializer/README.md b/core/vendor/masterminds/html5/src/HTML5/Serializer/README.md deleted file mode 100644 index 849a47f..0000000 --- a/core/vendor/masterminds/html5/src/HTML5/Serializer/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# The Serializer (Writer) Model - -The serializer roughly follows sections _8.1 Writing HTML documents_ and section -_8.3 Serializing HTML fragments_ by converting DOMDocument, DOMDocumentFragment, -and DOMNodeList into HTML5. - - [ HTML5 ] // Interface for saving. - || - [ Traverser ] // Walk the DOM - || - [ Rules ] // Convert DOM elements into strings. - || - [ HTML5 ] // HTML5 document or fragment in text. - - -## HTML5 Class - -Provides the top level interface for saving. - -## The Traverser - -Walks the DOM finding each element and passing it off to the output rules to -convert to HTML5. - -## Output Rules - -The output rules are defined in the RulesInterface which can have multiple -implementations. Currently, the OutputRules is the default implementation that -converts a DOM as is into HTML5. - -## HTML5 String - -The output of the process it HTML5 as a string or saved to a file. \ No newline at end of file diff --git a/core/vendor/masterminds/html5/src/HTML5/Serializer/RulesInterface.php b/core/vendor/masterminds/html5/src/HTML5/Serializer/RulesInterface.php deleted file mode 100644 index 6ef5e5e..0000000 --- a/core/vendor/masterminds/html5/src/HTML5/Serializer/RulesInterface.php +++ /dev/null @@ -1,103 +0,0 @@ - 'html', - 'http://www.w3.org/1998/Math/MathML' => 'math', - 'http://www.w3.org/2000/svg' => 'svg' - ); - - protected $dom; - - protected $options; - - protected $encode = false; - - protected $rules; - - protected $out; - - /** - * Create a traverser. - * - * @param DOMNode|DOMNodeList $dom - * The document or node to traverse. - * @param resource $out - * A stream that allows writing. The traverser will output into this - * stream. - * @param array $options - * An array or options for the traverser as key/value pairs. These include: - * - encode_entities: A bool to specify if full encding should happen for all named - * charachter references. Defaults to false which escapes &'<>". - * - output_rules: The path to the class handling the output rules. - */ - public function __construct($dom, $out, RulesInterface $rules, $options = array()) - { - $this->dom = $dom; - $this->out = $out; - $this->rules = $rules; - $this->options = $options; - - $this->rules->setTraverser($this); - } - - /** - * Tell the traverser to walk the DOM. - * - * @return resource $out - * Returns the output stream. - */ - public function walk() - { - if ($this->dom instanceof \DOMDocument) { - $this->rules->document($this->dom); - } elseif ($this->dom instanceof \DOMDocumentFragment) { - // Document fragments are a special case. Only the children need to - // be serialized. - if ($this->dom->hasChildNodes()) { - $this->children($this->dom->childNodes); - } - } // If NodeList, loop - elseif ($this->dom instanceof \DOMNodeList) { - // If this is a NodeList of DOMDocuments this will not work. - $this->children($this->dom); - } // Else assume this is a DOMNode-like datastructure. - else { - $this->node($this->dom); - } - - return $this->out; - } - - /** - * Process a node in the DOM. - * - * @param mixed $node - * A node implementing \DOMNode. - */ - public function node($node) - { - // A listing of types is at http://php.net/manual/en/dom.constants.php - switch ($node->nodeType) { - case XML_ELEMENT_NODE: - $this->rules->element($node); - break; - case XML_TEXT_NODE: - $this->rules->text($node); - break; - case XML_CDATA_SECTION_NODE: - $this->rules->cdata($node); - break; - // FIXME: It appears that the parser doesn't do PI's. - case XML_PI_NODE: - $this->rules->processorInstruction($node); - break; - case XML_COMMENT_NODE: - $this->rules->comment($node); - break; - // Currently we don't support embedding DTDs. - default: - //print ''; - break; - } - } - - /** - * Walk through all the nodes on a node list. - * - * @param \DOMNodeList $nl - * A list of child elements to walk through. - */ - public function children($nl) - { - foreach ($nl as $node) { - $this->node($node); - } - } - - /** - * Is an element local? - * - * @param mixed $ele - * An element that implement \DOMNode. - * - * @return bool True if local and false otherwise. - */ - public function isLocalElement($ele) - { - $uri = $ele->namespaceURI; - if (empty($uri)) { - return false; - } - - return isset(static::$local_ns[$uri]); - } -} diff --git a/core/vendor/masterminds/html5/test/HTML5/ElementsTest.php b/core/vendor/masterminds/html5/test/HTML5/ElementsTest.php deleted file mode 100644 index 629b561..0000000 --- a/core/vendor/masterminds/html5/test/HTML5/ElementsTest.php +++ /dev/null @@ -1,486 +0,0 @@ -html5Elements as $element) { - $this->assertTrue(Elements::isHtml5Element($element), 'html5 element test failed on: ' . $element); - - $this->assertTrue(Elements::isHtml5Element(strtoupper($element)), 'html5 element test failed on: ' . strtoupper($element)); - } - - $nonhtml5 = array( - 'foo', - 'bar', - 'baz' - ); - foreach ($nonhtml5 as $element) { - $this->assertFalse(Elements::isHtml5Element($element), 'html5 element test failed on: ' . $element); - - $this->assertFalse(Elements::isHtml5Element(strtoupper($element)), 'html5 element test failed on: ' . strtoupper($element)); - } - } - - public function testIsMathMLElement() - { - foreach ($this->mathmlElements as $element) { - $this->assertTrue(Elements::isMathMLElement($element), 'MathML element test failed on: ' . $element); - - // MathML is case sensetitive so these should all fail. - $this->assertFalse(Elements::isMathMLElement(strtoupper($element)), 'MathML element test failed on: ' . strtoupper($element)); - } - - $nonMathML = array( - 'foo', - 'bar', - 'baz' - ); - foreach ($nonMathML as $element) { - $this->assertFalse(Elements::isMathMLElement($element), 'MathML element test failed on: ' . $element); - } - } - - public function testIsSvgElement() - { - foreach ($this->svgElements as $element) { - $this->assertTrue(Elements::isSvgElement($element), 'SVG element test failed on: ' . $element); - - // SVG is case sensetitive so these should all fail. - $this->assertFalse(Elements::isSvgElement(strtoupper($element)), 'SVG element test failed on: ' . strtoupper($element)); - } - - $nonSVG = array( - 'foo', - 'bar', - 'baz' - ); - foreach ($nonSVG as $element) { - $this->assertFalse(Elements::isSvgElement($element), 'SVG element test failed on: ' . $element); - } - } - - public function testIsElement() - { - foreach ($this->html5Elements as $element) { - $this->assertTrue(Elements::isElement($element), 'html5 element test failed on: ' . $element); - - $this->assertTrue(Elements::isElement(strtoupper($element)), 'html5 element test failed on: ' . strtoupper($element)); - } - - foreach ($this->mathmlElements as $element) { - $this->assertTrue(Elements::isElement($element), 'MathML element test failed on: ' . $element); - - // MathML is case sensetitive so these should all fail. - $this->assertFalse(Elements::isElement(strtoupper($element)), 'MathML element test failed on: ' . strtoupper($element)); - } - - foreach ($this->svgElements as $element) { - $this->assertTrue(Elements::isElement($element), 'SVG element test failed on: ' . $element); - - // SVG is case sensetitive so these should all fail. But, there is duplication - // html5 and SVG. Since html5 is case insensetitive we need to make sure - // it's not a html5 element first. - if (! in_array($element, $this->html5Elements)) { - $this->assertFalse(Elements::isElement(strtoupper($element)), 'SVG element test failed on: ' . strtoupper($element)); - } - } - - $nonhtml5 = array( - 'foo', - 'bar', - 'baz' - ); - foreach ($nonhtml5 as $element) { - $this->assertFalse(Elements::isElement($element), 'html5 element test failed on: ' . $element); - - $this->assertFalse(Elements::isElement(strtoupper($element)), 'html5 element test failed on: ' . strtoupper($element)); - } - } - - public function testElement() - { - foreach ($this->html5Elements as $element) { - $this->assertGreaterThan(0, Elements::element($element)); - } - $nonhtml5 = array( - 'foo', - 'bar', - 'baz' - ); - foreach ($nonhtml5 as $element) { - $this->assertFalse(Elements::element($element)); - } - } - - public function testIsA() - { - $this->assertTrue(Elements::isA('script', Elements::KNOWN_ELEMENT)); - $this->assertFalse(Elements::isA('scriptypoo', Elements::KNOWN_ELEMENT)); - $this->assertTrue(Elements::isA('script', Elements::TEXT_RAW)); - $this->assertFalse(Elements::isA('script', Elements::TEXT_RCDATA)); - - $voidElements = array( - 'area', - 'base', - 'basefont', - 'bgsound', - 'br', - 'col', - 'command', - 'embed', - 'frame', - 'hr', - 'img' - ); - - foreach ($voidElements as $element) { - $this->assertTrue(Elements::isA($element, Elements::VOID_TAG), 'Void element test failed on: ' . $element); - } - - $nonVoid = array( - 'span', - 'a', - 'div' - ); - foreach ($nonVoid as $tag) { - $this->assertFalse(Elements::isA($tag, Elements::VOID_TAG), 'Void element test failed on: ' . $tag); - } - - $blockTags = array( - 'address', - 'article', - 'aside', - 'audio', - 'blockquote', - 'canvas', - 'dd', - 'div', - 'dl', - 'fieldset', - 'figcaption', - 'figure', - 'footer', - 'form', - 'h1', - 'h2', - 'h3', - 'h4', - 'h5', - 'h6', - 'header', - 'hgroup', - 'hr', - 'noscript', - 'ol', - 'output', - 'p', - 'pre', - 'section', - 'table', - 'tfoot', - 'ul', - 'video' - ); - - foreach ($blockTags as $tag) { - $this->assertTrue(Elements::isA($tag, Elements::BLOCK_TAG), 'Block tag test failed on: ' . $tag); - } - - $nonBlockTags = array( - 'span', - 'img', - 'label' - ); - foreach ($nonBlockTags as $tag) { - $this->assertFalse(Elements::isA($tag, Elements::BLOCK_TAG), 'Block tag test failed on: ' . $tag); - } - } - - public function testNormalizeSvgElement() - { - $tests = array( - 'foo' => 'foo', - 'altglyph' => 'altGlyph', - 'BAR' => 'bar', - 'fespecularlighting' => 'feSpecularLighting', - 'bAz' => 'baz', - 'foreignobject' => 'foreignObject' - ); - - foreach ($tests as $input => $expected) { - $this->assertEquals($expected, Elements::normalizeSvgElement($input)); - } - } - - public function testNormalizeSvgAttribute() - { - $tests = array( - 'foo' => 'foo', - 'attributename' => 'attributeName', - 'BAR' => 'bar', - 'limitingconeangle' => 'limitingConeAngle', - 'bAz' => 'baz', - 'patterncontentunits' => 'patternContentUnits' - ); - - foreach ($tests as $input => $expected) { - $this->assertEquals($expected, Elements::normalizeSvgAttribute($input)); - } - } - - public function testNormalizeMathMlAttribute() - { - $tests = array( - 'foo' => 'foo', - 'definitionurl' => 'definitionURL', - 'BAR' => 'bar' - ); - - foreach ($tests as $input => $expected) { - $this->assertEquals($expected, Elements::normalizeMathMlAttribute($input)); - } - } -} diff --git a/core/vendor/masterminds/html5/test/HTML5/Html5Test.html b/core/vendor/masterminds/html5/test/HTML5/Html5Test.html deleted file mode 100644 index a976e8b..0000000 --- a/core/vendor/masterminds/html5/test/HTML5/Html5Test.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - Test - - -

    This is a test.

    - - \ No newline at end of file diff --git a/core/vendor/masterminds/html5/test/HTML5/Html5Test.php b/core/vendor/masterminds/html5/test/HTML5/Html5Test.php deleted file mode 100644 index a1a6c9c..0000000 --- a/core/vendor/masterminds/html5/test/HTML5/Html5Test.php +++ /dev/null @@ -1,398 +0,0 @@ -html5 = $this->getInstance(); - } - - /** - * Parse and serialize a string. - */ - protected function cycle($html) - { - $dom = $this->html5->loadHTML('' . $html . ''); - $out = $this->html5->saveHTML($dom); - - return $out; - } - - protected function cycleFragment($fragment) - { - $dom = $this->html5->loadHTMLFragment($fragment); - $out = $this->html5->saveHTML($dom); - - return $out; - } - - public function testLoadOptions() - { - // doc - $dom = $this->html5->loadHTML($this->wrap(''), array( - 'implicitNamespaces' => array('t' => 'http://example.com'), - "xmlNamespaces" => true - )); - $this->assertInstanceOf('\DOMDocument', $dom); - $this->assertEmpty($this->html5->getErrors()); - $this->assertFalse($this->html5->hasErrors()); - - $xpath = new \DOMXPath( $dom ); - $xpath->registerNamespace( "t", "http://example.com" ); - $this->assertEquals(1, $xpath->query( "//t:tag" )->length); - - // doc fragment - $frag = $this->html5->loadHTMLFragment('', array( - 'implicitNamespaces' => array('t' => 'http://example.com'), - "xmlNamespaces" => true - )); - $this->assertInstanceOf('\DOMDocumentFragment', $frag); - $this->assertEmpty($this->html5->getErrors()); - $this->assertFalse($this->html5->hasErrors()); - - $frag->ownerDocument->appendChild($frag); - $xpath = new \DOMXPath( $frag->ownerDocument ); - $xpath->registerNamespace( "t", "http://example.com" ); - $this->assertEquals(1, $xpath->query( "//t:tag" , $frag)->length); - } - - public function testErrors() - { - $dom = $this->html5->loadHTML(''); - $this->assertInstanceOf('\DOMDocument', $dom); - - $this->assertNotEmpty($this->html5->getErrors()); - $this->assertTrue($this->html5->hasErrors()); - } - - public function testLoad() - { - $dom = $this->html5->load(__DIR__ . '/Html5Test.html'); - $this->assertInstanceOf('\DOMDocument', $dom); - $this->assertEmpty($this->html5->getErrors()); - $this->assertFalse($this->html5->hasErrors()); - - $file = fopen(__DIR__ . '/Html5Test.html', 'r'); - $dom = $this->html5->load($file); - $this->assertInstanceOf('\DOMDocument', $dom); - $this->assertEmpty($this->html5->getErrors()); - - $dom = $this->html5->loadHTMLFile(__DIR__ . '/Html5Test.html'); - $this->assertInstanceOf('\DOMDocument', $dom); - $this->assertEmpty($this->html5->getErrors()); - } - - public function testLoadHTML() - { - $contents = file_get_contents(__DIR__ . '/Html5Test.html'); - $dom = $this->html5->loadHTML($contents); - $this->assertInstanceOf('\DOMDocument', $dom); - $this->assertEmpty($this->html5->getErrors()); - } - - public function testLoadHTMLFragment() - { - $fragment = '
    Baz
    '; - $dom = $this->html5->loadHTMLFragment($fragment); - $this->assertInstanceOf('\DOMDocumentFragment', $dom); - $this->assertEmpty($this->html5->getErrors()); - } - - public function testSaveHTML() - { - $dom = $this->html5->load(__DIR__ . '/Html5Test.html'); - $this->assertInstanceOf('\DOMDocument', $dom); - $this->assertEmpty($this->html5->getErrors()); - - $saved = $this->html5->saveHTML($dom); - $this->assertRegExp('|

    This is a test.

    |', $saved); - } - - public function testSaveHTMLFragment() - { - $fragment = '
    Baz
    '; - $dom = $this->html5->loadHTMLFragment($fragment); - - $string = $this->html5->saveHTML($dom); - $this->assertEquals($fragment, $string); - } - - public function testSave() - { - $dom = $this->html5->load(__DIR__ . '/Html5Test.html'); - $this->assertInstanceOf('\DOMDocument', $dom); - $this->assertEmpty($this->html5->getErrors()); - - // Test resource - $file = fopen('php://temp', 'w'); - $this->html5->save($dom, $file); - $content = stream_get_contents($file, - 1, 0); - $this->assertRegExp('|

    This is a test.

    |', $content); - - // Test file - $tmpfname = tempnam(sys_get_temp_dir(), "html5-php"); - $this->html5->save($dom, $tmpfname); - $content = file_get_contents($tmpfname); - $this->assertRegExp('|

    This is a test.

    |', $content); - unlink($tmpfname); - } - - // This test reads a document into a dom, turn the dom into a document, - // then tries to read that document again. This makes sure we are reading, - // and generating a document that works at a high level. - public function testItWorks() - { - $dom = $this->html5->load(__DIR__ . '/Html5Test.html'); - $this->assertInstanceOf('\DOMDocument', $dom); - $this->assertEmpty($this->html5->getErrors()); - - $saved = $this->html5->saveHTML($dom); - - $dom2 = $this->html5->loadHTML($saved); - $this->assertInstanceOf('\DOMDocument', $dom2); - $this->assertEmpty($this->html5->getErrors()); - } - - public function testConfig() - { - $html5 = $this->getInstance(); - $options = $html5->getOptions(); - $this->assertEquals(false, $options['encode_entities']); - - $html5 = $this->getInstance(array( - 'foo' => 'bar', - 'encode_entities' => true - )); - $options = $html5->getOptions(); - $this->assertEquals('bar', $options['foo']); - $this->assertEquals(true, $options['encode_entities']); - - // Need to reset to original so future tests pass as expected. - // $this->getInstance()->setOption('encode_entities', false); - } - - public function testSvg() - { - $dom = $this->html5->loadHTML( - ' - - -
    foo bar baz
    - - - - - - - Test Text. - - - - - '); - - $this->assertEmpty($this->html5->getErrors()); - - // Test a mixed case attribute. - $list = $dom->getElementsByTagName('svg'); - $this->assertNotEmpty($list->length); - $svg = $list->item(0); - $this->assertEquals("0 0 3 2", $svg->getAttribute('viewBox')); - $this->assertFalse($svg->hasAttribute('viewbox')); - - // Test a mixed case tag. - // Note: getElementsByTagName is not case sensetitive. - $list = $dom->getElementsByTagName('textPath'); - $this->assertNotEmpty($list->length); - $textPath = $list->item(0); - $this->assertEquals('textPath', $textPath->tagName); - $this->assertNotEquals('textpath', $textPath->tagName); - - $html = $this->html5->saveHTML($dom); - $this->assertRegExp('||', $html); - $this->assertRegExp('||', $html); - } - - public function testMathMl() - { - $dom = $this->html5->loadHTML( - ' - - -
    foo bar baz
    - - x - - ± - - y - - - '); - - $this->assertEmpty($this->html5->getErrors()); - $list = $dom->getElementsByTagName('math'); - $this->assertNotEmpty($list->length); - - $list = $dom->getElementsByTagName('div'); - $this->assertNotEmpty($list->length); - $div = $list->item(0); - $this->assertEquals('http://example.com', $div->getAttribute('definitionurl')); - $this->assertFalse($div->hasAttribute('definitionURL')); - $list = $dom->getElementsByTagName('csymbol'); - $csymbol = $list->item(0); - $this->assertEquals('http://www.example.com/mathops/multiops.html#plusminus', $csymbol->getAttribute('definitionURL')); - $this->assertFalse($csymbol->hasAttribute('definitionurl')); - - $html = $this->html5->saveHTML($dom); - $this->assertRegExp('||', $html); - $this->assertRegExp('|y|', $html); - } - - public function testUnknownElements() - { - // The : should not have special handling accourding to section 2.9 of the - // spec. This is differenant than XML. Since we don't know these elements - // they are handled as normal elements. Note, to do this is really - // an invalid example and you should not embed prefixed xml in html5. - $dom = $this->html5->loadHTMLFragment( - " - Big rectangle thing - 40 - 80 - - um, yeah"); - - $this->assertEmpty($this->html5->getErrors()); - $markup = $this->html5->saveHTML($dom); - $this->assertRegExp('|Big rectangle thing|', $markup); - $this->assertRegExp('|um, yeah|', $markup); - } - - public function testElements() - { - // Should have content. - $res = $this->cycle('
    FOO
    '); - $this->assertRegExp('|
    FOO
    |', $res); - - // Should be empty - $res = $this->cycle(''); - $this->assertRegExp('||', $res); - - // Should have content. - $res = $this->cycleFragment('
    FOO
    '); - $this->assertRegExp('|
    FOO
    |', $res); - - // Should be empty - $res = $this->cycleFragment(''); - $this->assertRegExp('||', $res); - - // Elements with dashes and underscores - $res = $this->cycleFragment(''); - $this->assertRegExp('||', $res); - $res = $this->cycleFragment(''); - $this->assertRegExp('||', $res); - - // Should have no closing tag. - $res = $this->cycle('
    '); - $this->assertRegExp('|
    |', $res); - } - - public function testAttributes() - { - $res = $this->cycle('
    FOO
    '); - $this->assertRegExp('|
    FOO
    |', $res); - - // XXX: Note that spec does NOT require attrs in the same order. - $res = $this->cycle('
    FOO
    '); - $this->assertRegExp('|
    FOO
    |', $res); - - $res = $this->cycle('
    FOO
    '); - $this->assertRegExp('|
    FOO
    |', $res); - - $res = $this->cycleFragment('
    FOO
    '); - $this->assertRegExp('|
    FOO
    |', $res); - - // XXX: Note that spec does NOT require attrs in the same order. - $res = $this->cycleFragment('
    FOO
    '); - $this->assertRegExp('|
    FOO
    |', $res); - - $res = $this->cycleFragment('
    FOO
    '); - $this->assertRegExp('|
    FOO
    |', $res); - } - - public function testPCData() - { - $res = $this->cycle('This is a test.'); - $this->assertRegExp('|This is a test.|', $res); - - $res = $this->cycleFragment('This is a test.'); - $this->assertRegExp('|This is a test.|', $res); - - $res = $this->cycle('This - is - a - test.'); - - // Check that newlines are there, but don't count spaces. - $this->assertRegExp('|This\n\s*is\n\s*a\n\s*test.|', $res); - - $res = $this->cycleFragment('This - is - a - test.'); - - // Check that newlines are there, but don't count spaces. - $this->assertRegExp('|This\n\s*is\n\s*a\n\s*test.|', $res); - - $res = $this->cycle('This is a test.'); - $this->assertRegExp('|This is a test.|', $res); - - $res = $this->cycleFragment('This is a test.'); - $this->assertRegExp('|This is a test.|', $res); - } - - public function testUnescaped() - { - $res = $this->cycle(''); - $this->assertRegExp('|2 < 1|', $res); - - $res = $this->cycle(''); - $this->assertRegExp('|div>div>div|', $res); - - $res = $this->cycleFragment(''); - $this->assertRegExp('|2 < 1|', $res); - - $res = $this->cycleFragment(''); - $this->assertRegExp('|div>div>div|', $res); - } - - public function testEntities() - { - $res = $this->cycle('Apples & bananas.'); - $this->assertRegExp('|Apples & bananas.|', $res); - - $res = $this->cycleFragment('Apples & bananas.'); - $this->assertRegExp('|Apples & bananas.|', $res); - } - - public function testComment() - { - $res = $this->cycle('ab'); - $this->assertRegExp('||', $res); - - $res = $this->cycleFragment('ab'); - $this->assertRegExp('||', $res); - } - - public function testCDATA() - { - $res = $this->cycle('a a test. ]]>b'); - $this->assertRegExp('| a test\. \]\]>|', $res); - - $res = $this->cycleFragment('a a test. ]]>b'); - $this->assertRegExp('| a test\. \]\]>|', $res); - } -} diff --git a/core/vendor/masterminds/html5/test/HTML5/Parser/CharacterReferenceTest.php b/core/vendor/masterminds/html5/test/HTML5/Parser/CharacterReferenceTest.php deleted file mode 100644 index 762bcc2..0000000 --- a/core/vendor/masterminds/html5/test/HTML5/Parser/CharacterReferenceTest.php +++ /dev/null @@ -1,44 +0,0 @@ -assertEquals('&', CharacterReference::lookupName('amp')); - $this->assertEquals('<', CharacterReference::lookupName('lt')); - $this->assertEquals('>', CharacterReference::lookupName('gt')); - $this->assertEquals('"', CharacterReference::lookupName('quot')); - $this->assertEquals('∌', CharacterReference::lookupName('NotReverseElement')); - - $this->assertNull(CharacterReference::lookupName('StinkyCheese')); - } - - public function testLookupHex() - { - $this->assertEquals('<', CharacterReference::lookupHex('3c')); - $this->assertEquals('<', CharacterReference::lookupHex('003c')); - $this->assertEquals('&', CharacterReference::lookupHex('26')); - $this->assertEquals('}', CharacterReference::lookupHex('7d')); - $this->assertEquals('Σ', CharacterReference::lookupHex('3A3')); - $this->assertEquals('Σ', CharacterReference::lookupHex('03A3')); - $this->assertEquals('Σ', CharacterReference::lookupHex('3a3')); - $this->assertEquals('Σ', CharacterReference::lookupHex('03a3')); - } - - public function testLookupDecimal() - { - $this->assertEquals('&', CharacterReference::lookupDecimal(38)); - $this->assertEquals('&', CharacterReference::lookupDecimal('38')); - $this->assertEquals('<', CharacterReference::lookupDecimal(60)); - $this->assertEquals('Σ', CharacterReference::lookupDecimal(931)); - $this->assertEquals('Σ', CharacterReference::lookupDecimal('0931')); - } -} diff --git a/core/vendor/masterminds/html5/test/HTML5/Parser/DOMTreeBuilderTest.php b/core/vendor/masterminds/html5/test/HTML5/Parser/DOMTreeBuilderTest.php deleted file mode 100644 index 3c18039..0000000 --- a/core/vendor/masterminds/html5/test/HTML5/Parser/DOMTreeBuilderTest.php +++ /dev/null @@ -1,537 +0,0 @@ -parse(); - $this->errors = $treeBuilder->getErrors(); - - return $treeBuilder->document(); - } - - /** - * Utility function for parsing a fragment of HTML5. - */ - protected function parseFragment($string) - { - $treeBuilder = new DOMTreeBuilder(true); - $input = new StringInputStream($string); - $scanner = new Scanner($input); - $parser = new Tokenizer($scanner, $treeBuilder); - - $parser->parse(); - $this->errors = $treeBuilder->getErrors(); - - return $treeBuilder->fragment(); - } - - public function testDocument() - { - $html = ""; - $doc = $this->parse($html); - - $this->assertInstanceOf('\DOMDocument', $doc); - $this->assertEquals('html', $doc->documentElement->tagName); - $this->assertEquals('http://www.w3.org/1999/xhtml', $doc->documentElement->namespaceURI); - } - - public function testStrangeCapitalization() - { - $html = " - - - Hello, world! - - TheBody - "; - $doc = $this->parse($html); - - $this->assertInstanceOf('\DOMDocument', $doc); - $this->assertEquals('html', $doc->documentElement->tagName); - - $xpath = new \DOMXPath( $doc ); - $xpath->registerNamespace( "x", "http://www.w3.org/1999/xhtml" ); - - $this->assertEquals("Hello, world!", $xpath->query( "//x:title" )->item( 0 )->nodeValue); - $this->assertEquals("foo", $xpath->query( "//x:script" )->item( 0 )->nodeValue); - } - - public function testDocumentWithDisabledNamespaces() - { - $html = ""; - $doc = $this->parse($html, array('disable_html_ns' => true)); - - $this->assertInstanceOf('\DOMDocument', $doc); - $this->assertEquals('html', $doc->documentElement->tagName); - $this->assertNull($doc->documentElement->namespaceURI); - } - - public function testDocumentWithATargetDocument() - { - $targetDom = new \DOMDocument(); - - $html = ""; - $doc = $this->parse($html, array('target_document' => $targetDom)); - - $this->assertInstanceOf('\DOMDocument', $doc); - $this->assertSame($doc, $targetDom); - $this->assertEquals('html', $doc->documentElement->tagName); - } - - public function testDocumentFakeAttrAbsence() - { - $html = "foo"; - $doc = $this->parse($html, array('xmlNamespaces'=>true)); - - $xp = new \DOMXPath($doc); - $this->assertEquals(0, $xp->query("//@html5-php-fake-id-attribute")->length); - } - - public function testFragment() - { - $html = "
    test
    test2"; - $doc = $this->parseFragment($html); - - $this->assertInstanceOf('\DOMDocumentFragment', $doc); - $this->assertTrue($doc->hasChildNodes()); - $this->assertEquals('div', $doc->childNodes->item(0)->tagName); - $this->assertEquals('test', $doc->childNodes->item(0)->textContent); - $this->assertEquals('span', $doc->childNodes->item(1)->tagName); - $this->assertEquals('test2', $doc->childNodes->item(1)->textContent); - } - - public function testElements() - { - $html = ""; - $doc = $this->parse($html); - $root = $doc->documentElement; - - $this->assertEquals('html', $root->tagName); - $this->assertEquals('html', $root->localName); - $this->assertEquals('html', $root->nodeName); - - $this->assertEquals(2, $root->childNodes->length); - $kids = $root->childNodes; - - $this->assertEquals('head', $kids->item(0)->tagName); - $this->assertEquals('body', $kids->item(1)->tagName); - - $head = $kids->item(0); - $this->assertEquals(1, $head->childNodes->length); - $this->assertEquals('title', $head->childNodes->item(0)->tagName); - } - - public function testImplicitNamespaces() - { - $dom = $this->parse('foo'); - $a = $dom->getElementsByTagName('a')->item(0); - $attr = $a->getAttributeNode('xlink:href'); - $this->assertEquals('http://www.w3.org/1999/xlink', $attr->namespaceURI); - - $dom = $this->parse('foo'); - $a = $dom->getElementsByTagName('a')->item(0); - $attr = $a->getAttributeNode('xml:base'); - $this->assertEquals('http://www.w3.org/XML/1998/namespace', $attr->namespaceURI); - } - - public function testCustomImplicitNamespaces() - { - $dom = $this->parse('foo', array( - 'implicitNamespaces' => array( - 't' => 'http://www.example.com' - ) - )); - $a = $dom->getElementsByTagName('a')->item(0); - $attr = $a->getAttributeNode('t:href'); - $this->assertEquals('http://www.example.com', $attr->namespaceURI); - - $dom = $this->parse('foo', array( - 'implicitNamespaces' => array( - 't' => 'http://www.example.com' - ) - )); - $list = $dom->getElementsByTagNameNS('http://www.example.com', 'a'); - $this->assertEquals(1, $list->length); - } - - public function testXmlNamespaces() - { - $dom = $this->parse( - ' - - foo - -
    foo
    - ', array( - 'xmlNamespaces' => true - )); - $a = $dom->getElementsByTagName('a')->item(0); - $attr = $a->getAttributeNode('t:href'); - $this->assertEquals('http://www.example.com', $attr->namespaceURI); - - $list = $dom->getElementsByTagNameNS('http://www.example.com', 'body'); - $this->assertEquals(1, $list->length); - } - - public function testXmlNamespaceNesting() - { - $dom = $this->parse( - ' - - - - - - -
    - - - - ', array( - 'xmlNamespaces' => true - )); - - - $this->assertEmpty($this->errors); - - $div = $dom->getElementById('div'); - $this->assertEquals('http://www.w3.org/1999/xhtml', $div->namespaceURI); - - $body = $dom->getElementById('body'); - $this->assertEquals('http://www.w3.org/1999/xhtml', $body->namespaceURI); - - $bar1 = $dom->getElementById('bar1'); - $this->assertEquals('http://www.prefixed.com/bar1', $bar1->namespaceURI); - - $bar2 = $dom->getElementById('bar2'); - $this->assertEquals("http://www.prefixed.com/bar2", $bar2->namespaceURI); - - $bar3 = $dom->getElementById('bar3'); - $this->assertEquals("http://www.w3.org/1999/xhtml", $bar3->namespaceURI); - - $bar4 = $dom->getElementById('bar4'); - $this->assertEquals("http://www.prefixed.com/bar4", $bar4->namespaceURI); - - $svg = $dom->getElementById('svg'); - $this->assertEquals("http://www.w3.org/2000/svg", $svg->namespaceURI); - - $prefixed = $dom->getElementById('prefixed'); - $this->assertEquals("http://www.prefixed.com", $prefixed->namespaceURI); - - $prefixed = $dom->getElementById('bar5'); - $this->assertEquals("http://www.prefixed.com/xn", $prefixed->namespaceURI); - - $prefixed = $dom->getElementById('bar5_x'); - $this->assertEquals("http://www.prefixed.com/bar5_x", $prefixed->namespaceURI); - } - - public function testMoveNonInlineElements() - { - $doc = $this->parse('

    line1


    line2

    '); - $this->assertEquals('

    line1


    line2', $doc->saveXML($doc->documentElement), 'Move non-inline elements outside of inline containers.'); - - $doc = $this->parse('

    line1

    line2

    '); - $this->assertEquals('

    line1

    line2
    ', $doc->saveXML($doc->documentElement), 'Move non-inline elements outside of inline containers.'); - } - - public function testAttributes() - { - $html = " - - - - "; - $doc = $this->parse($html); - $root = $doc->documentElement; - - $body = $root->GetElementsByTagName('body')->item(0); - $this->assertEquals('body', $body->tagName); - $this->assertTrue($body->hasAttributes()); - $this->assertEquals('a', $body->getAttribute('id')); - $this->assertEquals('b c', $body->getAttribute('class')); - - $body2 = $doc->getElementById('a'); - $this->assertEquals('body', $body2->tagName); - $this->assertEquals('a', $body2->getAttribute('id')); - } - - public function testSVGAttributes() - { - $html = " - - - - foo - - "; - $doc = $this->parse($html); - $root = $doc->documentElement; - - $svg = $root->getElementsByTagName('svg')->item(0); - $this->assertTrue($svg->hasAttribute('viewBox')); - - $rect = $root->getElementsByTagName('rect')->item(0); - $this->assertTrue($rect->hasAttribute('textLength')); - - $ac = $root->getElementsByTagName('animateColor'); - $this->assertEquals(1, $ac->length); - } - - public function testMathMLAttribute() - { - $html = ' - - - - x - - ± - - y - - - '; - - $doc = $this->parse($html); - $root = $doc->documentElement; - - $csymbol = $root->getElementsByTagName('csymbol')->item(0); - $this->assertTrue($csymbol->hasAttribute('definitionURL')); - } - - public function testMissingHtmlTag() - { - $html = "test"; - $doc = $this->parse($html); - - $this->assertEquals('html', $doc->documentElement->tagName); - $this->assertEquals('title', $doc->documentElement->childNodes->item(0)->tagName); - } - - public function testComment() - { - $html = ''; - - $doc = $this->parse($html); - - $comment = $doc->documentElement->childNodes->item(0); - $this->assertEquals(XML_COMMENT_NODE, $comment->nodeType); - $this->assertEquals("Hello World.", $comment->data); - - $html = ''; - $doc = $this->parse($html); - - $comment = $doc->childNodes->item(1); - $this->assertEquals(XML_COMMENT_NODE, $comment->nodeType); - $this->assertEquals("Hello World.", $comment->data); - - $comment = $doc->childNodes->item(2); - $this->assertEquals(XML_ELEMENT_NODE, $comment->nodeType); - $this->assertEquals("html", $comment->tagName); - } - - public function testCDATA() - { - $html = "test"; - $doc = $this->parse($html); - - $wrapper = $doc->getElementsByTagName('math')->item(0); - $this->assertEquals(1, $wrapper->childNodes->length); - $cdata = $wrapper->childNodes->item(0); - $this->assertEquals(XML_CDATA_SECTION_NODE, $cdata->nodeType); - $this->assertEquals('test', $cdata->data); - } - - public function testText() - { - $html = "test"; - $doc = $this->parse($html); - - $wrapper = $doc->getElementsByTagName('math')->item(0); - $this->assertEquals(1, $wrapper->childNodes->length); - $data = $wrapper->childNodes->item(0); - $this->assertEquals(XML_TEXT_NODE, $data->nodeType); - $this->assertEquals('test', $data->data); - - // The DomTreeBuilder has special handling for text when in before head mode. - $html = " - Foo"; - $doc = $this->parse($html); - $this->assertEquals('Line 0, Col 0: Unexpected text. Ignoring: Foo', $this->errors[0]); - $headElement = $doc->documentElement->firstChild; - $this->assertEquals('head', $headElement->tagName); - } - - public function testParseErrors() - { - $html = "test"; - $doc = $this->parse($html); - - // We're JUST testing that we can access errors. Actual testing of - // error messages happen in the Tokenizer's tests. - $this->assertGreaterThan(0, count($this->errors)); - $this->assertTrue(is_string($this->errors[0])); - } - - public function testProcessingInstruction() - { - // Test the simple case, which is where PIs are inserted into the DOM. - $doc = $this->parse('<!DOCTYPE html><html><?foo bar?>'); - $this->assertEquals(1, $doc->documentElement->childNodes->length); - $pi = $doc->documentElement->firstChild; - $this->assertInstanceOf('\DOMProcessingInstruction', $pi); - $this->assertEquals('foo', $pi->nodeName); - $this->assertEquals('bar', $pi->data); - - // Leading xml PIs should be ignored. - $doc = $this->parse('<?xml version="1.0"?><!DOCTYPE html><html><head></head></html>'); - - $this->assertEquals(2, $doc->childNodes->length); - $this->assertInstanceOf('\DOMDocumentType', $doc->childNodes->item(0)); - $this->assertInstanceOf('\DOMElement', $doc->childNodes->item(1)); - } - - public function testAutocloseP() - { - $html = "<!DOCTYPE html><html><body><p><figure></body></html>"; - $doc = $this->parse($html); - - $p = $doc->getElementsByTagName('p')->item(0); - $this->assertEquals(0, $p->childNodes->length); - $this->assertEquals('figure', $p->nextSibling->tagName); - } - - public function testAutocloseLI() - { - $html = '<!doctype html> - <html lang="en"> - <body> - <ul><li>Foo<li>Bar<li>Baz</ul> - </body> - </html>'; - - $doc = $this->parse($html); - $length = $doc->getElementsByTagName('ul')->item(0)->childNodes->length; - $this->assertEquals(3, $length); - } - - public function testMathML() - { - $html = '<!doctype html> - <html lang="en"> - <body> - <math xmlns="http://www.w3.org/1998/Math/MathML"> - <mi>x</mi> - <csymbol definitionurl="http://www.example.com/mathops/multiops.html#plusminus"> - <mo>&PlusMinus;</mo> - </csymbol> - <mi>y</mi> - </math> - </body> - </html>'; - - $doc = $this->parse($html); - $math = $doc->getElementsByTagName('math')->item(0); - $this->assertEquals('math', $math->tagName); - $this->assertEquals('math', $math->nodeName); - $this->assertEquals('math', $math->localName); - $this->assertEquals('http://www.w3.org/1998/Math/MathML', $math->namespaceURI); - } - - public function testSVG() - { - $html = '<!doctype html> - <html lang="en"> - <body> - <svg width="150" height="100" viewBox="0 0 3 2" xmlns="http://www.w3.org/2000/svg"> - <rect width="1" height="2" x="2" fill="#d2232c" /> - <text font-family="Verdana" font-size="32"> - <textpath xlink:href="#Foo"> - Test Text. - </textPath> - </text> - </svg> - </body> - </html>'; - - $doc = $this->parse($html); - $svg = $doc->getElementsByTagName('svg')->item(0); - $this->assertEquals('svg', $svg->tagName); - $this->assertEquals('svg', $svg->nodeName); - $this->assertEquals('svg', $svg->localName); - $this->assertEquals('http://www.w3.org/2000/svg', $svg->namespaceURI); - - $textPath = $doc->getElementsByTagName('textPath')->item(0); - $this->assertEquals('textPath', $textPath->tagName); - } - - public function testNoScript() - { - $html = '<!DOCTYPE html><html><head><noscript>No JS</noscript></head></html>'; - $doc = $this->parse($html); - $this->assertEmpty($this->errors); - $noscript = $doc->getElementsByTagName('noscript')->item(0); - $this->assertEquals('noscript', $noscript->tagName); - } - - /** - * Regression for issue #13 - */ - public function testRegressionHTMLNoBody() - { - $html = '<!DOCTYPE html><html><span id="test">Test</span></html>'; - $doc = $this->parse($html); - $span = $doc->getElementById('test'); - - $this->assertEmpty($this->errors); - - $this->assertEquals('span', $span->tagName); - $this->assertEquals('Test', $span->textContent); - } - - public function testInstructionProcessor() - { - $string = '<!DOCTYPE html><html><?foo bar ?></html>'; - - $treeBuilder = new DOMTreeBuilder(); - $is = new InstructionProcessorMock(); - $treeBuilder->setInstructionProcessor($is); - - $input = new StringInputStream($string); - $scanner = new Scanner($input); - $parser = new Tokenizer($scanner, $treeBuilder); - - $parser->parse(); - $dom = $treeBuilder->document(); - $div = $dom->getElementsByTagName('div')->item(0); - - $this->assertEquals(1, $is->count); - $this->assertEquals('foo', $is->name); - $this->assertEquals('bar ', $is->data); - $this->assertEquals('div', $div->tagName); - $this->assertEquals('foo', $div->textContent); - } -} diff --git a/core/vendor/masterminds/html5/test/HTML5/Parser/EventStack.php b/core/vendor/masterminds/html5/test/HTML5/Parser/EventStack.php deleted file mode 100644 index 60e2abe..0000000 --- a/core/vendor/masterminds/html5/test/HTML5/Parser/EventStack.php +++ /dev/null @@ -1,116 +0,0 @@ -<?php -namespace Masterminds\HTML5\Tests\Parser; - -use Masterminds\HTML5\Elements; -use Masterminds\HTML5\Parser\EventHandler; - -/** - * This testing class gathers events from a parser and builds a stack of events. - * It is useful for checking the output of a tokenizer. - * - * IMPORTANT: - * - * The startTag event also kicks the parser into TEXT_RAW when it encounters - * script or pre tags. This is to match the behavior required by the HTML5 spec, - * which says that the tree builder must tell the tokenizer when to switch states. - */ -class EventStack implements EventHandler -{ - - protected $stack; - - public function __construct() - { - $this->stack = array(); - } - - /** - * Get the event stack. - */ - public function events() - { - return $this->stack; - } - - public function depth() - { - return count($this->stack); - } - - public function get($index) - { - return $this->stack[$index]; - } - - protected function store($event, $data = null) - { - $this->stack[] = array( - 'name' => $event, - 'data' => $data - ); - } - - public function doctype($name, $type = 0, $id = null, $quirks = false) - { - $args = array( - $name, - $type, - $id, - $quirks - ); - $this->store('doctype', $args); - } - - public function startTag($name, $attributes = array(), $selfClosing = false) - { - $args = func_get_args(); - $this->store('startTag', $args); - if ($name == 'pre' || $name == 'script') { - return Elements::TEXT_RAW; - } - } - - public function endTag($name) - { - $this->store('endTag', array( - $name - )); - } - - public function comment($cdata) - { - $this->store('comment', array( - $cdata - )); - } - - public function cdata($data) - { - $this->store('cdata', func_get_args()); - } - - public function text($cdata) - { - // fprintf(STDOUT, "Received TEXT event with: " . $cdata); - $this->store('text', array( - $cdata - )); - } - - public function eof() - { - $this->store('eof'); - } - - public function parseError($msg, $line, $col) - { - // throw new EventStackParseError(sprintf("%s (line %d, col %d)", $msg, $line, $col)); - // $this->store(sprintf("%s (line %d, col %d)", $msg, $line, $col)); - $this->store('error', func_get_args()); - } - - public function processingInstruction($name, $data = null) - { - $this->store('pi', func_get_args()); - } -} diff --git a/core/vendor/masterminds/html5/test/HTML5/Parser/EventStackError.php b/core/vendor/masterminds/html5/test/HTML5/Parser/EventStackError.php deleted file mode 100644 index e58fdff..0000000 --- a/core/vendor/masterminds/html5/test/HTML5/Parser/EventStackError.php +++ /dev/null @@ -1,6 +0,0 @@ -<?php -namespace Masterminds\HTML5\Tests\Parser; - -class EventStackError extends \Exception -{ -} diff --git a/core/vendor/masterminds/html5/test/HTML5/Parser/FileInputStreamTest.html b/core/vendor/masterminds/html5/test/HTML5/Parser/FileInputStreamTest.html deleted file mode 100644 index a976e8b..0000000 --- a/core/vendor/masterminds/html5/test/HTML5/Parser/FileInputStreamTest.html +++ /dev/null @@ -1,10 +0,0 @@ -<!doctype html> -<html lang="en"> - <head> - <meta charset="utf-8"> - <title>Test</title> - </head> - <body> - <p>This is a test.</p> - </body> -</html> \ No newline at end of file diff --git a/core/vendor/masterminds/html5/test/HTML5/Parser/FileInputStreamTest.php b/core/vendor/masterminds/html5/test/HTML5/Parser/FileInputStreamTest.php deleted file mode 100644 index 71dd828..0000000 --- a/core/vendor/masterminds/html5/test/HTML5/Parser/FileInputStreamTest.php +++ /dev/null @@ -1,195 +0,0 @@ -<?php -namespace Masterminds\HTML5\Tests\Parser; - -use Masterminds\HTML5\Parser\FileInputStream; - -class FileInputStreamTest extends \Masterminds\HTML5\Tests\TestCase -{ - - public function testConstruct() - { - $s = new FileInputStream(__DIR__ . '/FileInputStreamTest.html'); - - $this->assertInstanceOf('\Masterminds\HTML5\Parser\FileInputStream', $s); - } - - public function testNext() - { - $s = new FileInputStream(__DIR__ . '/FileInputStreamTest.html'); - - $s->next(); - $this->assertEquals('!', $s->current()); - $s->next(); - $this->assertEquals('d', $s->current()); - } - - public function testKey() - { - $s = new FileInputStream(__DIR__ . '/FileInputStreamTest.html'); - - $this->assertEquals(0, $s->key()); - - $s->next(); - $this->assertEquals(1, $s->key()); - } - - public function testPeek() - { - $s = new FileInputStream(__DIR__ . '/FileInputStreamTest.html'); - - $this->assertEquals('!', $s->peek()); - - $s->next(); - $this->assertEquals('d', $s->peek()); - } - - public function testCurrent() - { - $s = new FileInputStream(__DIR__ . '/FileInputStreamTest.html'); - - $this->assertEquals('<', $s->current()); - - $s->next(); - $this->assertEquals('!', $s->current()); - - $s->next(); - $this->assertEquals('d', $s->current()); - } - - public function testColumnOffset() - { - $s = new FileInputStream(__DIR__ . '/FileInputStreamTest.html'); - $this->assertEquals(0, $s->columnOffset()); - $s->next(); - $this->assertEquals(1, $s->columnOffset()); - $s->next(); - $this->assertEquals(2, $s->columnOffset()); - $s->next(); - $this->assertEquals(3, $s->columnOffset()); - - // Make sure we get to the second line - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $this->assertEquals(0, $s->columnOffset()); - - $s->next(); - $canary = $s->current(); // h - $this->assertEquals('h', $canary); - $this->assertEquals(1, $s->columnOffset()); - } - - public function testCurrentLine() - { - $s = new FileInputStream(__DIR__ . '/FileInputStreamTest.html'); - - $this->assertEquals(1, $s->currentLine()); - - // Make sure we get to the second line - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $this->assertEquals(2, $s->currentLine()); - - // Make sure we get to the third line - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $this->assertEquals(3, $s->currentLine()); - } - - public function testRemainingChars() - { - $text = file_get_contents(__DIR__ . '/FileInputStreamTest.html'); - $s = new FileInputStream(__DIR__ . '/FileInputStreamTest.html'); - $this->assertEquals($text, $s->remainingChars()); - - $text = substr(file_get_contents(__DIR__ . '/FileInputStreamTest.html'), 1); - $s = new FileInputStream(__DIR__ . '/FileInputStreamTest.html'); - $s->next(); // Pop one. - $this->assertEquals($text, $s->remainingChars()); - } - - public function testCharsUnitl() - { - $s = new FileInputStream(__DIR__ . '/FileInputStreamTest.html'); - - $this->assertEquals('', $s->charsUntil('<')); - // Pointer at '<', moves to ' ' - $this->assertEquals('<!doctype', $s->charsUntil(' ', 20)); - - // Pointer at ' ', moves to '>' - $this->assertEquals(' html', $s->charsUntil('>')); - - // Pointer at '>', moves to '\n'. - $this->assertEquals('>', $s->charsUntil("\n")); - - // Pointer at '\n', move forward then to the next'\n'. - $s->next(); - $this->assertEquals('<html lang="en">', $s->charsUntil("\n")); - - // Ony get one of the spaces. - $this->assertEquals("\n ", $s->charsUntil('<', 2)); - - // Get the other space. - $this->assertEquals(" ", $s->charsUntil('<')); - - // This should scan to the end of the file. - $text = "<head> - <meta charset=\"utf-8\"> - <title>Test</title> - </head> - <body> - <p>This is a test.</p> - </body> -</html>"; - $this->assertEquals($text, $s->charsUntil("\t")); - } - - public function testCharsWhile() - { - $s = new FileInputStream(__DIR__ . '/FileInputStreamTest.html'); - - $this->assertEquals('<!', $s->charsWhile('!<')); - $this->assertEquals('', $s->charsWhile('>')); - $this->assertEquals('doctype', $s->charsWhile('odcyept')); - $this->assertEquals(' htm', $s->charsWhile('html ', 4)); - } -} diff --git a/core/vendor/masterminds/html5/test/HTML5/Parser/InstructionProcessorMock.php b/core/vendor/masterminds/html5/test/HTML5/Parser/InstructionProcessorMock.php deleted file mode 100644 index 32a2204..0000000 --- a/core/vendor/masterminds/html5/test/HTML5/Parser/InstructionProcessorMock.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php -namespace Masterminds\HTML5\Tests\Parser; - -class InstructionProcessorMock implements \Masterminds\HTML5\InstructionProcessor -{ - - public $name = null; - - public $data = null; - - public $count = 0; - - public function process(\DOMElement $element, $name, $data) - { - $this->name = $name; - $this->data = $data; - $this->count ++; - - $div = $element->ownerDocument->createElement("div"); - $div->nodeValue = 'foo'; - - $element->appendChild($div); - - return $div; - } -} diff --git a/core/vendor/masterminds/html5/test/HTML5/Parser/ScannerTest.php b/core/vendor/masterminds/html5/test/HTML5/Parser/ScannerTest.php deleted file mode 100644 index 8fa5110..0000000 --- a/core/vendor/masterminds/html5/test/HTML5/Parser/ScannerTest.php +++ /dev/null @@ -1,171 +0,0 @@ -<?php -/** - * @file - * Test the Scanner. This requires the InputStream tests are all good. - */ -namespace Masterminds\HTML5\Tests\Parser; - -use Masterminds\HTML5\Parser\StringInputStream; -use Masterminds\HTML5\Parser\Scanner; - -class ScannerTest extends \Masterminds\HTML5\Tests\TestCase -{ - - /** - * A canary test to make sure the basics are setup and working. - */ - public function testConstruct() - { - $is = new StringInputStream("abc"); - $s = new Scanner($is); - - $this->assertInstanceOf('\Masterminds\HTML5\Parser\Scanner', $s); - } - - public function testNext() - { - $s = new Scanner(new StringInputStream("abc")); - - $this->assertEquals('b', $s->next()); - $this->assertEquals('c', $s->next()); - } - - public function testPosition() - { - $s = new Scanner(new StringInputStream("abc")); - - $this->assertEquals(0, $s->position()); - - $s->next(); - $this->assertEquals(1, $s->position()); - } - - public function testPeek() - { - $s = new Scanner(new StringInputStream("abc")); - - $this->assertEquals('b', $s->peek()); - - $s->next(); - $this->assertEquals('c', $s->peek()); - } - - public function testCurrent() - { - $s = new Scanner(new StringInputStream("abc")); - - // Before scanning the string begins the current is empty. - $this->assertEquals('a', $s->current()); - - $c = $s->next(); - $this->assertEquals('b', $s->current()); - - // Test movement through the string. - $c = $s->next(); - $this->assertEquals('c', $s->current()); - } - - public function testUnconsume() - { - $s = new Scanner(new StringInputStream("abcdefghijklmnopqrst")); - - // Get initial position. - $s->next(); - $start = $s->position(); - - // Move forward a bunch of positions. - $amount = 7; - for ($i = 0; $i < $amount; $i ++) { - $s->next(); - } - - // Roll back the amount we moved forward. - $s->unconsume($amount); - - $this->assertEquals($start, $s->position()); - } - - public function testGetHex() - { - $s = new Scanner(new StringInputStream("ab13ck45DE*")); - - $this->assertEquals('ab13c', $s->getHex()); - - $s->next(); - $this->assertEquals('45DE', $s->getHex()); - } - - public function testGetAsciiAlpha() - { - $s = new Scanner(new StringInputStream("abcdef1%mnop*")); - - $this->assertEquals('abcdef', $s->getAsciiAlpha()); - - // Move past the 1% to scan the next group of text. - $s->next(); - $s->next(); - $this->assertEquals('mnop', $s->getAsciiAlpha()); - } - - public function testGetAsciiAlphaNum() - { - $s = new Scanner(new StringInputStream("abcdef1ghpo#mn94op")); - - $this->assertEquals('abcdef1ghpo', $s->getAsciiAlphaNum()); - - // Move past the # to scan the next group of text. - $s->next(); - $this->assertEquals('mn94op', $s->getAsciiAlphaNum()); - } - - public function testGetNumeric() - { - $s = new Scanner(new StringInputStream("1784a 45 9867 #")); - - $this->assertEquals('1784', $s->getNumeric()); - - // Move past the 'a ' to scan the next group of text. - $s->next(); - $s->next(); - $this->assertEquals('45', $s->getNumeric()); - } - - public function testCurrentLine() - { - $s = new Scanner(new StringInputStream("1784a\n45\n9867 #\nThis is a test.")); - - $this->assertEquals(1, $s->currentLine()); - - // Move to the next line. - $s->getAsciiAlphaNum(); - $s->next(); - $this->assertEquals(2, $s->currentLine()); - } - - public function testColumnOffset() - { - $s = new Scanner(new StringInputStream("1784a a\n45 9867 #\nThis is a test.")); - - // Move the pointer to the space. - $s->getAsciiAlphaNum(); - $this->assertEquals(5, $s->columnOffset()); - - // We move the pointer ahead. There must be a better way to do this. - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $s->next(); - $this->assertEquals(3, $s->columnOffset()); - } - - public function testRemainingChars() - { - $string = "\n45\n9867 #\nThis is a test."; - $s = new Scanner(new StringInputStream("1784a\n45\n9867 #\nThis is a test.")); - - $s->getAsciiAlphaNum(); - $this->assertEquals($string, $s->remainingChars()); - } -} diff --git a/core/vendor/masterminds/html5/test/HTML5/Parser/StringInputStreamTest.php b/core/vendor/masterminds/html5/test/HTML5/Parser/StringInputStreamTest.php deleted file mode 100644 index f87cc10..0000000 --- a/core/vendor/masterminds/html5/test/HTML5/Parser/StringInputStreamTest.php +++ /dev/null @@ -1,327 +0,0 @@ -<?php -namespace Masterminds\HTML5\Tests\Parser; - -use Masterminds\HTML5\Parser\StringInputStream; - -class StringInputStreamTest extends \Masterminds\HTML5\Tests\TestCase -{ - - /** - * A canary test to make sure the basics are setup and working. - */ - public function testConstruct() - { - $s = new StringInputStream("abc"); - - $this->assertInstanceOf('\Masterminds\HTML5\Parser\StringInputStream', $s); - } - - public function testNext() - { - $s = new StringInputStream("abc"); - - $s->next(); - $this->assertEquals('b', $s->current()); - $s->next(); - $this->assertEquals('c', $s->current()); - } - - public function testKey() - { - $s = new StringInputStream("abc"); - - $this->assertEquals(0, $s->key()); - - $s->next(); - $this->assertEquals(1, $s->key()); - } - - public function testPeek() - { - $s = new StringInputStream("abc"); - - $this->assertEquals('b', $s->peek()); - - $s->next(); - $this->assertEquals('c', $s->peek()); - } - - public function testCurrent() - { - $s = new StringInputStream("abc"); - - // Before scanning the string begins the current is empty. - $this->assertEquals('a', $s->current()); - - $s->next(); - $this->assertEquals('b', $s->current()); - - // Test movement through the string. - $s->next(); - $this->assertEquals('c', $s->current()); - } - - public function testColumnOffset() - { - $s = new StringInputStream("abc\ndef\n"); - $this->assertEquals(0, $s->columnOffset()); - $s->next(); - $this->assertEquals(1, $s->columnOffset()); - $s->next(); - $this->assertEquals(2, $s->columnOffset()); - $s->next(); - $this->assertEquals(3, $s->columnOffset()); - $s->next(); // LF - $this->assertEquals(0, $s->columnOffset()); - $s->next(); - $canary = $s->current(); // e - $this->assertEquals('e', $canary); - $this->assertEquals(1, $s->columnOffset()); - - $s = new StringInputStream("abc"); - $this->assertEquals(0, $s->columnOffset()); - $s->next(); - $this->assertEquals(1, $s->columnOffset()); - $s->next(); - $this->assertEquals(2, $s->columnOffset()); - } - - public function testCurrentLine() - { - $txt = "1\n2\n\n\n\n3"; - $stream = new StringInputStream($txt); - $this->assertEquals(1, $stream->currentLine()); - - // Advance over 1 and LF on to line 2 value 2. - $stream->next(); - $stream->next(); - $canary = $stream->current(); - $this->assertEquals(2, $stream->currentLine()); - $this->assertEquals('2', $canary); - - // Advance over 4x LF - $stream->next(); - $stream->next(); - $stream->next(); - $stream->next(); - $stream->next(); - $this->assertEquals(6, $stream->currentLine()); - $this->assertEquals('3', $stream->current()); - - // Make sure it doesn't do 7. - $this->assertEquals(6, $stream->currentLine()); - } - - public function testRemainingChars() - { - $text = "abcd"; - $s = new StringInputStream($text); - $this->assertEquals($text, $s->remainingChars()); - - $text = "abcd"; - $s = new StringInputStream($text); - $s->next(); // Pop one. - $this->assertEquals('bcd', $s->remainingChars()); - } - - public function testCharsUnitl() - { - $text = "abcdefffffffghi"; - $s = new StringInputStream($text); - $this->assertEquals('', $s->charsUntil('a')); - // Pointer at 'a', moves 2 to 'c' - $this->assertEquals('ab', $s->charsUntil('w', 2)); - - // Pointer at 'c', moves to first 'f' - $this->assertEquals('cde', $s->charsUntil('fzxv')); - - // Only get five 'f's - $this->assertEquals('fffff', $s->charsUntil('g', 5)); - - // Get just the last two 'f's - $this->assertEquals('ff', $s->charsUntil('g')); - - // This should scan to the end. - $this->assertEquals('ghi', $s->charsUntil('w', 9)); - } - - public function testCharsWhile() - { - $text = "abcdefffffffghi"; - $s = new StringInputStream($text); - - $this->assertEquals('ab', $s->charsWhile('ba')); - - $this->assertEquals('', $s->charsWhile('a')); - $this->assertEquals('cde', $s->charsWhile('cdeba')); - $this->assertEquals('ff', $s->charsWhile('f', 2)); - $this->assertEquals('fffff', $s->charsWhile('f')); - $this->assertEquals('g', $s->charsWhile('fg')); - $this->assertEquals('hi', $s->charsWhile('fghi', 99)); - } - - public function testBOM() - { - // Ignore in-text BOM. - $stream = new StringInputStream("a\xEF\xBB\xBF"); - $this->assertEquals("a\xEF\xBB\xBF", $stream->remainingChars(), 'A non-leading U+FEFF (BOM/ZWNBSP) should remain'); - - // Strip leading BOM - $leading = new StringInputStream("\xEF\xBB\xBFa"); - $this->assertEquals('a', $leading->current(), 'BOM should be stripped'); - } - - public function testCarriageReturn() - { - // Replace NULL with Unicode replacement. - $stream = new StringInputStream("\0\0\0"); - $this->assertEquals("\xEF\xBF\xBD\xEF\xBF\xBD\xEF\xBF\xBD", $stream->remainingChars(), 'Null character should be replaced by U+FFFD'); - $this->assertEquals(3, count($stream->errors), 'Null character should set parse error: ' . print_r($stream->errors, true)); - - // Remove CR when next to LF. - $stream = new StringInputStream("\r\n"); - $this->assertEquals("\n", $stream->remainingChars(), 'CRLF should be replaced by LF'); - - // Convert CR to LF when on its own. - $stream = new StringInputStream("\r"); - $this->assertEquals("\n", $stream->remainingChars(), 'CR should be replaced by LF'); - } - - public function invalidParseErrorTestHandler($input, $numErrors, $name) - { - $stream = new StringInputStream($input, 'UTF-8'); - $this->assertEquals($input, $stream->remainingChars(), $name . ' (stream content)'); - $this->assertEquals($numErrors, count($stream->errors), $name . ' (number of errors)'); - } - - public function testInvalidReplace() - { - $invalidTest = array( - - // Min/max overlong - "\xC0\x80a" => 'Overlong representation of U+0000', - "\xE0\x80\x80a" => 'Overlong representation of U+0000', - "\xF0\x80\x80\x80a" => 'Overlong representation of U+0000', - "\xF8\x80\x80\x80\x80a" => 'Overlong representation of U+0000', - "\xFC\x80\x80\x80\x80\x80a" => 'Overlong representation of U+0000', - "\xC1\xBFa" => 'Overlong representation of U+007F', - "\xE0\x9F\xBFa" => 'Overlong representation of U+07FF', - "\xF0\x8F\xBF\xBFa" => 'Overlong representation of U+FFFF', - - "a\xDF" => 'Incomplete two byte sequence (missing final byte)', - "a\xEF\xBF" => 'Incomplete three byte sequence (missing final byte)', - "a\xF4\xBF\xBF" => 'Incomplete four byte sequence (missing final byte)', - - // Min/max continuation bytes - "a\x80" => 'Lone 80 continuation byte', - "a\xBF" => 'Lone BF continuation byte', - - // Invalid bytes (these can never occur) - "a\xFE" => 'Invalid FE byte', - "a\xFF" => 'Invalid FF byte' - ); - foreach ($invalidTest as $test => $note) { - $stream = new StringInputStream($test); - $this->assertEquals('a', $stream->remainingChars(), $note); - } - - // MPB: - // It appears that iconv just leaves these alone. Not sure what to - // do. - /* - * $converted = array( "a\xF5\x90\x80\x80" => 'U+110000, off unicode planes.', ); foreach ($converted as $test => $note) { $stream = new StringInputStream($test); $this->assertEquals(2, mb_strlen($stream->remainingChars()), $note); } - */ - } - - public function testInvalidParseError() - { - // C0 controls (except U+0000 and U+000D due to different handling) - $this->invalidParseErrorTestHandler("\x01", 1, 'U+0001 (C0 control)'); - $this->invalidParseErrorTestHandler("\x02", 1, 'U+0002 (C0 control)'); - $this->invalidParseErrorTestHandler("\x03", 1, 'U+0003 (C0 control)'); - $this->invalidParseErrorTestHandler("\x04", 1, 'U+0004 (C0 control)'); - $this->invalidParseErrorTestHandler("\x05", 1, 'U+0005 (C0 control)'); - $this->invalidParseErrorTestHandler("\x06", 1, 'U+0006 (C0 control)'); - $this->invalidParseErrorTestHandler("\x07", 1, 'U+0007 (C0 control)'); - $this->invalidParseErrorTestHandler("\x08", 1, 'U+0008 (C0 control)'); - $this->invalidParseErrorTestHandler("\x09", 0, 'U+0009 (C0 control)'); - $this->invalidParseErrorTestHandler("\x0A", 0, 'U+000A (C0 control)'); - $this->invalidParseErrorTestHandler("\x0B", 1, 'U+000B (C0 control)'); - $this->invalidParseErrorTestHandler("\x0C", 0, 'U+000C (C0 control)'); - $this->invalidParseErrorTestHandler("\x0E", 1, 'U+000E (C0 control)'); - $this->invalidParseErrorTestHandler("\x0F", 1, 'U+000F (C0 control)'); - $this->invalidParseErrorTestHandler("\x10", 1, 'U+0010 (C0 control)'); - $this->invalidParseErrorTestHandler("\x11", 1, 'U+0011 (C0 control)'); - $this->invalidParseErrorTestHandler("\x12", 1, 'U+0012 (C0 control)'); - $this->invalidParseErrorTestHandler("\x13", 1, 'U+0013 (C0 control)'); - $this->invalidParseErrorTestHandler("\x14", 1, 'U+0014 (C0 control)'); - $this->invalidParseErrorTestHandler("\x15", 1, 'U+0015 (C0 control)'); - $this->invalidParseErrorTestHandler("\x16", 1, 'U+0016 (C0 control)'); - $this->invalidParseErrorTestHandler("\x17", 1, 'U+0017 (C0 control)'); - $this->invalidParseErrorTestHandler("\x18", 1, 'U+0018 (C0 control)'); - $this->invalidParseErrorTestHandler("\x19", 1, 'U+0019 (C0 control)'); - $this->invalidParseErrorTestHandler("\x1A", 1, 'U+001A (C0 control)'); - $this->invalidParseErrorTestHandler("\x1B", 1, 'U+001B (C0 control)'); - $this->invalidParseErrorTestHandler("\x1C", 1, 'U+001C (C0 control)'); - $this->invalidParseErrorTestHandler("\x1D", 1, 'U+001D (C0 control)'); - $this->invalidParseErrorTestHandler("\x1E", 1, 'U+001E (C0 control)'); - $this->invalidParseErrorTestHandler("\x1F", 1, 'U+001F (C0 control)'); - - // DEL (U+007F) - $this->invalidParseErrorTestHandler("\x7F", 1, 'U+007F'); - - // C1 Controls - $this->invalidParseErrorTestHandler("\xC2\x80", 1, 'U+0080 (C1 control)'); - $this->invalidParseErrorTestHandler("\xC2\x9F", 1, 'U+009F (C1 control)'); - $this->invalidParseErrorTestHandler("\xC2\xA0", 0, 'U+00A0 (first codepoint above highest C1 control)'); - - // Charcters surrounding surrogates - $this->invalidParseErrorTestHandler("\xED\x9F\xBF", 0, 'U+D7FF (one codepoint below lowest surrogate codepoint)'); - $this->invalidParseErrorTestHandler("\xEF\xBF\xBD", 0, 'U+DE00 (one codepoint above highest surrogate codepoint)'); - - // Permanent noncharacters - $this->invalidParseErrorTestHandler("\xEF\xB7\x90", 1, 'U+FDD0 (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xEF\xB7\xAF", 1, 'U+FDEF (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xEF\xBF\xBE", 1, 'U+FFFE (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xEF\xBF\xBF", 1, 'U+FFFF (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF0\x9F\xBF\xBE", 1, 'U+1FFFE (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF0\x9F\xBF\xBF", 1, 'U+1FFFF (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF0\xAF\xBF\xBE", 1, 'U+2FFFE (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF0\xAF\xBF\xBF", 1, 'U+2FFFF (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF0\xBF\xBF\xBE", 1, 'U+3FFFE (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF0\xBF\xBF\xBF", 1, 'U+3FFFF (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF1\x8F\xBF\xBE", 1, 'U+4FFFE (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF1\x8F\xBF\xBF", 1, 'U+4FFFF (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF1\x9F\xBF\xBE", 1, 'U+5FFFE (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF1\x9F\xBF\xBF", 1, 'U+5FFFF (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF1\xAF\xBF\xBE", 1, 'U+6FFFE (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF1\xAF\xBF\xBF", 1, 'U+6FFFF (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF1\xBF\xBF\xBE", 1, 'U+7FFFE (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF1\xBF\xBF\xBF", 1, 'U+7FFFF (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF2\x8F\xBF\xBE", 1, 'U+8FFFE (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF2\x8F\xBF\xBF", 1, 'U+8FFFF (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF2\x9F\xBF\xBE", 1, 'U+9FFFE (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF2\x9F\xBF\xBF", 1, 'U+9FFFF (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF2\xAF\xBF\xBE", 1, 'U+AFFFE (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF2\xAF\xBF\xBF", 1, 'U+AFFFF (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF2\xBF\xBF\xBE", 1, 'U+BFFFE (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF2\xBF\xBF\xBF", 1, 'U+BFFFF (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF3\x8F\xBF\xBE", 1, 'U+CFFFE (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF3\x8F\xBF\xBF", 1, 'U+CFFFF (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF3\x9F\xBF\xBE", 1, 'U+DFFFE (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF3\x9F\xBF\xBF", 1, 'U+DFFFF (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF3\xAF\xBF\xBE", 1, 'U+EFFFE (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF3\xAF\xBF\xBF", 1, 'U+EFFFF (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF3\xBF\xBF\xBE", 1, 'U+FFFFE (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF3\xBF\xBF\xBF", 1, 'U+FFFFF (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF4\x8F\xBF\xBE", 1, 'U+10FFFE (permanent noncharacter)'); - $this->invalidParseErrorTestHandler("\xF4\x8F\xBF\xBF", 1, 'U+10FFFF (permanent noncharacter)'); - - // MPB: These pass on some versions of iconv, and fail on others. Since we aren't in the - // business of writing tests against iconv, I've just commented these out. Should revisit - // at a later point. - /* - * $this->invalidParseErrorTestHandler("\xED\xA0\x80", 1, 'U+D800 (UTF-16 surrogate character)'); $this->invalidParseErrorTestHandler("\xED\xAD\xBF", 1, 'U+DB7F (UTF-16 surrogate character)'); $this->invalidParseErrorTestHandler("\xED\xAE\x80", 1, 'U+DB80 (UTF-16 surrogate character)'); $this->invalidParseErrorTestHandler("\xED\xAF\xBF", 1, 'U+DBFF (UTF-16 surrogate character)'); $this->invalidParseErrorTestHandler("\xED\xB0\x80", 1, 'U+DC00 (UTF-16 surrogate character)'); $this->invalidParseErrorTestHandler("\xED\xBE\x80", 1, 'U+DF80 (UTF-16 surrogate character)'); $this->invalidParseErrorTestHandler("\xED\xBF\xBF", 1, 'U+DFFF (UTF-16 surrogate character)'); // Paired UTF-16 surrogates $this->invalidParseErrorTestHandler("\xED\xA0\x80\xED\xB0\x80", 2, 'U+D800 U+DC00 (paired UTF-16 surrogates)'); $this->invalidParseErrorTestHandler("\xED\xA0\x80\xED\xBF\xBF", 2, 'U+D800 U+DFFF (paired UTF-16 surrogates)'); $this->invalidParseErrorTestHandler("\xED\xAD\xBF\xED\xB0\x80", 2, 'U+DB7F U+DC00 (paired UTF-16 surrogates)'); $this->invalidParseErrorTestHandler("\xED\xAD\xBF\xED\xBF\xBF", 2, 'U+DB7F U+DFFF (paired UTF-16 surrogates)'); $this->invalidParseErrorTestHandler("\xED\xAE\x80\xED\xB0\x80", 2, 'U+DB80 U+DC00 (paired UTF-16 surrogates)'); $this->invalidParseErrorTestHandler("\xED\xAE\x80\xED\xBF\xBF", 2, 'U+DB80 U+DFFF (paired UTF-16 surrogates)'); $this->invalidParseErrorTestHandler("\xED\xAF\xBF\xED\xB0\x80", 2, 'U+DBFF U+DC00 (paired UTF-16 surrogates)'); $this->invalidParseErrorTestHandler("\xED\xAF\xBF\xED\xBF\xBF", 2, 'U+DBFF U+DFFF (paired UTF-16 surrogates)'); - */ - } -} diff --git a/core/vendor/masterminds/html5/test/HTML5/Parser/TokenizerTest.php b/core/vendor/masterminds/html5/test/HTML5/Parser/TokenizerTest.php deleted file mode 100644 index 3d834fd..0000000 --- a/core/vendor/masterminds/html5/test/HTML5/Parser/TokenizerTest.php +++ /dev/null @@ -1,970 +0,0 @@ -<?php -namespace Masterminds\HTML5\Tests\Parser; - -use Masterminds\HTML5\Parser\UTF8Utils; -use Masterminds\HTML5\Parser\StringInputStream; -use Masterminds\HTML5\Parser\Scanner; -use Masterminds\HTML5\Parser\Tokenizer; - -class TokenizerTest extends \Masterminds\HTML5\Tests\TestCase -{ - // ================================================================ - // Additional assertions. - // ================================================================ - /** - * Tests that an event matches both the event type and the expected value. - * - * @param string $type - * Expected event type. - * @param string $expects - * The value expected in $event['data'][0]. - */ - public function assertEventEquals($type, $expects, $event) - { - $this->assertEquals($type, $event['name'], "Event $type for " . print_r($event, true)); - if (is_array($expects)) { - $this->assertEquals($expects, $event['data'], "Event $type should equal " . print_r($expects, true) . ": " . print_r($event, true)); - } else { - $this->assertEquals($expects, $event['data'][0], "Event $type should equal $expects: " . print_r($event, true)); - } - } - - /** - * Assert that a given event is 'error'. - */ - public function assertEventError($event) - { - $this->assertEquals('error', $event['name'], "Expected error for event: " . print_r($event, true)); - } - - /** - * Asserts that all of the tests are good. - * - * This loops through a map of tests/expectations and runs a few assertions on each test. - * - * Checks: - * - depth (if depth is > 0) - * - event name - * - matches on event 0. - */ - protected function isAllGood($name, $depth, $tests, $debug = false) - { - foreach ($tests as $try => $expects) { - if ($debug) { - fprintf(STDOUT, "%s expects %s\n", $try, print_r($expects, true)); - } - $e = $this->parse($try); - if ($depth > 0) { - $this->assertEquals($depth, $e->depth(), "Expected depth $depth for test $try." . print_r($e, true)); - } - $this->assertEventEquals($name, $expects, $e->get(0)); - } - } - - // ================================================================ - // Utility functions. - // ================================================================ - public function testParse() - { - list ($tok, $events) = $this->createTokenizer(''); - - $tok->parse(); - $e1 = $events->get(0); - - $this->assertEquals(1, $events->Depth()); - $this->assertEquals('eof', $e1['name']); - } - - public function testWhitespace() - { - $spaces = ' '; - list ($tok, $events) = $this->createTokenizer($spaces); - - $tok->parse(); - - $this->assertEquals(2, $events->depth()); - - $e1 = $events->get(0); - - $this->assertEquals('text', $e1['name']); - $this->assertEquals($spaces, $e1['data'][0]); - } - - public function testCharacterReference() - { - $good = array( - '&amp;' => '&', - '&#x0003c;' => '<', - '&#38;' => '&', - '&' => '&' - ); - $this->isAllGood('text', 2, $good); - - // Test with broken charref - $str = '&foo'; - $events = $this->parse($str); - $e1 = $events->get(0); - $this->assertEquals('error', $e1['name']); - - $str = '&#xfoo'; - $events = $this->parse($str); - $e1 = $events->get(0); - $this->assertEquals('error', $e1['name']); - - $str = '&#foo'; - $events = $this->parse($str); - $e1 = $events->get(0); - $this->assertEquals('error', $e1['name']); - - // FIXME: Once the text processor is done, need to verify that the - // tokens are transformed correctly into text. - } - - public function testBogusComment() - { - $bogus = array( - '</+this is a bogus comment. +>', - '<!+this is a bogus comment. !>', - '<!D OCTYPE foo bar>', - '<!DOCTYEP foo bar>', - '<![CADATA[ TEST ', - '', - ' Hello [[>', - '<!CDATA[[ test ', - '', - '<![CDATA[hellooooo hello', - '<? Hello World ?>', - '<? Hello World' - ); - foreach ($bogus as $str) { - $events = $this->parse($str); - $this->assertEventError($events->get(0)); - $this->assertEventEquals('comment', $str, $events->get(1)); - } - } - - public function testEndTag() - { - $succeed = array( - '</a>' => 'a', - '</test>' => 'test', - '</test - >' => 'test', - '</thisIsTheTagThatDoesntEndItJustGoesOnAndOnMyFriend>' => 'thisisthetagthatdoesntenditjustgoesonandonmyfriend', - // See 8.2.4.10, which requires this and does not say error. - '</a<b>' => 'a<b' - ); - $this->isAllGood('endTag', 2, $succeed); - - // Recoverable failures - $fail = array( - '</a class="monkey">' => 'a', - '</a <b>' => 'a', - '</a <b <c>' => 'a', - '</a is the loneliest letter>' => 'a', - '</a' => 'a' - ); - foreach ($fail as $test => $result) { - $events = $this->parse($test); - $this->assertEquals(3, $events->depth()); - // Should have triggered an error. - $this->assertEventError($events->get(0)); - // Should have tried to parse anyway. - $this->assertEventEquals('endTag', $result, $events->get(1)); - } - - // BogoComments - $comments = array( - '</>' => '</>', - '</ >' => '</ >', - '</ a>' => '</ a>' - ); - foreach ($comments as $test => $result) { - $events = $this->parse($test); - $this->assertEquals(3, $events->depth()); - - // Should have triggered an error. - $this->assertEventError($events->get(0)); - - // Should have tried to parse anyway. - $this->assertEventEquals('comment', $result, $events->get(1)); - } - } - - public function testComment() - { - $good = array( - '<!--easy-->' => 'easy', - '<!-- 1 > 0 -->' => ' 1 > 0 ', - '<!-- --$i -->' => ' --$i ', - '<!----$i-->' => '--$i', - '<!-- 1 > 0 -->' => ' 1 > 0 ', - "<!--\nHello World.\na-->" => "\nHello World.\na", - '<!-- <!-- -->' => ' <!-- ' - ); - foreach ($good as $test => $expected) { - $events = $this->parse($test); - $this->assertEventEquals('comment', $expected, $events->get(0)); - } - - $fail = array( - '<!-->' => '', - '<!--Hello' => 'Hello', - "<!--\0Hello" => UTF8Utils::FFFD . 'Hello', - '<!--' => '' - ); - foreach ($fail as $test => $expected) { - $events = $this->parse($test); - $this->assertEquals(3, $events->depth()); - $this->assertEventError($events->get(0)); - $this->assertEventEquals('comment', $expected, $events->get(1)); - } - } - - public function testCDATASection() - { - $good = array( - '<![CDATA[ This is a test. ' => ' This is a test. ', - 'CDATA' => 'CDATA', - ' ]] > ' => ' ]] > ', - ' ' => ' ' - ); - $this->isAllGood('cdata', 2, $good); - } - - public function testDoctype() - { - $good = array( - '' => array( - 'html', - 0, - null, - false - ), - '' => array( - 'html', - 0, - null, - false - ), - '' => array( - 'html', - 0, - null, - false - ), - "" => array( - 'html', - 0, - null, - false - ), - "" => array( - 'html', - 0, - null, - false - ), - '' => array( - 'html', - EventStack::DOCTYPE_PUBLIC, - 'foo bar', - false - ), - "" => array( - 'html', - EventStack::DOCTYPE_PUBLIC, - 'foo bar', - false - ), - '' => array( - 'html', - EventStack::DOCTYPE_PUBLIC, - 'foo bar', - false - ), - "" => array( - 'html', - EventStack::DOCTYPE_PUBLIC, - 'foo bar', - false - ), - '' => array( - 'html', - EventStack::DOCTYPE_SYSTEM, - 'foo bar', - false - ), - "" => array( - 'html', - EventStack::DOCTYPE_SYSTEM, - 'foo bar', - false - ), - '' => array( - 'html', - EventStack::DOCTYPE_SYSTEM, - 'foo/bar', - false - ), - "" => array( - 'html', - EventStack::DOCTYPE_SYSTEM, - 'foo bar', - false - ) - ); - $this->isAllGood('doctype', 2, $good); - - $bad = array( - '' => array( - null, - EventStack::DOCTYPE_NONE, - null, - true - ), - '' => array( - null, - EventStack::DOCTYPE_NONE, - null, - true - ), - ' array( - 'foo', - EventStack::DOCTYPE_NONE, - null, - true - ), - ' array( - 'foo', - EventStack::DOCTYPE_NONE, - null, - true - ), - '' => array( - 'foo', - EventStack::DOCTYPE_NONE, - null, - true - ), - '' => array( - 'foo', - EventStack::DOCTYPE_NONE, - null, - true - ), - ' array( - 'foo', - EventStack::DOCTYPE_NONE, - null, - true - ), - - // Can't tell whether these are ids or ID types, since the context is chopped. - ' array( - 'foo', - EventStack::DOCTYPE_NONE, - null, - true - ), - '' => array( - 'foo', - EventStack::DOCTYPE_NONE, - null, - true - ), - ' array( - 'foo', - EventStack::DOCTYPE_NONE, - null, - true - ), - '' => array( - 'foo', - EventStack::DOCTYPE_NONE, - null, - true - ), - - ' array( - 'html', - EventStack::DOCTYPE_SYSTEM, - 'foo bar', - true - ), - '' => array( - 'html', - EventStack::DOCTYPE_SYSTEM, - 'foo bar', - true - ) - ); - foreach ($bad as $test => $expects) { - $events = $this->parse($test); - // fprintf(STDOUT, $test . PHP_EOL); - $this->assertEquals(3, $events->depth(), "Counting events for '$test': " . print_r($events, true)); - $this->assertEventError($events->get(0)); - $this->assertEventEquals('doctype', $expects, $events->get(1)); - } - } - - public function testProcessorInstruction() - { - $good = array( - '' => 'hph', - '' => array( - 'hph', - 'echo "Hello World"; ' - ), - "" => array( - 'hph', - "echo 'Hello World';\n" - ) - ); - $this->isAllGood('pi', 2, $good); - } - - /** - * This tests just simple tags. - */ - public function testSimpleTags() - { - $open = array( - '' => 'foo', - '' => 'foo', - '' => 'foo', - '' => 'foo', - "" => 'foo', - '' => 'foo:bar' - ); - $this->isAllGood('startTag', 2, $open); - - $selfClose = array( - '' => 'foo', - '' => 'foo', - '' => 'foo', - "" => 'foo', - '' => 'foo:bar' - ); - foreach ($selfClose as $test => $expects) { - $events = $this->parse($test); - $this->assertEquals(3, $events->depth(), "Counting events for '$test'" . print_r($events, true)); - $this->assertEventEquals('startTag', $expects, $events->get(0)); - $this->assertEventEquals('endTag', $expects, $events->get(1)); - } - - $bad = array( - ' 'foo', - ' 'foo', - ' 'foo', - ' 'foo' - ); - - foreach ($bad as $test => $expects) { - $events = $this->parse($test); - $this->assertEquals(3, $events->depth(), "Counting events for '$test': " . print_r($events, true)); - $this->assertEventError($events->get(0)); - $this->assertEventEquals('startTag', $expects, $events->get(1)); - } - } - - public function testTagsWithAttributeAndMissingName() - { - $cases = array( - '' => 'id', - '' => 'color', - "" => 'class', - '' => 'bgcolor', - '' => 'class' - ); - - foreach ($cases as $html => $expected) { - $events = $this->parse($html); - $this->assertEventError($events->get(0)); - $this->assertEventError($events->get(1)); - $this->assertEventError($events->get(2)); - $this->assertEventEquals('startTag', $expected, $events->get(3)); - $this->assertEventEquals('eof', null, $events->get(4)); - } - } - - public function testTagNotClosedAfterTagName() - { - $cases = array( - "" => array( - 'noscript', - 'img' - ), - '' => array( - 'center', - 'a' - ), - '' => array( - 'br', - 'br' - ) - ); - - foreach ($cases as $html => $expected) { - $events = $this->parse($html); - $this->assertEventError($events->get(0)); - $this->assertEventEquals('startTag', $expected[0], $events->get(1)); - $this->assertEventEquals('startTag', $expected[1], $events->get(2)); - $this->assertEventEquals('eof', null, $events->get(3)); - } - - $events = $this->parse('02'); - $this->assertEventError($events->get(0)); - $this->assertEventEquals('startTag', 'span', $events->get(1)); - $this->assertEventError($events->get(2)); - $this->assertEventEquals('text', '>02', $events->get(3)); - $this->assertEventEquals('endTag', 'span', $events->get(4)); - $this->assertEventEquals('eof', null, $events->get(5)); - - $events = $this->parse(''); - $this->assertEventError($events->get(0)); - $this->assertEventEquals('startTag', 'p', $events->get(1)); - $this->assertEventEquals('endTag', 'p', $events->get(2)); - $this->assertEventEquals('eof', null, $events->get(3)); - - $events = $this->parse(''); - $this->assertEventEquals('startTag', 'strong', $events->get(0)); - $this->assertEventError($events->get(1)); - $this->assertEventEquals('startTag', 'wordpress', $events->get(2)); - $this->assertEventEquals('endTag', 'strong', $events->get(3)); - $this->assertEventEquals('eof', null, $events->get(4)); - - $events = $this->parse(''); - $this->assertEventError($events->get(0)); - $this->assertEventError($events->get(1)); - $this->assertEventError($events->get(2)); - $this->assertEventEquals('startTag', 'src', $events->get(3)); - $this->assertEventEquals('startTag', 'a', $events->get(4)); - $this->assertEventEquals('eof', null, $events->get(5)); - - $events = $this->parse(''); - $this->assertEventError($events->get(0)); - $this->assertEventEquals('startTag', 'br', $events->get(1)); - $this->assertEventEquals('eof', null, $events->get(2)); - } - - public function testIllegalTagNames() - { - $cases = array( - '' => 'li', - '' => 'p', - '' => 'b', - '' => 'static', - '' => 'h', - '' => 'st', - ); - - foreach ($cases as $html => $expected) { - $events = $this->parse($html); - $this->assertEventError($events->get(0)); - $this->assertEventEquals('startTag', $expected, $events->get(1)); - } - } - - /** - * @depends testCharacterReference - */ - public function testTagAttributes() - { - // Opening tags. - $good = array( - '' => array( - 'foo', - array( - 'bar' => 'baz' - ), - false - ), - '' => array( - 'foo', - array( - 'bar' => ' baz ' - ), - false - ), - "" => array( - 'foo', - array( - 'bar' => "\nbaz\n" - ), - false - ), - "" => array( - 'foo', - array( - 'bar' => 'baz' - ), - false - ), - '' => array( - 'foo', - array( - 'bar' => 'A full sentence.' - ), - false - ), - "" => array( - 'foo', - array( - 'a' => '1', - 'b' => '2' - ), - false - ), - "" => array( - 'foo', - array( - 'ns:bar' => 'baz' - ), - false - ), - "" => array( - 'foo', - array( - 'a' => 'blue&red' - ), - false - ), - "" => array( - 'foo', - array( - 'a' => 'blue&&red' - ), - false - ), - "" => array( - 'foo', - array( - 'bar' => 'baz' - ), - false - ), - '' => array( - 'doe', - array( - 'a' => null, - 'deer' => null - ), - false - ), - '' => array( - 'foo', - array( - 'bar' => 'baz' - ), - false - ), - - // Updated for 8.1.2.3 - '' => array( - 'foo', - array( - 'bar' => 'baz' - ), - false - ), - - // The spec allows an unquoted value '/'. This will not be a closing - // tag. - '' => array( - 'foo', - array( - 'bar' => '/' - ), - false - ), - '' => array( - 'foo', - array( - 'bar' => 'baz/' - ), - false - ) - ); - $this->isAllGood('startTag', 2, $good); - - // Self-closing tags. - $withEnd = array( - '' => array( - 'foo', - array( - 'bar' => 'baz' - ), - true - ), - '' => array( - 'foo', - array( - 'bar' => 'baz' - ), - true - ), - '' => array( - 'foo', - array( - 'bar' => 'BAZ' - ), - true - ), - "" => array( - 'foo', - array( - 'a' => '1', - 'b' => '2', - 'c' => '3', - 'd' => null - ), - true - ) - ); - $this->isAllGood('startTag', 3, $withEnd); - - // Cause a parse error. - $bad = array( - // This will emit an entity lookup failure for &red. - "" => array( - 'foo', - array( - 'a' => 'blue&red' - ), - false - ), - "" => array( - 'foo', - array( - 'a' => 'blue&&&red' - ), - false - ), - '' => array( - 'foo', - array( - 'bar' => null - ), - false - ), - '' => array( - 'foo', - array( - 'bar' => 'oh"' - ), - false - ), - - // these attributes are ignored because of current implementation - // of method "DOMElement::setAttribute" - // see issue #23: https://github.com/Masterminds/html5-php/issues/23 - '' => array( - 'foo', - array(), - false - ), - '' => array( - 'foo', - array(), - false - ), - '' => array( - 'foo', - array(), - false - ), - '' => array( - 'foo', - array(), - false - ) - ) - ; - foreach ($bad as $test => $expects) { - $events = $this->parse($test); - $this->assertEquals(3, $events->depth(), "Counting events for '$test': " . print_r($events, true)); - $this->assertEventError($events->get(0)); - $this->assertEventEquals('startTag', $expects, $events->get(1)); - } - - // Cause multiple parse errors. - $reallyBad = array( - '' => array( - 'foo', - array( - '=' => null, - '"bar"' => null - ), - false - ), - '' => array( - 'foo', - array(), - true - ), - // character "&" in unquoted attribute shouldn't cause an infinite loop - '' => array( - 'foo', - array( - 'bar' => 'index.php?str=1&id=29' - ), - false - ) - ); - foreach ($reallyBad as $test => $expects) { - $events = $this->parse($test); - // fprintf(STDOUT, $test . print_r($events, true)); - $this->assertEventError($events->get(0)); - $this->assertEventError($events->get(1)); - // $this->assertEventEquals('startTag', $expects, $events->get(1)); - } - - // Regression: Malformed elements should be detected. - // '' => array('foo', array('baz' => '1'), false), - $events = $this->parse(''); - $this->assertEventError($events->get(0)); - $this->assertEventEquals('startTag', array( - 'foo', - array( - 'baz' => '1' - ), - false - ), $events->get(1)); - $this->assertEventEquals('startTag', array( - 'bar', - array(), - false - ), $events->get(2)); - $this->assertEventEquals('endTag', array( - 'foo' - ), $events->get(3)); - } - - public function testRawText() - { - $good = array( - ' ' => 'abcd efg hijk lmnop', - '' => '', - '' => '<<<<<<<<', - '' => 'hello\nhello" => "\nhello&' => '&', - '' => '', - '' => '' - ); - foreach ($good as $test => $expects) { - $events = $this->parse($test); - $this->assertEventEquals('startTag', 'script', $events->get(0)); - $this->assertEventEquals('text', $expects, $events->get(1)); - $this->assertEventEquals('endTag', 'script', $events->get(2)); - } - - $bad = array( - ' - - -
    foo bar baz
    - - '); - - $stream = fopen('php://temp', 'w'); - $r = new OutputRules($stream, $this->html5->getOptions()); - $t = new Traverser($dom, $stream, $r, $this->html5->getOptions()); - - $script = $dom->getElementsByTagName('script'); - $r->element($script->item(0)); - $this->assertEquals( - '', stream_get_contents($stream, - 1, 0)); - } - - public function testElementWithStyle() - { - $dom = $this->html5->loadHTML( - ' - - - - - -
    foo bar baz
    - - '); - - $stream = fopen('php://temp', 'w'); - $r = new OutputRules($stream, $this->html5->getOptions()); - $t = new Traverser($dom, $stream, $r, $this->html5->getOptions()); - - $style = $dom->getElementsByTagName('style'); - $r->element($style->item(0)); - $this->assertEquals('', stream_get_contents($stream, - 1, 0)); - } - - public function testOpenTag() - { - $dom = $this->html5->loadHTML(' - - -
    foo bar baz
    - - '); - - $stream = fopen('php://temp', 'w'); - $r = new OutputRules($stream, $this->html5->getOptions()); - $t = new Traverser($dom, $stream, $r, $this->html5->getOptions()); - - $list = $dom->getElementsByTagName('div'); - $m = $this->getProtectedMethod('openTag'); - $m->invoke($r, $list->item(0)); - $this->assertEquals('
    ', stream_get_contents($stream, - 1, 0)); - } - - public function testCData() - { - $dom = $this->html5->loadHTML(' - - -
    - - '); - - $stream = fopen('php://temp', 'w'); - $r = new OutputRules($stream, $this->html5->getOptions()); - $t = new Traverser($dom, $stream, $r, $this->html5->getOptions()); - - $list = $dom->getElementsByTagName('div'); - $r->cdata($list->item(0)->childNodes->item(0)); - $this->assertEquals('', stream_get_contents($stream, - 1, 0)); - - $dom = $this->html5->loadHTML(' - - -
    - - '); - - $dom->getElementById('foo')->appendChild(new \DOMCdataSection("]]>Foo<[![CDATA test ]]>")); - - $stream = fopen('php://temp', 'w'); - $r = new OutputRules($stream, $this->html5->getOptions()); - $t = new Traverser($dom, $stream, $r, $this->html5->getOptions()); - $list = $dom->getElementsByTagName('div'); - $r->cdata($list->item(0)->childNodes->item(0)); - - $this->assertEquals('Foo<[![CDATA test ]]]]>]]>', stream_get_contents($stream, - 1, 0)); - } - - public function testComment() - { - $dom = $this->html5->loadHTML(' - - -
    - - '); - - $stream = fopen('php://temp', 'w'); - $r = new OutputRules($stream, $this->html5->getOptions()); - $t = new Traverser($dom, $stream, $r, $this->html5->getOptions()); - - $list = $dom->getElementsByTagName('div'); - $r->comment($list->item(0)->childNodes->item(0)); - $this->assertEquals('', stream_get_contents($stream, - 1, 0)); - - $dom = $this->html5->loadHTML(' - - -
    - - '); - $dom->getElementById('foo')->appendChild(new \DOMComment(' --> Foo -->')); - - $stream = fopen('php://temp', 'w'); - $r = new OutputRules($stream, $this->html5->getOptions()); - $t = new Traverser($dom, $stream, $r, $this->html5->getOptions()); - - $list = $dom->getElementsByTagName('div'); - $r->comment($list->item(0)->childNodes->item(0)); - - // Could not find more definitive guidelines on what this should be. Went with - // what the HTML5 spec says and what \DOMDocument::saveXML() produces. - $this->assertEquals(' --> Foo -->-->', stream_get_contents($stream, - 1, 0)); - } - - public function testText() - { - $dom = $this->html5->loadHTML(' - - - - - '); - - $stream = fopen('php://temp', 'w'); - $r = new OutputRules($stream, $this->html5->getOptions()); - $t = new Traverser($dom, $stream, $r, $this->html5->getOptions()); - - $list = $dom->getElementsByTagName('script'); - $r->text($list->item(0)->childNodes->item(0)); - $this->assertEquals('baz();', stream_get_contents($stream, - 1, 0)); - - $dom = $this->html5->loadHTML(' - - - '); - $foo = $dom->getElementById('foo'); - $foo->appendChild(new \DOMText('')); - - $stream = fopen('php://temp', 'w'); - $r = new OutputRules($stream, $this->html5->getOptions()); - $t = new Traverser($dom, $stream, $r, $this->html5->getOptions()); - - $r->text($foo->firstChild); - $this->assertEquals('<script>alert("hi");</script>', stream_get_contents($stream, - 1, 0)); - } - - public function testNl() - { - list ($o, $s) = $this->getOutputRules(); - - $m = $this->getProtectedMethod('nl'); - $m->invoke($o); - $this->assertEquals(PHP_EOL, stream_get_contents($s, - 1, 0)); - } - - public function testWr() - { - list ($o, $s) = $this->getOutputRules(); - - $m = $this->getProtectedMethod('wr'); - $m->invoke($o, 'foo'); - $this->assertEquals('foo', stream_get_contents($s, - 1, 0)); - } - - public function getEncData() - { - return array( - array( - false, - '&\'<>"', - '&\'<>"', - '&'<>"' - ), - array( - false, - 'This + is. a < test', - 'This + is. a < test', - 'This + is. a < test' - ), - array( - false, - '.+#', - '.+#', - '.+#' - ), - - array( - true, - '.+#\'', - '.+#\'', - '.+#'' - ), - array( - true, - '&".<', - '&".<', - '&".<' - ), - array( - true, - '&\'<>"', - '&\'<>"', - '&'<>"' - ), - array( - true, - "\xc2\xa0\"'", - ' "\'', - ' "'' - ) - ); - } - - /** - * Test basic encoding of text. - * @dataProvider getEncData - */ - public function testEnc($isAttribute, $test, $expected, $expectedEncoded) - { - list ($o, $s) = $this->getOutputRules(); - $m = $this->getProtectedMethod('enc'); - - $this->assertEquals($expected, $m->invoke($o, $test, $isAttribute)); - - list ($o, $s) = $this->getOutputRules(array( - 'encode_entities' => true - )); - $m = $this->getProtectedMethod('enc'); - $this->assertEquals($expectedEncoded, $m->invoke($o, $test, $isAttribute)); - } - - /** - * Test basic encoding of text. - * @dataProvider getEncData - */ - public function testEscape($isAttribute, $test, $expected, $expectedEncoded) - { - list ($o, $s) = $this->getOutputRules(); - $m = $this->getProtectedMethod('escape'); - - $this->assertEquals($expected, $m->invoke($o, $test, $isAttribute)); - } - - public function booleanAttributes() - { - return array( - array(''), - array(''), - array(''), - array(''), - array(''), - array(''), - array('
    foo
    '), - array(''), - ); - } - /** - * @dataProvider booleanAttributes - */ - public function testBooleanAttrs($html) - { - $dom = $this->html5->loadHTML(''.$html.''); - - $stream = fopen('php://temp', 'w'); - $r = new OutputRules($stream, $this->html5->getOptions()); - $t = new Traverser($dom, $stream, $r, $this->html5->getOptions()); - - $node = $dom->getElementsByTagName('body')->item(0)->firstChild; - - $m = $this->getProtectedMethod('attrs'); - $m->invoke($r, $node); - - $content = stream_get_contents($stream, - 1, 0); - $this->assertContains($content, $html); - - } - - public function testAttrs() - { - $dom = $this->html5->loadHTML(' - - -
    foo bar baz
    - - '); - - $stream = fopen('php://temp', 'w'); - $r = new OutputRules($stream, $this->html5->getOptions()); - $t = new Traverser($dom, $stream, $r, $this->html5->getOptions()); - - $list = $dom->getElementsByTagName('div'); - - $m = $this->getProtectedMethod('attrs'); - $m->invoke($r, $list->item(0)); - - $content = stream_get_contents($stream, - 1, 0); - $this->assertEquals(' id="foo" class="bar baz"', $content); - } - - public function testSvg() - { - $dom = $this->html5->loadHTML( - ' - - -
    foo bar baz
    - - - - - - - - - - '); - - $stream = fopen('php://temp', 'w'); - $r = new OutputRules($stream, $this->html5->getOptions()); - $t = new Traverser($dom, $stream, $r, $this->html5->getOptions()); - - $list = $dom->getElementsByTagName('svg'); - $r->element($list->item(0)); - $contents = stream_get_contents($stream, - 1, 0); - $this->assertRegExp('||', $contents); - $this->assertRegExp('||', $contents); - $this->assertRegExp('||', $contents); - } - - public function testMath() - { - $dom = $this->html5->loadHTML( - ' - - -
    foo bar baz
    - - x - - ± - - y - - - '); - - $stream = fopen('php://temp', 'w'); - $r = new OutputRules($stream, $this->html5->getOptions()); - $t = new Traverser($dom, $stream, $r, $this->html5->getOptions()); - - $list = $dom->getElementsByTagName('math'); - $r->element($list->item(0)); - $content = stream_get_contents($stream, - 1, 0); - $this->assertRegExp('||', $content); - $this->assertRegExp('||', $content); - } - - public function testProcessorInstruction() - { - $dom = $this->html5->loadHTMLFragment(''); - - $stream = fopen('php://temp', 'w'); - $r = new OutputRules($stream, $this->html5->getOptions()); - $t = new Traverser($dom, $stream, $r, $this->html5->getOptions()); - - $r->processorInstruction($dom->firstChild); - $content = stream_get_contents($stream, - 1, 0); - $this->assertRegExp('|<\?foo bar \?>|', $content); - } -} diff --git a/core/vendor/masterminds/html5/test/HTML5/Serializer/TraverserTest.php b/core/vendor/masterminds/html5/test/HTML5/Serializer/TraverserTest.php deleted file mode 100644 index c914633..0000000 --- a/core/vendor/masterminds/html5/test/HTML5/Serializer/TraverserTest.php +++ /dev/null @@ -1,105 +0,0 @@ - - - - - Test - - -

    This is a test.

    - - '; - - public function setUp() - { - $this->html5 = $this->getInstance(); - } - - /** - * Using reflection we make a protected method accessible for testing. - * - * @param string $name - * The name of the method on the Traverser class to test. - * - * @return \ReflectionMethod \ReflectionMethod for the specified method - */ - public function getProtectedMethod($name) - { - $class = new \ReflectionClass('\Masterminds\HTML5\Serializer\Traverser'); - $method = $class->getMethod($name); - $method->setAccessible(true); - - return $method; - } - - public function getTraverser() - { - $stream = fopen('php://temp', 'w'); - - $dom = $this->html5->loadHTML($this->markup); - $t = new Traverser($dom, $stream, $html5->getOptions()); - - // We return both the traverser and stream so we can pull from it. - return array( - $t, - $stream - ); - } - - public function testConstruct() - { - // The traverser needs a place to write the output to. In our case we - // use a stream in temp space. - $stream = fopen('php://temp', 'w'); - - $html5 = $this->getInstance(); - - $r = new OutputRules($stream, $this->html5->getOptions()); - $dom = $this->html5->loadHTML($this->markup); - - $t = new Traverser($dom, $stream, $r, $html5->getOptions()); - - $this->assertInstanceOf('\Masterminds\HTML5\Serializer\Traverser', $t); - } - - public function testFragment() - { - $html = 'foo
    bar
    '; - $input = new \Masterminds\HTML5\Parser\StringInputStream($html); - $dom = $this->html5->parseFragment($input); - - $this->assertInstanceOf('\DOMDocumentFragment', $dom); - - $stream = fopen('php://temp', 'w'); - $r = new OutputRules($stream, $this->html5->getOptions()); - $t = new Traverser($dom, $stream, $r, $this->html5->getOptions()); - - $out = $t->walk(); - $this->assertEquals($html, stream_get_contents($stream, - 1, 0)); - } - - public function testProcessorInstruction() - { - $html = ''; - $input = new \Masterminds\HTML5\Parser\StringInputStream($html); - $dom = $this->html5->parseFragment($input); - - $this->assertInstanceOf('\DOMDocumentFragment', $dom); - - $stream = fopen('php://temp', 'w'); - $r = new OutputRules($stream, $this->html5->getOptions()); - $t = new Traverser($dom, $stream, $r, $this->html5->getOptions()); - - $out = $t->walk(); - $this->assertEquals($html, stream_get_contents($stream, - 1, 0)); - } -} diff --git a/core/vendor/masterminds/html5/test/HTML5/TestCase.php b/core/vendor/masterminds/html5/test/HTML5/TestCase.php deleted file mode 100644 index 3cb8645..0000000 --- a/core/vendor/masterminds/html5/test/HTML5/TestCase.php +++ /dev/null @@ -1,27 +0,0 @@ -test'; - - const DOC_CLOSE = ''; - - public function testFoo() - { - // Placeholder. Why is PHPUnit emitting warnings about no tests? - } - - public function getInstance(array $options = array()) - { - return new HTML5($options); - } - - protected function wrap($fragment) - { - return self::DOC_OPEN . $fragment . self::DOC_CLOSE; - } -} diff --git a/core/vendor/mikey179/vfsStream/CHANGELOG.md b/core/vendor/mikey179/vfsStream/CHANGELOG.md deleted file mode 100644 index b3f2eb1..0000000 --- a/core/vendor/mikey179/vfsStream/CHANGELOG.md +++ /dev/null @@ -1,192 +0,0 @@ -1.5.0 (2015-03-29) ------------------- - - * implemented #91: `vfsStream::copyFromFileSystem()` should create large file instances - * implemented #92: `vfsStream::copyFromFileSystem()` should respect block devices - * fixed #107: `touch()` does not respect file permissions - * fixed #105: vfs directory structure is not reset after each test - * fixed #104: vfsStream can't handle url encoded pathes - - -1.4.0 (2014-09-14) ------------------- - - * implemented #85: Added support for emulating block devices in the virtual filesystem, feature provided by Harris Borawski - * fixed #68: Unlink a non-existing file now triggers a PHP warning - - -1.3.0 (2014-07-21) ------------------- - - * implemented #79: possibility to mock large files without large memory footprint, see https://github.com/mikey179/vfsStream/wiki/MockingLargeFiles - * implemented #67: added partial support for text-mode translation flag (i.e., no actual translation of line endings takes place) so it no longer throws an exception (provided by Anthon Pang) - * fixed issue #74: issue with trailing windows path separators (provided by Sebastian Krüger) - * fixed issue #50: difference between real file system and vfs with `RecursiveDirectoryIterator` - * fixed issue #80: touch with no arguments for modification and access time behave incorrect - * deprecated `org\bovigo\vfs\vfsStreamFile::readUntilEnd()` - * deprecated `org\bovigo\vfs\vfsStreamFile::getBytesRead()` - - -1.2.0 (2013-04-01) ------------------- - - * implemented issue #34: provide `url()` method on all `vfsStreamContent` instances - * added `org\bovigo\vfs\vfsStreamContent::url()` - * added `org\bovigo\vfs\vfsStreamContent::path()` - * fixed issue #40: flock implementation doesn't work correctly, patch provided by Kamil Dziedzic - * fixed issue #49: call to member function on a non-object when trying to delete a file one above root where a file with same name in root exists - * fixed issue #51: `unlink()` must consider permissions of directory where file is inside, not of the file to unlink itself - * fixed issue #52: `chmod()`, `chown()` and `chgrp()` must consider permissions of directory where file/directory is inside - * fixed issue #53: `chmod()`, `chown()` and `chgrp()` must consider current user and current owner of file/directoy to change - - -1.1.0 (2012-08-25) ------------------- - - * implemented issue #11: add support for `streamWrapper::stream_metadata()` vfsStream now supports `touch()`, `chown()`, `chgrp()` and `chmod()` - * implemented issue #33: add support for `stream_truncate()` (provided by https://github.com/nikcorg) - * implemented issue #35: size limit (quota) for VFS - - -1.0.0 (2012-05-15) ------------------- - - * raised requirement for PHP version to 5.3.0 - * migrated codebase to use namespaces - * changed distribution from PEAR to Composer - * implemented issue #30: support "c" mode for `fopen()` - * fixed issue #31: prohibit aquiring locks when already locked / release lock on `fclose()` - * fixed issue #32: problems when subfolder has same name as folder - * fixed issue #36: `vfsStreamWrapper::stream_open()` should return false while trying to open existing non-writable file, patch provided by Alexander Peresypkin - - -0.11.2 (2012-01-14) -------------------- - - * fixed issue #29: set permissions properly when using `vfsStream::copyFromFileSystem()`, patch provided by predakanga - * fixed failing tests under PHP > 5.3.2 - - -0.11.1 (2011-12-04) -------------------- - - * fixed issue #28: `mkdir()` overwrites existing directories/files - - -0.11.0 (2011-11-29) -------------------- - - * implemented issue #20: `vfsStream::create()` removes old structure - * implemented issue #4: possibility to copy structure from existing file system - * fixed issue #23: `unlink()` should not remove any directory - * fixed issue #25: `vfsStreamDirectory::hasChild()` gives false positives for nested paths, patch provided by Andrew Coulton - * fixed issue #26: opening a file for reading only should not update its modification time, reported and initial patch provided by Ludovic Chabant - - -0.10.1 (2011-08-22) -------------------- - - * fixed issue #16: replace `vfsStreamContent` to `vfsStreamContainer` for autocompletion - * fixed issue #17: `vfsStream::create()` has issues with numeric directories, patch provided by mathieuk - - -0.10.0 (2011-07-22) -------------------- - - * added new method `vfsStreamContainer::hasChildren()` and `vfsStreamDirectory::hasChildren()` - * implemented issue #14: less verbose way to initialize vfsStream - * implemented issue #13: remove deprecated method `vfsStreamContent::setFilemtime()` - * implemented issue #6: locking meachanism for files - * ensured that `stream_set_blocking()`, `stream_set_timeout()` and `stream_set_write_buffer()` on vfsStream urls have the same behaviour with PHP 5.2 and 5.3 - * implemented issue #10: method to print directory structure - - -0.9.0 (2011-07-13) ------------------- - - * implemented feature request issue #7: add support for `fileatime()` and `filectime()` - * fixed issue #3: add support for `streamWrapper::stream_cast()` - * fixed issue #9: resolve path not called everywhere its needed - * deprecated `vfsStreamAbstractContent::setFilemtime()`, use `vfsStreamAbstractContent::lastModified()` instead, will be removed with 0.10.0 - - -0.8.0 (2010-10-08) ------------------- - - * implemented enhancement #6: use `vfsStream::umask()` to influence initial file mode for files and directories - * implemented enhancement #19: support of .. in the url, patch provided by Guislain Duthieuw - * fixed issue #18: `getChild()` returns NULL when child's name contains parent name - * fixed bug with incomplete error message when accessing non-existing files on root level - - -0.7.0 (2010-06-08) ------------------- - - * added new `vfsStream::setup()` method to simplify vfsStream usage - * fixed issue #15: `mkdir()` creates a subfolder in a folder without permissions - - -0.6.0 (2010-02-15) ------------------- - - * added support for `$mode` param when opening files, implements enhancement #7 and fixes issue #13 - * `vfsStreamWrapper::stream_open()` now evaluates `$options` for `STREAM_REPORT_ERRORS` - - -0.5.0 (2010-01-25) ------------------- - - * added support for `rename()`, patch provided by Benoit Aubuchon - * added support for . as directory alias so that `vfs://foo/.` resolves to `vfs://foo`, can be used as workaround for bug #8 - - -0.4.0 (2009-07-13) ------------------- - - * added support for file modes, users and groups (with restrictions, see http://code.google.com/p/bovigo/wiki/vfsStreamDocsKnownIssues) - * fixed bug #5: `vfsStreamDirectory::addChild()` does not replace child with same name - * fixed bug with `is_writable()` because of missing `stat()` fields, patch provided by Sergey Galkin - - -0.3.2 (2009-02-16) ------------------- - - * support trailing slashes on directories in vfsStream urls, patch provided by Gabriel Birke - * fixed bug #4: vfsstream can only be read once, reported by Christoph Bloemer - * enabled multiple iterations at the same time over the same directory - - -0.3.1 (2008-02-18) ------------------- - - * fixed path/directory separator issues under linux systems - * fixed uid/gid issues under linux systems - - -0.3.0 (2008-01-02) ------------------- - - * added support for `rmdir()` - * added `vfsStream::newDirectory()`, dropped `vfsStreamDirectory::ceate()` - * added new interface `vfsStreamContainer` - * added `vfsStreamContent::at()` which allows code like `$file = vfsStream::newFile('file.txt.')->withContent('foo')->at($otherDir);` - * added `vfsStreamContent::lastModified()`, made `vfsStreamContent::setFilemtime()` an alias for this - * moved from Stubbles development environment to bovigo - * refactorings to reduce crap index of various methods - - -0.2.0 (2007-12-29) ------------------- - - * moved `vfsStreamWrapper::PROTOCOL` to `vfsStream::SCHEME` - * added new `vfsStream::url()` method to assist in creating correct vfsStream urls - * added `vfsStream::path()` method as opposite to `vfsStream::url()` - * a call to `vfsStreamWrapper::register()` will now reset the root to null, implemented on request from David Zuelke - * added support for `is_readable()`, `is_dir()`, `is_file()` - * added `vfsStream::newFile()` to be able to do `$file = vfsStream::newFile("foo.txt")->withContent("bar");` - - -0.1.0 (2007-12-14) ------------------- - - * Initial release. diff --git a/core/vendor/mikey179/vfsStream/LICENSE b/core/vendor/mikey179/vfsStream/LICENSE deleted file mode 100644 index 1d41ab9..0000000 --- a/core/vendor/mikey179/vfsStream/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2007-2015, Frank Kleine -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - -* Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -* Neither the name of Stubbles nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS -IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER -OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/core/vendor/mikey179/vfsStream/composer.json b/core/vendor/mikey179/vfsStream/composer.json deleted file mode 100644 index c87f5fe..0000000 --- a/core/vendor/mikey179/vfsStream/composer.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "mikey179/vfsStream", - "type": "library", - "homepage": "http://vfs.bovigo.org/", - "description": "Virtual file system to mock the real file system in unit tests.", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Frank Kleine", - "homepage": "http://frankkleine.de/", - "role": "Developer" - } - ], - "support": { - "issues": "https://github.com/mikey179/vfsStream/issues", - "source": "https://github.com/mikey179/vfsStream/tree/master", - "wiki": "https://github.com/mikey179/vfsStream/wiki" - }, - "require": { - "php": ">=5.3.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.5" - }, - "autoload": { - "psr-0": { "org\\bovigo\\vfs\\": "src/main/php" } - }, - "extra": { - "branch-alias": { - "dev-master": "1.5.x-dev" - } - } -} diff --git a/core/vendor/mikey179/vfsStream/readme.md b/core/vendor/mikey179/vfsStream/readme.md deleted file mode 100644 index 9eb78c5..0000000 --- a/core/vendor/mikey179/vfsStream/readme.md +++ /dev/null @@ -1,5 +0,0 @@ -For more information have a look in the [wiki](https://github.com/mikey179/vfsStream/wiki). - -[![Build Status](https://secure.travis-ci.org/mikey179/vfsStream.png)](http://travis-ci.org/mikey179/vfsStream) [![Coverage Status](https://coveralls.io/repos/mikey179/vfsStream/badge.png?branch=master)](https://coveralls.io/r/mikey179/vfsStream?branch=master) - -[![Latest Stable Version](https://poser.pugx.org/mikey179/vfsStream/version.png)](https://packagist.org/packages/mikey179/vfsStream) [![Latest Unstable Version](https://poser.pugx.org/mikey179/vfsStream/v/unstable.png)](//packagist.org/packages/mikey179/vfsStream) diff --git a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/DotDirectory.php b/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/DotDirectory.php deleted file mode 100644 index e9bc215..0000000 --- a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/DotDirectory.php +++ /dev/null @@ -1,36 +0,0 @@ - \ No newline at end of file diff --git a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/Quota.php b/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/Quota.php deleted file mode 100644 index b86ad8c..0000000 --- a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/Quota.php +++ /dev/null @@ -1,87 +0,0 @@ -amount = $amount; - } - - /** - * create with unlimited space - * - * @return Quota - */ - public static function unlimited() - { - return new self(self::UNLIMITED); - } - - /** - * checks if a quota is set - * - * @return bool - */ - public function isLimited() - { - return self::UNLIMITED < $this->amount; - } - - /** - * checks if given used space exceeda quota limit - * - * - * @param int $usedSpace - * @return int - */ - public function spaceLeft($usedSpace) - { - if (self::UNLIMITED === $this->amount) { - return $usedSpace; - } - - if ($usedSpace >= $this->amount) { - return 0; - } - - $spaceLeft = $this->amount - $usedSpace; - if (0 >= $spaceLeft) { - return 0; - } - - return $spaceLeft; - } -} -?> \ No newline at end of file diff --git a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/content/FileContent.php b/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/content/FileContent.php deleted file mode 100644 index de649a8..0000000 --- a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/content/FileContent.php +++ /dev/null @@ -1,71 +0,0 @@ -size = $size; - } - - /** - * create large file with given size in kilobyte - * - * @param int $kilobyte - * @return LargeFileContent - */ - public static function withKilobytes($kilobyte) - { - return new self($kilobyte * 1024); - } - - /** - * create large file with given size in megabyte - * - * @param int $megabyte - * @return LargeFileContent - */ - public static function withMegabytes($megabyte) - { - return self::withKilobytes($megabyte * 1024); - } - - /** - * create large file with given size in gigabyte - * - * @param int $gigabyte - * @return LargeFileContent - */ - public static function withGigabytes($gigabyte) - { - return self::withMegabytes($gigabyte * 1024); - } - - /** - * returns actual content - * - * @return string - */ - public function content() - { - return $this->doRead(0, $this->size); - } - - /** - * returns size of content - * - * @return int - */ - public function size() - { - return $this->size; - } - - /** - * actual reading of given byte count starting at given offset - * - * @param int $offset - * @param int $count - */ - protected function doRead($offset, $count) - { - if (($offset + $count) > $this->size) { - $count = $this->size - $offset; - } - - $result = ''; - for ($i = 0; $i < $count; $i++) { - if (isset($this->content[$i + $offset])) { - $result .= $this->content[$i + $offset]; - } else { - $result .= ' '; - } - } - - return $result; - } - - /** - * actual writing of data with specified length at given offset - * - * @param string $data - * @param int $offset - * @param int $length - */ - protected function doWrite($data, $offset, $length) - { - for ($i = 0; $i < $length; $i++) { - $this->content[$i + $offset] = $data{$i}; - } - - if ($offset >= $this->size) { - $this->size += $length; - } elseif (($offset + $length) > $this->size) { - $this->size = $offset + $length; - } - } - - /** - * Truncates a file to a given length - * - * @param int $size length to truncate file to - * @return bool - */ - public function truncate($size) - { - $this->size = $size; - foreach (array_filter(array_keys($this->content), - function($pos) use ($size) - { - return $pos >= $size; - } - ) as $removePos) { - unset($this->content[$removePos]); - } - - return true; - } -} diff --git a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/content/SeekableFileContent.php b/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/content/SeekableFileContent.php deleted file mode 100644 index e748000..0000000 --- a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/content/SeekableFileContent.php +++ /dev/null @@ -1,129 +0,0 @@ -doRead($this->offset, $count); - $this->offset += $count; - return $data; - } - - /** - * actual reading of given byte count starting at given offset - * - * @param int $offset - * @param int $count - */ - protected abstract function doRead($offset, $count); - - /** - * seeks to the given offset - * - * @param int $offset - * @param int $whence - * @return bool - */ - public function seek($offset, $whence) - { - switch ($whence) { - case SEEK_CUR: - $this->offset += $offset; - return true; - - case SEEK_END: - $this->offset = $this->size() + $offset; - return true; - - case SEEK_SET: - $this->offset = $offset; - return true; - - default: - return false; - } - - return false; - } - - /** - * checks whether pointer is at end of file - * - * @return bool - */ - public function eof() - { - return $this->size() <= $this->offset; - } - - /** - * writes an amount of data - * - * @param string $data - * @return amount of written bytes - */ - public function write($data) - { - $dataLength = strlen($data); - $this->doWrite($data, $this->offset, $dataLength); - $this->offset += $dataLength; - return $dataLength; - } - - /** - * actual writing of data with specified length at given offset - * - * @param string $data - * @param int $offset - * @param int $length - */ - protected abstract function doWrite($data, $offset, $length); - - /** - * for backwards compatibility with vfsStreamFile::bytesRead() - * - * @return int - * @deprecated - */ - public function bytesRead() - { - return $this->offset; - } - - /** - * for backwards compatibility with vfsStreamFile::readUntilEnd() - * - * @return string - * @deprecated - */ - public function readUntilEnd() - { - return substr($this->content(), $this->offset); - } -} diff --git a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/content/StringBasedFileContent.php b/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/content/StringBasedFileContent.php deleted file mode 100644 index 58bd214..0000000 --- a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/content/StringBasedFileContent.php +++ /dev/null @@ -1,97 +0,0 @@ -content = $content; - } - - /** - * returns actual content - * - * @return string - */ - public function content() - { - return $this->content; - } - - /** - * returns size of content - * - * @return int - */ - public function size() - { - return strlen($this->content); - } - - /** - * actual reading of length starting at given offset - * - * @param int $offset - * @param int $count - */ - protected function doRead($offset, $count) - { - return substr($this->content, $offset, $count); - } - - /** - * actual writing of data with specified length at given offset - * - * @param string $data - * @param int $offset - * @param int $length - */ - protected function doWrite($data, $offset, $length) - { - $this->content = substr($this->content, 0, $offset) - . $data - . substr($this->content, $offset + $length); - } - - /** - * Truncates a file to a given length - * - * @param int $size length to truncate file to - * @return bool - */ - public function truncate($size) - { - if ($size > $this->size()) { - // Pad with null-chars if we're "truncating up" - $this->content .= str_repeat("\0", $size - $this->size()); - } else { - $this->content = substr($this->content, 0, $size); - } - - return true; - } -} \ No newline at end of file diff --git a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStream.php b/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStream.php deleted file mode 100644 index f7f13cb..0000000 --- a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStream.php +++ /dev/null @@ -1,462 +0,0 @@ - - * array('Core' = array('AbstractFactory' => array('test.php' => 'some text content', - * 'other.php' => 'Some more text content', - * 'Invalid.csv' => 'Something else', - * ), - * 'AnEmptyFolder' => array(), - * 'badlocation.php' => 'some bad content', - * ) - * ) - * - * the resulting directory tree will look like this: - *
    -     * root
    -     * \- Core
    -     *  |- badlocation.php
    -     *  |- AbstractFactory
    -     *  | |- test.php
    -     *  | |- other.php
    -     *  | \- Invalid.csv
    -     *  \- AnEmptyFolder
    -     * 
    - * Arrays will become directories with their key as directory name, and - * strings becomes files with their key as file name and their value as file - * content. - * - * @param string $rootDirName name of root directory - * @param int $permissions file permissions of root directory - * @param array $structure directory structure to add under root directory - * @return \org\bovigo\vfs\vfsStreamDirectory - * @since 0.7.0 - * @see https://github.com/mikey179/vfsStream/issues/14 - * @see https://github.com/mikey179/vfsStream/issues/20 - */ - public static function setup($rootDirName = 'root', $permissions = null, array $structure = array()) - { - vfsStreamWrapper::register(); - return self::create($structure, vfsStreamWrapper::setRoot(self::newDirectory($rootDirName, $permissions))); - } - - /** - * creates vfsStream directory structure from an array and adds it to given base dir - * - * Assumed $structure contains an array like this: - * - * array('Core' = array('AbstractFactory' => array('test.php' => 'some text content', - * 'other.php' => 'Some more text content', - * 'Invalid.csv' => 'Something else', - * ), - * 'AnEmptyFolder' => array(), - * 'badlocation.php' => 'some bad content', - * ) - * ) - * - * the resulting directory tree will look like this: - *
    -     * baseDir
    -     * \- Core
    -     *  |- badlocation.php
    -     *  |- AbstractFactory
    -     *  | |- test.php
    -     *  | |- other.php
    -     *  | \- Invalid.csv
    -     *  \- AnEmptyFolder
    -     * 
    - * Arrays will become directories with their key as directory name, and - * strings becomes files with their key as file name and their value as file - * content. - * - * If no baseDir is given it will try to add the structure to the existing - * root directory without replacing existing childs except those with equal - * names. - * - * @param array $structure directory structure to add under root directory - * @param vfsStreamDirectory $baseDir base directory to add structure to - * @return vfsStreamDirectory - * @throws \InvalidArgumentException - * @since 0.10.0 - * @see https://github.com/mikey179/vfsStream/issues/14 - * @see https://github.com/mikey179/vfsStream/issues/20 - */ - public static function create(array $structure, vfsStreamDirectory $baseDir = null) - { - if (null === $baseDir) { - $baseDir = vfsStreamWrapper::getRoot(); - } - - if (null === $baseDir) { - throw new \InvalidArgumentException('No baseDir given and no root directory set.'); - } - - return self::addStructure($structure, $baseDir); - } - - /** - * helper method to create subdirectories recursively - * - * @param array $structure subdirectory structure to add - * @param vfsStreamDirectory $baseDir directory to add the structure to - * @return vfsStreamDirectory - */ - protected static function addStructure(array $structure, vfsStreamDirectory $baseDir) - { - foreach ($structure as $name => $data) { - $name = (string) $name; - if (is_array($data) === true) { - self::addStructure($data, self::newDirectory($name)->at($baseDir)); - } elseif (is_string($data) === true) { - $matches = null; - preg_match('/^\[(.*)\]$/', $name, $matches); - if ($matches !== array()) { - self::newBlock($matches[1])->withContent($data)->at($baseDir); - } else { - self::newFile($name)->withContent($data)->at($baseDir); - } - } - } - - return $baseDir; - } - - /** - * copies the file system structure from given path into the base dir - * - * If no baseDir is given it will try to add the structure to the existing - * root directory without replacing existing childs except those with equal - * names. - * File permissions are copied as well. - * Please note that file contents will only be copied if their file size - * does not exceed the given $maxFileSize which defaults to 1024 KB. In case - * the file is larger file content will be mocked, see - * https://github.com/mikey179/vfsStream/wiki/MockingLargeFiles. - * - * @param string $path path to copy the structure from - * @param vfsStreamDirectory $baseDir directory to add the structure to - * @param int $maxFileSize maximum file size of files to copy content from - * @return vfsStreamDirectory - * @throws \InvalidArgumentException - * @since 0.11.0 - * @see https://github.com/mikey179/vfsStream/issues/4 - */ - public static function copyFromFileSystem($path, vfsStreamDirectory $baseDir = null, $maxFileSize = 1048576) - { - if (null === $baseDir) { - $baseDir = vfsStreamWrapper::getRoot(); - } - - if (null === $baseDir) { - throw new \InvalidArgumentException('No baseDir given and no root directory set.'); - } - - $dir = new \DirectoryIterator($path); - foreach ($dir as $fileinfo) { - switch (filetype($fileinfo->getPathname())) { - case 'file': - if ($fileinfo->getSize() <= $maxFileSize) { - $content = file_get_contents($fileinfo->getPathname()); - } else { - $content = new LargeFileContent($fileinfo->getSize()); - } - - self::newFile( - $fileinfo->getFilename(), - octdec(substr(sprintf('%o', $fileinfo->getPerms()), -4)) - ) - ->withContent($content) - ->at($baseDir); - break; - - case 'dir': - if (!$fileinfo->isDot()) { - self::copyFromFileSystem( - $fileinfo->getPathname(), - self::newDirectory( - $fileinfo->getFilename(), - octdec(substr(sprintf('%o', $fileinfo->getPerms()), -4)) - )->at($baseDir), - $maxFileSize - ); - } - - break; - - case 'block': - self::newBlock( - $fileinfo->getFilename(), - octdec(substr(sprintf('%o', $fileinfo->getPerms()), -4)) - )->at($baseDir); - break; - } - } - - return $baseDir; - } - - /** - * returns a new file with given name - * - * @param string $name name of file to create - * @param int $permissions permissions of file to create - * @return vfsStreamFile - */ - public static function newFile($name, $permissions = null) - { - return new vfsStreamFile($name, $permissions); - } - - /** - * returns a new directory with given name - * - * If the name contains slashes, a new directory structure will be created. - * The returned directory will always be the parent directory of this - * directory structure. - * - * @param string $name name of directory to create - * @param int $permissions permissions of directory to create - * @return vfsStreamDirectory - */ - public static function newDirectory($name, $permissions = null) - { - if ('/' === $name{0}) { - $name = substr($name, 1); - } - - $firstSlash = strpos($name, '/'); - if (false === $firstSlash) { - return new vfsStreamDirectory($name, $permissions); - } - - $ownName = substr($name, 0, $firstSlash); - $subDirs = substr($name, $firstSlash + 1); - $directory = new vfsStreamDirectory($ownName, $permissions); - self::newDirectory($subDirs, $permissions)->at($directory); - return $directory; - } - - /** - * returns a new block with the given name - * - * @param string $name name of the block device - * @param int $permissions permissions of block to create - * @return vfsStreamBlock - */ - public static function newBlock($name, $permissions = null) - { - return new vfsStreamBlock($name, $permissions); - } - - /** - * returns current user - * - * If the system does not support posix_getuid() the current user will be root (0). - * - * @return int - */ - public static function getCurrentUser() - { - return function_exists('posix_getuid') ? posix_getuid() : self::OWNER_ROOT; - } - - /** - * returns current group - * - * If the system does not support posix_getgid() the current group will be root (0). - * - * @return int - */ - public static function getCurrentGroup() - { - return function_exists('posix_getgid') ? posix_getgid() : self::GROUP_ROOT; - } - - /** - * use visitor to inspect a content structure - * - * If the given content is null it will fall back to use the current root - * directory of the stream wrapper. - * - * Returns given visitor for method chaining comfort. - * - * @param vfsStreamVisitor $visitor the visitor who inspects - * @param vfsStreamContent $content directory structure to inspect - * @return vfsStreamVisitor - * @throws \InvalidArgumentException - * @since 0.10.0 - * @see https://github.com/mikey179/vfsStream/issues/10 - */ - public static function inspect(vfsStreamVisitor $visitor, vfsStreamContent $content = null) - { - if (null !== $content) { - return $visitor->visit($content); - } - - $root = vfsStreamWrapper::getRoot(); - if (null === $root) { - throw new \InvalidArgumentException('No content given and no root directory set.'); - } - - return $visitor->visitDirectory($root); - } - - /** - * sets quota to given amount of bytes - * - * @param int $bytes - * @since 1.1.0 - */ - public static function setQuota($bytes) - { - vfsStreamWrapper::setQuota(new Quota($bytes)); - } - - /** - * checks if vfsStream lists dotfiles in directory listings - * - * @return bool - * @since 1.3.0 - */ - public static function useDotfiles() - { - return self::$dotFiles; - } - - /** - * disable dotfiles in directory listings - * - * @since 1.3.0 - */ - public static function disableDotfiles() - { - self::$dotFiles = false; - } - - /** - * enable dotfiles in directory listings - * - * @since 1.3.0 - */ - public static function enableDotfiles() - { - self::$dotFiles = true; - } -} diff --git a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamAbstractContent.php b/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamAbstractContent.php deleted file mode 100644 index 5ec4352..0000000 --- a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamAbstractContent.php +++ /dev/null @@ -1,419 +0,0 @@ -name = $name; - $time = time(); - if (null === $permissions) { - $permissions = $this->getDefaultPermissions() & ~vfsStream::umask(); - } - - $this->lastAccessed = $time; - $this->lastAttributeModified = $time; - $this->lastModified = $time; - $this->permissions = $permissions; - $this->user = vfsStream::getCurrentUser(); - $this->group = vfsStream::getCurrentGroup(); - } - - /** - * returns default permissions for concrete implementation - * - * @return int - * @since 0.8.0 - */ - protected abstract function getDefaultPermissions(); - - /** - * returns the file name of the content - * - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * renames the content - * - * @param string $newName - */ - public function rename($newName) - { - $this->name = $newName; - } - - /** - * checks whether the container can be applied to given name - * - * @param string $name - * @return bool - */ - public function appliesTo($name) - { - if ($name === $this->name) { - return true; - } - - $segment_name = $this->name.'/'; - return (strncmp($segment_name, $name, strlen($segment_name)) == 0); - } - - /** - * returns the type of the container - * - * @return int - */ - public function getType() - { - return $this->type; - } - - /** - * sets the last modification time of the stream content - * - * @param int $filemtime - * @return vfsStreamContent - */ - public function lastModified($filemtime) - { - $this->lastModified = $filemtime; - return $this; - } - - /** - * returns the last modification time of the stream content - * - * @return int - */ - public function filemtime() - { - return $this->lastModified; - } - - /** - * sets last access time of the stream content - * - * @param int $fileatime - * @return vfsStreamContent - * @since 0.9 - */ - public function lastAccessed($fileatime) - { - $this->lastAccessed = $fileatime; - return $this; - } - - /** - * returns the last access time of the stream content - * - * @return int - * @since 0.9 - */ - public function fileatime() - { - return $this->lastAccessed; - } - - /** - * sets the last attribute modification time of the stream content - * - * @param int $filectime - * @return vfsStreamContent - * @since 0.9 - */ - public function lastAttributeModified($filectime) - { - $this->lastAttributeModified = $filectime; - return $this; - } - - /** - * returns the last attribute modification time of the stream content - * - * @return int - * @since 0.9 - */ - public function filectime() - { - return $this->lastAttributeModified; - } - - /** - * adds content to given container - * - * @param vfsStreamContainer $container - * @return vfsStreamContent - */ - public function at(vfsStreamContainer $container) - { - $container->addChild($this); - return $this; - } - - /** - * change file mode to given permissions - * - * @param int $permissions - * @return vfsStreamContent - */ - public function chmod($permissions) - { - $this->permissions = $permissions; - $this->lastAttributeModified = time(); - clearstatcache(); - return $this; - } - - /** - * returns permissions - * - * @return int - */ - public function getPermissions() - { - return $this->permissions; - } - - /** - * checks whether content is readable - * - * @param int $user id of user to check for - * @param int $group id of group to check for - * @return bool - */ - public function isReadable($user, $group) - { - if ($this->user === $user) { - $check = 0400; - } elseif ($this->group === $group) { - $check = 0040; - } else { - $check = 0004; - } - - return (bool) ($this->permissions & $check); - } - - /** - * checks whether content is writable - * - * @param int $user id of user to check for - * @param int $group id of group to check for - * @return bool - */ - public function isWritable($user, $group) - { - if ($this->user === $user) { - $check = 0200; - } elseif ($this->group === $group) { - $check = 0020; - } else { - $check = 0002; - } - - return (bool) ($this->permissions & $check); - } - - /** - * checks whether content is executable - * - * @param int $user id of user to check for - * @param int $group id of group to check for - * @return bool - */ - public function isExecutable($user, $group) - { - if ($this->user === $user) { - $check = 0100; - } elseif ($this->group === $group) { - $check = 0010; - } else { - $check = 0001; - } - - return (bool) ($this->permissions & $check); - } - - /** - * change owner of file to given user - * - * @param int $user - * @return vfsStreamContent - */ - public function chown($user) - { - $this->user = $user; - $this->lastAttributeModified = time(); - return $this; - } - - /** - * checks whether file is owned by given user - * - * @param int $user - * @return bool - */ - public function isOwnedByUser($user) - { - return $this->user === $user; - } - - /** - * returns owner of file - * - * @return int - */ - public function getUser() - { - return $this->user; - } - - /** - * change owner group of file to given group - * - * @param int $group - * @return vfsStreamContent - */ - public function chgrp($group) - { - $this->group = $group; - $this->lastAttributeModified = time(); - return $this; - } - - /** - * checks whether file is owned by group - * - * @param int $group - * @return bool - */ - public function isOwnedByGroup($group) - { - return $this->group === $group; - } - - /** - * returns owner group of file - * - * @return int - */ - public function getGroup() - { - return $this->group; - } - - /** - * sets parent path - * - * @param string $parentPath - * @internal only to be set by parent - * @since 1.2.0 - */ - public function setParentPath($parentPath) - { - $this->parentPath = $parentPath; - } - - /** - * returns path to this content - * - * @return string - * @since 1.2.0 - */ - public function path() - { - if (null === $this->parentPath) { - return $this->name; - } - - return $this->parentPath . '/' . $this->name; - } - - /** - * returns complete vfsStream url for this content - * - * @return string - * @since 1.2.0 - */ - public function url() - { - return vfsStream::url($this->path()); - } -} -?> \ No newline at end of file diff --git a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamBlock.php b/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamBlock.php deleted file mode 100644 index 128a96a..0000000 --- a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamBlock.php +++ /dev/null @@ -1,34 +0,0 @@ -type = vfsStreamContent::TYPE_BLOCK; - } -} diff --git a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamContainer.php b/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamContainer.php deleted file mode 100644 index e27a581..0000000 --- a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamContainer.php +++ /dev/null @@ -1,62 +0,0 @@ - \ No newline at end of file diff --git a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamContainerIterator.php b/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamContainerIterator.php deleted file mode 100644 index 83943dc..0000000 --- a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamContainerIterator.php +++ /dev/null @@ -1,94 +0,0 @@ -children = $children; - if (vfsStream::useDotfiles()) { - array_unshift($this->children, new DotDirectory('.'), new DotDirectory('..')); - } - - reset($this->children); - } - - /** - * resets children pointer - */ - public function rewind() - { - reset($this->children); - } - - /** - * returns the current child - * - * @return vfsStreamContent - */ - public function current() - { - $child = current($this->children); - if (false === $child) { - return null; - } - - return $child; - } - - /** - * returns the name of the current child - * - * @return string - */ - public function key() - { - $child = current($this->children); - if (false === $child) { - return null; - } - - return $child->getName(); - } - - /** - * iterates to next child - */ - public function next() - { - next($this->children); - } - - /** - * checks if the current value is valid - * - * @return bool - */ - public function valid() - { - return (false !== current($this->children)); - } -} -?> \ No newline at end of file diff --git a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamContent.php b/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamContent.php deleted file mode 100644 index efcccce..0000000 --- a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamContent.php +++ /dev/null @@ -1,214 +0,0 @@ - diff --git a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamDirectory.php b/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamDirectory.php deleted file mode 100644 index e17c835..0000000 --- a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamDirectory.php +++ /dev/null @@ -1,267 +0,0 @@ -type = vfsStreamContent::TYPE_DIR; - parent::__construct($name, $permissions); - } - - /** - * returns default permissions for concrete implementation - * - * @return int - * @since 0.8.0 - */ - protected function getDefaultPermissions() - { - return 0777; - } - - /** - * returns size of directory - * - * The size of a directory is always 0 bytes. To calculate the summarized - * size of all children in the directory use sizeSummarized(). - * - * @return int - */ - public function size() - { - return 0; - } - - /** - * returns summarized size of directory and its children - * - * @return int - */ - public function sizeSummarized() - { - $size = 0; - foreach ($this->children as $child) { - if ($child->getType() === vfsStreamContent::TYPE_DIR) { - $size += $child->sizeSummarized(); - } else { - $size += $child->size(); - } - } - - return $size; - } - - /** - * renames the content - * - * @param string $newName - * @throws vfsStreamException - */ - public function rename($newName) - { - if (strstr($newName, '/') !== false) { - throw new vfsStreamException('Directory name can not contain /.'); - } - - parent::rename($newName); - } - - - /** - * sets parent path - * - * @param string $parentPath - * @internal only to be set by parent - * @since 1.2.0 - */ - public function setParentPath($parentPath) - { - parent::setParentPath($parentPath); - foreach ($this->children as $child) { - $child->setParentPath($this->path()); - } - } - - /** - * adds child to the directory - * - * @param vfsStreamContent $child - */ - public function addChild(vfsStreamContent $child) - { - $child->setParentPath($this->path()); - $this->children[$child->getName()] = $child; - $this->updateModifications(); - } - - /** - * removes child from the directory - * - * @param string $name - * @return bool - */ - public function removeChild($name) - { - foreach ($this->children as $key => $child) { - if ($child->appliesTo($name)) { - $child->setParentPath(null); - unset($this->children[$key]); - $this->updateModifications(); - return true; - } - } - - return false; - } - - /** - * updates internal timestamps - */ - protected function updateModifications() - { - $time = time(); - $this->lastAttributeModified = $time; - $this->lastModified = $time; - } - - /** - * checks whether the container contains a child with the given name - * - * @param string $name - * @return bool - */ - public function hasChild($name) - { - return ($this->getChild($name) !== null); - } - - /** - * returns the child with the given name - * - * @param string $name - * @return vfsStreamContent - */ - public function getChild($name) - { - $childName = $this->getRealChildName($name); - foreach ($this->children as $child) { - if ($child->getName() === $childName) { - return $child; - } - - if ($child->appliesTo($childName) === true && $child->hasChild($childName) === true) { - return $child->getChild($childName); - } - } - - return null; - } - - /** - * helper method to detect the real child name - * - * @param string $name - * @return string - */ - protected function getRealChildName($name) - { - if ($this->appliesTo($name) === true) { - return self::getChildName($name, $this->name); - } - - return $name; - } - - /** - * helper method to calculate the child name - * - * @param string $name - * @param string $ownName - * @return string - */ - protected static function getChildName($name, $ownName) - { - if ($name === $ownName) { - return $name; - } - - return substr($name, strlen($ownName) + 1); - } - - /** - * checks whether directory contains any children - * - * @return bool - * @since 0.10.0 - */ - public function hasChildren() - { - return (count($this->children) > 0); - } - - /** - * returns a list of children for this directory - * - * @return vfsStreamContent[] - */ - public function getChildren() - { - return array_values($this->children); - } - - /** - * returns iterator for the children - * - * @return vfsStreamContainerIterator - */ - public function getIterator() - { - return new vfsStreamContainerIterator($this->children); - } - - /** - * checks whether dir is a dot dir - * - * @return bool - */ - public function isDot() - { - if ('.' === $this->name || '..' === $this->name) { - return true; - } - - return false; - } -} -?> \ No newline at end of file diff --git a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamException.php b/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamException.php deleted file mode 100644 index aa79d64..0000000 --- a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamException.php +++ /dev/null @@ -1,20 +0,0 @@ - \ No newline at end of file diff --git a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamFile.php b/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamFile.php deleted file mode 100644 index 7e5f065..0000000 --- a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamFile.php +++ /dev/null @@ -1,394 +0,0 @@ -content = new StringBasedFileContent(null); - $this->type = vfsStreamContent::TYPE_FILE; - parent::__construct($name, $permissions); - } - - /** - * returns default permissions for concrete implementation - * - * @return int - * @since 0.8.0 - */ - protected function getDefaultPermissions() - { - return 0666; - } - - /** - * checks whether the container can be applied to given name - * - * @param string $name - * @return bool - */ - public function appliesTo($name) - { - return ($name === $this->name); - } - - /** - * alias for withContent() - * - * @param string $content - * @return vfsStreamFile - * @see withContent() - */ - public function setContent($content) - { - return $this->withContent($content); - } - - /** - * sets the contents of the file - * - * Setting content with this method does not change the time when the file - * was last modified. - * - * @param string]FileContent $content - * @return vfsStreamFile - * @throws \InvalidArgumentException - */ - public function withContent($content) - { - if (is_string($content)) { - $this->content = new StringBasedFileContent($content); - } elseif ($content instanceof FileContent) { - $this->content = $content; - } else { - throw new \InvalidArgumentException('Given content must either be a string or an instance of org\bovigo\vfs\content\FileContent'); - } - - return $this; - } - - /** - * returns the contents of the file - * - * Getting content does not change the time when the file - * was last accessed. - * - * @return string - */ - public function getContent() - { - return $this->content->content(); - } - - /** - * simply open the file - * - * @since 0.9 - */ - public function open() - { - $this->content->seek(0, SEEK_SET); - $this->lastAccessed = time(); - } - - /** - * open file and set pointer to end of file - * - * @since 0.9 - */ - public function openForAppend() - { - $this->content->seek(0, SEEK_END); - $this->lastAccessed = time(); - } - - /** - * open file and truncate content - * - * @since 0.9 - */ - public function openWithTruncate() - { - $this->open(); - $this->content->truncate(0); - $time = time(); - $this->lastAccessed = $time; - $this->lastModified = $time; - } - - /** - * reads the given amount of bytes from content - * - * Using this method changes the time when the file was last accessed. - * - * @param int $count - * @return string - */ - public function read($count) - { - $this->lastAccessed = time(); - return $this->content->read($count); - } - - /** - * returns the content until its end from current offset - * - * Using this method changes the time when the file was last accessed. - * - * @return string - * @deprecated since 1.3.0 - */ - public function readUntilEnd() - { - $this->lastAccessed = time(); - return $this->content->readUntilEnd(); - } - - /** - * writes an amount of data - * - * Using this method changes the time when the file was last modified. - * - * @param string $data - * @return amount of written bytes - */ - public function write($data) - { - $this->lastModified = time(); - return $this->content->write($data); - } - - /** - * Truncates a file to a given length - * - * @param int $size length to truncate file to - * @return bool - * @since 1.1.0 - */ - public function truncate($size) - { - $this->content->truncate($size); - $this->lastModified = time(); - return true; - } - - /** - * checks whether pointer is at end of file - * - * @return bool - */ - public function eof() - { - return $this->content->eof(); - } - - /** - * returns the current position within the file - * - * @return int - * @deprecated since 1.3.0 - */ - public function getBytesRead() - { - return $this->content->bytesRead(); - } - - /** - * seeks to the given offset - * - * @param int $offset - * @param int $whence - * @return bool - */ - public function seek($offset, $whence) - { - return $this->content->seek($offset, $whence); - } - - /** - * returns size of content - * - * @return int - */ - public function size() - { - return $this->content->size(); - } - - - /** - * locks file for - * - * @param resource|vfsStreamWrapper $resource - * @param int $operation - * @return bool - * @since 0.10.0 - * @see https://github.com/mikey179/vfsStream/issues/6 - * @see https://github.com/mikey179/vfsStream/issues/40 - */ - public function lock($resource, $operation) - { - if ((LOCK_NB & $operation) == LOCK_NB) { - $operation = $operation - LOCK_NB; - } - - // call to lock file on the same file handler firstly releases the lock - $this->unlock($resource); - - if (LOCK_EX === $operation) { - if ($this->isLocked()) { - return false; - } - - $this->setExclusiveLock($resource); - } elseif(LOCK_SH === $operation) { - if ($this->hasExclusiveLock()) { - return false; - } - - $this->addSharedLock($resource); - } - - return true; - } - - /** - * Removes lock from file acquired by given resource - * - * @param resource|vfsStreamWrapper $resource - * @see https://github.com/mikey179/vfsStream/issues/40 - */ - public function unlock($resource) { - if ($this->hasExclusiveLock($resource)) { - $this->exclusiveLock = null; - } - if ($this->hasSharedLock($resource)) { - unset($this->sharedLock[$this->getResourceId($resource)]); - } - } - - /** - * Set exlusive lock on file by given resource - * - * @param resource|vfsStreamWrapper $resource - * @see https://github.com/mikey179/vfsStream/issues/40 - */ - protected function setExclusiveLock($resource) { - $this->exclusiveLock = $this->getResourceId($resource); - } - - /** - * Add shared lock on file by given resource - * - * @param resource|vfsStreamWrapper $resource - * @see https://github.com/mikey179/vfsStream/issues/40 - */ - protected function addSharedLock($resource) { - $this->sharedLock[$this->getResourceId($resource)] = true; - } - - /** - * checks whether file is locked - * - * @param resource|vfsStreamWrapper $resource - * @return bool - * @since 0.10.0 - * @see https://github.com/mikey179/vfsStream/issues/6 - * @see https://github.com/mikey179/vfsStream/issues/40 - */ - public function isLocked($resource = null) - { - return $this->hasSharedLock($resource) || $this->hasExclusiveLock($resource); - } - - /** - * checks whether file is locked in shared mode - * - * @param resource|vfsStreamWrapper $resource - * @return bool - * @since 0.10.0 - * @see https://github.com/mikey179/vfsStream/issues/6 - * @see https://github.com/mikey179/vfsStream/issues/40 - */ - public function hasSharedLock($resource = null) - { - if (null !== $resource) { - return isset($this->sharedLock[$this->getResourceId($resource)]); - } - - return !empty($this->sharedLock); - } - - /** - * Returns unique resource id - * - * @param resource|vfsStreamWrapper $resource - * @return string - * @see https://github.com/mikey179/vfsStream/issues/40 - */ - public function getResourceId($resource) { - if (is_resource($resource)) { - $data = stream_get_meta_data($resource); - $resource = $data['wrapper_data']; - } - - return spl_object_hash($resource); - } - - /** - * checks whether file is locked in exclusive mode - * - * @param resource|vfsStreamWrapper $resource - * @return bool - * @since 0.10.0 - * @see https://github.com/mikey179/vfsStream/issues/6 - * @see https://github.com/mikey179/vfsStream/issues/40 - */ - public function hasExclusiveLock($resource = null) - { - if (null !== $resource) { - return $this->exclusiveLock === $this->getResourceId($resource); - } - - return null !== $this->exclusiveLock; - } -} diff --git a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamWrapper.php b/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamWrapper.php deleted file mode 100644 index 31c021e..0000000 --- a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamWrapper.php +++ /dev/null @@ -1,986 +0,0 @@ -getName() === $path) { - return self::$root; - } - - if ($this->isInRoot($path) && self::$root->hasChild($path) === true) { - return self::$root->getChild($path); - } - - return null; - } - - /** - * helper method to detect whether given path is in root path - * - * @param string $path - * @return bool - */ - private function isInRoot($path) - { - return substr($path, 0, strlen(self::$root->getName())) === self::$root->getName(); - } - - /** - * returns content for given path but only when it is of given type - * - * @param string $path - * @param int $type - * @return vfsStreamContent - */ - protected function getContentOfType($path, $type) - { - $content = $this->getContent($path); - if (null !== $content && $content->getType() === $type) { - return $content; - } - - return null; - } - - /** - * splits path into its dirname and the basename - * - * @param string $path - * @return string[] - */ - protected function splitPath($path) - { - $lastSlashPos = strrpos($path, '/'); - if (false === $lastSlashPos) { - return array('dirname' => '', 'basename' => $path); - } - - return array('dirname' => substr($path, 0, $lastSlashPos), - 'basename' => substr($path, $lastSlashPos + 1) - ); - } - - /** - * helper method to resolve a path from /foo/bar/. to /foo/bar - * - * @param string $path - * @return string - */ - protected function resolvePath($path) - { - $newPath = array(); - foreach (explode('/', $path) as $pathPart) { - if ('.' !== $pathPart) { - if ('..' !== $pathPart) { - $newPath[] = $pathPart; - } else { - array_pop($newPath); - } - } - } - - return implode('/', $newPath); - } - - /** - * open the stream - * - * @param string $path the path to open - * @param string $mode mode for opening - * @param string $options options for opening - * @param string $opened_path full path that was actually opened - * @return bool - */ - public function stream_open($path, $mode, $options, $opened_path) - { - $extended = ((strstr($mode, '+') !== false) ? (true) : (false)); - $mode = str_replace(array('t', 'b', '+'), '', $mode); - if (in_array($mode, array('r', 'w', 'a', 'x', 'c')) === false) { - if (($options & STREAM_REPORT_ERRORS) === STREAM_REPORT_ERRORS) { - trigger_error('Illegal mode ' . $mode . ', use r, w, a, x or c, flavoured with t, b and/or +', E_USER_WARNING); - } - - return false; - } - - $this->mode = $this->calculateMode($mode, $extended); - $path = $this->resolvePath(vfsStream::path($path)); - $this->content = $this->getContentOfType($path, vfsStreamContent::TYPE_FILE); - if (null !== $this->content) { - if (self::WRITE === $mode) { - if (($options & STREAM_REPORT_ERRORS) === STREAM_REPORT_ERRORS) { - trigger_error('File ' . $path . ' already exists, can not open with mode x', E_USER_WARNING); - } - - return false; - } - - if ( - (self::TRUNCATE === $mode || self::APPEND === $mode) && - $this->content->isWritable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()) === false - ) { - return false; - } - - if (self::TRUNCATE === $mode) { - $this->content->openWithTruncate(); - } elseif (self::APPEND === $mode) { - $this->content->openForAppend(); - } else { - if (!$this->content->isReadable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup())) { - if (($options & STREAM_REPORT_ERRORS) === STREAM_REPORT_ERRORS) { - trigger_error('Permission denied', E_USER_WARNING); - } - return false; - } - $this->content->open(); - } - - return true; - } - - $content = $this->createFile($path, $mode, $options); - if (false === $content) { - return false; - } - - $this->content = $content; - return true; - } - - /** - * creates a file at given path - * - * @param string $path the path to open - * @param string $mode mode for opening - * @param string $options options for opening - * @return bool - */ - private function createFile($path, $mode = null, $options = null) - { - $names = $this->splitPath($path); - if (empty($names['dirname']) === true) { - if (($options & STREAM_REPORT_ERRORS) === STREAM_REPORT_ERRORS) { - trigger_error('File ' . $names['basename'] . ' does not exist', E_USER_WARNING); - } - - return false; - } - - $dir = $this->getContentOfType($names['dirname'], vfsStreamContent::TYPE_DIR); - if (null === $dir) { - if (($options & STREAM_REPORT_ERRORS) === STREAM_REPORT_ERRORS) { - trigger_error('Directory ' . $names['dirname'] . ' does not exist', E_USER_WARNING); - } - - return false; - } elseif ($dir->hasChild($names['basename']) === true) { - if (($options & STREAM_REPORT_ERRORS) === STREAM_REPORT_ERRORS) { - trigger_error('Directory ' . $names['dirname'] . ' already contains a director named ' . $names['basename'], E_USER_WARNING); - } - - return false; - } - - if (self::READ === $mode) { - if (($options & STREAM_REPORT_ERRORS) === STREAM_REPORT_ERRORS) { - trigger_error('Can not open non-existing file ' . $path . ' for reading', E_USER_WARNING); - } - - return false; - } - - if ($dir->isWritable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()) === false) { - if (($options & STREAM_REPORT_ERRORS) === STREAM_REPORT_ERRORS) { - trigger_error('Can not create new file in non-writable path ' . $names['dirname'], E_USER_WARNING); - } - - return false; - } - - return vfsStream::newFile($names['basename'])->at($dir); - } - - /** - * calculates the file mode - * - * @param string $mode opening mode: r, w, a or x - * @param bool $extended true if + was set with opening mode - * @return int - */ - protected function calculateMode($mode, $extended) - { - if (true === $extended) { - return self::ALL; - } - - if (self::READ === $mode) { - return self::READONLY; - } - - return self::WRITEONLY; - } - - /** - * closes the stream - * - * @see https://github.com/mikey179/vfsStream/issues/40 - */ - public function stream_close() - { - $this->content->lock($this, LOCK_UN); - } - - /** - * read the stream up to $count bytes - * - * @param int $count amount of bytes to read - * @return string - */ - public function stream_read($count) - { - if (self::WRITEONLY === $this->mode) { - return ''; - } - - if ($this->content->isReadable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()) === false) { - return ''; - } - - return $this->content->read($count); - } - - /** - * writes data into the stream - * - * @param string $data - * @return int amount of bytes written - */ - public function stream_write($data) - { - if (self::READONLY === $this->mode) { - return 0; - } - - if ($this->content->isWritable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()) === false) { - return 0; - } - - if (self::$quota->isLimited()) { - $data = substr($data, 0, self::$quota->spaceLeft(self::$root->sizeSummarized())); - } - - return $this->content->write($data); - } - - /** - * truncates a file to a given length - * - * @param int $size length to truncate file to - * @return bool - * @since 1.1.0 - */ - public function stream_truncate($size) - { - if (self::READONLY === $this->mode) { - return false; - } - - if ($this->content->isWritable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()) === false) { - return false; - } - - if ($this->content->getType() !== vfsStreamContent::TYPE_FILE) { - return false; - } - - if (self::$quota->isLimited() && $this->content->size() < $size) { - $maxSize = self::$quota->spaceLeft(self::$root->sizeSummarized()); - if (0 === $maxSize) { - return false; - } - - if ($size > $maxSize) { - $size = $maxSize; - } - } - - return $this->content->truncate($size); - } - - /** - * sets metadata like owner, user or permissions - * - * @param string $path - * @param int $option - * @param mixed $var - * @return bool - * @since 1.1.0 - */ - public function stream_metadata($path, $option, $var) - { - $path = $this->resolvePath(vfsStream::path($path)); - $content = $this->getContent($path); - switch ($option) { - case STREAM_META_TOUCH: - if (null === $content) { - $content = $this->createFile($path, null, STREAM_REPORT_ERRORS); - // file creation may not be allowed at provided path - if (false === $content) { - return false; - } - } - - $currentTime = time(); - $content->lastModified(((isset($var[0])) ? ($var[0]) : ($currentTime))) - ->lastAccessed(((isset($var[1])) ? ($var[1]) : ($currentTime))); - return true; - - case STREAM_META_OWNER_NAME: - return false; - - case STREAM_META_OWNER: - if (null === $content) { - return false; - } - - return $this->doPermChange($path, - $content, - function() use ($content, $var) - { - $content->chown($var); - } - ); - - case STREAM_META_GROUP_NAME: - return false; - - case STREAM_META_GROUP: - if (null === $content) { - return false; - } - - return $this->doPermChange($path, - $content, - function() use ($content, $var) - { - $content->chgrp($var); - } - ); - - case STREAM_META_ACCESS: - if (null === $content) { - return false; - } - - return $this->doPermChange($path, - $content, - function() use ($content, $var) - { - $content->chmod($var); - } - ); - - default: - return false; - } - } - - /** - * executes given permission change when necessary rights allow such a change - * - * @param string $path - * @param vfsStreamAbstractContent $content - * @param \Closure $change - * @return bool - */ - private function doPermChange($path, vfsStreamAbstractContent $content, \Closure $change) - { - if (!$content->isOwnedByUser(vfsStream::getCurrentUser())) { - return false; - } - - if (self::$root->getName() !== $path) { - $names = $this->splitPath($path); - $parent = $this->getContent($names['dirname']); - if (!$parent->isWritable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup())) { - return false; - } - } - - $change(); - return true; - } - - /** - * checks whether stream is at end of file - * - * @return bool - */ - public function stream_eof() - { - return $this->content->eof(); - } - - /** - * returns the current position of the stream - * - * @return int - */ - public function stream_tell() - { - return $this->content->getBytesRead(); - } - - /** - * seeks to the given offset - * - * @param int $offset - * @param int $whence - * @return bool - */ - public function stream_seek($offset, $whence) - { - return $this->content->seek($offset, $whence); - } - - /** - * flushes unstored data into storage - * - * @return bool - */ - public function stream_flush() - { - return true; - } - - /** - * returns status of stream - * - * @return array - */ - public function stream_stat() - { - $fileStat = array('dev' => 0, - 'ino' => 0, - 'mode' => $this->content->getType() | $this->content->getPermissions(), - 'nlink' => 0, - 'uid' => $this->content->getUser(), - 'gid' => $this->content->getGroup(), - 'rdev' => 0, - 'size' => $this->content->size(), - 'atime' => $this->content->fileatime(), - 'mtime' => $this->content->filemtime(), - 'ctime' => $this->content->filectime(), - 'blksize' => -1, - 'blocks' => -1 - ); - return array_merge(array_values($fileStat), $fileStat); - } - - /** - * retrieve the underlaying resource - * - * Please note that this method always returns false as there is no - * underlaying resource to return. - * - * @param int $cast_as - * @since 0.9.0 - * @see https://github.com/mikey179/vfsStream/issues/3 - * @return bool - */ - public function stream_cast($cast_as) - { - return false; - } - - /** - * set lock status for stream - * - * @param int $operation - * @return bool - * @since 0.10.0 - * @see https://github.com/mikey179/vfsStream/issues/6 - * @see https://github.com/mikey179/vfsStream/issues/31 - * @see https://github.com/mikey179/vfsStream/issues/40 - */ - public function stream_lock($operation) - { - if ((LOCK_NB & $operation) == LOCK_NB) { - $operation = $operation - LOCK_NB; - } - - return $this->content->lock($this, $operation); - } - - /** - * sets options on the stream - * - * @param int $option key of option to set - * @param int $arg1 - * @param int $arg2 - * @return bool - * @since 0.10.0 - * @see https://github.com/mikey179/vfsStream/issues/15 - * @see http://www.php.net/manual/streamwrapper.stream-set-option.php - */ - public function stream_set_option($option, $arg1, $arg2) - { - switch ($option) { - case STREAM_OPTION_BLOCKING: - // break omitted - - case STREAM_OPTION_READ_TIMEOUT: - // break omitted - - case STREAM_OPTION_WRITE_BUFFER: - // break omitted - - default: - // nothing to do here - } - - return false; - } - - /** - * remove the data under the given path - * - * @param string $path - * @return bool - */ - public function unlink($path) - { - $realPath = $this->resolvePath(vfsStream::path($path)); - $content = $this->getContent($realPath); - if (null === $content) { - trigger_error('unlink(' . $path . '): No such file or directory', E_USER_WARNING); - return false; - } - - if ($content->getType() !== vfsStreamContent::TYPE_FILE) { - trigger_error('unlink(' . $path . '): Operation not permitted', E_USER_WARNING); - return false; - } - - return $this->doUnlink($realPath); - } - - /** - * removes a path - * - * @param string $path - * @return bool - */ - protected function doUnlink($path) - { - if (self::$root->getName() === $path) { - // delete root? very brave. :) - self::$root = null; - clearstatcache(); - return true; - } - - $names = $this->splitPath($path); - $content = $this->getContent($names['dirname']); - if (!$content->isWritable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup())) { - return false; - } - - clearstatcache(); - return $content->removeChild($names['basename']); - } - - /** - * rename from one path to another - * - * @param string $path_from - * @param string $path_to - * @return bool - * @author Benoit Aubuchon - */ - public function rename($path_from, $path_to) - { - $srcRealPath = $this->resolvePath(vfsStream::path($path_from)); - $dstRealPath = $this->resolvePath(vfsStream::path($path_to)); - $srcContent = $this->getContent($srcRealPath); - if (null == $srcContent) { - trigger_error(' No such file or directory', E_USER_WARNING); - return false; - } - $dstNames = $this->splitPath($dstRealPath); - $dstParentContent = $this->getContent($dstNames['dirname']); - if (null == $dstParentContent) { - trigger_error('No such file or directory', E_USER_WARNING); - return false; - } - if (!$dstParentContent->isWritable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup())) { - trigger_error('Permission denied', E_USER_WARNING); - return false; - } - if ($dstParentContent->getType() !== vfsStreamContent::TYPE_DIR) { - trigger_error('Target is not a directory', E_USER_WARNING); - return false; - } - - // remove old source first, so we can rename later - // (renaming first would lead to not being able to remove the old path) - if (!$this->doUnlink($srcRealPath)) { - return false; - } - - $dstContent = $srcContent; - // Renaming the filename - $dstContent->rename($dstNames['basename']); - // Copying to the destination - $dstParentContent->addChild($dstContent); - return true; - } - - /** - * creates a new directory - * - * @param string $path - * @param int $mode - * @param int $options - * @return bool - */ - public function mkdir($path, $mode, $options) - { - $umask = vfsStream::umask(); - if (0 < $umask) { - $permissions = $mode & ~$umask; - } else { - $permissions = $mode; - } - - $path = $this->resolvePath(vfsStream::path($path)); - if (null !== $this->getContent($path)) { - trigger_error('mkdir(): Path vfs://' . $path . ' exists', E_USER_WARNING); - return false; - } - - if (null === self::$root) { - self::$root = vfsStream::newDirectory($path, $permissions); - return true; - } - - $maxDepth = count(explode('/', $path)); - $names = $this->splitPath($path); - $newDirs = $names['basename']; - $dir = null; - $i = 0; - while ($dir === null && $i < $maxDepth) { - $dir = $this->getContent($names['dirname']); - $names = $this->splitPath($names['dirname']); - if (null == $dir) { - $newDirs = $names['basename'] . '/' . $newDirs; - } - - $i++; - } - - if (null === $dir - || $dir->getType() !== vfsStreamContent::TYPE_DIR - || $dir->isWritable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()) === false) { - return false; - } - - $recursive = ((STREAM_MKDIR_RECURSIVE & $options) !== 0) ? (true) : (false); - if (strpos($newDirs, '/') !== false && false === $recursive) { - return false; - } - - vfsStream::newDirectory($newDirs, $permissions)->at($dir); - return true; - } - - /** - * removes a directory - * - * @param string $path - * @param int $options - * @return bool - * @todo consider $options with STREAM_MKDIR_RECURSIVE - */ - public function rmdir($path, $options) - { - $path = $this->resolvePath(vfsStream::path($path)); - $child = $this->getContentOfType($path, vfsStreamContent::TYPE_DIR); - if (null === $child) { - return false; - } - - // can only remove empty directories - if (count($child->getChildren()) > 0) { - return false; - } - - if (self::$root->getName() === $path) { - // delete root? very brave. :) - self::$root = null; - clearstatcache(); - return true; - } - - $names = $this->splitPath($path); - $dir = $this->getContentOfType($names['dirname'], vfsStreamContent::TYPE_DIR); - if ($dir->isWritable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()) === false) { - return false; - } - - clearstatcache(); - return $dir->removeChild($child->getName()); - } - - /** - * opens a directory - * - * @param string $path - * @param int $options - * @return bool - */ - public function dir_opendir($path, $options) - { - $path = $this->resolvePath(vfsStream::path($path)); - $this->dir = $this->getContentOfType($path, vfsStreamContent::TYPE_DIR); - if (null === $this->dir || $this->dir->isReadable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()) === false) { - return false; - } - - $this->dirIterator = $this->dir->getIterator(); - return true; - } - - /** - * reads directory contents - * - * @return string - */ - public function dir_readdir() - { - $dir = $this->dirIterator->current(); - if (null === $dir) { - return false; - } - - $this->dirIterator->next(); - return $dir->getName(); - } - - /** - * reset directory iteration - * - * @return bool - */ - public function dir_rewinddir() - { - return $this->dirIterator->rewind(); - } - - /** - * closes directory - * - * @return bool - */ - public function dir_closedir() - { - $this->dirIterator = null; - return true; - } - - /** - * returns status of url - * - * @param string $path path of url to return status for - * @param int $flags flags set by the stream API - * @return array - */ - public function url_stat($path, $flags) - { - $content = $this->getContent($this->resolvePath(vfsStream::path($path))); - if (null === $content) { - if (($flags & STREAM_URL_STAT_QUIET) != STREAM_URL_STAT_QUIET) { - trigger_error(' No such file or directory: ' . $path, E_USER_WARNING); - } - - return false; - - } - - $fileStat = array('dev' => 0, - 'ino' => 0, - 'mode' => $content->getType() | $content->getPermissions(), - 'nlink' => 0, - 'uid' => $content->getUser(), - 'gid' => $content->getGroup(), - 'rdev' => 0, - 'size' => $content->size(), - 'atime' => $content->fileatime(), - 'mtime' => $content->filemtime(), - 'ctime' => $content->filectime(), - 'blksize' => -1, - 'blocks' => -1 - ); - return array_merge(array_values($fileStat), $fileStat); - } -} -?> diff --git a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/visitor/vfsStreamAbstractVisitor.php b/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/visitor/vfsStreamAbstractVisitor.php deleted file mode 100644 index 4f8c286..0000000 --- a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/visitor/vfsStreamAbstractVisitor.php +++ /dev/null @@ -1,65 +0,0 @@ -getType()) { - case vfsStreamContent::TYPE_BLOCK: - $this->visitBlockDevice($content); - break; - - case vfsStreamContent::TYPE_FILE: - $this->visitFile($content); - break; - - case vfsStreamContent::TYPE_DIR: - if (!$content->isDot()) { - $this->visitDirectory($content); - } - - break; - - default: - throw new \InvalidArgumentException('Unknown content type ' . $content->getType() . ' for ' . $content->getName()); - } - - return $this; - } - - /** - * visit a block device and process it - * - * @param vfsStreamBlock $block - * @return vfsStreamVisitor - */ - public function visitBlockDevice(vfsStreamBlock $block) - { - return $this->visitFile($block); - } -} -?> diff --git a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/visitor/vfsStreamPrintVisitor.php b/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/visitor/vfsStreamPrintVisitor.php deleted file mode 100644 index 4175485..0000000 --- a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/visitor/vfsStreamPrintVisitor.php +++ /dev/null @@ -1,108 +0,0 @@ -out = $out; - } - - /** - * visit a file and process it - * - * @param vfsStreamFile $file - * @return vfsStreamPrintVisitor - */ - public function visitFile(vfsStreamFile $file) - { - $this->printContent($file->getName()); - return $this; - } - - /** - * visit a block device and process it - * - * @param vfsStreamBlock $block - * @return vfsStreamPrintVisitor - */ - public function visitBlockDevice(vfsStreamBlock $block) - { - $name = '[' . $block->getName() . ']'; - $this->printContent($name); - return $this; - } - - /** - * visit a directory and process it - * - * @param vfsStreamDirectory $dir - * @return vfsStreamPrintVisitor - */ - public function visitDirectory(vfsStreamDirectory $dir) - { - $this->printContent($dir->getName()); - $this->depth++; - foreach ($dir as $child) { - $this->visit($child); - } - - $this->depth--; - return $this; - } - - /** - * helper method to print the content - * - * @param string $name - */ - protected function printContent($name) - { - fwrite($this->out, str_repeat(' ', $this->depth) . '- ' . $name . "\n"); - } -} -?> diff --git a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/visitor/vfsStreamStructureVisitor.php b/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/visitor/vfsStreamStructureVisitor.php deleted file mode 100644 index 957e5df..0000000 --- a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/visitor/vfsStreamStructureVisitor.php +++ /dev/null @@ -1,112 +0,0 @@ -reset(); - } - - /** - * visit a file and process it - * - * @param vfsStreamFile $file - * @return vfsStreamStructureVisitor - */ - public function visitFile(vfsStreamFile $file) - { - $this->current[$file->getName()] = $file->getContent(); - return $this; - } - - /** - * visit a block device and process it - * - * @param vfsStreamBlock $block - * @return vfsStreamStructureVisitor - */ - public function visitBlockDevice(vfsStreamBlock $block) - { - $this->current['[' . $block->getName() . ']'] = $block->getContent(); - return $this; - } - - /** - * visit a directory and process it - * - * @param vfsStreamDirectory $dir - * @return vfsStreamStructureVisitor - */ - public function visitDirectory(vfsStreamDirectory $dir) - { - $this->current[$dir->getName()] = array(); - $tmp =& $this->current; - $this->current =& $tmp[$dir->getName()]; - foreach ($dir as $child) { - $this->visit($child); - } - - $this->current =& $tmp; - return $this; - } - - /** - * returns structure of visited contents - * - * @return array - * @api - */ - public function getStructure() - { - return $this->structure; - } - - /** - * resets structure so visitor could be reused - * - * @return vfsStreamStructureVisitor - */ - public function reset() - { - $this->structure = array(); - $this->current =& $this->structure; - return $this; - } -} -?> diff --git a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/visitor/vfsStreamVisitor.php b/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/visitor/vfsStreamVisitor.php deleted file mode 100644 index 89e4374..0000000 --- a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/visitor/vfsStreamVisitor.php +++ /dev/null @@ -1,56 +0,0 @@ - diff --git a/core/vendor/phpdocumentor/reflection-docblock/.gitignore b/core/vendor/phpdocumentor/reflection-docblock/.gitignore deleted file mode 100644 index 3ce5adb..0000000 --- a/core/vendor/phpdocumentor/reflection-docblock/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -.idea -vendor diff --git a/core/vendor/phpdocumentor/reflection-docblock/.travis.yml b/core/vendor/phpdocumentor/reflection-docblock/.travis.yml deleted file mode 100644 index eef782c..0000000 --- a/core/vendor/phpdocumentor/reflection-docblock/.travis.yml +++ /dev/null @@ -1,32 +0,0 @@ -language: php -php: - - 5.3.3 - - 5.3 - - 5.4 - - 5.5 - - 5.6 - - hhvm - - hhvm-nightly - -matrix: - allow_failures: - - php: hhvm - - php: hhvm-nightly - -script: - - vendor/bin/phpunit - -before_script: - - sudo apt-get -qq update > /dev/null - - phpenv rehash > /dev/null - - composer selfupdate --quiet - - composer install --no-interaction --prefer-source --dev - - vendor/bin/phpunit - - composer update --no-interaction --prefer-source --dev - -notifications: - irc: "irc.freenode.org#phpdocumentor" - email: - - mike.vanriel@naenius.com - - ashnazg@php.net - - boen.robot@gmail.com diff --git a/core/vendor/phpdocumentor/reflection-docblock/LICENSE b/core/vendor/phpdocumentor/reflection-docblock/LICENSE deleted file mode 100644 index 792e404..0000000 --- a/core/vendor/phpdocumentor/reflection-docblock/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2010 Mike van Riel - -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/core/vendor/phpdocumentor/reflection-docblock/README.md b/core/vendor/phpdocumentor/reflection-docblock/README.md deleted file mode 100644 index 6405d1a..0000000 --- a/core/vendor/phpdocumentor/reflection-docblock/README.md +++ /dev/null @@ -1,57 +0,0 @@ -The ReflectionDocBlock Component [![Build Status](https://secure.travis-ci.org/phpDocumentor/ReflectionDocBlock.png)](https://travis-ci.org/phpDocumentor/ReflectionDocBlock) -================================ - -Introduction ------------- - -The ReflectionDocBlock component of phpDocumentor provides a DocBlock parser -that is 100% compatible with the [PHPDoc standard](http://phpdoc.org/docs/latest). - -With this component, a library can provide support for annotations via DocBlocks -or otherwise retrieve information that is embedded in a DocBlock. - -> **Note**: *this is a core component of phpDocumentor and is constantly being -> optimized for performance.* - -Installation ------------- - -You can install the component in the following ways: - -* Use the official Github repository (https://github.com/phpDocumentor/ReflectionDocBlock) -* Via Composer (http://packagist.org/packages/phpdocumentor/reflection-docblock) - -Usage ------ - -The ReflectionDocBlock component is designed to work in an identical fashion to -PHP's own Reflection extension (http://php.net/manual/en/book.reflection.php). - -Parsing can be initiated by instantiating the -`\phpDocumentor\Reflection\DocBlock()` class and passing it a string containing -a DocBlock (including asterisks) or by passing an object supporting the -`getDocComment()` method. - -> *Examples of objects having the `getDocComment()` method are the -> `ReflectionClass` and the `ReflectionMethod` classes of the PHP -> Reflection extension* - -Example: - - $class = new ReflectionClass('MyClass'); - $phpdoc = new \phpDocumentor\Reflection\DocBlock($class); - -or - - $docblock = <<=5.3.3" - }, - "autoload": { - "psr-0": {"phpDocumentor": ["src/"]} - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "suggest": { - "dflydev/markdown": "~1.0", - "erusev/parsedown": "~1.0" - }, - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - } -} diff --git a/core/vendor/phpdocumentor/reflection-docblock/composer.lock b/core/vendor/phpdocumentor/reflection-docblock/composer.lock deleted file mode 100644 index 4c6a8bb..0000000 --- a/core/vendor/phpdocumentor/reflection-docblock/composer.lock +++ /dev/null @@ -1,827 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", - "This file is @generated automatically" - ], - "hash": "ea1734d11b8c878445c2c6e58de8b85f", - "packages": [], - "packages-dev": [ - { - "name": "ocramius/instantiator", - "version": "1.1.2", - "source": { - "type": "git", - "url": "https://github.com/Ocramius/Instantiator.git", - "reference": "a7abbb5fc9df6e7126af741dd6c140d1a7369435" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Ocramius/Instantiator/zipball/a7abbb5fc9df6e7126af741dd6c140d1a7369435", - "reference": "a7abbb5fc9df6e7126af741dd6c140d1a7369435", - "shasum": "" - }, - "require": { - "ocramius/lazy-map": "1.0.*", - "php": "~5.3" - }, - "require-dev": { - "athletic/athletic": "~0.1.8", - "ext-pdo": "*", - "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "2.0.*@ALPHA" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-0": { - "Instantiator\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://github.com/Ocramius/Instantiator", - "keywords": [ - "constructor", - "instantiate" - ], - "time": "2014-08-14 15:10:55" - }, - { - "name": "ocramius/lazy-map", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/Ocramius/LazyMap.git", - "reference": "7fe3d347f5e618bcea7d39345ff83f3651d8b752" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Ocramius/LazyMap/zipball/7fe3d347f5e618bcea7d39345ff83f3651d8b752", - "reference": "7fe3d347f5e618bcea7d39345ff83f3651d8b752", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "athletic/athletic": "~0.1.6", - "phpmd/phpmd": "1.5.*", - "phpunit/phpunit": ">=3.7", - "satooshi/php-coveralls": "~0.6", - "squizlabs/php_codesniffer": "1.4.*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-0": { - "LazyMap\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/", - "role": "Developer" - } - ], - "description": "A library that provides lazy instantiation logic for a map of objects", - "homepage": "https://github.com/Ocramius/LazyMap", - "keywords": [ - "lazy", - "lazy instantiation", - "lazy loading", - "map", - "service location" - ], - "time": "2013-11-09 22:30:54" - }, - { - "name": "phpunit/php-code-coverage", - "version": "2.0.10", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "6d196af48e8c100a3ae881940123e693da5a9217" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/6d196af48e8c100a3ae881940123e693da5a9217", - "reference": "6d196af48e8c100a3ae881940123e693da5a9217", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "phpunit/php-file-iterator": "~1.3.1", - "phpunit/php-text-template": "~1.2.0", - "phpunit/php-token-stream": "~1.2.2", - "sebastian/environment": "~1.0.0", - "sebastian/version": "~1.0.3" - }, - "require-dev": { - "ext-xdebug": ">=2.1.4", - "phpunit/phpunit": "~4.0.14" - }, - "suggest": { - "ext-dom": "*", - "ext-xdebug": ">=2.2.1", - "ext-xmlwriter": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "time": "2014-08-06 06:39:42" - }, - { - "name": "phpunit/php-file-iterator", - "version": "1.3.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/acd690379117b042d1c8af1fafd61bde001bf6bb", - "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "File/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "time": "2013-10-10 15:34:57" - }, - { - "name": "phpunit/php-text-template", - "version": "1.2.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", - "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "Text/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "time": "2014-01-30 17:20:04" - }, - { - "name": "phpunit/php-timer", - "version": "1.0.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/19689d4354b295ee3d8c54b4f42c3efb69cbc17c", - "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "PHP/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "time": "2013-08-02 07:42:54" - }, - { - "name": "phpunit/php-token-stream", - "version": "1.2.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "ad4e1e23ae01b483c16f600ff1bebec184588e32" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/ad4e1e23ae01b483c16f600ff1bebec184588e32", - "reference": "ad4e1e23ae01b483c16f600ff1bebec184588e32", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2-dev" - } - }, - "autoload": { - "classmap": [ - "PHP/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ], - "time": "2014-03-03 05:10:30" - }, - { - "name": "phpunit/phpunit", - "version": "4.2.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "a33fa68ece9f8c68589bfc2da8d2794e27b820bc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a33fa68ece9f8c68589bfc2da8d2794e27b820bc", - "reference": "a33fa68ece9f8c68589bfc2da8d2794e27b820bc", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-json": "*", - "ext-pcre": "*", - "ext-reflection": "*", - "ext-spl": "*", - "php": ">=5.3.3", - "phpunit/php-code-coverage": "~2.0", - "phpunit/php-file-iterator": "~1.3.1", - "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": "~1.0.2", - "phpunit/phpunit-mock-objects": "~2.2", - "sebastian/comparator": "~1.0", - "sebastian/diff": "~1.1", - "sebastian/environment": "~1.0", - "sebastian/exporter": "~1.0", - "sebastian/version": "~1.0", - "symfony/yaml": "~2.0" - }, - "suggest": { - "phpunit/php-invoker": "~1.1" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "", - "../../symfony/yaml/" - ], - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "The PHP Unit Testing framework.", - "homepage": "http://www.phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "time": "2014-08-18 05:12:30" - }, - { - "name": "phpunit/phpunit-mock-objects", - "version": "2.2.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "42e589e08bc86e3e9bdf20d385e948347788505b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/42e589e08bc86e3e9bdf20d385e948347788505b", - "reference": "42e589e08bc86e3e9bdf20d385e948347788505b", - "shasum": "" - }, - "require": { - "ocramius/instantiator": "~1.0", - "php": ">=5.3.3", - "phpunit/php-text-template": "~1.2" - }, - "require-dev": { - "phpunit/phpunit": "4.2.*@dev" - }, - "suggest": { - "ext-soap": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", - "keywords": [ - "mock", - "xunit" - ], - "time": "2014-08-02 13:50:58" - }, - { - "name": "sebastian/comparator", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "f7069ee51fa9fb6c038e16a9d0e3439f5449dcf2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/f7069ee51fa9fb6c038e16a9d0e3439f5449dcf2", - "reference": "f7069ee51fa9fb6c038e16a9d0e3439f5449dcf2", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.1", - "sebastian/exporter": "~1.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "time": "2014-05-02 07:05:58" - }, - { - "name": "sebastian/diff", - "version": "1.1.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "1e091702a5a38e6b4c1ba9ca816e3dd343df2e2d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/1e091702a5a38e6b4c1ba9ca816e3dd343df2e2d", - "reference": "1e091702a5a38e6b4c1ba9ca816e3dd343df2e2d", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - }, - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - } - ], - "description": "Diff implementation", - "homepage": "http://www.github.com/sebastianbergmann/diff", - "keywords": [ - "diff" - ], - "time": "2013-08-03 16:46:33" - }, - { - "name": "sebastian/environment", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "79517609ec01139cd7e9fded0dd7ce08c952ef6a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/79517609ec01139cd7e9fded0dd7ce08c952ef6a", - "reference": "79517609ec01139cd7e9fded0dd7ce08c952ef6a", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "4.0.*@dev" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], - "time": "2014-02-18 16:17:19" - }, - { - "name": "sebastian/exporter", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "1f9a98e6f5dfe0524cb8c6166f7c82f3e9ae1529" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/1f9a98e6f5dfe0524cb8c6166f7c82f3e9ae1529", - "reference": "1f9a98e6f5dfe0524cb8c6166f7c82f3e9ae1529", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "4.0.*@dev" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net", - "role": "Lead" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - } - ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "time": "2014-02-16 08:26:31" - }, - { - "name": "sebastian/version", - "version": "1.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "b6e1f0cf6b9e1ec409a0d3e2f2a5fb0998e36b43" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/b6e1f0cf6b9e1ec409a0d3e2f2a5fb0998e36b43", - "reference": "b6e1f0cf6b9e1ec409a0d3e2f2a5fb0998e36b43", - "shasum": "" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "time": "2014-03-07 15:35:33" - }, - { - "name": "symfony/yaml", - "version": "v2.5.3", - "target-dir": "Symfony/Component/Yaml", - "source": { - "type": "git", - "url": "https://github.com/symfony/Yaml.git", - "reference": "5a75366ae9ca8b4792cd0083e4ca4dff9fe96f1f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/5a75366ae9ca8b4792cd0083e4ca4dff9fe96f1f", - "reference": "5a75366ae9ca8b4792cd0083e4ca4dff9fe96f1f", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.5-dev" - } - }, - "autoload": { - "psr-0": { - "Symfony\\Component\\Yaml\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "Symfony Yaml Component", - "homepage": "http://symfony.com", - "time": "2014-08-05 09:00:40" - } - ], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "platform": { - "php": ">=5.3.3" - }, - "platform-dev": [] -} diff --git a/core/vendor/phpdocumentor/reflection-docblock/phpunit.xml.dist b/core/vendor/phpdocumentor/reflection-docblock/phpunit.xml.dist deleted file mode 100644 index f67ad2a..0000000 --- a/core/vendor/phpdocumentor/reflection-docblock/phpunit.xml.dist +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - ./tests/ - - - - - ./src/ - - - diff --git a/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock.php b/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock.php deleted file mode 100644 index 02968b1..0000000 --- a/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock.php +++ /dev/null @@ -1,468 +0,0 @@ - - * @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\Tag; -use phpDocumentor\Reflection\DocBlock\Context; -use phpDocumentor\Reflection\DocBlock\Location; - -/** - * Parses the DocBlock for any structure. - * - * @author Mike van Riel - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class DocBlock implements \Reflector -{ - /** @var string The opening line for this docblock. */ - protected $short_description = ''; - - /** - * @var DocBlock\Description The actual - * description for this docblock. - */ - protected $long_description = null; - - /** - * @var Tag[] An array containing all - * the tags in this docblock; except inline. - */ - protected $tags = array(); - - /** @var Context Information about the context of this DocBlock. */ - protected $context = null; - - /** @var Location Information about the location of this DocBlock. */ - protected $location = null; - - /** @var bool Is this DocBlock (the start of) a template? */ - protected $isTemplateStart = false; - - /** @var bool Does this DocBlock signify the end of a DocBlock template? */ - protected $isTemplateEnd = false; - - /** - * Parses the given docblock and populates the member fields. - * - * The constructor may also receive namespace information such as the - * current namespace and aliases. This information is used by some tags - * (e.g. @return, @param, etc.) to turn a relative Type into a FQCN. - * - * @param \Reflector|string $docblock A docblock comment (including - * asterisks) or reflector supporting the getDocComment method. - * @param Context $context The context in which the DocBlock - * occurs. - * @param Location $location The location within the file that this - * DocBlock occurs in. - * - * @throws \InvalidArgumentException if the given argument does not have the - * getDocComment method. - */ - public function __construct( - $docblock, - Context $context = null, - Location $location = null - ) { - if (is_object($docblock)) { - if (!method_exists($docblock, 'getDocComment')) { - throw new \InvalidArgumentException( - 'Invalid object passed; the given reflector must support ' - . 'the getDocComment method' - ); - } - - $docblock = $docblock->getDocComment(); - } - - $docblock = $this->cleanInput($docblock); - - list($templateMarker, $short, $long, $tags) = $this->splitDocBlock($docblock); - $this->isTemplateStart = $templateMarker === '#@+'; - $this->isTemplateEnd = $templateMarker === '#@-'; - $this->short_description = $short; - $this->long_description = new DocBlock\Description($long, $this); - $this->parseTags($tags); - - $this->context = $context; - $this->location = $location; - } - - /** - * Strips the asterisks from the DocBlock comment. - * - * @param string $comment String containing the comment text. - * - * @return string - */ - protected function cleanInput($comment) - { - $comment = trim( - preg_replace( - '#[ \t]*(?:\/\*\*|\*\/|\*)?[ \t]{0,1}(.*)?#u', - '$1', - $comment - ) - ); - - // reg ex above is not able to remove */ from a single line docblock - if (substr($comment, -2) == '*/') { - $comment = trim(substr($comment, 0, -2)); - } - - // normalize strings - $comment = str_replace(array("\r\n", "\r"), "\n", $comment); - - return $comment; - } - - /** - * Splits the DocBlock into a template marker, summary, description and block of tags. - * - * @param string $comment Comment to split into the sub-parts. - * - * @author Richard van Velzen (@_richardJ) Special thanks to Richard for the regex responsible for the split. - * @author Mike van Riel for extending the regex with template marker support. - * - * @return string[] containing the template marker (if any), summary, description and a string containing the tags. - */ - protected function splitDocBlock($comment) - { - // Performance improvement cheat: if the first character is an @ then only tags are in this DocBlock. This - // method does not split tags so we return this verbatim as the fourth result (tags). This saves us the - // performance impact of running a regular expression - if (strpos($comment, '@') === 0) { - return array('', '', '', $comment); - } - - // clears all extra horizontal whitespace from the line endings to prevent parsing issues - $comment = preg_replace('/\h*$/Sum', '', $comment); - - /* - * Splits the docblock into a template marker, short description, long description and tags section - * - * - The template marker is empty, #@+ or #@- if the DocBlock starts with either of those (a newline may - * occur after it and will be stripped). - * - The short description is started from the first character until a dot is encountered followed by a - * newline OR two consecutive newlines (horizontal whitespace is taken into account to consider spacing - * errors). This is optional. - * - The long description, any character until a new line is encountered followed by an @ and word - * characters (a tag). This is optional. - * - Tags; the remaining characters - * - * Big thanks to RichardJ for contributing this Regular Expression - */ - preg_match( - '/ - \A - # 1. Extract the template marker - (?:(\#\@\+|\#\@\-)\n?)? - - # 2. Extract the summary - (?: - (?! @\pL ) # The summary may not start with an @ - ( - [^\n.]+ - (?: - (?! \. \n | \n{2} ) # End summary upon a dot followed by newline or two newlines - [\n.] (?! [ \t]* @\pL ) # End summary when an @ is found as first character on a new line - [^\n.]+ # Include anything else - )* - \.? - )? - ) - - # 3. Extract the description - (?: - \s* # Some form of whitespace _must_ precede a description because a summary must be there - (?! @\pL ) # The description may not start with an @ - ( - [^\n]+ - (?: \n+ - (?! [ \t]* @\pL ) # End description when an @ is found as first character on a new line - [^\n]+ # Include anything else - )* - ) - )? - - # 4. Extract the tags (anything that follows) - (\s+ [\s\S]*)? # everything that follows - /ux', - $comment, - $matches - ); - array_shift($matches); - - while (count($matches) < 4) { - $matches[] = ''; - } - - return $matches; - } - - /** - * Creates the tag objects. - * - * @param string $tags Tag block to parse. - * - * @return void - */ - protected function parseTags($tags) - { - $result = array(); - $tags = trim($tags); - if ('' !== $tags) { - if ('@' !== $tags[0]) { - throw new \LogicException( - 'A tag block started with text instead of an actual tag,' - . ' this makes the tag block invalid: ' . $tags - ); - } - foreach (explode("\n", $tags) as $tag_line) { - if (isset($tag_line[0]) && ($tag_line[0] === '@')) { - $result[] = $tag_line; - } else { - $result[count($result) - 1] .= "\n" . $tag_line; - } - } - - // create proper Tag objects - foreach ($result as $key => $tag_line) { - $result[$key] = Tag::createInstance(trim($tag_line), $this); - } - } - - $this->tags = $result; - } - - /** - * Gets the text portion of the doc block. - * - * Gets the text portion (short and long description combined) of the doc - * block. - * - * @return string The text portion of the doc block. - */ - public function getText() - { - $short = $this->getShortDescription(); - $long = $this->getLongDescription()->getContents(); - - if ($long) { - return "{$short}\n\n{$long}"; - } else { - return $short; - } - } - - /** - * Set the text portion of the doc block. - * - * Sets the text portion (short and long description combined) of the doc - * block. - * - * @param string $docblock The new text portion of the doc block. - * - * @return $this This doc block. - */ - public function setText($comment) - { - list(,$short, $long) = $this->splitDocBlock($comment); - $this->short_description = $short; - $this->long_description = new DocBlock\Description($long, $this); - return $this; - } - /** - * Returns the opening line or also known as short description. - * - * @return string - */ - public function getShortDescription() - { - return $this->short_description; - } - - /** - * Returns the full description or also known as long description. - * - * @return DocBlock\Description - */ - public function getLongDescription() - { - return $this->long_description; - } - - /** - * Returns whether this DocBlock is the start of a Template section. - * - * A Docblock may serve as template for a series of subsequent DocBlocks. This is indicated by a special marker - * (`#@+`) that is appended directly after the opening `/**` of a DocBlock. - * - * An example of such an opening is: - * - * ``` - * /**#@+ - * * My DocBlock - * * / - * ``` - * - * The description and tags (not the summary!) are copied onto all subsequent DocBlocks and also applied to all - * elements that follow until another DocBlock is found that contains the closing marker (`#@-`). - * - * @see self::isTemplateEnd() for the check whether a closing marker was provided. - * - * @return boolean - */ - public function isTemplateStart() - { - return $this->isTemplateStart; - } - - /** - * Returns whether this DocBlock is the end of a Template section. - * - * @see self::isTemplateStart() for a more complete description of the Docblock Template functionality. - * - * @return boolean - */ - public function isTemplateEnd() - { - return $this->isTemplateEnd; - } - - /** - * Returns the current context. - * - * @return Context - */ - public function getContext() - { - return $this->context; - } - - /** - * Returns the current location. - * - * @return Location - */ - public function getLocation() - { - return $this->location; - } - - /** - * Returns the tags for this DocBlock. - * - * @return Tag[] - */ - public function getTags() - { - return $this->tags; - } - - /** - * Returns an array of tags matching the given name. If no tags are found - * an empty array is returned. - * - * @param string $name String to search by. - * - * @return Tag[] - */ - public function getTagsByName($name) - { - $result = array(); - - /** @var Tag $tag */ - foreach ($this->getTags() as $tag) { - if ($tag->getName() != $name) { - continue; - } - - $result[] = $tag; - } - - return $result; - } - - /** - * Checks if a tag of a certain type is present in this DocBlock. - * - * @param string $name Tag name to check for. - * - * @return bool - */ - public function hasTag($name) - { - /** @var Tag $tag */ - foreach ($this->getTags() as $tag) { - if ($tag->getName() == $name) { - return true; - } - } - - return false; - } - - /** - * Appends a tag at the end of the list of tags. - * - * @param Tag $tag The tag to add. - * - * @return Tag The newly added tag. - * - * @throws \LogicException When the tag belongs to a different DocBlock. - */ - public function appendTag(Tag $tag) - { - if (null === $tag->getDocBlock()) { - $tag->setDocBlock($this); - } - - if ($tag->getDocBlock() === $this) { - $this->tags[] = $tag; - } else { - throw new \LogicException( - 'This tag belongs to a different DocBlock object.' - ); - } - - return $tag; - } - - - /** - * Builds a string representation of this object. - * - * @todo determine the exact format as used by PHP Reflection and - * implement it. - * - * @return string - * @codeCoverageIgnore Not yet implemented - */ - public static function export() - { - throw new \Exception('Not yet implemented'); - } - - /** - * Returns the exported information (we should use the export static method - * BUT this throws an exception at this point). - * - * @return string - * @codeCoverageIgnore Not yet implemented - */ - public function __toString() - { - return 'Not yet implemented'; - } -} diff --git a/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Context.php b/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Context.php deleted file mode 100644 index 81aa83c..0000000 --- a/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Context.php +++ /dev/null @@ -1,154 +0,0 @@ - - * @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 context in which a DocBlock occurs. - * - * @author Vasil Rangelov - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class Context -{ - /** @var string The current namespace. */ - protected $namespace = ''; - - /** @var array List of namespace aliases => Fully Qualified Namespace. */ - protected $namespace_aliases = array(); - - /** @var string Name of the structural element, within the namespace. */ - protected $lsen = ''; - - /** - * Cteates a new context. - * @param string $namespace The namespace where this DocBlock - * resides in. - * @param array $namespace_aliases List of namespace aliases => Fully - * Qualified Namespace. - * @param string $lsen Name of the structural element, within - * the namespace. - */ - public function __construct( - $namespace = '', - array $namespace_aliases = array(), - $lsen = '' - ) { - if (!empty($namespace)) { - $this->setNamespace($namespace); - } - $this->setNamespaceAliases($namespace_aliases); - $this->setLSEN($lsen); - } - - /** - * @return string The namespace where this DocBlock resides in. - */ - public function getNamespace() - { - return $this->namespace; - } - - /** - * @return array List of namespace aliases => Fully Qualified Namespace. - */ - public function getNamespaceAliases() - { - return $this->namespace_aliases; - } - - /** - * Returns the Local Structural Element Name. - * - * @return string Name of the structural element, within the namespace. - */ - public function getLSEN() - { - return $this->lsen; - } - - /** - * Sets a new namespace. - * - * Sets a new namespace for the context. Leading and trailing slashes are - * trimmed, and the keywords "global" and "default" are treated as aliases - * to no namespace. - * - * @param string $namespace The new namespace to set. - * - * @return $this - */ - public function setNamespace($namespace) - { - if ('global' !== $namespace - && 'default' !== $namespace - ) { - // Srip leading and trailing slash - $this->namespace = trim((string)$namespace, '\\'); - } else { - $this->namespace = ''; - } - return $this; - } - - /** - * Sets the namespace aliases, replacing all previous ones. - * - * @param array $namespace_aliases List of namespace aliases => Fully - * Qualified Namespace. - * - * @return $this - */ - public function setNamespaceAliases(array $namespace_aliases) - { - $this->namespace_aliases = array(); - foreach ($namespace_aliases as $alias => $fqnn) { - $this->setNamespaceAlias($alias, $fqnn); - } - return $this; - } - - /** - * Adds a namespace alias to the context. - * - * @param string $alias The alias name (the part after "as", or the last - * part of the Fully Qualified Namespace Name) to add. - * @param string $fqnn The Fully Qualified Namespace Name for this alias. - * Any form of leading/trailing slashes are accepted, but what will be - * stored is a name, prefixed with a slash, and no trailing slash. - * - * @return $this - */ - public function setNamespaceAlias($alias, $fqnn) - { - $this->namespace_aliases[$alias] = '\\' . trim((string)$fqnn, '\\'); - return $this; - } - - /** - * Sets a new Local Structural Element Name. - * - * Sets a new Local Structural Element Name. A local name also contains - * punctuation determining the kind of structural element (e.g. trailing "(" - * and ")" for functions and methods). - * - * @param string $lsen The new local name of a structural element. - * - * @return $this - */ - public function setLSEN($lsen) - { - $this->lsen = (string)$lsen; - return $this; - } -} diff --git a/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Description.php b/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Description.php deleted file mode 100644 index d41142e..0000000 --- a/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Description.php +++ /dev/null @@ -1,223 +0,0 @@ - - * @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 Description of a DocBlock or tag. - * - * @author Mike van Riel - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class Description implements \Reflector -{ - /** @var string */ - protected $contents = ''; - - /** @var array The contents, as an array of strings and Tag objects. */ - protected $parsedContents = null; - - /** @var DocBlock The DocBlock which this description belongs to. */ - protected $docblock = null; - - /** - * Populates the fields of a description. - * - * @param string $content The description's conetnts. - * @param DocBlock $docblock The DocBlock which this description belongs to. - */ - public function __construct($content, DocBlock $docblock = null) - { - $this->setContent($content)->setDocBlock($docblock); - } - - /** - * Gets the text of this description. - * - * @return string - */ - public function getContents() - { - return $this->contents; - } - - /** - * Sets the text of this description. - * - * @param string $content The new text of this description. - * - * @return $this - */ - public function setContent($content) - { - $this->contents = trim($content); - - $this->parsedContents = null; - return $this; - } - - /** - * Returns 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 getParsedContents() - { - if (null === $this->parsedContents) { - $this->parsedContents = preg_split( - '/\{ - # "{@}" is not a valid inline tag. This ensures that - # we do not treat it as one, but treat it literally. - (?!@\}) - # We want to capture the whole tag line, but without the - # inline tag delimiters. - (\@ - # Match everything up to the next delimiter. - [^{}]* - # Nested inline tag content should not be captured, or - # it will appear in the result separately. - (?: - # Match nested inline tags. - (?: - # Because we did not catch the tag delimiters - # earlier, we must be explicit with them here. - # Notice that this also matches "{}", as a way - # to later introduce it as an escape sequence. - \{(?1)?\} - | - # Make sure we match hanging "{". - \{ - ) - # Match content after the nested inline tag. - [^{}]* - )* # If there are more inline tags, match them as well. - # We use "*" since there may not be any nested inline - # tags. - ) - \}/Sux', - $this->contents, - null, - PREG_SPLIT_DELIM_CAPTURE - ); - - $count = count($this->parsedContents); - for ($i=1; $i<$count; $i += 2) { - $this->parsedContents[$i] = Tag::createInstance( - $this->parsedContents[$i], - $this->docblock - ); - } - - //In order to allow "literal" inline tags, the otherwise invalid - //sequence "{@}" is changed to "@", and "{}" is changed to "}". - //See unit tests for examples. - for ($i=0; $i<$count; $i += 2) { - $this->parsedContents[$i] = str_replace( - array('{@}', '{}'), - array('@', '}'), - $this->parsedContents[$i] - ); - } - } - return $this->parsedContents; - } - - /** - * Return a formatted variant of the Long Description using MarkDown. - * - * @todo this should become a more intelligent piece of code where the - * configuration contains a setting what format long descriptions are. - * - * @codeCoverageIgnore Will be removed soon, in favor of adapters at - * PhpDocumentor itself that will process text in various formats. - * - * @return string - */ - public function getFormattedContents() - { - $result = $this->contents; - - // if the long description contains a plain HTML 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/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Location.php b/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Location.php deleted file mode 100644 index 966ed44..0000000 --- a/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Location.php +++ /dev/null @@ -1,76 +0,0 @@ - - * @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/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Serializer.php b/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Serializer.php deleted file mode 100644 index c161785..0000000 --- a/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Serializer.php +++ /dev/null @@ -1,198 +0,0 @@ - - * @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/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag.php b/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag.php deleted file mode 100644 index a96db09..0000000 --- a/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag.php +++ /dev/null @@ -1,377 +0,0 @@ - - * @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/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/AuthorTag.php b/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/AuthorTag.php deleted file mode 100644 index bacf52e..0000000 --- a/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/AuthorTag.php +++ /dev/null @@ -1,131 +0,0 @@ - - * @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/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/CoversTag.php b/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/CoversTag.php deleted file mode 100644 index bd31b56..0000000 --- a/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/CoversTag.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @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/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/DeprecatedTag.php b/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/DeprecatedTag.php deleted file mode 100644 index 7226316..0000000 --- a/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/DeprecatedTag.php +++ /dev/null @@ -1,26 +0,0 @@ - - * @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/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ExampleTag.php b/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ExampleTag.php deleted file mode 100644 index 0e163ea..0000000 --- a/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ExampleTag.php +++ /dev/null @@ -1,156 +0,0 @@ - - * @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/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/LinkTag.php b/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/LinkTag.php deleted file mode 100644 index f79f25d..0000000 --- a/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/LinkTag.php +++ /dev/null @@ -1,81 +0,0 @@ - - * @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/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/MethodTag.php b/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/MethodTag.php deleted file mode 100644 index 7a5ce79..0000000 --- a/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/MethodTag.php +++ /dev/null @@ -1,209 +0,0 @@ - - * @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/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ParamTag.php b/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ParamTag.php deleted file mode 100644 index 9bc0270..0000000 --- a/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ParamTag.php +++ /dev/null @@ -1,119 +0,0 @@ - - * @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/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyReadTag.php b/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyReadTag.php deleted file mode 100644 index 3340602..0000000 --- a/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyReadTag.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @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/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyTag.php b/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyTag.php deleted file mode 100644 index 288ecff..0000000 --- a/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyTag.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @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/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyWriteTag.php b/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyWriteTag.php deleted file mode 100644 index ec4e866..0000000 --- a/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyWriteTag.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @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/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ReturnTag.php b/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ReturnTag.php deleted file mode 100644 index 9293db9..0000000 --- a/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ReturnTag.php +++ /dev/null @@ -1,99 +0,0 @@ - - * @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/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/SeeTag.php b/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/SeeTag.php deleted file mode 100644 index 4f5f22c..0000000 --- a/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/SeeTag.php +++ /dev/null @@ -1,81 +0,0 @@ - - * @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/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/SinceTag.php b/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/SinceTag.php deleted file mode 100644 index ba009c4..0000000 --- a/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/SinceTag.php +++ /dev/null @@ -1,26 +0,0 @@ - - * @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/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/SourceTag.php b/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/SourceTag.php deleted file mode 100644 index 3400220..0000000 --- a/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/SourceTag.php +++ /dev/null @@ -1,137 +0,0 @@ - - * @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/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ThrowsTag.php b/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ThrowsTag.php deleted file mode 100644 index 58ee44a..0000000 --- a/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ThrowsTag.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @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/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/UsesTag.php b/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/UsesTag.php deleted file mode 100644 index da0d663..0000000 --- a/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/UsesTag.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @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/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/VarTag.php b/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/VarTag.php deleted file mode 100644 index 236b2c8..0000000 --- a/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/VarTag.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @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/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/VersionTag.php b/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/VersionTag.php deleted file mode 100644 index 260f698..0000000 --- a/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/VersionTag.php +++ /dev/null @@ -1,108 +0,0 @@ - - * @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/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Type/Collection.php b/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Type/Collection.php deleted file mode 100644 index 90ead3f..0000000 --- a/core/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Type/Collection.php +++ /dev/null @@ -1,221 +0,0 @@ - - * @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/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/DescriptionTest.php b/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/DescriptionTest.php deleted file mode 100644 index a6ca7b3..0000000 --- a/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/DescriptionTest.php +++ /dev/null @@ -1,245 +0,0 @@ - - * @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/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/CoversTagTest.php b/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/CoversTagTest.php deleted file mode 100644 index ff257aa..0000000 --- a/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/CoversTagTest.php +++ /dev/null @@ -1,86 +0,0 @@ - - * @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/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/DeprecatedTagTest.php b/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/DeprecatedTagTest.php deleted file mode 100644 index 7a75e79..0000000 --- a/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/DeprecatedTagTest.php +++ /dev/null @@ -1,115 +0,0 @@ - - * @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/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ExampleTagTest.php b/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ExampleTagTest.php deleted file mode 100644 index 519a61b..0000000 --- a/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ExampleTagTest.php +++ /dev/null @@ -1,203 +0,0 @@ - - * @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/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/LinkTagTest.php b/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/LinkTagTest.php deleted file mode 100644 index 0c64ed0..0000000 --- a/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/LinkTagTest.php +++ /dev/null @@ -1,87 +0,0 @@ - - * @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/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/MethodTagTest.php b/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/MethodTagTest.php deleted file mode 100644 index efc3a15..0000000 --- a/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/MethodTagTest.php +++ /dev/null @@ -1,146 +0,0 @@ - - * @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/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ParamTagTest.php b/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ParamTagTest.php deleted file mode 100644 index 0e05382..0000000 --- a/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ParamTagTest.php +++ /dev/null @@ -1,118 +0,0 @@ - - * @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/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ReturnTagTest.php b/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ReturnTagTest.php deleted file mode 100644 index 9e2aec0..0000000 --- a/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ReturnTagTest.php +++ /dev/null @@ -1,102 +0,0 @@ - - * @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/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SeeTagTest.php b/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SeeTagTest.php deleted file mode 100644 index 6829b04..0000000 --- a/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SeeTagTest.php +++ /dev/null @@ -1,86 +0,0 @@ - - * @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/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SinceTagTest.php b/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SinceTagTest.php deleted file mode 100644 index 8caf25d..0000000 --- a/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SinceTagTest.php +++ /dev/null @@ -1,115 +0,0 @@ - - * @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/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SourceTagTest.php b/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SourceTagTest.php deleted file mode 100644 index 2a40e0a..0000000 --- a/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SourceTagTest.php +++ /dev/null @@ -1,116 +0,0 @@ - - * @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/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ThrowsTagTest.php b/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ThrowsTagTest.php deleted file mode 100644 index 3c669d5..0000000 --- a/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ThrowsTagTest.php +++ /dev/null @@ -1,102 +0,0 @@ - - * @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/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/UsesTagTest.php b/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/UsesTagTest.php deleted file mode 100644 index 45868d7..0000000 --- a/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/UsesTagTest.php +++ /dev/null @@ -1,86 +0,0 @@ - - * @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/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/VarTagTest.php b/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/VarTagTest.php deleted file mode 100644 index 9ae2aa5..0000000 --- a/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/VarTagTest.php +++ /dev/null @@ -1,94 +0,0 @@ - - * @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/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/VersionTagTest.php b/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/VersionTagTest.php deleted file mode 100644 index e145386..0000000 --- a/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/VersionTagTest.php +++ /dev/null @@ -1,115 +0,0 @@ - - * @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/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/TagTest.php b/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/TagTest.php deleted file mode 100644 index 9e873ec..0000000 --- a/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/TagTest.php +++ /dev/null @@ -1,313 +0,0 @@ - - * @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/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Type/CollectionTest.php b/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Type/CollectionTest.php deleted file mode 100644 index 78c7306..0000000 --- a/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Type/CollectionTest.php +++ /dev/null @@ -1,195 +0,0 @@ - - * @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/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlockTest.php b/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlockTest.php deleted file mode 100644 index 30eedfc..0000000 --- a/core/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlockTest.php +++ /dev/null @@ -1,337 +0,0 @@ - - * @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/core/vendor/phpspec/prophecy/.gitignore b/core/vendor/phpspec/prophecy/.gitignore deleted file mode 100644 index 0c39a17..0000000 --- a/core/vendor/phpspec/prophecy/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -*.tgz -*.phar -bin -vendor -composer.lock diff --git a/core/vendor/phpspec/prophecy/.travis.yml b/core/vendor/phpspec/prophecy/.travis.yml deleted file mode 100644 index 4a69309..0000000 --- a/core/vendor/phpspec/prophecy/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -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/core/vendor/phpspec/prophecy/CHANGES.md b/core/vendor/phpspec/prophecy/CHANGES.md deleted file mode 100644 index fe761da..0000000 --- a/core/vendor/phpspec/prophecy/CHANGES.md +++ /dev/null @@ -1,110 +0,0 @@ -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/core/vendor/phpspec/prophecy/CONTRIBUTING.md b/core/vendor/phpspec/prophecy/CONTRIBUTING.md deleted file mode 100644 index 6ea0589..0000000 --- a/core/vendor/phpspec/prophecy/CONTRIBUTING.md +++ /dev/null @@ -1,21 +0,0 @@ -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/core/vendor/phpspec/prophecy/LICENSE b/core/vendor/phpspec/prophecy/LICENSE deleted file mode 100644 index c8b3647..0000000 --- a/core/vendor/phpspec/prophecy/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -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/core/vendor/phpspec/prophecy/README.md b/core/vendor/phpspec/prophecy/README.md deleted file mode 100644 index 639ffd0..0000000 --- a/core/vendor/phpspec/prophecy/README.md +++ /dev/null @@ -1,389 +0,0 @@ -# Prophecy - -[![Build Status](https://travis-ci.org/phpspec/prophecy.svg?branch=master)](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/core/vendor/phpspec/prophecy/composer.json b/core/vendor/phpspec/prophecy/composer.json deleted file mode 100644 index 654aaad..0000000 --- a/core/vendor/phpspec/prophecy/composer.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "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/core/vendor/phpspec/prophecy/spec/Prophecy/Argument/ArgumentsWildcardSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Argument/ArgumentsWildcardSpec.php deleted file mode 100644 index d96318e..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Argument/ArgumentsWildcardSpec.php +++ /dev/null @@ -1,143 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/AnyValueTokenSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/AnyValueTokenSpec.php deleted file mode 100644 index a43e923..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/AnyValueTokenSpec.php +++ /dev/null @@ -1,28 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/AnyValuesTokenSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/AnyValuesTokenSpec.php deleted file mode 100644 index c29076f..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/AnyValuesTokenSpec.php +++ /dev/null @@ -1,28 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ArrayCountTokenSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ArrayCountTokenSpec.php deleted file mode 100644 index 5d040d5..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ArrayCountTokenSpec.php +++ /dev/null @@ -1,64 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ArrayEntryTokenSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ArrayEntryTokenSpec.php deleted file mode 100644 index 8ff0f15..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ArrayEntryTokenSpec.php +++ /dev/null @@ -1,229 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ArrayEveryEntryTokenSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ArrayEveryEntryTokenSpec.php deleted file mode 100644 index 8662e7d..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ArrayEveryEntryTokenSpec.php +++ /dev/null @@ -1,109 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/CallbackTokenSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/CallbackTokenSpec.php deleted file mode 100644 index 4395bf0..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/CallbackTokenSpec.php +++ /dev/null @@ -1,42 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ExactValueTokenSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ExactValueTokenSpec.php deleted file mode 100644 index 9e46e02..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ExactValueTokenSpec.php +++ /dev/null @@ -1,155 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/IdenticalValueTokenSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/IdenticalValueTokenSpec.php deleted file mode 100644 index 00c3a21..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/IdenticalValueTokenSpec.php +++ /dev/null @@ -1,152 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/LogicalAndTokenSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/LogicalAndTokenSpec.php deleted file mode 100644 index bb5e384..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/LogicalAndTokenSpec.php +++ /dev/null @@ -1,78 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/LogicalNotTokenSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/LogicalNotTokenSpec.php deleted file mode 100644 index 7ce7f3d..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/LogicalNotTokenSpec.php +++ /dev/null @@ -1,65 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ObjectStateTokenSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ObjectStateTokenSpec.php deleted file mode 100644 index a783a15..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ObjectStateTokenSpec.php +++ /dev/null @@ -1,101 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/StringContainsTokenSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/StringContainsTokenSpec.php deleted file mode 100644 index c7fd265..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/StringContainsTokenSpec.php +++ /dev/null @@ -1,49 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/TypeTokenSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/TypeTokenSpec.php deleted file mode 100644 index f9a9507..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/TypeTokenSpec.php +++ /dev/null @@ -1,59 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/ArgumentSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/ArgumentSpec.php deleted file mode 100644 index 990aa80..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/ArgumentSpec.php +++ /dev/null @@ -1,101 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Call/CallCenterSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Call/CallCenterSpec.php deleted file mode 100644 index e9b91c8..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Call/CallCenterSpec.php +++ /dev/null @@ -1,188 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Call/CallSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Call/CallSpec.php deleted file mode 100644 index d1a8539..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Call/CallSpec.php +++ /dev/null @@ -1,54 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/DisableConstructorPatchSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/DisableConstructorPatchSpec.php deleted file mode 100644 index 2d7d934..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/DisableConstructorPatchSpec.php +++ /dev/null @@ -1,59 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/HhvmExceptionPatchSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/HhvmExceptionPatchSpec.php deleted file mode 100644 index 8c348b8..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/HhvmExceptionPatchSpec.php +++ /dev/null @@ -1,37 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/KeywordPatchSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/KeywordPatchSpec.php deleted file mode 100644 index 200d961..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/KeywordPatchSpec.php +++ /dev/null @@ -1,44 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/MagicCallPatchSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/MagicCallPatchSpec.php deleted file mode 100644 index cb1d0f0..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/MagicCallPatchSpec.php +++ /dev/null @@ -1,76 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/ProphecySubjectPatchSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/ProphecySubjectPatchSpec.php deleted file mode 100644 index c460814..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/ProphecySubjectPatchSpec.php +++ /dev/null @@ -1,83 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/ReflectionClassNewInstancePatchSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/ReflectionClassNewInstancePatchSpec.php deleted file mode 100644 index 4116e4d..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/ReflectionClassNewInstancePatchSpec.php +++ /dev/null @@ -1,47 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/SplFileInfoPatchSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/SplFileInfoPatchSpec.php deleted file mode 100644 index 37fe82f..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/SplFileInfoPatchSpec.php +++ /dev/null @@ -1,91 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/TraversablePatchSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/TraversablePatchSpec.php deleted file mode 100644 index 2279b72..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/TraversablePatchSpec.php +++ /dev/null @@ -1,61 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/DoublerSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/DoublerSpec.php deleted file mode 100644 index a39fa87..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/DoublerSpec.php +++ /dev/null @@ -1,122 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/ClassCodeGeneratorSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/ClassCodeGeneratorSpec.php deleted file mode 100644 index 1dc8cda..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/ClassCodeGeneratorSpec.php +++ /dev/null @@ -1,186 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/ClassCreatorSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/ClassCreatorSpec.php deleted file mode 100644 index c7b5700..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/ClassCreatorSpec.php +++ /dev/null @@ -1,44 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/ClassMirrorSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/ClassMirrorSpec.php deleted file mode 100644 index dd9e9c4..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/ClassMirrorSpec.php +++ /dev/null @@ -1,554 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/Node/ArgumentNodeSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/Node/ArgumentNodeSpec.php deleted file mode 100644 index cea578f..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/Node/ArgumentNodeSpec.php +++ /dev/null @@ -1,62 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/Node/ClassNodeSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/Node/ClassNodeSpec.php deleted file mode 100644 index 18f0e1c..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/Node/ClassNodeSpec.php +++ /dev/null @@ -1,154 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/Node/MethodNodeSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/Node/MethodNodeSpec.php deleted file mode 100644 index 7582706..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/Node/MethodNodeSpec.php +++ /dev/null @@ -1,123 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/LazyDoubleSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/LazyDoubleSpec.php deleted file mode 100644 index 7026126..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/LazyDoubleSpec.php +++ /dev/null @@ -1,96 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/NameGeneratorSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/NameGeneratorSpec.php deleted file mode 100644 index a3e7491..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Doubler/NameGeneratorSpec.php +++ /dev/null @@ -1,72 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Exception/Call/UnexpectedCallExceptionSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Exception/Call/UnexpectedCallExceptionSpec.php deleted file mode 100644 index 6fd1a5c..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Exception/Call/UnexpectedCallExceptionSpec.php +++ /dev/null @@ -1,32 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/ClassCreatorExceptionSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/ClassCreatorExceptionSpec.php deleted file mode 100644 index 5824138..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/ClassCreatorExceptionSpec.php +++ /dev/null @@ -1,28 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/ClassMirrorExceptionSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/ClassMirrorExceptionSpec.php deleted file mode 100644 index 21e31a3..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/ClassMirrorExceptionSpec.php +++ /dev/null @@ -1,27 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/ClassNotFoundExceptionSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/ClassNotFoundExceptionSpec.php deleted file mode 100644 index 251512b..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/ClassNotFoundExceptionSpec.php +++ /dev/null @@ -1,25 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/DoubleExceptionSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/DoubleExceptionSpec.php deleted file mode 100644 index 6fe5a19..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/DoubleExceptionSpec.php +++ /dev/null @@ -1,14 +0,0 @@ -shouldBeAnInstanceOf('RuntimeException'); - $this->shouldBeAnInstanceOf('Prophecy\Exception\Doubler\DoublerException'); - } -} diff --git a/core/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/InterfaceNotFoundExceptionSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/InterfaceNotFoundExceptionSpec.php deleted file mode 100644 index ad1a439..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/InterfaceNotFoundExceptionSpec.php +++ /dev/null @@ -1,24 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/MethodNotFoundExceptionSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/MethodNotFoundExceptionSpec.php deleted file mode 100644 index a889dd7..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/MethodNotFoundExceptionSpec.php +++ /dev/null @@ -1,40 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prediction/AggregateExceptionSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prediction/AggregateExceptionSpec.php deleted file mode 100644 index 22a5ebd..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prediction/AggregateExceptionSpec.php +++ /dev/null @@ -1,57 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prediction/NoCallsExceptionSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prediction/NoCallsExceptionSpec.php deleted file mode 100644 index 473f1a2..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prediction/NoCallsExceptionSpec.php +++ /dev/null @@ -1,29 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prediction/UnexpectedCallsCountExceptionSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prediction/UnexpectedCallsCountExceptionSpec.php deleted file mode 100644 index adad975..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prediction/UnexpectedCallsCountExceptionSpec.php +++ /dev/null @@ -1,31 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prediction/UnexpectedCallsExceptionSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prediction/UnexpectedCallsExceptionSpec.php deleted file mode 100644 index c0fe24d..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prediction/UnexpectedCallsExceptionSpec.php +++ /dev/null @@ -1,36 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prophecy/MethodProphecyExceptionSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prophecy/MethodProphecyExceptionSpec.php deleted file mode 100644 index 97cf9e1..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prophecy/MethodProphecyExceptionSpec.php +++ /dev/null @@ -1,30 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prophecy/ObjectProphecyExceptionSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prophecy/ObjectProphecyExceptionSpec.php deleted file mode 100644 index bcacfed..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prophecy/ObjectProphecyExceptionSpec.php +++ /dev/null @@ -1,27 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Prediction/CallPredictionSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Prediction/CallPredictionSpec.php deleted file mode 100644 index 3da8c59..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Prediction/CallPredictionSpec.php +++ /dev/null @@ -1,42 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Prediction/CallTimesPredictionSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Prediction/CallTimesPredictionSpec.php deleted file mode 100644 index c670892..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Prediction/CallTimesPredictionSpec.php +++ /dev/null @@ -1,54 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Prediction/CallbackPredictionSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Prediction/CallbackPredictionSpec.php deleted file mode 100644 index 7fe475e..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Prediction/CallbackPredictionSpec.php +++ /dev/null @@ -1,36 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Prediction/NoCallsPredictionSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Prediction/NoCallsPredictionSpec.php deleted file mode 100644 index a3ef9bc..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Prediction/NoCallsPredictionSpec.php +++ /dev/null @@ -1,43 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Promise/CallbackPromiseSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Promise/CallbackPromiseSpec.php deleted file mode 100644 index 5d99b1b..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Promise/CallbackPromiseSpec.php +++ /dev/null @@ -1,110 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Promise/ReturnArgumentPromiseSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Promise/ReturnArgumentPromiseSpec.php deleted file mode 100644 index 4acb7bb..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Promise/ReturnArgumentPromiseSpec.php +++ /dev/null @@ -1,41 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Promise/ReturnPromiseSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Promise/ReturnPromiseSpec.php deleted file mode 100644 index 18bfd87..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Promise/ReturnPromiseSpec.php +++ /dev/null @@ -1,61 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Promise/ThrowPromiseSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Promise/ThrowPromiseSpec.php deleted file mode 100644 index 5f44897..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Promise/ThrowPromiseSpec.php +++ /dev/null @@ -1,58 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Prophecy/MethodProphecySpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Prophecy/MethodProphecySpec.php deleted file mode 100644 index d8299a7..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Prophecy/MethodProphecySpec.php +++ /dev/null @@ -1,381 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Prophecy/ObjectProphecySpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Prophecy/ObjectProphecySpec.php deleted file mode 100644 index 00f57fe..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Prophecy/ObjectProphecySpec.php +++ /dev/null @@ -1,305 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Prophecy/RevealerSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Prophecy/RevealerSpec.php deleted file mode 100644 index 4d83d73..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Prophecy/RevealerSpec.php +++ /dev/null @@ -1,51 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/ProphetSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/ProphetSpec.php deleted file mode 100644 index 74d5976..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/ProphetSpec.php +++ /dev/null @@ -1,91 +0,0 @@ -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/core/vendor/phpspec/prophecy/spec/Prophecy/Util/StringUtilSpec.php b/core/vendor/phpspec/prophecy/spec/Prophecy/Util/StringUtilSpec.php deleted file mode 100644 index a4eef59..0000000 --- a/core/vendor/phpspec/prophecy/spec/Prophecy/Util/StringUtilSpec.php +++ /dev/null @@ -1,97 +0,0 @@ -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/core/vendor/phpspec/prophecy/src/Prophecy/Argument.php b/core/vendor/phpspec/prophecy/src/Prophecy/Argument.php deleted file mode 100644 index f2b3364..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Argument.php +++ /dev/null @@ -1,198 +0,0 @@ - - * 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/core/vendor/phpspec/prophecy/src/Prophecy/Argument/ArgumentsWildcard.php b/core/vendor/phpspec/prophecy/src/Prophecy/Argument/ArgumentsWildcard.php deleted file mode 100644 index a088f21..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Argument/ArgumentsWildcard.php +++ /dev/null @@ -1,101 +0,0 @@ - - * 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/core/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/AnyValueToken.php b/core/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/AnyValueToken.php deleted file mode 100644 index 5098811..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/AnyValueToken.php +++ /dev/null @@ -1,52 +0,0 @@ - - * 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/core/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/AnyValuesToken.php b/core/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/AnyValuesToken.php deleted file mode 100644 index f76b17b..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/AnyValuesToken.php +++ /dev/null @@ -1,52 +0,0 @@ - - * 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/core/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ArrayCountToken.php b/core/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ArrayCountToken.php deleted file mode 100644 index 96b4bef..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ArrayCountToken.php +++ /dev/null @@ -1,86 +0,0 @@ - - * 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/core/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ArrayEntryToken.php b/core/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ArrayEntryToken.php deleted file mode 100644 index 0305fc7..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ArrayEntryToken.php +++ /dev/null @@ -1,143 +0,0 @@ - - * 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/core/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ArrayEveryEntryToken.php b/core/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ArrayEveryEntryToken.php deleted file mode 100644 index 5d41fa4..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ArrayEveryEntryToken.php +++ /dev/null @@ -1,82 +0,0 @@ - - * 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/core/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/CallbackToken.php b/core/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/CallbackToken.php deleted file mode 100644 index f45ba20..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/CallbackToken.php +++ /dev/null @@ -1,75 +0,0 @@ - - * 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/core/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ExactValueToken.php b/core/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ExactValueToken.php deleted file mode 100644 index ba895ab..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ExactValueToken.php +++ /dev/null @@ -1,116 +0,0 @@ - - * 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/core/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/IdenticalValueToken.php b/core/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/IdenticalValueToken.php deleted file mode 100644 index 0b6d23a..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/IdenticalValueToken.php +++ /dev/null @@ -1,74 +0,0 @@ - - * 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/core/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/LogicalAndToken.php b/core/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/LogicalAndToken.php deleted file mode 100644 index 4ee1b25..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/LogicalAndToken.php +++ /dev/null @@ -1,80 +0,0 @@ - - * 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/core/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/LogicalNotToken.php b/core/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/LogicalNotToken.php deleted file mode 100644 index 623efa5..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/LogicalNotToken.php +++ /dev/null @@ -1,73 +0,0 @@ - - * 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/core/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ObjectStateToken.php b/core/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ObjectStateToken.php deleted file mode 100644 index ea38fe1..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ObjectStateToken.php +++ /dev/null @@ -1,104 +0,0 @@ - - * 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/core/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/StringContainsToken.php b/core/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/StringContainsToken.php deleted file mode 100644 index 24ff8c2..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/StringContainsToken.php +++ /dev/null @@ -1,67 +0,0 @@ - - * 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/core/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/TokenInterface.php b/core/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/TokenInterface.php deleted file mode 100644 index 625d3ba..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/TokenInterface.php +++ /dev/null @@ -1,43 +0,0 @@ - - * 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/core/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/TypeToken.php b/core/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/TypeToken.php deleted file mode 100644 index cb65132..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/TypeToken.php +++ /dev/null @@ -1,76 +0,0 @@ - - * 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/core/vendor/phpspec/prophecy/src/Prophecy/Call/Call.php b/core/vendor/phpspec/prophecy/src/Prophecy/Call/Call.php deleted file mode 100644 index 2f3fbad..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Call/Call.php +++ /dev/null @@ -1,127 +0,0 @@ - - * 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/core/vendor/phpspec/prophecy/src/Prophecy/Call/CallCenter.php b/core/vendor/phpspec/prophecy/src/Prophecy/Call/CallCenter.php deleted file mode 100644 index 7495855..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Call/CallCenter.php +++ /dev/null @@ -1,152 +0,0 @@ - - * 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/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/CachedDoubler.php b/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/CachedDoubler.php deleted file mode 100644 index d6b6b1a..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/CachedDoubler.php +++ /dev/null @@ -1,68 +0,0 @@ - - * 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/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/ClassPatchInterface.php b/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/ClassPatchInterface.php deleted file mode 100644 index d6d1968..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/ClassPatchInterface.php +++ /dev/null @@ -1,48 +0,0 @@ - - * 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 - */ -interface ClassPatchInterface -{ - /** - * Checks if patch supports specific class node. - * - * @param ClassNode $node - * - * @return bool - */ - public function supports(ClassNode $node); - - /** - * Applies patch to the specific class node. - * - * @param ClassNode $node - * @return void - */ - public function apply(ClassNode $node); - - /** - * Returns patch priority, which determines when patch will be applied. - * - * @return int Priority number (higher - earlier) - */ - public function getPriority(); -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/DisableConstructorPatch.php b/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/DisableConstructorPatch.php deleted file mode 100644 index 61998fc..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/DisableConstructorPatch.php +++ /dev/null @@ -1,72 +0,0 @@ - - * 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; -use Prophecy\Doubler\Generator\Node\MethodNode; - -/** - * Disable constructor. - * Makes all constructor arguments optional. - * - * @author Konstantin Kudryashov - */ -class DisableConstructorPatch implements ClassPatchInterface -{ - /** - * Checks if class has `__construct` method. - * - * @param ClassNode $node - * - * @return bool - */ - public function supports(ClassNode $node) - { - return true; - } - - /** - * Makes all class constructor arguments optional. - * - * @param ClassNode $node - */ - public function apply(ClassNode $node) - { - if (!$node->hasMethod('__construct')) { - $node->addMethod(new MethodNode('__construct', '')); - - return; - } - - $constructor = $node->getMethod('__construct'); - foreach ($constructor->getArguments() as $argument) { - $argument->setDefault(null); - } - - $constructor->setCode(<< - * 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; - -/** - * Exception patch for HHVM to remove the stubs from special methods - * - * @author Christophe Coevoet - */ -class HhvmExceptionPatch implements ClassPatchInterface -{ - /** - * Supports exceptions on HHVM. - * - * @param ClassNode $node - * - * @return bool - */ - public function supports(ClassNode $node) - { - if (!defined('HHVM_VERSION')) { - return false; - } - - return 'Exception' === $node->getParentClass() || is_subclass_of($node->getParentClass(), 'Exception'); - } - - /** - * Removes special exception static methods from the doubled methods. - * - * @param ClassNode $node - * - * @return void - */ - public function apply(ClassNode $node) - { - if ($node->hasMethod('setTraceOptions')) { - $node->getMethod('setTraceOptions')->useParentCode(); - } - if ($node->hasMethod('getTraceOptions')) { - $node->getMethod('getTraceOptions')->useParentCode(); - } - } - - /** - * {@inheritdoc} - */ - public function getPriority() - { - return -50; - } -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/KeywordPatch.php b/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/KeywordPatch.php deleted file mode 100644 index b0d9793..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/KeywordPatch.php +++ /dev/null @@ -1,135 +0,0 @@ - - * 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; - -/** - * Remove method functionality from the double which will clash with php keywords. - * - * @author Milan Magudia - */ -class KeywordPatch implements ClassPatchInterface -{ - /** - * Support any class - * - * @param ClassNode $node - * - * @return boolean - */ - public function supports(ClassNode $node) - { - return true; - } - - /** - * Remove methods that clash with php keywords - * - * @param ClassNode $node - */ - public function apply(ClassNode $node) - { - $methodNames = array_keys($node->getMethods()); - $methodsToRemove = array_intersect($methodNames, $this->getKeywords()); - foreach ($methodsToRemove as $methodName) { - $node->removeMethod($methodName); - } - } - - /** - * Returns patch priority, which determines when patch will be applied. - * - * @return int Priority number (higher - earlier) - */ - public function getPriority() { - return 49; - } - - /** - * Returns array of php keywords. - * - * @return array - */ - private function getKeywords() { - - return array( - '__halt_compiler', - 'abstract', - 'and', - 'array', - 'as', - 'break', - 'callable', - 'case', - 'catch', - 'class', - 'clone', - 'const', - 'continue', - 'declare', - 'default', - 'die', - 'do', - 'echo', - 'else', - 'elseif', - 'empty', - 'enddeclare', - 'endfor', - 'endforeach', - 'endif', - 'endswitch', - 'endwhile', - 'eval', - 'exit', - 'extends', - 'final', - 'finally', - 'for', - 'foreach', - 'function', - 'global', - 'goto', - 'if', - 'implements', - 'include', - 'include_once', - 'instanceof', - 'insteadof', - 'interface', - 'isset', - 'list', - 'namespace', - 'new', - 'or', - 'print', - 'private', - 'protected', - 'public', - 'require', - 'require_once', - 'return', - 'static', - 'switch', - 'throw', - 'trait', - 'try', - 'unset', - 'use', - 'var', - 'while', - 'xor', - 'yield', - ); - } -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/MagicCallPatch.php b/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/MagicCallPatch.php deleted file mode 100644 index da45450..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/MagicCallPatch.php +++ /dev/null @@ -1,73 +0,0 @@ - - * 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 phpDocumentor\Reflection\DocBlock; -use Prophecy\Doubler\Generator\Node\ClassNode; -use Prophecy\Doubler\Generator\Node\MethodNode; - -/** - * Discover Magical API using "@method" PHPDoc format. - * - * @author Thomas Tourlourat - */ -class MagicCallPatch implements ClassPatchInterface -{ - /** - * Support any class - * - * @param ClassNode $node - * - * @return boolean - */ - public function supports(ClassNode $node) - { - return true; - } - - /** - * Discover Magical API - * - * @param ClassNode $node - */ - public function apply(ClassNode $node) - { - $parentClass = $node->getParentClass(); - $reflectionClass = new \ReflectionClass($parentClass); - - $phpdoc = new DocBlock($reflectionClass->getDocComment()); - - $tagList = $phpdoc->getTagsByName('method'); - - foreach($tagList as $tag) { - $methodName = $tag->getMethodName(); - - if (!$reflectionClass->hasMethod($methodName)) { - $methodNode = new MethodNode($tag->getMethodName()); - $methodNode->setStatic($tag->isStatic()); - - $node->addMethod($methodNode); - } - } - } - - /** - * Returns patch priority, which determines when patch will be applied. - * - * @return integer Priority number (higher - earlier) - */ - public function getPriority() - { - return 50; - } -} - diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/ProphecySubjectPatch.php b/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/ProphecySubjectPatch.php deleted file mode 100644 index ab0bb7c..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/ProphecySubjectPatch.php +++ /dev/null @@ -1,98 +0,0 @@ - - * 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; -use Prophecy\Doubler\Generator\Node\MethodNode; -use Prophecy\Doubler\Generator\Node\ArgumentNode; - -/** - * Add Prophecy functionality to the double. - * This is a core class patch for Prophecy. - * - * @author Konstantin Kudryashov - */ -class ProphecySubjectPatch implements ClassPatchInterface -{ - /** - * Always returns true. - * - * @param ClassNode $node - * - * @return bool - */ - public function supports(ClassNode $node) - { - return true; - } - - /** - * Apply Prophecy functionality to class node. - * - * @param ClassNode $node - */ - public function apply(ClassNode $node) - { - $node->addInterface('Prophecy\Prophecy\ProphecySubjectInterface'); - $node->addProperty('objectProphecy', 'private'); - - foreach ($node->getMethods() as $name => $method) { - if ('__construct' === strtolower($name)) { - continue; - } - - $method->setCode( - 'return $this->getProphecy()->makeProphecyMethodCall(__FUNCTION__, func_get_args());' - ); - } - - $prophecySetter = new MethodNode('setProphecy'); - $prophecyArgument = new ArgumentNode('prophecy'); - $prophecyArgument->setTypeHint('Prophecy\Prophecy\ProphecyInterface'); - $prophecySetter->addArgument($prophecyArgument); - $prophecySetter->setCode('$this->objectProphecy = $prophecy;'); - - $prophecyGetter = new MethodNode('getProphecy'); - $prophecyGetter->setCode('return $this->objectProphecy;'); - - if ($node->hasMethod('__call')) { - $__call = $node->getMethod('__call'); - } else { - $__call = new MethodNode('__call'); - $__call->addArgument(new ArgumentNode('name')); - $__call->addArgument(new ArgumentNode('arguments')); - - $node->addMethod($__call); - } - - $__call->setCode(<<getProphecy(), func_get_arg(0) -); -PHP - ); - - $node->addMethod($prophecySetter); - $node->addMethod($prophecyGetter); - } - - /** - * Returns patch priority, which determines when patch will be applied. - * - * @return int Priority number (higher - earlier) - */ - public function getPriority() - { - return 0; - } -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/ReflectionClassNewInstancePatch.php b/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/ReflectionClassNewInstancePatch.php deleted file mode 100644 index 9166aee..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/ReflectionClassNewInstancePatch.php +++ /dev/null @@ -1,57 +0,0 @@ - - * 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; - -/** - * ReflectionClass::newInstance patch. - * Makes first argument of newInstance optional, since it works but signature is misleading - * - * @author Florian Klein - */ -class ReflectionClassNewInstancePatch implements ClassPatchInterface -{ - /** - * Supports ReflectionClass - * - * @param ClassNode $node - * - * @return bool - */ - public function supports(ClassNode $node) - { - return 'ReflectionClass' === $node->getParentClass(); - } - - /** - * Updates newInstance's first argument to make it optional - * - * @param ClassNode $node - */ - public function apply(ClassNode $node) - { - foreach ($node->getMethod('newInstance')->getArguments() as $argument) { - $argument->setDefault(null); - } - } - - /** - * Returns patch priority, which determines when patch will be applied. - * - * @return int Priority number (higher = earlier) - */ - public function getPriority() - { - return 50; - } -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/SplFileInfoPatch.php b/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/SplFileInfoPatch.php deleted file mode 100644 index 8401159..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/SplFileInfoPatch.php +++ /dev/null @@ -1,85 +0,0 @@ - - * 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; -use Prophecy\Doubler\Generator\Node\MethodNode; - -/** - * SplFileInfo patch. - * Makes SplFileInfo and derivative classes usable with Prophecy. - * - * @author Konstantin Kudryashov - */ -class SplFileInfoPatch implements ClassPatchInterface -{ - /** - * Supports everything that extends SplFileInfo. - * - * @param ClassNode $node - * - * @return bool - */ - public function supports(ClassNode $node) - { - if (null === $node->getParentClass()) { - return false; - } - - return 'SplFileInfo' === $node->getParentClass() - || is_subclass_of($node->getParentClass(), 'SplFileInfo') - ; - } - - /** - * Updated constructor code to call parent one with dummy file argument. - * - * @param ClassNode $node - */ - public function apply(ClassNode $node) - { - if ($node->hasMethod('__construct')) { - $constructor = $node->getMethod('__construct'); - } else { - $constructor = new MethodNode('__construct'); - $node->addMethod($constructor); - } - - if ($this->nodeIsDirectoryIterator($node)) { - $constructor->setCode('return parent::__construct("' . __DIR__ . '");'); - return; - } - - $constructor->useParentCode(); - } - - /** - * Returns patch priority, which determines when patch will be applied. - * - * @return int Priority number (higher - earlier) - */ - public function getPriority() - { - return 50; - } - - /** - * @param ClassNode $node - * @return boolean - */ - private function nodeIsDirectoryIterator(ClassNode $node) - { - $parent = $node->getParentClass(); - return 'DirectoryIterator' === $parent - || is_subclass_of($parent, 'DirectoryIterator'); - } -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/TraversablePatch.php b/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/TraversablePatch.php deleted file mode 100644 index eea0202..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/TraversablePatch.php +++ /dev/null @@ -1,83 +0,0 @@ - - * 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; -use Prophecy\Doubler\Generator\Node\MethodNode; - -/** - * Traversable interface patch. - * Forces classes that implement interfaces, that extend Traversable to also implement Iterator. - * - * @author Konstantin Kudryashov - */ -class TraversablePatch implements ClassPatchInterface -{ - /** - * Supports nodetree, that implement Traversable, but not Iterator or IteratorAggregate. - * - * @param ClassNode $node - * - * @return bool - */ - public function supports(ClassNode $node) - { - if (in_array('Iterator', $node->getInterfaces())) { - return false; - } - if (in_array('IteratorAggregate', $node->getInterfaces())) { - return false; - } - - foreach ($node->getInterfaces() as $interface) { - if ('Traversable' !== $interface && !is_subclass_of($interface, 'Traversable')) { - continue; - } - if ('Iterator' === $interface || is_subclass_of($interface, 'Iterator')) { - continue; - } - if ('IteratorAggregate' === $interface || is_subclass_of($interface, 'IteratorAggregate')) { - continue; - } - - return true; - } - - return false; - } - - /** - * Forces class to implement Iterator interface. - * - * @param ClassNode $node - */ - public function apply(ClassNode $node) - { - $node->addInterface('Iterator'); - - $node->addMethod(new MethodNode('current')); - $node->addMethod(new MethodNode('key')); - $node->addMethod(new MethodNode('next')); - $node->addMethod(new MethodNode('rewind')); - $node->addMethod(new MethodNode('valid')); - } - - /** - * Returns patch priority, which determines when patch will be applied. - * - * @return int Priority number (higher - earlier) - */ - public function getPriority() - { - return 100; - } -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/DoubleInterface.php b/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/DoubleInterface.php deleted file mode 100644 index 699be3a..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/DoubleInterface.php +++ /dev/null @@ -1,22 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Doubler; - -/** - * Core double interface. - * All doubled classes will implement this one. - * - * @author Konstantin Kudryashov - */ -interface DoubleInterface -{ -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/Doubler.php b/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/Doubler.php deleted file mode 100644 index a378ae2..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/Doubler.php +++ /dev/null @@ -1,146 +0,0 @@ - - * 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 Doctrine\Instantiator\Instantiator; -use Prophecy\Doubler\ClassPatch\ClassPatchInterface; -use Prophecy\Doubler\Generator\ClassMirror; -use Prophecy\Doubler\Generator\ClassCreator; -use Prophecy\Exception\InvalidArgumentException; -use ReflectionClass; - -/** - * Cached class doubler. - * Prevents mirroring/creation of the same structure twice. - * - * @author Konstantin Kudryashov - */ -class Doubler -{ - private $mirror; - private $creator; - private $namer; - - /** - * @var ClassPatchInterface[] - */ - private $patches = array(); - - /** - * @var \Doctrine\Instantiator\Instantiator - */ - private $instantiator; - - /** - * Initializes doubler. - * - * @param ClassMirror $mirror - * @param ClassCreator $creator - * @param NameGenerator $namer - */ - public function __construct(ClassMirror $mirror = null, ClassCreator $creator = null, - NameGenerator $namer = null) - { - $this->mirror = $mirror ?: new ClassMirror; - $this->creator = $creator ?: new ClassCreator; - $this->namer = $namer ?: new NameGenerator; - } - - /** - * Returns list of registered class patches. - * - * @return ClassPatchInterface[] - */ - public function getClassPatches() - { - return $this->patches; - } - - /** - * Registers new class patch. - * - * @param ClassPatchInterface $patch - */ - public function registerClassPatch(ClassPatchInterface $patch) - { - $this->patches[] = $patch; - - @usort($this->patches, function (ClassPatchInterface $patch1, ClassPatchInterface $patch2) { - return $patch2->getPriority() - $patch1->getPriority(); - }); - } - - /** - * Creates double from specific class or/and list of interfaces. - * - * @param ReflectionClass $class - * @param ReflectionClass[] $interfaces Array of ReflectionClass instances - * @param array $args Constructor arguments - * - * @return DoubleInterface - * - * @throws \Prophecy\Exception\InvalidArgumentException - */ - public function double(ReflectionClass $class = null, array $interfaces, array $args = null) - { - foreach ($interfaces as $interface) { - if (!$interface instanceof ReflectionClass) { - throw new InvalidArgumentException(sprintf( - "[ReflectionClass \$interface1 [, ReflectionClass \$interface2]] array expected as\n". - "a second argument to `Doubler::double(...)`, but got %s.", - is_object($interface) ? get_class($interface).' class' : gettype($interface) - )); - } - } - - $classname = $this->createDoubleClass($class, $interfaces); - $reflection = new ReflectionClass($classname); - - if (null !== $args) { - return $reflection->newInstanceArgs($args); - } - if ((null === $constructor = $reflection->getConstructor()) - || ($constructor->isPublic() && !$constructor->isFinal())) { - return $reflection->newInstance(); - } - - if (!$this->instantiator) { - $this->instantiator = new Instantiator(); - } - - return $this->instantiator->instantiate($classname); - } - - /** - * Creates double class and returns its FQN. - * - * @param ReflectionClass $class - * @param ReflectionClass[] $interfaces - * - * @return string - */ - protected function createDoubleClass(ReflectionClass $class = null, array $interfaces) - { - $name = $this->namer->name($class, $interfaces); - $node = $this->mirror->reflect($class, $interfaces); - - foreach ($this->patches as $patch) { - if ($patch->supports($node)) { - $patch->apply($node); - } - } - - $this->creator->create($name, $node); - - return $name; - } -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ClassCodeGenerator.php b/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ClassCodeGenerator.php deleted file mode 100644 index 8577ba0..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ClassCodeGenerator.php +++ /dev/null @@ -1,91 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Doubler\Generator; - -/** - * Class code creator. - * Generates PHP code for specific class node tree. - * - * @author Konstantin Kudryashov - */ -class ClassCodeGenerator -{ - /** - * Generates PHP code for class node. - * - * @param string $classname - * @param Node\ClassNode $class - * - * @return string - */ - public function generate($classname, Node\ClassNode $class) - { - $parts = explode('\\', $classname); - $classname = array_pop($parts); - $namespace = implode('\\', $parts); - - $code = sprintf("class %s extends \%s implements %s {\n", - $classname, $class->getParentClass(), implode(', ', - array_map(function ($interface) {return '\\'.$interface;}, $class->getInterfaces()) - ) - ); - - foreach ($class->getProperties() as $name => $visibility) { - $code .= sprintf("%s \$%s;\n", $visibility, $name); - } - $code .= "\n"; - - foreach ($class->getMethods() as $method) { - $code .= $this->generateMethod($method)."\n"; - } - $code .= "\n}"; - - return sprintf("namespace %s {\n%s\n}", $namespace, $code); - } - - private function generateMethod(Node\MethodNode $method) - { - $php = sprintf("%s %s function %s%s(%s) {\n", - $method->getVisibility(), - $method->isStatic() ? 'static' : '', - $method->returnsReference() ? '&':'', - $method->getName(), - implode(', ', $this->generateArguments($method->getArguments())) - ); - $php .= $method->getCode()."\n"; - - return $php.'}'; - } - - private function generateArguments(array $arguments) - { - return array_map(function (Node\ArgumentNode $argument) { - $php = ''; - - if ($hint = $argument->getTypeHint()) { - if ('array' === $hint || 'callable' === $hint) { - $php .= $hint; - } else { - $php .= '\\'.$hint; - } - } - - $php .= ' '.($argument->isPassedByReference() ? '&' : '').'$'.$argument->getName(); - - if ($argument->isOptional()) { - $php .= ' = '.var_export($argument->getDefault(), true); - } - - return $php; - }, $arguments); - } -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ClassCreator.php b/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ClassCreator.php deleted file mode 100644 index 882a4a4..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ClassCreator.php +++ /dev/null @@ -1,67 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Doubler\Generator; - -use Prophecy\Exception\Doubler\ClassCreatorException; - -/** - * Class creator. - * Creates specific class in current environment. - * - * @author Konstantin Kudryashov - */ -class ClassCreator -{ - private $generator; - - /** - * Initializes creator. - * - * @param ClassCodeGenerator $generator - */ - public function __construct(ClassCodeGenerator $generator = null) - { - $this->generator = $generator ?: new ClassCodeGenerator; - } - - /** - * Creates class. - * - * @param string $classname - * @param Node\ClassNode $class - * - * @return mixed - * - * @throws \Prophecy\Exception\Doubler\ClassCreatorException - */ - public function create($classname, Node\ClassNode $class) - { - $code = $this->generator->generate($classname, $class); - $return = eval($code); - - if (!class_exists($classname, false)) { - if (count($class->getInterfaces())) { - throw new ClassCreatorException(sprintf( - 'Could not double `%s` and implement interfaces: [%s].', - $class->getParentClass(), implode(', ', $class->getInterfaces()) - ), $class); - } - - throw new ClassCreatorException( - sprintf('Could not double `%s`.', $class->getParentClass()), - $class - ); - } - - return $return; - } -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ClassMirror.php b/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ClassMirror.php deleted file mode 100644 index c89d002..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ClassMirror.php +++ /dev/null @@ -1,202 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Doubler\Generator; - -use Prophecy\Exception\InvalidArgumentException; -use Prophecy\Exception\Doubler\ClassMirrorException; -use ReflectionClass; -use ReflectionMethod; -use ReflectionParameter; - -/** - * Class mirror. - * Core doubler class. Mirrors specific class and/or interfaces into class node tree. - * - * @author Konstantin Kudryashov - */ -class ClassMirror -{ - private static $reflectableMethods = array( - '__construct', - '__destruct', - '__sleep', - '__wakeup', - '__toString', - '__call', - ); - - /** - * Reflects provided arguments into class node. - * - * @param ReflectionClass $class - * @param ReflectionClass[] $interfaces - * - * @return Node\ClassNode - * - * @throws \Prophecy\Exception\InvalidArgumentException - */ - public function reflect(ReflectionClass $class = null, array $interfaces) - { - $node = new Node\ClassNode; - - if (null !== $class) { - if (true === $class->isInterface()) { - throw new InvalidArgumentException(sprintf( - "Could not reflect %s as a class, because it\n". - "is interface - use the second argument instead.", - $class->getName() - )); - } - - $this->reflectClassToNode($class, $node); - } - - foreach ($interfaces as $interface) { - if (!$interface instanceof ReflectionClass) { - throw new InvalidArgumentException(sprintf( - "[ReflectionClass \$interface1 [, ReflectionClass \$interface2]] array expected as\n". - "a second argument to `ClassMirror::reflect(...)`, but got %s.", - is_object($interface) ? get_class($interface).' class' : gettype($interface) - )); - } - if (false === $interface->isInterface()) { - throw new InvalidArgumentException(sprintf( - "Could not reflect %s as an interface, because it\n". - "is class - use the first argument instead.", - $interface->getName() - )); - } - - $this->reflectInterfaceToNode($interface, $node); - } - - $node->addInterface('Prophecy\Doubler\Generator\ReflectionInterface'); - - return $node; - } - - private function reflectClassToNode(ReflectionClass $class, Node\ClassNode $node) - { - if (true === $class->isFinal()) { - throw new ClassMirrorException(sprintf( - 'Could not reflect class %s as it is marked final.', $class->getName() - ), $class); - } - - $node->setParentClass($class->getName()); - - foreach ($class->getMethods(ReflectionMethod::IS_ABSTRACT) as $method) { - if (false === $method->isProtected()) { - continue; - } - - $this->reflectMethodToNode($method, $node); - } - - foreach ($class->getMethods(ReflectionMethod::IS_PUBLIC) as $method) { - if (0 === strpos($method->getName(), '_') - && !in_array($method->getName(), self::$reflectableMethods)) { - continue; - } - - if (true === $method->isFinal()) { - continue; - } - - $this->reflectMethodToNode($method, $node); - } - } - - private function reflectInterfaceToNode(ReflectionClass $interface, Node\ClassNode $node) - { - $node->addInterface($interface->getName()); - - foreach ($interface->getMethods() as $method) { - $this->reflectMethodToNode($method, $node); - } - } - - private function reflectMethodToNode(ReflectionMethod $method, Node\ClassNode $classNode) - { - $node = new Node\MethodNode($method->getName()); - - if (true === $method->isProtected()) { - $node->setVisibility('protected'); - } - - if (true === $method->isStatic()) { - $node->setStatic(); - } - - if (true === $method->returnsReference()) { - $node->setReturnsReference(); - } - - if (is_array($params = $method->getParameters()) && count($params)) { - foreach ($params as $param) { - $this->reflectArgumentToNode($param, $node); - } - } - - $classNode->addMethod($node); - } - - private function reflectArgumentToNode(ReflectionParameter $parameter, Node\MethodNode $methodNode) - { - $name = $parameter->getName() == '...' ? '__dot_dot_dot__' : $parameter->getName(); - $node = new Node\ArgumentNode($name); - - $typeHint = $this->getTypeHint($parameter); - $node->setTypeHint($typeHint); - - if (true === $parameter->isDefaultValueAvailable()) { - $node->setDefault($parameter->getDefaultValue()); - } elseif (true === $parameter->isOptional() - || (true === $parameter->allowsNull() && $typeHint)) { - $node->setDefault(null); - } - - if (true === $parameter->isPassedByReference()) { - $node->setAsPassedByReference(); - } - - $methodNode->addArgument($node); - } - - private function getTypeHint(ReflectionParameter $parameter) - { - if (null !== $className = $this->getParameterClassName($parameter)) { - return $className; - } - - if (true === $parameter->isArray()) { - return 'array'; - } - - if (version_compare(PHP_VERSION, '5.4', '>=') && true === $parameter->isCallable()) { - return 'callable'; - } - - return null; - } - - private function getParameterClassName(ReflectionParameter $parameter) - { - try { - return $parameter->getClass() ? $parameter->getClass()->getName() : null; - } catch (\ReflectionException $e) { - preg_match('/\[\s\<\w+?>\s([\w,\\\]+)/s', $parameter, $matches); - - return isset($matches[1]) ? $matches[1] : null; - } - } -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/Node/ArgumentNode.php b/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/Node/ArgumentNode.php deleted file mode 100644 index a6c42a3..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/Node/ArgumentNode.php +++ /dev/null @@ -1,75 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Doubler\Generator\Node; - -/** - * Argument node. - * - * @author Konstantin Kudryashov - */ -class ArgumentNode -{ - private $name; - private $typeHint; - private $default; - private $optional = false; - private $byReference = false; - - /** - * @param string $name - */ - public function __construct($name) - { - $this->name = $name; - } - - public function getName() - { - return $this->name; - } - - public function getTypeHint() - { - return $this->typeHint; - } - - public function setTypeHint($typeHint = null) - { - $this->typeHint = $typeHint; - } - - public function getDefault() - { - return $this->default; - } - - public function setDefault($default = null) - { - $this->optional = true; - $this->default = $default; - } - - public function isOptional() - { - return $this->optional; - } - - public function setAsPassedByReference($byReference = true) - { - $this->byReference = $byReference; - } - - public function isPassedByReference() - { - return $this->byReference; - } -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/Node/ClassNode.php b/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/Node/ClassNode.php deleted file mode 100644 index b38cb4e..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/Node/ClassNode.php +++ /dev/null @@ -1,130 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Doubler\Generator\Node; - -use Prophecy\Exception\InvalidArgumentException; - -/** - * Class node. - * - * @author Konstantin Kudryashov - */ -class ClassNode -{ - private $parentClass = 'stdClass'; - private $interfaces = array(); - private $properties = array(); - - /** - * @var MethodNode[] - */ - private $methods = array(); - - public function getParentClass() - { - return $this->parentClass; - } - - /** - * @param string $class - */ - public function setParentClass($class) - { - $this->parentClass = $class ?: 'stdClass'; - } - - /** - * @return string[] - */ - public function getInterfaces() - { - return $this->interfaces; - } - - /** - * @param string $interface - */ - public function addInterface($interface) - { - if ($this->hasInterface($interface)) { - return; - } - - array_unshift($this->interfaces, $interface); - } - - /** - * @param string $interface - * - * @return bool - */ - public function hasInterface($interface) - { - return in_array($interface, $this->interfaces); - } - - public function getProperties() - { - return $this->properties; - } - - public function addProperty($name, $visibility = 'public') - { - $visibility = strtolower($visibility); - - if (!in_array($visibility, array('public', 'private', 'protected'))) { - throw new InvalidArgumentException(sprintf( - '`%s` property visibility is not supported.', $visibility - )); - } - - $this->properties[$name] = $visibility; - } - - /** - * @return MethodNode[] - */ - public function getMethods() - { - return $this->methods; - } - - public function addMethod(MethodNode $method) - { - $this->methods[$method->getName()] = $method; - } - - public function removeMethod($name) - { - unset($this->methods[$name]); - } - - /** - * @param string $name - * - * @return MethodNode|null - */ - public function getMethod($name) - { - return $this->hasMethod($name) ? $this->methods[$name] : null; - } - - /** - * @param string $name - * - * @return bool - */ - public function hasMethod($name) - { - return isset($this->methods[$name]); - } -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/Node/MethodNode.php b/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/Node/MethodNode.php deleted file mode 100644 index ef303b6..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/Node/MethodNode.php +++ /dev/null @@ -1,129 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Doubler\Generator\Node; - -use Prophecy\Exception\InvalidArgumentException; - -/** - * Method node. - * - * @author Konstantin Kudryashov - */ -class MethodNode -{ - private $name; - private $code; - private $visibility = 'public'; - private $static = false; - private $returnsReference = false; - - /** - * @var ArgumentNode[] - */ - private $arguments = array(); - - /** - * @param string $name - * @param string $code - */ - public function __construct($name, $code = null) - { - $this->name = $name; - $this->code = $code; - } - - public function getVisibility() - { - return $this->visibility; - } - - /** - * @param string $visibility - */ - public function setVisibility($visibility) - { - $visibility = strtolower($visibility); - - if (!in_array($visibility, array('public', 'private', 'protected'))) { - throw new InvalidArgumentException(sprintf( - '`%s` method visibility is not supported.', $visibility - )); - } - - $this->visibility = $visibility; - } - - public function isStatic() - { - return $this->static; - } - - public function setStatic($static = true) - { - $this->static = (bool) $static; - } - - public function returnsReference() - { - return $this->returnsReference; - } - - public function setReturnsReference() - { - $this->returnsReference = true; - } - - public function getName() - { - return $this->name; - } - - public function addArgument(ArgumentNode $argument) - { - $this->arguments[] = $argument; - } - - /** - * @return ArgumentNode[] - */ - public function getArguments() - { - return $this->arguments; - } - - /** - * @param string $code - */ - public function setCode($code) - { - $this->code = $code; - } - - public function getCode() - { - if ($this->returnsReference) - { - return "throw new \Prophecy\Exception\Doubler\ReturnByReferenceException('Returning by reference not supported', get_class(\$this), '{$this->name}');"; - } - - return (string) $this->code; - } - - public function useParentCode() - { - $this->code = sprintf( - 'return parent::%s(%s);', $this->getName(), implode(', ', - array_map(function (ArgumentNode $arg) { return '$'.$arg->getName(); }, $this->arguments) - ) - ); - } -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ReflectionInterface.php b/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ReflectionInterface.php deleted file mode 100644 index d720b15..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ReflectionInterface.php +++ /dev/null @@ -1,22 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Doubler\Generator; - -/** - * Reflection interface. - * All reflected classes implement this interface. - * - * @author Konstantin Kudryashov - */ -interface ReflectionInterface -{ -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/LazyDouble.php b/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/LazyDouble.php deleted file mode 100644 index 8a99c4c..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/LazyDouble.php +++ /dev/null @@ -1,127 +0,0 @@ - - * 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 Prophecy\Exception\Doubler\DoubleException; -use Prophecy\Exception\Doubler\ClassNotFoundException; -use Prophecy\Exception\Doubler\InterfaceNotFoundException; -use ReflectionClass; - -/** - * Lazy double. - * Gives simple interface to describe double before creating it. - * - * @author Konstantin Kudryashov - */ -class LazyDouble -{ - private $doubler; - private $class; - private $interfaces = array(); - private $arguments = null; - private $double; - - /** - * Initializes lazy double. - * - * @param Doubler $doubler - */ - public function __construct(Doubler $doubler) - { - $this->doubler = $doubler; - } - - /** - * Tells doubler to use specific class as parent one for double. - * - * @param string|ReflectionClass $class - * - * @throws \Prophecy\Exception\Doubler\ClassNotFoundException - * @throws \Prophecy\Exception\Doubler\DoubleException - */ - public function setParentClass($class) - { - if (null !== $this->double) { - throw new DoubleException('Can not extend class with already instantiated double.'); - } - - if (!$class instanceof ReflectionClass) { - if (!class_exists($class)) { - throw new ClassNotFoundException(sprintf('Class %s not found.', $class), $class); - } - - $class = new ReflectionClass($class); - } - - $this->class = $class; - } - - /** - * Tells doubler to implement specific interface with double. - * - * @param string|ReflectionClass $interface - * - * @throws \Prophecy\Exception\Doubler\InterfaceNotFoundException - * @throws \Prophecy\Exception\Doubler\DoubleException - */ - public function addInterface($interface) - { - if (null !== $this->double) { - throw new DoubleException( - 'Can not implement interface with already instantiated double.' - ); - } - - if (!$interface instanceof ReflectionClass) { - if (!interface_exists($interface)) { - throw new InterfaceNotFoundException( - sprintf('Interface %s not found.', $interface), - $interface - ); - } - - $interface = new ReflectionClass($interface); - } - - $this->interfaces[] = $interface; - } - - /** - * Sets constructor arguments. - * - * @param array $arguments - */ - public function setArguments(array $arguments = null) - { - $this->arguments = $arguments; - } - - /** - * Creates double instance or returns already created one. - * - * @return DoubleInterface - */ - public function getInstance() - { - if (null === $this->double) { - if (null !== $this->arguments) { - return $this->double = $this->doubler->double( - $this->class, $this->interfaces, $this->arguments - ); - } - - $this->double = $this->doubler->double($this->class, $this->interfaces); - } - - return $this->double; - } -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/NameGenerator.php b/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/NameGenerator.php deleted file mode 100644 index d67ec6a..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Doubler/NameGenerator.php +++ /dev/null @@ -1,52 +0,0 @@ - - * 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; - -/** - * Name generator. - * Generates classname for double. - * - * @author Konstantin Kudryashov - */ -class NameGenerator -{ - private static $counter = 1; - - /** - * Generates name. - * - * @param ReflectionClass $class - * @param ReflectionClass[] $interfaces - * - * @return string - */ - public function name(ReflectionClass $class = null, array $interfaces) - { - $parts = array(); - - if (null !== $class) { - $parts[] = $class->getName(); - } else { - foreach ($interfaces as $interface) { - $parts[] = $interface->getShortName(); - } - } - - if (!count($parts)) { - $parts[] = 'stdClass'; - } - - return sprintf('Double\%s\P%d', implode('\\', $parts), self::$counter++); - } -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Call/UnexpectedCallException.php b/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Call/UnexpectedCallException.php deleted file mode 100644 index 48ed225..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Call/UnexpectedCallException.php +++ /dev/null @@ -1,40 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Exception\Call; - -use Prophecy\Exception\Prophecy\ObjectProphecyException; -use Prophecy\Prophecy\ObjectProphecy; - -class UnexpectedCallException extends ObjectProphecyException -{ - private $methodName; - private $arguments; - - public function __construct($message, ObjectProphecy $objectProphecy, - $methodName, array $arguments) - { - parent::__construct($message, $objectProphecy); - - $this->methodName = $methodName; - $this->arguments = $arguments; - } - - public function getMethodName() - { - return $this->methodName; - } - - public function getArguments() - { - return $this->arguments; - } -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/ClassCreatorException.php b/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/ClassCreatorException.php deleted file mode 100644 index 822918a..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/ClassCreatorException.php +++ /dev/null @@ -1,31 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Exception\Doubler; - -use Prophecy\Doubler\Generator\Node\ClassNode; - -class ClassCreatorException extends \RuntimeException implements DoublerException -{ - private $node; - - public function __construct($message, ClassNode $node) - { - parent::__construct($message); - - $this->node = $node; - } - - public function getClassNode() - { - return $this->node; - } -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/ClassMirrorException.php b/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/ClassMirrorException.php deleted file mode 100644 index 8fc53b8..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/ClassMirrorException.php +++ /dev/null @@ -1,31 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Exception\Doubler; - -use ReflectionClass; - -class ClassMirrorException extends \RuntimeException implements DoublerException -{ - private $class; - - public function __construct($message, ReflectionClass $class) - { - parent::__construct($message); - - $this->class = $class; - } - - public function getReflectedClass() - { - return $this->class; - } -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/ClassNotFoundException.php b/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/ClassNotFoundException.php deleted file mode 100644 index 5bc826d..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/ClassNotFoundException.php +++ /dev/null @@ -1,33 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Exception\Doubler; - -class ClassNotFoundException extends DoubleException -{ - private $classname; - - /** - * @param string $message - * @param string $classname - */ - public function __construct($message, $classname) - { - parent::__construct($message); - - $this->classname = $classname; - } - - public function getClassname() - { - return $this->classname; - } -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/DoubleException.php b/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/DoubleException.php deleted file mode 100644 index 6642a58..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/DoubleException.php +++ /dev/null @@ -1,18 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Exception\Doubler; - -use RuntimeException; - -class DoubleException extends RuntimeException implements DoublerException -{ -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/DoublerException.php b/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/DoublerException.php deleted file mode 100644 index 9d6be17..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/DoublerException.php +++ /dev/null @@ -1,18 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Exception\Doubler; - -use Prophecy\Exception\Exception; - -interface DoublerException extends Exception -{ -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/InterfaceNotFoundException.php b/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/InterfaceNotFoundException.php deleted file mode 100644 index e344dea..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/InterfaceNotFoundException.php +++ /dev/null @@ -1,20 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Exception\Doubler; - -class InterfaceNotFoundException extends ClassNotFoundException -{ - public function getInterfaceName() - { - return $this->getClassname(); - } -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/MethodNotFoundException.php b/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/MethodNotFoundException.php deleted file mode 100644 index b113941..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/MethodNotFoundException.php +++ /dev/null @@ -1,60 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Exception\Doubler; - -class MethodNotFoundException extends DoubleException -{ - /** - * @var string - */ - private $classname; - - /** - * @var string - */ - private $methodName; - - /** - * @var array - */ - private $arguments; - - /** - * @param string $message - * @param string $classname - * @param string $methodName - * @param null|Argument\ArgumentsWildcard|array $arguments - */ - public function __construct($message, $classname, $methodName, $arguments = null) - { - parent::__construct($message); - - $this->classname = $classname; - $this->methodName = $methodName; - $this->arguments = $arguments; - } - - public function getClassname() - { - return $this->classname; - } - - public function getMethodName() - { - return $this->methodName; - } - - public function getArguments() - { - return $this->arguments; - } -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/ReturnByReferenceException.php b/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/ReturnByReferenceException.php deleted file mode 100644 index 6303049..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/ReturnByReferenceException.php +++ /dev/null @@ -1,41 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Exception\Doubler; - -class ReturnByReferenceException extends DoubleException -{ - private $classname; - private $methodName; - - /** - * @param string $message - * @param string $classname - * @param string $methodName - */ - public function __construct($message, $classname, $methodName) - { - parent::__construct($message); - - $this->classname = $classname; - $this->methodName = $methodName; - } - - public function getClassname() - { - return $this->classname; - } - - public function getMethodName() - { - return $this->methodName; - } -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Exception.php b/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Exception.php deleted file mode 100644 index ac9fe4d..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Exception.php +++ /dev/null @@ -1,26 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Exception; - -/** - * Core Prophecy exception interface. - * All Prophecy exceptions implement it. - * - * @author Konstantin Kudryashov - */ -interface Exception -{ - /** - * @return string - */ - public function getMessage(); -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Exception/InvalidArgumentException.php b/core/vendor/phpspec/prophecy/src/Prophecy/Exception/InvalidArgumentException.php deleted file mode 100644 index bc91c69..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Exception/InvalidArgumentException.php +++ /dev/null @@ -1,16 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Exception; - -class InvalidArgumentException extends \InvalidArgumentException implements Exception -{ -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/AggregateException.php b/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/AggregateException.php deleted file mode 100644 index 44b598a..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/AggregateException.php +++ /dev/null @@ -1,50 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Exception\Prediction; - -use Prophecy\Prophecy\ObjectProphecy; - -class AggregateException extends \RuntimeException implements PredictionException -{ - private $exceptions = array(); - private $objectProphecy; - - public function append(PredictionException $exception) - { - $message = $exception->getMessage(); - $message = ' '.strtr($message, array("\n" => "\n "))."\n"; - - $this->message = rtrim($this->message.$message); - $this->exceptions[] = $exception; - } - - /** - * @return PredictionException[] - */ - public function getExceptions() - { - return $this->exceptions; - } - - public function setObjectProphecy(ObjectProphecy $objectProphecy) - { - $this->objectProphecy = $objectProphecy; - } - - /** - * @return ObjectProphecy - */ - public function getObjectProphecy() - { - return $this->objectProphecy; - } -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/FailedPredictionException.php b/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/FailedPredictionException.php deleted file mode 100644 index bbbbc3d..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/FailedPredictionException.php +++ /dev/null @@ -1,24 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Exception\Prediction; - -use RuntimeException; - -/** - * Basic failed prediction exception. - * Use it for custom prediction failures. - * - * @author Konstantin Kudryashov - */ -class FailedPredictionException extends RuntimeException implements PredictionException -{ -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/NoCallsException.php b/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/NoCallsException.php deleted file mode 100644 index 05ea4aa..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/NoCallsException.php +++ /dev/null @@ -1,18 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Exception\Prediction; - -use Prophecy\Exception\Prophecy\MethodProphecyException; - -class NoCallsException extends MethodProphecyException implements PredictionException -{ -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/PredictionException.php b/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/PredictionException.php deleted file mode 100644 index 2596b1e..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/PredictionException.php +++ /dev/null @@ -1,18 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Exception\Prediction; - -use Prophecy\Exception\Exception; - -interface PredictionException extends Exception -{ -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/UnexpectedCallsCountException.php b/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/UnexpectedCallsCountException.php deleted file mode 100644 index 9d90543..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/UnexpectedCallsCountException.php +++ /dev/null @@ -1,31 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Exception\Prediction; - -use Prophecy\Prophecy\MethodProphecy; - -class UnexpectedCallsCountException extends UnexpectedCallsException -{ - private $expectedCount; - - public function __construct($message, MethodProphecy $methodProphecy, $count, array $calls) - { - parent::__construct($message, $methodProphecy, $calls); - - $this->expectedCount = intval($count); - } - - public function getExpectedCount() - { - return $this->expectedCount; - } -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/UnexpectedCallsException.php b/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/UnexpectedCallsException.php deleted file mode 100644 index 7a99c2d..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/UnexpectedCallsException.php +++ /dev/null @@ -1,32 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Exception\Prediction; - -use Prophecy\Prophecy\MethodProphecy; -use Prophecy\Exception\Prophecy\MethodProphecyException; - -class UnexpectedCallsException extends MethodProphecyException implements PredictionException -{ - private $calls = array(); - - public function __construct($message, MethodProphecy $methodProphecy, array $calls) - { - parent::__construct($message, $methodProphecy); - - $this->calls = $calls; - } - - public function getCalls() - { - return $this->calls; - } -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Prophecy/MethodProphecyException.php b/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Prophecy/MethodProphecyException.php deleted file mode 100644 index 1b03eaf..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Prophecy/MethodProphecyException.php +++ /dev/null @@ -1,34 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Exception\Prophecy; - -use Prophecy\Prophecy\MethodProphecy; - -class MethodProphecyException extends ObjectProphecyException -{ - private $methodProphecy; - - public function __construct($message, MethodProphecy $methodProphecy) - { - parent::__construct($message, $methodProphecy->getObjectProphecy()); - - $this->methodProphecy = $methodProphecy; - } - - /** - * @return MethodProphecy - */ - public function getMethodProphecy() - { - return $this->methodProphecy; - } -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Prophecy/ObjectProphecyException.php b/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Prophecy/ObjectProphecyException.php deleted file mode 100644 index e345402..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Prophecy/ObjectProphecyException.php +++ /dev/null @@ -1,34 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Exception\Prophecy; - -use Prophecy\Prophecy\ObjectProphecy; - -class ObjectProphecyException extends \RuntimeException implements ProphecyException -{ - private $objectProphecy; - - public function __construct($message, ObjectProphecy $objectProphecy) - { - parent::__construct($message); - - $this->objectProphecy = $objectProphecy; - } - - /** - * @return ObjectProphecy - */ - public function getObjectProphecy() - { - return $this->objectProphecy; - } -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Prophecy/ProphecyException.php b/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Prophecy/ProphecyException.php deleted file mode 100644 index 9157332..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Exception/Prophecy/ProphecyException.php +++ /dev/null @@ -1,18 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Exception\Prophecy; - -use Prophecy\Exception\Exception; - -interface ProphecyException extends Exception -{ -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Prediction/CallPrediction.php b/core/vendor/phpspec/prophecy/src/Prophecy/Prediction/CallPrediction.php deleted file mode 100644 index 5bdcdc4..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Prediction/CallPrediction.php +++ /dev/null @@ -1,86 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Prediction; - -use Prophecy\Call\Call; -use Prophecy\Prophecy\ObjectProphecy; -use Prophecy\Prophecy\MethodProphecy; -use Prophecy\Argument\ArgumentsWildcard; -use Prophecy\Argument\Token\AnyValuesToken; -use Prophecy\Util\StringUtil; -use Prophecy\Exception\Prediction\NoCallsException; - -/** - * Call prediction. - * - * @author Konstantin Kudryashov - */ -class CallPrediction implements PredictionInterface -{ - private $util; - - /** - * Initializes prediction. - * - * @param StringUtil $util - */ - public function __construct(StringUtil $util = null) - { - $this->util = $util ?: new StringUtil; - } - - /** - * Tests that there was at least one call. - * - * @param Call[] $calls - * @param ObjectProphecy $object - * @param MethodProphecy $method - * - * @throws \Prophecy\Exception\Prediction\NoCallsException - */ - public function check(array $calls, ObjectProphecy $object, MethodProphecy $method) - { - if (count($calls)) { - return; - } - - $methodCalls = $object->findProphecyMethodCalls( - $method->getMethodName(), - new ArgumentsWildcard(array(new AnyValuesToken)) - ); - - if (count($methodCalls)) { - throw new NoCallsException(sprintf( - "No calls been made that match:\n". - " %s->%s(%s)\n". - "but expected at least one.\n". - "Recorded `%s(...)` calls:\n%s", - - get_class($object->reveal()), - $method->getMethodName(), - $method->getArgumentsWildcard(), - $method->getMethodName(), - $this->util->stringifyCalls($methodCalls) - ), $method); - } - - throw new NoCallsException(sprintf( - "No calls been made that match:\n". - " %s->%s(%s)\n". - "but expected at least one.", - - get_class($object->reveal()), - $method->getMethodName(), - $method->getArgumentsWildcard() - ), $method); - } -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Prediction/CallTimesPrediction.php b/core/vendor/phpspec/prophecy/src/Prophecy/Prediction/CallTimesPrediction.php deleted file mode 100644 index 31c6c57..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Prediction/CallTimesPrediction.php +++ /dev/null @@ -1,107 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Prediction; - -use Prophecy\Call\Call; -use Prophecy\Prophecy\ObjectProphecy; -use Prophecy\Prophecy\MethodProphecy; -use Prophecy\Argument\ArgumentsWildcard; -use Prophecy\Argument\Token\AnyValuesToken; -use Prophecy\Util\StringUtil; -use Prophecy\Exception\Prediction\UnexpectedCallsCountException; - -/** - * Prediction interface. - * Predictions are logical test blocks, tied to `should...` keyword. - * - * @author Konstantin Kudryashov - */ -class CallTimesPrediction implements PredictionInterface -{ - private $times; - private $util; - - /** - * Initializes prediction. - * - * @param int $times - * @param StringUtil $util - */ - public function __construct($times, StringUtil $util = null) - { - $this->times = intval($times); - $this->util = $util ?: new StringUtil; - } - - /** - * Tests that there was exact amount of calls made. - * - * @param Call[] $calls - * @param ObjectProphecy $object - * @param MethodProphecy $method - * - * @throws \Prophecy\Exception\Prediction\UnexpectedCallsCountException - */ - public function check(array $calls, ObjectProphecy $object, MethodProphecy $method) - { - if ($this->times == count($calls)) { - return; - } - - $methodCalls = $object->findProphecyMethodCalls( - $method->getMethodName(), - new ArgumentsWildcard(array(new AnyValuesToken)) - ); - - if (count($calls)) { - $message = sprintf( - "Expected exactly %d calls that match:\n". - " %s->%s(%s)\n". - "but %d were made:\n%s", - - $this->times, - get_class($object->reveal()), - $method->getMethodName(), - $method->getArgumentsWildcard(), - count($calls), - $this->util->stringifyCalls($calls) - ); - } elseif (count($methodCalls)) { - $message = sprintf( - "Expected exactly %d calls that match:\n". - " %s->%s(%s)\n". - "but none were made.\n". - "Recorded `%s(...)` calls:\n%s", - - $this->times, - get_class($object->reveal()), - $method->getMethodName(), - $method->getArgumentsWildcard(), - $method->getMethodName(), - $this->util->stringifyCalls($methodCalls) - ); - } else { - $message = sprintf( - "Expected exactly %d calls that match:\n". - " %s->%s(%s)\n". - "but none were made.", - - $this->times, - get_class($object->reveal()), - $method->getMethodName(), - $method->getArgumentsWildcard() - ); - } - - throw new UnexpectedCallsCountException($message, $method, $this->times, $calls); - } -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Prediction/CallbackPrediction.php b/core/vendor/phpspec/prophecy/src/Prophecy/Prediction/CallbackPrediction.php deleted file mode 100644 index 44bc782..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Prediction/CallbackPrediction.php +++ /dev/null @@ -1,65 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Prediction; - -use Prophecy\Call\Call; -use Prophecy\Prophecy\ObjectProphecy; -use Prophecy\Prophecy\MethodProphecy; -use Prophecy\Exception\InvalidArgumentException; -use Closure; - -/** - * Callback prediction. - * - * @author Konstantin Kudryashov - */ -class CallbackPrediction implements PredictionInterface -{ - private $callback; - - /** - * Initializes callback prediction. - * - * @param callable $callback Custom callback - * - * @throws \Prophecy\Exception\InvalidArgumentException - */ - public function __construct($callback) - { - if (!is_callable($callback)) { - throw new InvalidArgumentException(sprintf( - 'Callable expected as an argument to CallbackPrediction, but got %s.', - gettype($callback) - )); - } - - $this->callback = $callback; - } - - /** - * Executes preset callback. - * - * @param Call[] $calls - * @param ObjectProphecy $object - * @param MethodProphecy $method - */ - public function check(array $calls, ObjectProphecy $object, MethodProphecy $method) - { - $callback = $this->callback; - - if ($callback instanceof Closure && method_exists('Closure', 'bind')) { - $callback = Closure::bind($callback, $object); - } - - call_user_func($callback, $calls, $object, $method); - } -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Prediction/NoCallsPrediction.php b/core/vendor/phpspec/prophecy/src/Prophecy/Prediction/NoCallsPrediction.php deleted file mode 100644 index 46ac5bf..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Prediction/NoCallsPrediction.php +++ /dev/null @@ -1,68 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Prediction; - -use Prophecy\Call\Call; -use Prophecy\Prophecy\ObjectProphecy; -use Prophecy\Prophecy\MethodProphecy; -use Prophecy\Util\StringUtil; -use Prophecy\Exception\Prediction\UnexpectedCallsException; - -/** - * No calls prediction. - * - * @author Konstantin Kudryashov - */ -class NoCallsPrediction implements PredictionInterface -{ - private $util; - - /** - * Initializes prediction. - * - * @param null|StringUtil $util - */ - public function __construct(StringUtil $util = null) - { - $this->util = $util ?: new StringUtil; - } - - /** - * Tests that there were no calls made. - * - * @param Call[] $calls - * @param ObjectProphecy $object - * @param MethodProphecy $method - * - * @throws \Prophecy\Exception\Prediction\UnexpectedCallsException - */ - public function check(array $calls, ObjectProphecy $object, MethodProphecy $method) - { - if (!count($calls)) { - return; - } - - $verb = count($calls) === 1 ? 'was' : 'were'; - - throw new UnexpectedCallsException(sprintf( - "No calls expected that match:\n". - " %s->%s(%s)\n". - "but %d %s made:\n%s", - get_class($object->reveal()), - $method->getMethodName(), - $method->getArgumentsWildcard(), - count($calls), - $verb, - $this->util->stringifyCalls($calls) - ), $method, $calls); - } -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Prediction/PredictionInterface.php b/core/vendor/phpspec/prophecy/src/Prophecy/Prediction/PredictionInterface.php deleted file mode 100644 index f7fb06a..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Prediction/PredictionInterface.php +++ /dev/null @@ -1,37 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Prediction; - -use Prophecy\Call\Call; -use Prophecy\Prophecy\ObjectProphecy; -use Prophecy\Prophecy\MethodProphecy; - -/** - * Prediction interface. - * Predictions are logical test blocks, tied to `should...` keyword. - * - * @author Konstantin Kudryashov - */ -interface PredictionInterface -{ - /** - * Tests that double fulfilled prediction. - * - * @param Call[] $calls - * @param ObjectProphecy $object - * @param MethodProphecy $method - * - * @throws object - * @return void - */ - public function check(array $calls, ObjectProphecy $object, MethodProphecy $method); -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Promise/CallbackPromise.php b/core/vendor/phpspec/prophecy/src/Prophecy/Promise/CallbackPromise.php deleted file mode 100644 index 5f406bf..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Promise/CallbackPromise.php +++ /dev/null @@ -1,66 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Promise; - -use Prophecy\Prophecy\ObjectProphecy; -use Prophecy\Prophecy\MethodProphecy; -use Prophecy\Exception\InvalidArgumentException; -use Closure; - -/** - * Callback promise. - * - * @author Konstantin Kudryashov - */ -class CallbackPromise implements PromiseInterface -{ - private $callback; - - /** - * Initializes callback promise. - * - * @param callable $callback Custom callback - * - * @throws \Prophecy\Exception\InvalidArgumentException - */ - public function __construct($callback) - { - if (!is_callable($callback)) { - throw new InvalidArgumentException(sprintf( - 'Callable expected as an argument to CallbackPromise, but got %s.', - gettype($callback) - )); - } - - $this->callback = $callback; - } - - /** - * Evaluates promise callback. - * - * @param array $args - * @param ObjectProphecy $object - * @param MethodProphecy $method - * - * @return mixed - */ - public function execute(array $args, ObjectProphecy $object, MethodProphecy $method) - { - $callback = $this->callback; - - if ($callback instanceof Closure && method_exists('Closure', 'bind')) { - $callback = Closure::bind($callback, $object); - } - - return call_user_func($callback, $args, $object, $method); - } -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Promise/PromiseInterface.php b/core/vendor/phpspec/prophecy/src/Prophecy/Promise/PromiseInterface.php deleted file mode 100644 index 382537b..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Promise/PromiseInterface.php +++ /dev/null @@ -1,35 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Promise; - -use Prophecy\Prophecy\ObjectProphecy; -use Prophecy\Prophecy\MethodProphecy; - -/** - * Promise interface. - * Promises are logical blocks, tied to `will...` keyword. - * - * @author Konstantin Kudryashov - */ -interface PromiseInterface -{ - /** - * Evaluates promise. - * - * @param array $args - * @param ObjectProphecy $object - * @param MethodProphecy $method - * - * @return mixed - */ - public function execute(array $args, ObjectProphecy $object, MethodProphecy $method); -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Promise/ReturnArgumentPromise.php b/core/vendor/phpspec/prophecy/src/Prophecy/Promise/ReturnArgumentPromise.php deleted file mode 100644 index a06724b..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Promise/ReturnArgumentPromise.php +++ /dev/null @@ -1,61 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Promise; - -use Prophecy\Exception\InvalidArgumentException; -use Prophecy\Prophecy\ObjectProphecy; -use Prophecy\Prophecy\MethodProphecy; - -/** - * Return argument promise. - * - * @author Konstantin Kudryashov - */ -class ReturnArgumentPromise implements PromiseInterface -{ - /** - * @var int - */ - private $index; - - /** - * Initializes callback promise. - * - * @param int $index The zero-indexed number of the argument to return - * - * @throws \Prophecy\Exception\InvalidArgumentException - */ - public function __construct($index = 0) - { - if (!is_int($index) || $index < 0) { - throw new InvalidArgumentException( - 'Zero-based index expected as argument to ReturnArgumentPromise, but got %s.', - $index - ); - } - $this->index = $index; - } - - /** - * Returns nth argument if has one, null otherwise. - * - * @param array $args - * @param ObjectProphecy $object - * @param MethodProphecy $method - * - * @return null|mixed - */ - public function execute(array $args, ObjectProphecy $object, MethodProphecy $method) - { - return count($args) > $this->index ? $args[$this->index] : null; - } -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Promise/ReturnPromise.php b/core/vendor/phpspec/prophecy/src/Prophecy/Promise/ReturnPromise.php deleted file mode 100644 index c7d5ac5..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Promise/ReturnPromise.php +++ /dev/null @@ -1,55 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Promise; - -use Prophecy\Prophecy\ObjectProphecy; -use Prophecy\Prophecy\MethodProphecy; - -/** - * Return promise. - * - * @author Konstantin Kudryashov - */ -class ReturnPromise implements PromiseInterface -{ - private $returnValues = array(); - - /** - * Initializes promise. - * - * @param array $returnValues Array of values - */ - public function __construct(array $returnValues) - { - $this->returnValues = $returnValues; - } - - /** - * Returns saved values one by one until last one, then continuously returns last value. - * - * @param array $args - * @param ObjectProphecy $object - * @param MethodProphecy $method - * - * @return mixed - */ - public function execute(array $args, ObjectProphecy $object, MethodProphecy $method) - { - $value = array_shift($this->returnValues); - - if (!count($this->returnValues)) { - $this->returnValues[] = $value; - } - - return $value; - } -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Promise/ThrowPromise.php b/core/vendor/phpspec/prophecy/src/Prophecy/Promise/ThrowPromise.php deleted file mode 100644 index 8007330..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Promise/ThrowPromise.php +++ /dev/null @@ -1,91 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Promise; - -use Doctrine\Instantiator\Instantiator; -use Prophecy\Prophecy\ObjectProphecy; -use Prophecy\Prophecy\MethodProphecy; -use Prophecy\Exception\InvalidArgumentException; -use ReflectionClass; - -/** - * Throw promise. - * - * @author Konstantin Kudryashov - */ -class ThrowPromise implements PromiseInterface -{ - private $exception; - - /** - * @var \Doctrine\Instantiator\Instantiator - */ - private $instantiator; - - /** - * Initializes promise. - * - * @param string|\Exception $exception Exception class name or instance - * - * @throws \Prophecy\Exception\InvalidArgumentException - */ - public function __construct($exception) - { - if (is_string($exception)) { - if (!class_exists($exception) - && 'Exception' !== $exception - && !is_subclass_of($exception, 'Exception')) { - throw new InvalidArgumentException(sprintf( - 'Exception class or instance expected as argument to ThrowPromise, but got %s.', - gettype($exception) - )); - } - } elseif (!$exception instanceof \Exception) { - throw new InvalidArgumentException(sprintf( - 'Exception class or instance expected as argument to ThrowPromise, but got %s.', - gettype($exception) - )); - } - - $this->exception = $exception; - } - - /** - * Throws predefined exception. - * - * @param array $args - * @param ObjectProphecy $object - * @param MethodProphecy $method - * - * @throws object - */ - public function execute(array $args, ObjectProphecy $object, MethodProphecy $method) - { - if (is_string($this->exception)) { - $classname = $this->exception; - $reflection = new ReflectionClass($classname); - $constructor = $reflection->getConstructor(); - - if ($constructor->isPublic() && 0 == $constructor->getNumberOfRequiredParameters()) { - throw $reflection->newInstance(); - } - - if (!$this->instantiator) { - $this->instantiator = new Instantiator(); - } - - throw $this->instantiator->instantiate($classname); - } - - throw $this->exception; - } -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Prophecy/MethodProphecy.php b/core/vendor/phpspec/prophecy/src/Prophecy/Prophecy/MethodProphecy.php deleted file mode 100644 index 9af03b9..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Prophecy/MethodProphecy.php +++ /dev/null @@ -1,409 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Prophecy; - -use Prophecy\Argument; -use Prophecy\Promise; -use Prophecy\Prediction; -use Prophecy\Exception\Doubler\MethodNotFoundException; -use Prophecy\Exception\InvalidArgumentException; -use Prophecy\Exception\Prophecy\MethodProphecyException; - -/** - * Method prophecy. - * - * @author Konstantin Kudryashov - */ -class MethodProphecy -{ - private $objectProphecy; - private $methodName; - private $argumentsWildcard; - private $promise; - private $prediction; - private $checkedPredictions = array(); - private $bound = false; - - /** - * Initializes method prophecy. - * - * @param ObjectProphecy $objectProphecy - * @param string $methodName - * @param null|Argument\ArgumentsWildcard|array $arguments - * - * @throws \Prophecy\Exception\Doubler\MethodNotFoundException If method not found - */ - public function __construct(ObjectProphecy $objectProphecy, $methodName, $arguments = null) - { - $double = $objectProphecy->reveal(); - if (!method_exists($double, $methodName)) { - throw new MethodNotFoundException(sprintf( - 'Method `%s::%s()` is not defined.', get_class($double), $methodName - ), get_class($double), $methodName, $arguments); - } - - $this->objectProphecy = $objectProphecy; - $this->methodName = $methodName; - - $reflectedMethod = new \ReflectionMethod($double, $methodName); - if ($reflectedMethod->isFinal()) { - throw new MethodProphecyException(sprintf( - "Can not add prophecy for a method `%s::%s()`\n". - "as it is a final method.", - get_class($double), - $methodName - ), $this); - } - - if (null !== $arguments) { - $this->withArguments($arguments); - } - } - - /** - * Sets argument wildcard. - * - * @param array|Argument\ArgumentsWildcard $arguments - * - * @return $this - * - * @throws \Prophecy\Exception\InvalidArgumentException - */ - public function withArguments($arguments) - { - if (is_array($arguments)) { - $arguments = new Argument\ArgumentsWildcard($arguments); - } - - if (!$arguments instanceof Argument\ArgumentsWildcard) { - throw new InvalidArgumentException(sprintf( - "Either an array or an instance of ArgumentsWildcard expected as\n". - 'a `MethodProphecy::withArguments()` argument, but got %s.', - gettype($arguments) - )); - } - - $this->argumentsWildcard = $arguments; - - return $this; - } - - /** - * Sets custom promise to the prophecy. - * - * @param callable|Promise\PromiseInterface $promise - * - * @return $this - * - * @throws \Prophecy\Exception\InvalidArgumentException - */ - public function will($promise) - { - if (is_callable($promise)) { - $promise = new Promise\CallbackPromise($promise); - } - - if (!$promise instanceof Promise\PromiseInterface) { - throw new InvalidArgumentException(sprintf( - 'Expected callable or instance of PromiseInterface, but got %s.', - gettype($promise) - )); - } - - $this->bindToObjectProphecy(); - $this->promise = $promise; - - return $this; - } - - /** - * Sets return promise to the prophecy. - * - * @see Prophecy\Promise\ReturnPromise - * - * @return $this - */ - public function willReturn() - { - return $this->will(new Promise\ReturnPromise(func_get_args())); - } - - /** - * Sets return argument promise to the prophecy. - * - * @param int $index The zero-indexed number of the argument to return - * - * @see Prophecy\Promise\ReturnArgumentPromise - * - * @return $this - */ - public function willReturnArgument($index = 0) - { - return $this->will(new Promise\ReturnArgumentPromise($index)); - } - - /** - * Sets throw promise to the prophecy. - * - * @see Prophecy\Promise\ThrowPromise - * - * @param string|\Exception $exception Exception class or instance - * - * @return $this - */ - public function willThrow($exception) - { - return $this->will(new Promise\ThrowPromise($exception)); - } - - /** - * Sets custom prediction to the prophecy. - * - * @param callable|Prediction\PredictionInterface $prediction - * - * @return $this - * - * @throws \Prophecy\Exception\InvalidArgumentException - */ - public function should($prediction) - { - if (is_callable($prediction)) { - $prediction = new Prediction\CallbackPrediction($prediction); - } - - if (!$prediction instanceof Prediction\PredictionInterface) { - throw new InvalidArgumentException(sprintf( - 'Expected callable or instance of PredictionInterface, but got %s.', - gettype($prediction) - )); - } - - $this->bindToObjectProphecy(); - $this->prediction = $prediction; - - return $this; - } - - /** - * Sets call prediction to the prophecy. - * - * @see Prophecy\Prediction\CallPrediction - * - * @return $this - */ - public function shouldBeCalled() - { - return $this->should(new Prediction\CallPrediction); - } - - /** - * Sets no calls prediction to the prophecy. - * - * @see Prophecy\Prediction\NoCallsPrediction - * - * @return $this - */ - public function shouldNotBeCalled() - { - return $this->should(new Prediction\NoCallsPrediction); - } - - /** - * Sets call times prediction to the prophecy. - * - * @see Prophecy\Prediction\CallTimesPrediction - * - * @param $count - * - * @return $this - */ - public function shouldBeCalledTimes($count) - { - return $this->should(new Prediction\CallTimesPrediction($count)); - } - - /** - * Checks provided prediction immediately. - * - * @param callable|Prediction\PredictionInterface $prediction - * - * @return $this - * - * @throws \Prophecy\Exception\InvalidArgumentException - */ - public function shouldHave($prediction) - { - if (is_callable($prediction)) { - $prediction = new Prediction\CallbackPrediction($prediction); - } - - if (!$prediction instanceof Prediction\PredictionInterface) { - throw new InvalidArgumentException(sprintf( - 'Expected callable or instance of PredictionInterface, but got %s.', - gettype($prediction) - )); - } - - if (null === $this->promise) { - $this->willReturn(); - } - - $calls = $this->getObjectProphecy()->findProphecyMethodCalls( - $this->getMethodName(), - $this->getArgumentsWildcard() - ); - - try { - $prediction->check($calls, $this->getObjectProphecy(), $this); - $this->checkedPredictions[] = $prediction; - } catch (\Exception $e) { - $this->checkedPredictions[] = $prediction; - - throw $e; - } - - return $this; - } - - /** - * Checks call prediction. - * - * @see Prophecy\Prediction\CallPrediction - * - * @return $this - */ - public function shouldHaveBeenCalled() - { - return $this->shouldHave(new Prediction\CallPrediction); - } - - /** - * Checks no calls prediction. - * - * @see Prophecy\Prediction\NoCallsPrediction - * - * @return $this - */ - public function shouldNotHaveBeenCalled() - { - return $this->shouldHave(new Prediction\NoCallsPrediction); - } - - /** - * Checks no calls prediction. - * - * @see Prophecy\Prediction\NoCallsPrediction - * @deprecated - * - * @return $this - */ - public function shouldNotBeenCalled() - { - return $this->shouldNotHaveBeenCalled(); - } - - /** - * Checks call times prediction. - * - * @see Prophecy\Prediction\CallTimesPrediction - * - * @param int $count - * - * @return $this - */ - public function shouldHaveBeenCalledTimes($count) - { - return $this->shouldHave(new Prediction\CallTimesPrediction($count)); - } - - /** - * Checks currently registered [with should(...)] prediction. - */ - public function checkPrediction() - { - if (null === $this->prediction) { - return; - } - - $this->shouldHave($this->prediction); - } - - /** - * Returns currently registered promise. - * - * @return null|Promise\PromiseInterface - */ - public function getPromise() - { - return $this->promise; - } - - /** - * Returns currently registered prediction. - * - * @return null|Prediction\PredictionInterface - */ - public function getPrediction() - { - return $this->prediction; - } - - /** - * Returns predictions that were checked on this object. - * - * @return Prediction\PredictionInterface[] - */ - public function getCheckedPredictions() - { - return $this->checkedPredictions; - } - - /** - * Returns object prophecy this method prophecy is tied to. - * - * @return ObjectProphecy - */ - public function getObjectProphecy() - { - return $this->objectProphecy; - } - - /** - * Returns method name. - * - * @return string - */ - public function getMethodName() - { - return $this->methodName; - } - - /** - * Returns arguments wildcard. - * - * @return Argument\ArgumentsWildcard - */ - public function getArgumentsWildcard() - { - return $this->argumentsWildcard; - } - - private function bindToObjectProphecy() - { - if ($this->bound) { - return; - } - - $this->getObjectProphecy()->addMethodProphecy($this); - $this->bound = true; - } -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Prophecy/ObjectProphecy.php b/core/vendor/phpspec/prophecy/src/Prophecy/Prophecy/ObjectProphecy.php deleted file mode 100644 index e85c9d5..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Prophecy/ObjectProphecy.php +++ /dev/null @@ -1,279 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Prophecy; - -use SebastianBergmann\Comparator\Factory as ComparatorFactory; -use SebastianBergmann\Comparator\ComparisonFailure; -use Prophecy\Call\Call; -use Prophecy\Doubler\LazyDouble; -use Prophecy\Argument\ArgumentsWildcard; -use Prophecy\Call\CallCenter; -use Prophecy\Exception\Prophecy\ObjectProphecyException; -use Prophecy\Exception\Prophecy\MethodProphecyException; -use Prophecy\Exception\Prediction\AggregateException; -use Prophecy\Exception\Prediction\PredictionException; - -/** - * Object prophecy. - * - * @author Konstantin Kudryashov - */ -class ObjectProphecy implements ProphecyInterface -{ - private $lazyDouble; - private $callCenter; - private $revealer; - private $comparatorFactory; - - /** - * @var MethodProphecy[][] - */ - private $methodProphecies = array(); - - /** - * Initializes object prophecy. - * - * @param LazyDouble $lazyDouble - * @param CallCenter $callCenter - * @param RevealerInterface $revealer - * @param ComparatorFactory $comparatorFactory - */ - public function __construct( - LazyDouble $lazyDouble, - CallCenter $callCenter = null, - RevealerInterface $revealer = null, - ComparatorFactory $comparatorFactory = null - ) { - $this->lazyDouble = $lazyDouble; - $this->callCenter = $callCenter ?: new CallCenter; - $this->revealer = $revealer ?: new Revealer; - - $this->comparatorFactory = $comparatorFactory ?: ComparatorFactory::getInstance(); - } - - /** - * Forces double to extend specific class. - * - * @param string $class - * - * @return $this - */ - public function willExtend($class) - { - $this->lazyDouble->setParentClass($class); - - return $this; - } - - /** - * Forces double to implement specific interface. - * - * @param string $interface - * - * @return $this - */ - public function willImplement($interface) - { - $this->lazyDouble->addInterface($interface); - - return $this; - } - - /** - * Sets constructor arguments. - * - * @param array $arguments - * - * @return $this - */ - public function willBeConstructedWith(array $arguments = null) - { - $this->lazyDouble->setArguments($arguments); - - return $this; - } - - /** - * Reveals double. - * - * @return object - * - * @throws \Prophecy\Exception\Prophecy\ObjectProphecyException If double doesn't implement needed interface - */ - public function reveal() - { - $double = $this->lazyDouble->getInstance(); - - if (null === $double || !$double instanceof ProphecySubjectInterface) { - throw new ObjectProphecyException( - "Generated double must implement ProphecySubjectInterface, but it does not.\n". - 'It seems you have wrongly configured doubler without required ClassPatch.', - $this - ); - } - - $double->setProphecy($this); - - return $double; - } - - /** - * Adds method prophecy to object prophecy. - * - * @param MethodProphecy $methodProphecy - * - * @throws \Prophecy\Exception\Prophecy\MethodProphecyException If method prophecy doesn't - * have arguments wildcard - */ - public function addMethodProphecy(MethodProphecy $methodProphecy) - { - $argumentsWildcard = $methodProphecy->getArgumentsWildcard(); - if (null === $argumentsWildcard) { - throw new MethodProphecyException(sprintf( - "Can not add prophecy for a method `%s::%s()`\n". - "as you did not specify arguments wildcard for it.", - get_class($this->reveal()), - $methodProphecy->getMethodName() - ), $methodProphecy); - } - - $methodName = $methodProphecy->getMethodName(); - - if (!isset($this->methodProphecies[$methodName])) { - $this->methodProphecies[$methodName] = array(); - } - - $this->methodProphecies[$methodName][] = $methodProphecy; - } - - /** - * Returns either all or related to single method prophecies. - * - * @param null|string $methodName - * - * @return MethodProphecy[] - */ - public function getMethodProphecies($methodName = null) - { - if (null === $methodName) { - return $this->methodProphecies; - } - - if (!isset($this->methodProphecies[$methodName])) { - return array(); - } - - return $this->methodProphecies[$methodName]; - } - - /** - * Makes specific method call. - * - * @param string $methodName - * @param array $arguments - * - * @return mixed - */ - public function makeProphecyMethodCall($methodName, array $arguments) - { - $arguments = $this->revealer->reveal($arguments); - $return = $this->callCenter->makeCall($this, $methodName, $arguments); - - return $this->revealer->reveal($return); - } - - /** - * Finds calls by method name & arguments wildcard. - * - * @param string $methodName - * @param ArgumentsWildcard $wildcard - * - * @return Call[] - */ - public function findProphecyMethodCalls($methodName, ArgumentsWildcard $wildcard) - { - return $this->callCenter->findCalls($methodName, $wildcard); - } - - /** - * Checks that registered method predictions do not fail. - * - * @throws \Prophecy\Exception\Prediction\AggregateException If any of registered predictions fail - */ - public function checkProphecyMethodsPredictions() - { - $exception = new AggregateException(sprintf("%s:\n", get_class($this->reveal()))); - $exception->setObjectProphecy($this); - - foreach ($this->methodProphecies as $prophecies) { - foreach ($prophecies as $prophecy) { - try { - $prophecy->checkPrediction(); - } catch (PredictionException $e) { - $exception->append($e); - } - } - } - - if (count($exception->getExceptions())) { - throw $exception; - } - } - - /** - * Creates new method prophecy using specified method name and arguments. - * - * @param string $methodName - * @param array $arguments - * - * @return MethodProphecy - */ - public function __call($methodName, array $arguments) - { - $arguments = new ArgumentsWildcard($this->revealer->reveal($arguments)); - - foreach ($this->getMethodProphecies($methodName) as $prophecy) { - $argumentsWildcard = $prophecy->getArgumentsWildcard(); - $comparator = $this->comparatorFactory->getComparatorFor( - $argumentsWildcard, $arguments - ); - - try { - $comparator->assertEquals($argumentsWildcard, $arguments); - return $prophecy; - } catch (ComparisonFailure $failure) {} - } - - return new MethodProphecy($this, $methodName, $arguments); - } - - /** - * Tries to get property value from double. - * - * @param string $name - */ - public function __get($name) - { - return $this->reveal()->$name; - } - - /** - * Tries to set property value to double. - * - * @param string $name - * @param string $value - */ - public function __set($name, $value) - { - $this->reveal()->$name = $this->revealer->reveal($value); - } -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Prophecy/ProphecyInterface.php b/core/vendor/phpspec/prophecy/src/Prophecy/Prophecy/ProphecyInterface.php deleted file mode 100644 index 462f15a..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Prophecy/ProphecyInterface.php +++ /dev/null @@ -1,27 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Prophecy; - -/** - * Core Prophecy interface. - * - * @author Konstantin Kudryashov - */ -interface ProphecyInterface -{ - /** - * Reveals prophecy object (double) . - * - * @return object - */ - public function reveal(); -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Prophecy/ProphecySubjectInterface.php b/core/vendor/phpspec/prophecy/src/Prophecy/Prophecy/ProphecySubjectInterface.php deleted file mode 100644 index 2d83958..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Prophecy/ProphecySubjectInterface.php +++ /dev/null @@ -1,34 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Prophecy; - -/** - * Controllable doubles interface. - * - * @author Konstantin Kudryashov - */ -interface ProphecySubjectInterface -{ - /** - * Sets subject prophecy. - * - * @param ProphecyInterface $prophecy - */ - public function setProphecy(ProphecyInterface $prophecy); - - /** - * Returns subject prophecy. - * - * @return ProphecyInterface - */ - public function getProphecy(); -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Prophecy/Revealer.php b/core/vendor/phpspec/prophecy/src/Prophecy/Prophecy/Revealer.php deleted file mode 100644 index 60ecdac..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Prophecy/Revealer.php +++ /dev/null @@ -1,44 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Prophecy; - -/** - * Basic prophecies revealer. - * - * @author Konstantin Kudryashov - */ -class Revealer implements RevealerInterface -{ - /** - * Unwraps value(s). - * - * @param mixed $value - * - * @return mixed - */ - public function reveal($value) - { - if (is_array($value)) { - return array_map(array($this, __FUNCTION__), $value); - } - - if (!is_object($value)) { - return $value; - } - - if ($value instanceof ProphecyInterface) { - $value = $value->reveal(); - } - - return $value; - } -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Prophecy/RevealerInterface.php b/core/vendor/phpspec/prophecy/src/Prophecy/Prophecy/RevealerInterface.php deleted file mode 100644 index ffc82bb..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Prophecy/RevealerInterface.php +++ /dev/null @@ -1,29 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Prophecy; - -/** - * Prophecies revealer interface. - * - * @author Konstantin Kudryashov - */ -interface RevealerInterface -{ - /** - * Unwraps value(s). - * - * @param mixed $value - * - * @return mixed - */ - public function reveal($value); -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Prophet.php b/core/vendor/phpspec/prophecy/src/Prophecy/Prophet.php deleted file mode 100644 index ac64923..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Prophet.php +++ /dev/null @@ -1,134 +0,0 @@ - - * 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\Doubler\Doubler; -use Prophecy\Doubler\LazyDouble; -use Prophecy\Doubler\ClassPatch; -use Prophecy\Prophecy\ObjectProphecy; -use Prophecy\Prophecy\RevealerInterface; -use Prophecy\Prophecy\Revealer; -use Prophecy\Call\CallCenter; -use Prophecy\Util\StringUtil; -use Prophecy\Exception\Prediction\PredictionException; -use Prophecy\Exception\Prediction\AggregateException; - -/** - * Prophet creates prophecies. - * - * @author Konstantin Kudryashov - */ -class Prophet -{ - private $doubler; - private $revealer; - private $util; - - /** - * @var ObjectProphecy[] - */ - private $prophecies = array(); - - /** - * Initializes Prophet. - * - * @param null|Doubler $doubler - * @param null|RevealerInterface $revealer - * @param null|StringUtil $util - */ - public function __construct(Doubler $doubler = null, RevealerInterface $revealer = null, - StringUtil $util = null) - { - if (null === $doubler) { - $doubler = new Doubler; - $doubler->registerClassPatch(new ClassPatch\SplFileInfoPatch); - $doubler->registerClassPatch(new ClassPatch\TraversablePatch); - $doubler->registerClassPatch(new ClassPatch\DisableConstructorPatch); - $doubler->registerClassPatch(new ClassPatch\ProphecySubjectPatch); - $doubler->registerClassPatch(new ClassPatch\ReflectionClassNewInstancePatch); - $doubler->registerClassPatch(new ClassPatch\HhvmExceptionPatch()); - $doubler->registerClassPatch(new ClassPatch\MagicCallPatch); - $doubler->registerClassPatch(new ClassPatch\KeywordPatch); - } - - $this->doubler = $doubler; - $this->revealer = $revealer ?: new Revealer; - $this->util = $util ?: new StringUtil; - } - - /** - * Creates new object prophecy. - * - * @param null|string $classOrInterface Class or interface name - * - * @return ObjectProphecy - */ - public function prophesize($classOrInterface = null) - { - $this->prophecies[] = $prophecy = new ObjectProphecy( - new LazyDouble($this->doubler), - new CallCenter($this->util), - $this->revealer - ); - - if ($classOrInterface && class_exists($classOrInterface)) { - return $prophecy->willExtend($classOrInterface); - } - - if ($classOrInterface && interface_exists($classOrInterface)) { - return $prophecy->willImplement($classOrInterface); - } - - return $prophecy; - } - - /** - * Returns all created object prophecies. - * - * @return ObjectProphecy[] - */ - public function getProphecies() - { - return $this->prophecies; - } - - /** - * Returns Doubler instance assigned to this Prophet. - * - * @return Doubler - */ - public function getDoubler() - { - return $this->doubler; - } - - /** - * Checks all predictions defined by prophecies of this Prophet. - * - * @throws Exception\Prediction\AggregateException If any prediction fails - */ - public function checkPredictions() - { - $exception = new AggregateException("Some predictions failed:\n"); - foreach ($this->prophecies as $prophecy) { - try { - $prophecy->checkProphecyMethodsPredictions(); - } catch (PredictionException $e) { - $exception->append($e); - } - } - - if (count($exception->getExceptions())) { - throw $exception; - } - } -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Util/ExportUtil.php b/core/vendor/phpspec/prophecy/src/Prophecy/Util/ExportUtil.php deleted file mode 100644 index 54d3832..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Util/ExportUtil.php +++ /dev/null @@ -1,185 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Exporting utility. - * - * This class is derived from the PHPUnit testing framework. - * - * @author Sebastiaan Stok - * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License> - */ -class ExportUtil -{ - /** - * Exports a value into a string. - * - * The output of this method is similar to the output of print_r(), but - * improved in various aspects: - * - * - NULL is rendered as "null" (instead of "") - * - true is rendered as "true" (instead of "1") - * - FALSE is rendered as "false" (instead of "") - * - Strings are always quoted with single quotes - * - Carriage returns and newlines are normalized to \n - * - Recursion and repeated rendering is treated properly - * - * @param mixed $value The value to export - * @param integer $indentation The indentation level of the 2nd+ line - * - * @return string - */ - public static function export($value, $indentation = 0) - { - return static::recursiveExport($value, $indentation); - } - - /** - * Converts an object to an array containing all of its private, protected - * and public properties. - * - * @param object $object - * - * @return array - */ - public static function toArray($object) - { - $array = array(); - - foreach ((array) $object as $key => $value) { - // properties are transformed to keys in the following way: - - // private $property => "\0Classname\0property" - // protected $property => "\0*\0property" - // public $property => "property" - - if (preg_match('/^\0.+\0(.+)$/', $key, $matches)) { - $key = $matches[1]; - } - - $array[$key] = $value; - } - - // Some internal classes like SplObjectStorage don't work with the - // above (fast) mechanism nor with reflection - // Format the output similarly to print_r() in this case - if ($object instanceof SplObjectStorage) { - foreach ($object as $key => $value) { - $array[spl_object_hash($value)] = array( - 'obj' => $value, - 'inf' => $object->getInfo(), - ); - } - } - - return $array; - } - - /** - * Recursive implementation of export. - * - * @param mixed $value The value to export - * @param integer $indentation The indentation level of the 2nd+ line - * @param array $processedObjects Contains all objects that were already - * rendered - * - * @return string - */ - protected static function recursiveExport($value, $indentation, &$processedObjects = array()) - { - if ($value === null) { - return 'null'; - } - - if ($value === true) { - return 'true'; - } - - if ($value === false) { - return 'false'; - } - - if (is_string($value)) { - // Match for most non printable chars somewhat taking multibyte chars into account - if (preg_match('/[^\x09-\x0d\x20-\xff]/', $value)) { - return 'Binary String: 0x' . bin2hex($value); - } - - return "'" . str_replace(array("\r\n", "\n\r", "\r"), array("\n", "\n", "\n"), $value) . "'"; - } - - $origValue = $value; - - if (is_object($value)) { - if ($value instanceof ProphecyInterface) { - return sprintf('%s Object (*Prophecy*)', get_class($value)); - } elseif (in_array($value, $processedObjects, true)) { - return sprintf('%s Object (*RECURSION*)', get_class($value)); - } - - $processedObjects[] = $value; - - // Convert object to array - $value = self::toArray($value); - } - - if (is_array($value)) { - $whitespace = str_repeat(' ', $indentation); - - // There seems to be no other way to check arrays for recursion - // http://www.php.net/manual/en/language.types.array.php#73936 - preg_match_all('/\n \[(\w+)\] => Array\s+\*RECURSION\*/', print_r($value, true), $matches); - $recursiveKeys = array_unique($matches[1]); - - // Convert to valid array keys - // Numeric integer strings are automatically converted to integers - // by PHP - foreach ($recursiveKeys as $key => $recursiveKey) { - if ((string) (integer) $recursiveKey === $recursiveKey) { - $recursiveKeys[$key] = (integer) $recursiveKey; - } - } - - $content = ''; - - foreach ($value as $key => $val) { - if (in_array($key, $recursiveKeys, true)) { - $val = 'Array (*RECURSION*)'; - } else { - $val = self::recursiveExport($val, $indentation + 1, $processedObjects); - } - - $content .= $whitespace . ' ' . self::export($key) . ' => ' . $val . "\n"; - } - - if (strlen($content) > 0) { - $content = "\n" . $content . $whitespace; - } - - return sprintf( - "%s (%s)", - is_object($origValue) ? sprintf('%s:%s', get_class($origValue), spl_object_hash($origValue)) . ' Object' : 'Array', $content - ); - } - - if (is_double($value) && (double)(integer) $value === $value) { - return $value . '.0'; - } - - return (string) $value; - } -} diff --git a/core/vendor/phpspec/prophecy/src/Prophecy/Util/StringUtil.php b/core/vendor/phpspec/prophecy/src/Prophecy/Util/StringUtil.php deleted file mode 100644 index bb90156..0000000 --- a/core/vendor/phpspec/prophecy/src/Prophecy/Util/StringUtil.php +++ /dev/null @@ -1,89 +0,0 @@ - - * Marcello Duarte - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Prophecy\Util; - -use Prophecy\Call\Call; - -/** - * String utility. - * - * @author Konstantin Kudryashov - */ -class StringUtil -{ - /** - * Stringifies any provided value. - * - * @param mixed $value - * @param boolean $exportObject - * - * @return string - */ - public function stringify($value, $exportObject = true) - { - if (is_array($value)) { - if (range(0, count($value) - 1) === array_keys($value)) { - return '['.implode(', ', array_map(array($this, __FUNCTION__), $value)).']'; - } - - $stringify = array($this, __FUNCTION__); - - return '['.implode(', ', array_map(function ($item, $key) use ($stringify) { - return (is_integer($key) ? $key : '"'.$key.'"'). - ' => '.call_user_func($stringify, $item); - }, $value, array_keys($value))).']'; - } - if (is_resource($value)) { - return get_resource_type($value).':'.$value; - } - if (is_object($value)) { - return $exportObject ? ExportUtil::export($value) : sprintf('%s:%s', get_class($value), spl_object_hash($value)); - } - if (true === $value || false === $value) { - return $value ? 'true' : 'false'; - } - if (is_string($value)) { - $str = sprintf('"%s"', str_replace("\n", '\\n', $value)); - - if (50 <= strlen($str)) { - return substr($str, 0, 50).'"...'; - } - - return $str; - } - if (null === $value) { - return 'null'; - } - - return (string) $value; - } - - /** - * Stringifies provided array of calls. - * - * @param Call[] $calls Array of Call instances - * - * @return string - */ - public function stringifyCalls(array $calls) - { - $self = $this; - - return implode(PHP_EOL, array_map(function (Call $call) use ($self) { - return sprintf(' - %s(%s) @ %s', - $call->getMethodName(), - implode(', ', array_map(array($self, 'stringify'), $call->getArguments())), - str_replace(GETCWD().DIRECTORY_SEPARATOR, '', $call->getCallPlace()) - ); - }, $calls)); - } -} diff --git a/core/vendor/phpunit/php-code-coverage/.gitattributes b/core/vendor/phpunit/php-code-coverage/.gitattributes deleted file mode 100644 index 461090b..0000000 --- a/core/vendor/phpunit/php-code-coverage/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.php diff=php diff --git a/core/vendor/phpunit/php-code-coverage/.gitignore b/core/vendor/phpunit/php-code-coverage/.gitignore deleted file mode 100644 index b386531..0000000 --- a/core/vendor/phpunit/php-code-coverage/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -build/api -build/code-browser -build/coverage -build/logs -build/pdepend -cache.properties -phpunit.xml -/vendor -/composer.lock -/composer.phar -/.idea diff --git a/core/vendor/phpunit/php-code-coverage/.travis.yml b/core/vendor/phpunit/php-code-coverage/.travis.yml deleted file mode 100644 index 5c23715..0000000 --- a/core/vendor/phpunit/php-code-coverage/.travis.yml +++ /dev/null @@ -1,20 +0,0 @@ -language: php - -php: - - 5.3.3 - - 5.3 - - 5.4 - - 5.5 - - 5.6 - -before_script: - - COMPOSER_ROOT_VERSION=dev-master composer install --dev --prefer-source - -script: vendor/bin/phpunit --configuration ./build/travis-ci.xml - -notifications: - email: false - irc: - channels: - - "irc.freenode.org#phpunit" - use_notice: true diff --git a/core/vendor/phpunit/php-code-coverage/CONTRIBUTING.md b/core/vendor/phpunit/php-code-coverage/CONTRIBUTING.md deleted file mode 100644 index 40dbc25..0000000 --- a/core/vendor/phpunit/php-code-coverage/CONTRIBUTING.md +++ /dev/null @@ -1,5 +0,0 @@ -Pull Requests for bug fixes should be made against the current release branch (2.0). - -Pull Requests for new features should be made against master. - -For further notes please refer to [https://github.com/sebastianbergmann/phpunit/blob/master/CONTRIBUTING.md](https://github.com/sebastianbergmann/phpunit/blob/master/CONTRIBUTING.md) diff --git a/core/vendor/phpunit/php-code-coverage/LICENSE b/core/vendor/phpunit/php-code-coverage/LICENSE deleted file mode 100644 index fcfa37e..0000000 --- a/core/vendor/phpunit/php-code-coverage/LICENSE +++ /dev/null @@ -1,33 +0,0 @@ -PHP_CodeCoverage - -Copyright (c) 2009-2015, Sebastian Bergmann . -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Sebastian Bergmann nor the names of his - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. diff --git a/core/vendor/phpunit/php-code-coverage/README.md b/core/vendor/phpunit/php-code-coverage/README.md deleted file mode 100644 index 6ca608a..0000000 --- a/core/vendor/phpunit/php-code-coverage/README.md +++ /dev/null @@ -1,40 +0,0 @@ -[![Latest Stable Version](https://poser.pugx.org/phpunit/php-code-coverage/v/stable.png)](https://packagist.org/packages/phpunit/php-code-coverage) -[![Build Status](https://travis-ci.org/sebastianbergmann/php-code-coverage.svg?branch=master)](https://travis-ci.org/sebastianbergmann/php-code-coverage) - -# PHP_CodeCoverage - -**PHP_CodeCoverage** is a library that provides collection, processing, and rendering functionality for PHP code coverage information. - -## Requirements - -* PHP 5.3.3 is required but using the latest version of PHP is highly recommended -* [Xdebug](http://xdebug.org/) 2.1.3 is required but using the latest version of Xdebug is highly recommended - -## Installation - -To add PHP_CodeCoverage as a local, per-project dependency to your project, simply add a dependency on `phpunit/php-code-coverage` to your project's `composer.json` file. Here is a minimal example of a `composer.json` file that just defines a dependency on PHP_CodeCoverage 2.0: - - { - "require": { - "phpunit/php-code-coverage": "~2.0" - } - } - -## Using the PHP_CodeCoverage API - -```php -start(''); - -// ... - -$coverage->stop(); - -$writer = new PHP_CodeCoverage_Report_Clover; -$writer->process($coverage, '/tmp/clover.xml'); - -$writer = new PHP_CodeCoverage_Report_HTML; -$writer->process($coverage, '/tmp/code-coverage-report'); -``` - diff --git a/core/vendor/phpunit/php-code-coverage/build.xml b/core/vendor/phpunit/php-code-coverage/build.xml deleted file mode 100644 index c335d15..0000000 --- a/core/vendor/phpunit/php-code-coverage/build.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/core/vendor/phpunit/php-code-coverage/build/travis-ci.xml b/core/vendor/phpunit/php-code-coverage/build/travis-ci.xml deleted file mode 100644 index 15e879fa..0000000 --- a/core/vendor/phpunit/php-code-coverage/build/travis-ci.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - ../tests/PHP - - - - - - - - - - ../src - - - diff --git a/core/vendor/phpunit/php-code-coverage/composer.json b/core/vendor/phpunit/php-code-coverage/composer.json deleted file mode 100644 index 23df5ba..0000000 --- a/core/vendor/phpunit/php-code-coverage/composer.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "phpunit/php-code-coverage", - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "type": "library", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "irc": "irc://irc.freenode.net/phpunit" - }, - "require": { - "php": ">=5.3.3", - "phpunit/php-file-iterator": "~1.3", - "phpunit/php-token-stream": "~1.3", - "phpunit/php-text-template": "~1.2", - "sebastian/environment": "~1.0", - "sebastian/version": "~1.0" - }, - "require-dev": { - "phpunit/phpunit": "~4", - "ext-xdebug": ">=2.1.4" - }, - "suggest": { - "ext-dom": "*", - "ext-xdebug": ">=2.2.1", - "ext-xmlwriter": "*" - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - } -} diff --git a/core/vendor/phpunit/php-code-coverage/phpunit.xml.dist b/core/vendor/phpunit/php-code-coverage/phpunit.xml.dist deleted file mode 100644 index f5fa606..0000000 --- a/core/vendor/phpunit/php-code-coverage/phpunit.xml.dist +++ /dev/null @@ -1,23 +0,0 @@ - - - - - tests/PHP - - - - - - - - - - - - src - - - - diff --git a/core/vendor/phpunit/php-code-coverage/scripts/auto_append.php b/core/vendor/phpunit/php-code-coverage/scripts/auto_append.php deleted file mode 100644 index 6cd768d..0000000 --- a/core/vendor/phpunit/php-code-coverage/scripts/auto_append.php +++ /dev/null @@ -1,5 +0,0 @@ -stop(); - -$writer = new PHP_CodeCoverage_Report_HTML; -$writer->process($coverage, '/tmp/coverage'); diff --git a/core/vendor/phpunit/php-code-coverage/scripts/auto_prepend.php b/core/vendor/phpunit/php-code-coverage/scripts/auto_prepend.php deleted file mode 100644 index 7a8887a..0000000 --- a/core/vendor/phpunit/php-code-coverage/scripts/auto_prepend.php +++ /dev/null @@ -1,10 +0,0 @@ -filter(); - -$filter->addFileToBlacklist(__FILE__); -$filter->addFileToBlacklist(dirname(__FILE__) . '/auto_append.php'); - -$coverage->start($_SERVER['SCRIPT_FILENAME']); diff --git a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage.php b/core/vendor/phpunit/php-code-coverage/src/CodeCoverage.php deleted file mode 100644 index 54f0f6a..0000000 --- a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage.php +++ /dev/null @@ -1,864 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use SebastianBergmann\Environment\Runtime; - -/** - * Provides collection functionality for PHP code coverage information. - * - * @category PHP - * @package CodeCoverage - * @author Sebastian Bergmann - * @copyright Sebastian Bergmann - * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License - * @link http://github.com/sebastianbergmann/php-code-coverage - * @since Class available since Release 1.0.0 - */ -class PHP_CodeCoverage -{ - /** - * @var PHP_CodeCoverage_Driver - */ - private $driver; - - /** - * @var PHP_CodeCoverage_Filter - */ - private $filter; - - /** - * @var boolean - */ - private $cacheTokens = false; - - /** - * @var boolean - */ - private $checkForUnintentionallyCoveredCode = false; - - /** - * @var boolean - */ - private $forceCoversAnnotation = false; - - /** - * @var boolean - */ - private $mapTestClassNameToCoveredClassName = false; - - /** - * @var boolean - */ - private $addUncoveredFilesFromWhitelist = true; - - /** - * @var boolean - */ - private $processUncoveredFilesFromWhitelist = false; - - /** - * @var mixed - */ - private $currentId; - - /** - * Code coverage data. - * - * @var array - */ - private $data = array(); - - /** - * @var array - */ - private $ignoredLines = array(); - - /** - * Test data. - * - * @var array - */ - private $tests = array(); - - /** - * Constructor. - * - * @param PHP_CodeCoverage_Driver $driver - * @param PHP_CodeCoverage_Filter $filter - * @throws PHP_CodeCoverage_Exception - */ - public function __construct(PHP_CodeCoverage_Driver $driver = null, PHP_CodeCoverage_Filter $filter = null) - { - if ($driver === null) { - $runtime = new Runtime; - - if ($runtime->isHHVM()) { - $driver = new PHP_CodeCoverage_Driver_HHVM; - } elseif ($runtime->hasXdebug()) { - $driver = new PHP_CodeCoverage_Driver_Xdebug; - } else { - throw new PHP_CodeCoverage_Exception('No code coverage driver available'); - } - } - - if ($filter === null) { - $filter = new PHP_CodeCoverage_Filter; - } - - $this->driver = $driver; - $this->filter = $filter; - } - - /** - * Returns the PHP_CodeCoverage_Report_Node_* object graph - * for this PHP_CodeCoverage object. - * - * @return PHP_CodeCoverage_Report_Node_Directory - * @since Method available since Release 1.1.0 - */ - public function getReport() - { - $factory = new PHP_CodeCoverage_Report_Factory; - - return $factory->create($this); - } - - /** - * Clears collected code coverage data. - */ - public function clear() - { - $this->currentId = null; - $this->data = array(); - $this->tests = array(); - } - - /** - * Returns the PHP_CodeCoverage_Filter used. - * - * @return PHP_CodeCoverage_Filter - */ - public function filter() - { - return $this->filter; - } - - /** - * Returns the collected code coverage data. - * Set $raw = true to bypass all filters. - * - * @param bool $raw - * @return array - * @since Method available since Release 1.1.0 - */ - public function getData($raw = false) - { - if (!$raw && $this->addUncoveredFilesFromWhitelist) { - $this->addUncoveredFilesFromWhitelist(); - } - - // We need to apply the blacklist filter a second time - // when no whitelist is used. - if (!$raw && !$this->filter->hasWhitelist()) { - $this->applyListsFilter($this->data); - } - - return $this->data; - } - - /** - * Sets the coverage data. - * - * @param array $data - * @since Method available since Release 2.0.0 - */ - public function setData(array $data) - { - $this->data = $data; - } - - /** - * Returns the test data. - * - * @return array - * @since Method available since Release 1.1.0 - */ - public function getTests() - { - return $this->tests; - } - - /** - * Sets the test data. - * - * @param array $tests - * @since Method available since Release 2.0.0 - */ - public function setTests(array $tests) - { - $this->tests = $tests; - } - - /** - * Start collection of code coverage information. - * - * @param mixed $id - * @param boolean $clear - * @throws PHP_CodeCoverage_Exception - */ - public function start($id, $clear = false) - { - if (!is_bool($clear)) { - throw PHP_CodeCoverage_Util_InvalidArgumentHelper::factory( - 1, - 'boolean' - ); - } - - if ($clear) { - $this->clear(); - } - - $this->currentId = $id; - - $this->driver->start(); - } - - /** - * Stop collection of code coverage information. - * - * @param boolean $append - * @param mixed $linesToBeCovered - * @param array $linesToBeUsed - * @return array - * @throws PHP_CodeCoverage_Exception - */ - public function stop($append = true, $linesToBeCovered = array(), array $linesToBeUsed = array()) - { - if (!is_bool($append)) { - throw PHP_CodeCoverage_Util_InvalidArgumentHelper::factory( - 1, - 'boolean' - ); - } - - if (!is_array($linesToBeCovered) && $linesToBeCovered !== false) { - throw PHP_CodeCoverage_Util_InvalidArgumentHelper::factory( - 2, - 'array or false' - ); - } - - $data = $this->driver->stop(); - $this->append($data, null, $append, $linesToBeCovered, $linesToBeUsed); - - $this->currentId = null; - - return $data; - } - - /** - * Appends code coverage data. - * - * @param array $data - * @param mixed $id - * @param boolean $append - * @param mixed $linesToBeCovered - * @param array $linesToBeUsed - * @throws PHP_CodeCoverage_Exception - */ - public function append(array $data, $id = null, $append = true, $linesToBeCovered = array(), array $linesToBeUsed = array()) - { - if ($id === null) { - $id = $this->currentId; - } - - if ($id === null) { - throw new PHP_CodeCoverage_Exception; - } - - $this->applyListsFilter($data); - $this->applyIgnoredLinesFilter($data); - $this->initializeFilesThatAreSeenTheFirstTime($data); - - if (!$append) { - return; - } - - if ($id != 'UNCOVERED_FILES_FROM_WHITELIST') { - $this->applyCoversAnnotationFilter( - $data, - $linesToBeCovered, - $linesToBeUsed - ); - } - - if (empty($data)) { - return; - } - - $status = null; - - if ($id instanceof PHPUnit_Framework_TestCase) { - $status = $id->getStatus(); - $id = get_class($id) . '::' . $id->getName(); - } elseif ($id instanceof PHPUnit_Extensions_PhptTestCase) { - $id = $id->getName(); - } - - $this->tests[$id] = $status; - - foreach ($data as $file => $lines) { - if (!$this->filter->isFile($file)) { - continue; - } - - foreach ($lines as $k => $v) { - if ($v == 1) { - $this->data[$file][$k][] = $id; - } - } - } - } - - /** - * Merges the data from another instance of PHP_CodeCoverage. - * - * @param PHP_CodeCoverage $that - */ - public function merge(PHP_CodeCoverage $that) - { - foreach ($that->getData() as $file => $lines) { - if (!isset($this->data[$file])) { - if (!$that->filter()->isFiltered($file)) { - $this->data[$file] = $lines; - } - - continue; - } - - foreach ($lines as $line => $data) { - if ($data !== null) { - if (!isset($this->data[$file][$line])) { - $this->data[$file][$line] = $data; - } else { - $this->data[$file][$line] = array_unique( - array_merge($this->data[$file][$line], $data) - ); - } - } - } - } - - $this->tests = array_merge($this->tests, $that->getTests()); - } - - /** - * @param boolean $flag - * @throws PHP_CodeCoverage_Exception - * @since Method available since Release 1.1.0 - */ - public function setCacheTokens($flag) - { - if (!is_bool($flag)) { - throw PHP_CodeCoverage_Util_InvalidArgumentHelper::factory( - 1, - 'boolean' - ); - } - - $this->cacheTokens = $flag; - } - - /** - * @since Method available since Release 1.1.0 - */ - public function getCacheTokens() - { - return $this->cacheTokens; - } - - /** - * @param boolean $flag - * @throws PHP_CodeCoverage_Exception - * @since Method available since Release 2.0.0 - */ - public function setCheckForUnintentionallyCoveredCode($flag) - { - if (!is_bool($flag)) { - throw PHP_CodeCoverage_Util_InvalidArgumentHelper::factory( - 1, - 'boolean' - ); - } - - $this->checkForUnintentionallyCoveredCode = $flag; - } - - /** - * @param boolean $flag - * @throws PHP_CodeCoverage_Exception - */ - public function setForceCoversAnnotation($flag) - { - if (!is_bool($flag)) { - throw PHP_CodeCoverage_Util_InvalidArgumentHelper::factory( - 1, - 'boolean' - ); - } - - $this->forceCoversAnnotation = $flag; - } - - /** - * @param boolean $flag - * @throws PHP_CodeCoverage_Exception - */ - public function setMapTestClassNameToCoveredClassName($flag) - { - if (!is_bool($flag)) { - throw PHP_CodeCoverage_Util_InvalidArgumentHelper::factory( - 1, - 'boolean' - ); - } - - $this->mapTestClassNameToCoveredClassName = $flag; - } - - /** - * @param boolean $flag - * @throws PHP_CodeCoverage_Exception - */ - public function setAddUncoveredFilesFromWhitelist($flag) - { - if (!is_bool($flag)) { - throw PHP_CodeCoverage_Util_InvalidArgumentHelper::factory( - 1, - 'boolean' - ); - } - - $this->addUncoveredFilesFromWhitelist = $flag; - } - - /** - * @param boolean $flag - * @throws PHP_CodeCoverage_Exception - */ - public function setProcessUncoveredFilesFromWhitelist($flag) - { - if (!is_bool($flag)) { - throw PHP_CodeCoverage_Util_InvalidArgumentHelper::factory( - 1, - 'boolean' - ); - } - - $this->processUncoveredFilesFromWhitelist = $flag; - } - - /** - * Applies the @covers annotation filtering. - * - * @param array $data - * @param mixed $linesToBeCovered - * @param array $linesToBeUsed - * @throws PHP_CodeCoverage_Exception_UnintentionallyCoveredCode - */ - private function applyCoversAnnotationFilter(array &$data, $linesToBeCovered, array $linesToBeUsed) - { - if ($linesToBeCovered === false || - ($this->forceCoversAnnotation && empty($linesToBeCovered))) { - $data = array(); - - return; - } - - if (empty($linesToBeCovered)) { - return; - } - - if ($this->checkForUnintentionallyCoveredCode) { - $this->performUnintentionallyCoveredCodeCheck( - $data, - $linesToBeCovered, - $linesToBeUsed - ); - } - - $data = array_intersect_key($data, $linesToBeCovered); - - foreach (array_keys($data) as $filename) { - $_linesToBeCovered = array_flip($linesToBeCovered[$filename]); - - $data[$filename] = array_intersect_key( - $data[$filename], - $_linesToBeCovered - ); - } - } - - /** - * Applies the blacklist/whitelist filtering. - * - * @param array $data - */ - private function applyListsFilter(array &$data) - { - foreach (array_keys($data) as $filename) { - if ($this->filter->isFiltered($filename)) { - unset($data[$filename]); - } - } - } - - /** - * Applies the "ignored lines" filtering. - * - * @param array $data - */ - private function applyIgnoredLinesFilter(array &$data) - { - foreach (array_keys($data) as $filename) { - if (!$this->filter->isFile($filename)) { - continue; - } - - foreach ($this->getLinesToBeIgnored($filename) as $line) { - unset($data[$filename][$line]); - } - } - } - - /** - * @param array $data - * @since Method available since Release 1.1.0 - */ - private function initializeFilesThatAreSeenTheFirstTime(array $data) - { - foreach ($data as $file => $lines) { - if ($this->filter->isFile($file) && !isset($this->data[$file])) { - $this->data[$file] = array(); - - foreach ($lines as $k => $v) { - $this->data[$file][$k] = $v == -2 ? null : array(); - } - } - } - } - - /** - * Processes whitelisted files that are not covered. - */ - private function addUncoveredFilesFromWhitelist() - { - $data = array(); - $uncoveredFiles = array_diff( - $this->filter->getWhitelist(), - array_keys($this->data) - ); - - foreach ($uncoveredFiles as $uncoveredFile) { - if (!file_exists($uncoveredFile)) { - continue; - } - - if ($this->processUncoveredFilesFromWhitelist) { - $this->processUncoveredFileFromWhitelist( - $uncoveredFile, - $data, - $uncoveredFiles - ); - } else { - $data[$uncoveredFile] = array(); - - $lines = count(file($uncoveredFile)); - - for ($i = 1; $i <= $lines; $i++) { - $data[$uncoveredFile][$i] = -1; - } - } - } - - $this->append($data, 'UNCOVERED_FILES_FROM_WHITELIST'); - } - - /** - * @param string $uncoveredFile - * @param array $data - * @param array $uncoveredFiles - */ - private function processUncoveredFileFromWhitelist($uncoveredFile, array &$data, array $uncoveredFiles) - { - $this->driver->start(); - include_once $uncoveredFile; - $coverage = $this->driver->stop(); - - foreach ($coverage as $file => $fileCoverage) { - if (!isset($data[$file]) && - in_array($file, $uncoveredFiles)) { - foreach (array_keys($fileCoverage) as $key) { - if ($fileCoverage[$key] == 1) { - $fileCoverage[$key] = -1; - } - } - - $data[$file] = $fileCoverage; - } - } - } - - /** - * Returns the lines of a source file that should be ignored. - * - * @param string $filename - * @return array - * @throws PHP_CodeCoverage_Exception - * @since Method available since Release 2.0.0 - */ - private function getLinesToBeIgnored($filename) - { - if (!is_string($filename)) { - throw PHP_CodeCoverage_Util_InvalidArgumentHelper::factory( - 1, - 'string' - ); - } - - if (!isset($this->ignoredLines[$filename])) { - $this->ignoredLines[$filename] = array(); - $ignore = false; - $stop = false; - $lines = file($filename); - $numLines = count($lines); - - foreach ($lines as $index => $line) { - if (!trim($line)) { - $this->ignoredLines[$filename][] = $index + 1; - } - } - - if ($this->cacheTokens) { - $tokens = PHP_Token_Stream_CachingFactory::get($filename); - } else { - $tokens = new PHP_Token_Stream($filename); - } - - $classes = array_merge($tokens->getClasses(), $tokens->getTraits()); - $tokens = $tokens->tokens(); - - foreach ($tokens as $token) { - switch (get_class($token)) { - case 'PHP_Token_COMMENT': - case 'PHP_Token_DOC_COMMENT': - $_token = trim($token); - $_line = trim($lines[$token->getLine() - 1]); - - if ($_token == '// @codeCoverageIgnore' || - $_token == '//@codeCoverageIgnore') { - $ignore = true; - $stop = true; - } elseif ($_token == '// @codeCoverageIgnoreStart' || - $_token == '//@codeCoverageIgnoreStart') { - $ignore = true; - } elseif ($_token == '// @codeCoverageIgnoreEnd' || - $_token == '//@codeCoverageIgnoreEnd') { - $stop = true; - } - - if (!$ignore) { - $start = $token->getLine(); - $end = $start + substr_count($token, "\n"); - - // Do not ignore the first line when there is a token - // before the comment - if (0 !== strpos($_token, $_line)) { - $start++; - } - - for ($i = $start; $i < $end; $i++) { - $this->ignoredLines[$filename][] = $i; - } - - // A DOC_COMMENT token or a COMMENT token starting with "/*" - // does not contain the final \n character in its text - if (0 === strpos($_token, '/*') && '*/' === substr(trim($lines[$i-1]), -2)) { - $this->ignoredLines[$filename][] = $i; - } - } - break; - - case 'PHP_Token_INTERFACE': - case 'PHP_Token_TRAIT': - case 'PHP_Token_CLASS': - case 'PHP_Token_FUNCTION': - $docblock = $token->getDocblock(); - - $this->ignoredLines[$filename][] = $token->getLine(); - - if (strpos($docblock, '@codeCoverageIgnore')) { - $endLine = $token->getEndLine(); - - for ($i = $token->getLine(); $i <= $endLine; $i++) { - $this->ignoredLines[$filename][] = $i; - } - } elseif ($token instanceof PHP_Token_INTERFACE || - $token instanceof PHP_Token_TRAIT || - $token instanceof PHP_Token_CLASS) { - if (empty($classes[$token->getName()]['methods'])) { - for ($i = $token->getLine(); - $i <= $token->getEndLine(); - $i++) { - $this->ignoredLines[$filename][] = $i; - } - } else { - $firstMethod = array_shift( - $classes[$token->getName()]['methods'] - ); - - do { - $lastMethod = array_pop( - $classes[$token->getName()]['methods'] - ); - } while ($lastMethod !== null && - substr($lastMethod['signature'], 0, 18) == 'anonymous function'); - - if ($lastMethod === null) { - $lastMethod = $firstMethod; - } - - for ($i = $token->getLine(); - $i < $firstMethod['startLine']; - $i++) { - $this->ignoredLines[$filename][] = $i; - } - - for ($i = $token->getEndLine(); - $i > $lastMethod['endLine']; - $i--) { - $this->ignoredLines[$filename][] = $i; - } - } - } - break; - - case 'PHP_Token_NAMESPACE': - $this->ignoredLines[$filename][] = $token->getEndLine(); - - // Intentional fallthrough - case 'PHP_Token_OPEN_TAG': - case 'PHP_Token_CLOSE_TAG': - case 'PHP_Token_USE': - $this->ignoredLines[$filename][] = $token->getLine(); - break; - } - - if ($ignore) { - $this->ignoredLines[$filename][] = $token->getLine(); - - if ($stop) { - $ignore = false; - $stop = false; - } - } - } - - $this->ignoredLines[$filename][] = $numLines + 1; - - $this->ignoredLines[$filename] = array_unique( - $this->ignoredLines[$filename] - ); - - sort($this->ignoredLines[$filename]); - } - - return $this->ignoredLines[$filename]; - } - - /** - * @param array $data - * @param array $linesToBeCovered - * @param array $linesToBeUsed - * @throws PHP_CodeCoverage_Exception_UnintentionallyCoveredCode - * @since Method available since Release 2.0.0 - */ - private function performUnintentionallyCoveredCodeCheck(array &$data, array $linesToBeCovered, array $linesToBeUsed) - { - $allowedLines = $this->getAllowedLines( - $linesToBeCovered, - $linesToBeUsed - ); - - $message = ''; - - foreach ($data as $file => $_data) { - foreach ($_data as $line => $flag) { - if ($flag == 1 && - (!isset($allowedLines[$file]) || - !isset($allowedLines[$file][$line]))) { - $message .= sprintf( - '- %s:%d' . PHP_EOL, - $file, - $line - ); - } - } - } - - if (!empty($message)) { - throw new PHP_CodeCoverage_Exception_UnintentionallyCoveredCode( - $message - ); - } - } - - /** - * @param array $linesToBeCovered - * @param array $linesToBeUsed - * @return array - * @since Method available since Release 2.0.0 - */ - private function getAllowedLines(array $linesToBeCovered, array $linesToBeUsed) - { - $allowedLines = array(); - - foreach (array_keys($linesToBeCovered) as $file) { - if (!isset($allowedLines[$file])) { - $allowedLines[$file] = array(); - } - - $allowedLines[$file] = array_merge( - $allowedLines[$file], - $linesToBeCovered[$file] - ); - } - - foreach (array_keys($linesToBeUsed) as $file) { - if (!isset($allowedLines[$file])) { - $allowedLines[$file] = array(); - } - - $allowedLines[$file] = array_merge( - $allowedLines[$file], - $linesToBeUsed[$file] - ); - } - - foreach (array_keys($allowedLines) as $file) { - $allowedLines[$file] = array_flip( - array_unique($allowedLines[$file]) - ); - } - - return $allowedLines; - } -} diff --git a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Driver.php b/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Driver.php deleted file mode 100644 index fd2ead8..0000000 --- a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Driver.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Interface for code coverage drivers. - * - * @category PHP - * @package CodeCoverage - * @author Sebastian Bergmann - * @copyright Sebastian Bergmann - * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License - * @link http://github.com/sebastianbergmann/php-code-coverage - * @since Class available since Release 1.0.0 - */ -interface PHP_CodeCoverage_Driver -{ - /** - * Start collection of code coverage information. - */ - public function start(); - - /** - * Stop collection of code coverage information. - * - * @return array - */ - public function stop(); -} diff --git a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Driver/HHVM.php b/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Driver/HHVM.php deleted file mode 100644 index 324a99f..0000000 --- a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Driver/HHVM.php +++ /dev/null @@ -1,56 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Driver for HHVM's code coverage functionality. - * - * @category PHP - * @package CodeCoverage - * @author Sebastian Bergmann - * @copyright Sebastian Bergmann - * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License - * @link http://github.com/sebastianbergmann/php-code-coverage - * @since Class available since Release 1.3.0 - * @codeCoverageIgnore - */ -class PHP_CodeCoverage_Driver_HHVM implements PHP_CodeCoverage_Driver -{ - /** - * Constructor. - */ - public function __construct() - { - if (!defined('HHVM_VERSION')) { - throw new PHP_CodeCoverage_Exception('This driver requires HHVM'); - } - } - - /** - * Start collection of code coverage information. - */ - public function start() - { - fb_enable_code_coverage(); - } - - /** - * Stop collection of code coverage information. - * - * @return array - */ - public function stop() - { - $codeCoverage = fb_get_code_coverage(true); - - fb_disable_code_coverage(); - - return $codeCoverage; - } -} diff --git a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Driver/Xdebug.php b/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Driver/Xdebug.php deleted file mode 100644 index 3b33188..0000000 --- a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Driver/Xdebug.php +++ /dev/null @@ -1,105 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Driver for Xdebug's code coverage functionality. - * - * @category PHP - * @package CodeCoverage - * @author Sebastian Bergmann - * @copyright Sebastian Bergmann - * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License - * @link http://github.com/sebastianbergmann/php-code-coverage - * @since Class available since Release 1.0.0 - * @codeCoverageIgnore - */ -class PHP_CodeCoverage_Driver_Xdebug implements PHP_CodeCoverage_Driver -{ - /** - * Constructor. - */ - public function __construct() - { - if (!extension_loaded('xdebug')) { - throw new PHP_CodeCoverage_Exception('This driver requires Xdebug'); - } - - if (version_compare(phpversion('xdebug'), '2.2.0-dev', '>=') && - !ini_get('xdebug.coverage_enable')) { - throw new PHP_CodeCoverage_Exception( - 'xdebug.coverage_enable=On has to be set in php.ini' - ); - } - } - - /** - * Start collection of code coverage information. - */ - public function start() - { - xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE); - } - - /** - * Stop collection of code coverage information. - * - * @return array - */ - public function stop() - { - $data = xdebug_get_code_coverage(); - xdebug_stop_code_coverage(); - - return $this->cleanup($data); - } - - /** - * @param array $data - * @return array - * @since Method available since Release 2.0.0 - */ - private function cleanup(array $data) - { - foreach (array_keys($data) as $file) { - if (isset($data[$file][0])) { - unset($data[$file][0]); - } - - if (file_exists($file)) { - $numLines = $this->getNumberOfLinesInFile($file); - - foreach (array_keys($data[$file]) as $line) { - if (isset($data[$file][$line]) && $line > $numLines) { - unset($data[$file][$line]); - } - } - } - } - - return $data; - } - - /** - * @param string $file - * @return integer - * @since Method available since Release 2.0.0 - */ - private function getNumberOfLinesInFile($file) - { - $buffer = file_get_contents($file); - $lines = substr_count($buffer, "\n"); - - if (substr($buffer, -1) !== "\n") { - $lines++; - } - - return $lines; - } -} diff --git a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Exception.php b/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Exception.php deleted file mode 100644 index a960c08..0000000 --- a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Exception.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Exception class for PHP_CodeCoverage component. - * - * @category PHP - * @package CodeCoverage - * @author Sebastian Bergmann - * @copyright Sebastian Bergmann - * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License - * @link http://github.com/sebastianbergmann/php-code-coverage - * @since Class available since Release 1.1.0 - */ -class PHP_CodeCoverage_Exception extends RuntimeException -{ -} diff --git a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Exception/UnintentionallyCoveredCode.php b/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Exception/UnintentionallyCoveredCode.php deleted file mode 100644 index 7f09503..0000000 --- a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Exception/UnintentionallyCoveredCode.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Exception that is raised when code is unintentionally covered. - * - * @category PHP - * @package CodeCoverage - * @author Sebastian Bergmann - * @copyright Sebastian Bergmann - * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License - * @link http://github.com/sebastianbergmann/php-code-coverage - * @since Class available since Release 2.0.0 - */ -class PHP_CodeCoverage_Exception_UnintentionallyCoveredCode extends PHP_CodeCoverage_Exception -{ -} diff --git a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Filter.php b/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Filter.php deleted file mode 100644 index fce8461..0000000 --- a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Filter.php +++ /dev/null @@ -1,376 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Filter for blacklisting and whitelisting of code coverage information. - * - * @category PHP - * @package CodeCoverage - * @author Sebastian Bergmann - * @copyright Sebastian Bergmann - * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License - * @link http://github.com/sebastianbergmann/php-code-coverage - * @since Class available since Release 1.0.0 - */ -class PHP_CodeCoverage_Filter -{ - /** - * Source files that are blacklisted. - * - * @var array - */ - private $blacklistedFiles = array(); - - /** - * Source files that are whitelisted. - * - * @var array - */ - private $whitelistedFiles = array(); - - /** - * @var boolean - */ - private $blacklistPrefilled = false; - - /** - * A list of classes which are always blacklisted - * - * @var array - */ - public static $blacklistClassNames = array( - 'File_Iterator' => 1, - 'PHP_CodeCoverage' => 1, - 'PHP_Invoker' => 1, - 'PHP_Timer' => 1, - 'PHP_Token' => 1, - 'PHPUnit_Framework_TestCase' => 2, - 'PHPUnit_Extensions_Database_TestCase' => 2, - 'PHPUnit_Framework_MockObject_Generator' => 2, - 'PHPUnit_Extensions_SeleniumTestCase' => 2, - 'PHPUnit_Extensions_Story_TestCase' => 2, - 'Text_Template' => 1, - 'Symfony\Component\Yaml\Yaml' => 1, - 'SebastianBergmann\Diff\Diff' => 1, - 'SebastianBergmann\Environment\Runtime' => 1, - 'SebastianBergmann\Comparator\Comparator' => 1, - 'SebastianBergmann\Exporter\Exporter' => 1, - 'SebastianBergmann\GlobalState\Snapshot' => 1, - 'SebastianBergmann\RecursionContext\Context' => 1, - 'SebastianBergmann\Version' => 1, - 'Composer\Autoload\ClassLoader' => 1, - 'Doctrine\Instantiator\Instantiator' => 1, - 'phpDocumentor\Reflection\DocBlock' => 1, - 'Prophecy\Prophet' => 1 - ); - - /** - * Adds a directory to the blacklist (recursively). - * - * @param string $directory - * @param string $suffix - * @param string $prefix - */ - public function addDirectoryToBlacklist($directory, $suffix = '.php', $prefix = '') - { - $facade = new File_Iterator_Facade; - $files = $facade->getFilesAsArray($directory, $suffix, $prefix); - - foreach ($files as $file) { - $this->addFileToBlacklist($file); - } - } - - /** - * Adds a file to the blacklist. - * - * @param string $filename - */ - public function addFileToBlacklist($filename) - { - $this->blacklistedFiles[realpath($filename)] = true; - } - - /** - * Adds files to the blacklist. - * - * @param array $files - */ - public function addFilesToBlacklist(array $files) - { - foreach ($files as $file) { - $this->addFileToBlacklist($file); - } - } - - /** - * Removes a directory from the blacklist (recursively). - * - * @param string $directory - * @param string $suffix - * @param string $prefix - */ - public function removeDirectoryFromBlacklist($directory, $suffix = '.php', $prefix = '') - { - $facade = new File_Iterator_Facade; - $files = $facade->getFilesAsArray($directory, $suffix, $prefix); - - foreach ($files as $file) { - $this->removeFileFromBlacklist($file); - } - } - - /** - * Removes a file from the blacklist. - * - * @param string $filename - */ - public function removeFileFromBlacklist($filename) - { - $filename = realpath($filename); - - if (isset($this->blacklistedFiles[$filename])) { - unset($this->blacklistedFiles[$filename]); - } - } - - /** - * Adds a directory to the whitelist (recursively). - * - * @param string $directory - * @param string $suffix - * @param string $prefix - */ - public function addDirectoryToWhitelist($directory, $suffix = '.php', $prefix = '') - { - $facade = new File_Iterator_Facade; - $files = $facade->getFilesAsArray($directory, $suffix, $prefix); - - foreach ($files as $file) { - $this->addFileToWhitelist($file); - } - } - - /** - * Adds a file to the whitelist. - * - * @param string $filename - */ - public function addFileToWhitelist($filename) - { - $this->whitelistedFiles[realpath($filename)] = true; - } - - /** - * Adds files to the whitelist. - * - * @param array $files - */ - public function addFilesToWhitelist(array $files) - { - foreach ($files as $file) { - $this->addFileToWhitelist($file); - } - } - - /** - * Removes a directory from the whitelist (recursively). - * - * @param string $directory - * @param string $suffix - * @param string $prefix - */ - public function removeDirectoryFromWhitelist($directory, $suffix = '.php', $prefix = '') - { - $facade = new File_Iterator_Facade; - $files = $facade->getFilesAsArray($directory, $suffix, $prefix); - - foreach ($files as $file) { - $this->removeFileFromWhitelist($file); - } - } - - /** - * Removes a file from the whitelist. - * - * @param string $filename - */ - public function removeFileFromWhitelist($filename) - { - $filename = realpath($filename); - - if (isset($this->whitelistedFiles[$filename])) { - unset($this->whitelistedFiles[$filename]); - } - } - - /** - * Checks whether a filename is a real filename. - * - * @param string $filename - */ - public function isFile($filename) - { - if ($filename == '-' || - strpos($filename, 'vfs://') === 0 || - strpos($filename, 'xdebug://debug-eval') !== false || - strpos($filename, 'eval()\'d code') !== false || - strpos($filename, 'runtime-created function') !== false || - strpos($filename, 'runkit created function') !== false || - strpos($filename, 'assert code') !== false || - strpos($filename, 'regexp code') !== false) { - return false; - } - - return file_exists($filename); - } - - /** - * Checks whether or not a file is filtered. - * - * When the whitelist is empty (default), blacklisting is used. - * When the whitelist is not empty, whitelisting is used. - * - * @param string $filename - * @param boolean $ignoreWhitelist - * @return boolean - * @throws PHP_CodeCoverage_Exception - */ - public function isFiltered($filename) - { - if (!$this->isFile($filename)) { - return true; - } - - $filename = realpath($filename); - - if (!empty($this->whitelistedFiles)) { - return !isset($this->whitelistedFiles[$filename]); - } - - if (!$this->blacklistPrefilled) { - $this->prefillBlacklist(); - } - - return isset($this->blacklistedFiles[$filename]); - } - - /** - * Returns the list of blacklisted files. - * - * @return array - */ - public function getBlacklist() - { - return array_keys($this->blacklistedFiles); - } - - /** - * Returns the list of whitelisted files. - * - * @return array - */ - public function getWhitelist() - { - return array_keys($this->whitelistedFiles); - } - - /** - * Returns whether this filter has a whitelist. - * - * @return boolean - * @since Method available since Release 1.1.0 - */ - public function hasWhitelist() - { - return !empty($this->whitelistedFiles); - } - - /** - * @since Method available since Release 1.2.3 - */ - private function prefillBlacklist() - { - if (defined('__PHPUNIT_PHAR__')) { - $this->addFileToBlacklist(__PHPUNIT_PHAR__); - } - - foreach (self::$blacklistClassNames as $className => $parent) { - $this->addDirectoryContainingClassToBlacklist($className, $parent); - } - - $this->blacklistPrefilled = true; - } - - /** - * @param string $className - * @param integer $parent - * @since Method available since Release 1.2.3 - */ - private function addDirectoryContainingClassToBlacklist($className, $parent = 1) - { - if (!class_exists($className)) { - return; - } - - $reflector = new ReflectionClass($className); - $directory = $reflector->getFileName(); - - for ($i = 0; $i < $parent; $i++) { - $directory = dirname($directory); - } - - $this->addDirectoryToBlacklist($directory); - } - - /** - * Returns the blacklisted files. - * - * @return array - * @since Method available since Release 2.0.0 - */ - public function getBlacklistedFiles() - { - return $this->blacklistedFiles; - } - - /** - * Sets the blacklisted files. - * - * @param array $blacklistedFiles - * @since Method available since Release 2.0.0 - */ - public function setBlacklistedFiles($blacklistedFiles) - { - $this->blacklistedFiles = $blacklistedFiles; - } - - /** - * Returns the whitelisted files. - * - * @return array - * @since Method available since Release 2.0.0 - */ - public function getWhitelistedFiles() - { - return $this->whitelistedFiles; - } - - /** - * Sets the whitelisted files. - * - * @param array $whitelistedFiles - * @since Method available since Release 2.0.0 - */ - public function setWhitelistedFiles($whitelistedFiles) - { - $this->whitelistedFiles = $whitelistedFiles; - } -} diff --git a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/Clover.php b/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/Clover.php deleted file mode 100644 index c29e175..0000000 --- a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/Clover.php +++ /dev/null @@ -1,290 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Generates a Clover XML logfile from an PHP_CodeCoverage object. - * - * @category PHP - * @package CodeCoverage - * @author Sebastian Bergmann - * @copyright Sebastian Bergmann - * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License - * @link http://github.com/sebastianbergmann/php-code-coverage - * @since Class available since Release 1.0.0 - */ -class PHP_CodeCoverage_Report_Clover -{ - /** - * @param PHP_CodeCoverage $coverage - * @param string $target - * @param string $name - * @return string - */ - public function process(PHP_CodeCoverage $coverage, $target = null, $name = null) - { - $xmlDocument = new DOMDocument('1.0', 'UTF-8'); - $xmlDocument->formatOutput = true; - - $xmlCoverage = $xmlDocument->createElement('coverage'); - $xmlCoverage->setAttribute('generated', (int) $_SERVER['REQUEST_TIME']); - $xmlDocument->appendChild($xmlCoverage); - - $xmlProject = $xmlDocument->createElement('project'); - $xmlProject->setAttribute('timestamp', (int) $_SERVER['REQUEST_TIME']); - - if (is_string($name)) { - $xmlProject->setAttribute('name', $name); - } - - $xmlCoverage->appendChild($xmlProject); - - $packages = array(); - $report = $coverage->getReport(); - unset($coverage); - - foreach ($report as $item) { - $namespace = 'global'; - - if (!$item instanceof PHP_CodeCoverage_Report_Node_File) { - continue; - } - - $xmlFile = $xmlDocument->createElement('file'); - $xmlFile->setAttribute('name', $item->getPath()); - - $classes = $item->getClassesAndTraits(); - $coverage = $item->getCoverageData(); - $lines = array(); - - foreach ($classes as $className => $class) { - $classStatements = 0; - $coveredClassStatements = 0; - $coveredMethods = 0; - $classMethods = 0; - - foreach ($class['methods'] as $methodName => $method) { - if ($method['executableLines'] == 0) { - continue; - } - - $classMethods++; - $classStatements += $method['executableLines']; - $coveredClassStatements += $method['executedLines']; - if ($method['coverage'] == 100) { - $coveredMethods++; - } - - $methodCount = 0; - for ($i = $method['startLine']; - $i <= $method['endLine']; - $i++) { - if (isset($coverage[$i]) && ($coverage[$i] !== null)) { - $methodCount = max($methodCount, count($coverage[$i])); - } - } - - $lines[$method['startLine']] = array( - 'count' => $methodCount, - 'crap' => $method['crap'], - 'type' => 'method', - 'name' => $methodName - ); - } - - if (!empty($class['package']['namespace'])) { - $namespace = $class['package']['namespace']; - } - - $xmlClass = $xmlDocument->createElement('class'); - $xmlClass->setAttribute('name', $className); - $xmlClass->setAttribute('namespace', $namespace); - - if (!empty($class['package']['fullPackage'])) { - $xmlClass->setAttribute( - 'fullPackage', - $class['package']['fullPackage'] - ); - } - - if (!empty($class['package']['category'])) { - $xmlClass->setAttribute( - 'category', - $class['package']['category'] - ); - } - - if (!empty($class['package']['package'])) { - $xmlClass->setAttribute( - 'package', - $class['package']['package'] - ); - } - - if (!empty($class['package']['subpackage'])) { - $xmlClass->setAttribute( - 'subpackage', - $class['package']['subpackage'] - ); - } - - $xmlFile->appendChild($xmlClass); - - $xmlMetrics = $xmlDocument->createElement('metrics'); - $xmlMetrics->setAttribute('methods', $classMethods); - $xmlMetrics->setAttribute('coveredmethods', $coveredMethods); - $xmlMetrics->setAttribute('conditionals', 0); - $xmlMetrics->setAttribute('coveredconditionals', 0); - $xmlMetrics->setAttribute('statements', $classStatements); - $xmlMetrics->setAttribute( - 'coveredstatements', - $coveredClassStatements - ); - $xmlMetrics->setAttribute( - 'elements', - $classMethods + - $classStatements - /* + conditionals */ - ); - $xmlMetrics->setAttribute( - 'coveredelements', - $coveredMethods + - $coveredClassStatements - /* + coveredconditionals */ - ); - $xmlClass->appendChild($xmlMetrics); - } - - foreach ($coverage as $line => $data) { - if ($data === null || isset($lines[$line])) { - continue; - } - - $lines[$line] = array( - 'count' => count($data), 'type' => 'stmt' - ); - } - - ksort($lines); - - foreach ($lines as $line => $data) { - $xmlLine = $xmlDocument->createElement('line'); - $xmlLine->setAttribute('num', $line); - $xmlLine->setAttribute('type', $data['type']); - - if (isset($data['name'])) { - $xmlLine->setAttribute('name', $data['name']); - } - - if (isset($data['crap'])) { - $xmlLine->setAttribute('crap', $data['crap']); - } - - $xmlLine->setAttribute('count', $data['count']); - $xmlFile->appendChild($xmlLine); - } - - $linesOfCode = $item->getLinesOfCode(); - - $xmlMetrics = $xmlDocument->createElement('metrics'); - $xmlMetrics->setAttribute('loc', $linesOfCode['loc']); - $xmlMetrics->setAttribute('ncloc', $linesOfCode['ncloc']); - $xmlMetrics->setAttribute('classes', $item->getNumClassesAndTraits()); - $xmlMetrics->setAttribute('methods', $item->getNumMethods()); - $xmlMetrics->setAttribute( - 'coveredmethods', - $item->getNumTestedMethods() - ); - $xmlMetrics->setAttribute('conditionals', 0); - $xmlMetrics->setAttribute('coveredconditionals', 0); - $xmlMetrics->setAttribute( - 'statements', - $item->getNumExecutableLines() - ); - $xmlMetrics->setAttribute( - 'coveredstatements', - $item->getNumExecutedLines() - ); - $xmlMetrics->setAttribute( - 'elements', - $item->getNumMethods() + $item->getNumExecutableLines() - /* + conditionals */ - ); - $xmlMetrics->setAttribute( - 'coveredelements', - $item->getNumTestedMethods() + $item->getNumExecutedLines() - /* + coveredconditionals */ - ); - $xmlFile->appendChild($xmlMetrics); - - if ($namespace == 'global') { - $xmlProject->appendChild($xmlFile); - } else { - if (!isset($packages[$namespace])) { - $packages[$namespace] = $xmlDocument->createElement( - 'package' - ); - - $packages[$namespace]->setAttribute('name', $namespace); - $xmlProject->appendChild($packages[$namespace]); - } - - $packages[$namespace]->appendChild($xmlFile); - } - } - - $linesOfCode = $report->getLinesOfCode(); - - $xmlMetrics = $xmlDocument->createElement('metrics'); - $xmlMetrics->setAttribute('files', count($report)); - $xmlMetrics->setAttribute('loc', $linesOfCode['loc']); - $xmlMetrics->setAttribute('ncloc', $linesOfCode['ncloc']); - $xmlMetrics->setAttribute( - 'classes', - $report->getNumClassesAndTraits() - ); - $xmlMetrics->setAttribute('methods', $report->getNumMethods()); - $xmlMetrics->setAttribute( - 'coveredmethods', - $report->getNumTestedMethods() - ); - $xmlMetrics->setAttribute('conditionals', 0); - $xmlMetrics->setAttribute('coveredconditionals', 0); - $xmlMetrics->setAttribute( - 'statements', - $report->getNumExecutableLines() - ); - $xmlMetrics->setAttribute( - 'coveredstatements', - $report->getNumExecutedLines() - ); - $xmlMetrics->setAttribute( - 'elements', - $report->getNumMethods() + $report->getNumExecutableLines() - /* + conditionals */ - ); - $xmlMetrics->setAttribute( - 'coveredelements', - $report->getNumTestedMethods() + $report->getNumExecutedLines() - /* + coveredconditionals */ - ); - - $xmlProject->appendChild($xmlMetrics); - - if ($target !== null) { - if (!is_dir(dirname($target))) { - mkdir(dirname($target), 0777, true); - } - - return $xmlDocument->save($target); - } else { - return $xmlDocument->saveXML(); - } - } -} diff --git a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/Crap4j.php b/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/Crap4j.php deleted file mode 100644 index 8e1f11a..0000000 --- a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/Crap4j.php +++ /dev/null @@ -1,134 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @category PHP - * @package CodeCoverage - * @author Zsolt Takács - * @copyright Sebastian Bergmann - * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License - * @link http://github.com/sebastianbergmann/php-code-coverage - * @since Class available since Release 2.0.0 - */ -class PHP_CodeCoverage_Report_Crap4j -{ - private $threshold = 30; - - /** - * @param PHP_CodeCoverage $coverage - * @param string $target - * @param string $name - * @return string - */ - public function process(PHP_CodeCoverage $coverage, $target = null, $name = null) - { - $document = new DOMDocument('1.0', 'UTF-8'); - $document->formatOutput = true; - - $root = $document->createElement('crap_result'); - $document->appendChild($root); - - $project = $document->createElement('project', is_string($name) ? $name : ''); - $root->appendChild($project); - $root->appendChild($document->createElement('timestamp', date('Y-m-d H:i:s', (int) $_SERVER['REQUEST_TIME']))); - - $stats = $document->createElement('stats'); - $methodsNode = $document->createElement('methods'); - - $report = $coverage->getReport(); - unset($coverage); - - $fullMethodCount = 0; - $fullCrapMethodCount = 0; - $fullCrapLoad = 0; - $fullCrap = 0; - - foreach ($report as $item) { - $namespace = 'global'; - - if (!$item instanceof PHP_CodeCoverage_Report_Node_File) { - continue; - } - - $file = $document->createElement('file'); - $file->setAttribute('name', $item->getPath()); - - $classes = $item->getClassesAndTraits(); - - foreach ($classes as $className => $class) { - foreach ($class['methods'] as $methodName => $method) { - $crapLoad = $this->getCrapLoad($method['crap'], $method['ccn'], $method['coverage']); - - $fullCrap += $method['crap']; - $fullCrapLoad += $crapLoad; - $fullMethodCount++; - - if ($method['crap'] >= $this->threshold) { - $fullCrapMethodCount++; - } - - $methodNode = $document->createElement('method'); - - if (!empty($class['package']['namespace'])) { - $namespace = $class['package']['namespace']; - } - - $methodNode->appendChild($document->createElement('package', $namespace)); - $methodNode->appendChild($document->createElement('className', $className)); - $methodNode->appendChild($document->createElement('methodName', $methodName)); - $methodNode->appendChild($document->createElement('methodSignature', htmlspecialchars($method['signature']))); - $methodNode->appendChild($document->createElement('fullMethod', htmlspecialchars($method['signature']))); - $methodNode->appendChild($document->createElement('crap', $this->roundValue($method['crap']))); - $methodNode->appendChild($document->createElement('complexity', $method['ccn'])); - $methodNode->appendChild($document->createElement('coverage', $this->roundValue($method['coverage']))); - $methodNode->appendChild($document->createElement('crapLoad', round($crapLoad))); - - $methodsNode->appendChild($methodNode); - } - } - } - - $stats->appendChild($document->createElement('name', 'Method Crap Stats')); - $stats->appendChild($document->createElement('methodCount', $fullMethodCount)); - $stats->appendChild($document->createElement('crapMethodCount', $fullCrapMethodCount)); - $stats->appendChild($document->createElement('crapLoad', round($fullCrapLoad))); - $stats->appendChild($document->createElement('totalCrap', $fullCrap)); - $stats->appendChild($document->createElement('crapMethodPercent', $this->roundValue(100 * $fullCrapMethodCount / $fullMethodCount))); - - $root->appendChild($stats); - $root->appendChild($methodsNode); - - if ($target !== null) { - if (!is_dir(dirname($target))) { - mkdir(dirname($target), 0777, true); - } - - return $document->save($target); - } else { - return $document->saveXML(); - } - } - - private function getCrapLoad($crapValue, $cyclomaticComplexity, $coveragePercent) - { - $crapLoad = 0; - if ($crapValue >= $this->threshold) { - $crapLoad += $cyclomaticComplexity * (1.0 - $coveragePercent / 100); - $crapLoad += $cyclomaticComplexity / $this->threshold; - } - - return $crapLoad; - } - - private function roundValue($value) - { - return round($value, 2); - } -} diff --git a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/Factory.php b/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/Factory.php deleted file mode 100644 index b9bffdf..0000000 --- a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/Factory.php +++ /dev/null @@ -1,248 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Factory for PHP_CodeCoverage_Report_Node_* object graphs. - * - * @category PHP - * @package CodeCoverage - * @author Sebastian Bergmann - * @copyright Sebastian Bergmann - * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License - * @link http://github.com/sebastianbergmann/php-code-coverage - * @since Class available since Release 1.1.0 - */ -class PHP_CodeCoverage_Report_Factory -{ - /** - * @param PHP_CodeCoverage $coverage - * @return PHP_CodeCoverage_Report_Node_Directory - */ - public function create(PHP_CodeCoverage $coverage) - { - $files = $coverage->getData(); - $commonPath = $this->reducePaths($files); - $root = new PHP_CodeCoverage_Report_Node_Directory( - $commonPath, - null - ); - - $this->addItems( - $root, - $this->buildDirectoryStructure($files), - $coverage->getTests(), - $coverage->getCacheTokens() - ); - - return $root; - } - - /** - * @param PHP_CodeCoverage_Report_Node_Directory $root - * @param array $items - * @param array $tests - * @param boolean $cacheTokens - */ - private function addItems(PHP_CodeCoverage_Report_Node_Directory $root, array $items, array $tests, $cacheTokens) - { - foreach ($items as $key => $value) { - if (substr($key, -2) == '/f') { - $key = substr($key, 0, -2); - - if (file_exists($root->getPath() . DIRECTORY_SEPARATOR . $key)) { - $root->addFile($key, $value, $tests, $cacheTokens); - } - } else { - $child = $root->addDirectory($key); - $this->addItems($child, $value, $tests, $cacheTokens); - } - } - } - - /** - * Builds an array representation of the directory structure. - * - * For instance, - * - * - * Array - * ( - * [Money.php] => Array - * ( - * ... - * ) - * - * [MoneyBag.php] => Array - * ( - * ... - * ) - * ) - * - * - * is transformed into - * - * - * Array - * ( - * [.] => Array - * ( - * [Money.php] => Array - * ( - * ... - * ) - * - * [MoneyBag.php] => Array - * ( - * ... - * ) - * ) - * ) - * - * - * @param array $files - * @return array - */ - private function buildDirectoryStructure($files) - { - $result = array(); - - foreach ($files as $path => $file) { - $path = explode('/', $path); - $pointer = &$result; - $max = count($path); - - for ($i = 0; $i < $max; $i++) { - if ($i == ($max - 1)) { - $type = '/f'; - } else { - $type = ''; - } - - $pointer = &$pointer[$path[$i] . $type]; - } - - $pointer = $file; - } - - return $result; - } - - /** - * Reduces the paths by cutting the longest common start path. - * - * For instance, - * - * - * Array - * ( - * [/home/sb/Money/Money.php] => Array - * ( - * ... - * ) - * - * [/home/sb/Money/MoneyBag.php] => Array - * ( - * ... - * ) - * ) - * - * - * is reduced to - * - * - * Array - * ( - * [Money.php] => Array - * ( - * ... - * ) - * - * [MoneyBag.php] => Array - * ( - * ... - * ) - * ) - * - * - * @param array $files - * @return string - */ - private function reducePaths(&$files) - { - if (empty($files)) { - return '.'; - } - - $commonPath = ''; - $paths = array_keys($files); - - if (count($files) == 1) { - $commonPath = dirname($paths[0]) . '/'; - $files[basename($paths[0])] = $files[$paths[0]]; - - unset($files[$paths[0]]); - - return $commonPath; - } - - $max = count($paths); - - for ($i = 0; $i < $max; $i++) { - // strip phar:// prefixes - if (strpos($paths[$i], 'phar://') === 0) { - $paths[$i] = substr($paths[$i], 7); - $paths[$i] = strtr($paths[$i], '/', DIRECTORY_SEPARATOR); - } - $paths[$i] = explode(DIRECTORY_SEPARATOR, $paths[$i]); - - if (empty($paths[$i][0])) { - $paths[$i][0] = DIRECTORY_SEPARATOR; - } - } - - $done = false; - $max = count($paths); - - while (!$done) { - for ($i = 0; $i < $max - 1; $i++) { - if (!isset($paths[$i][0]) || - !isset($paths[$i+1][0]) || - $paths[$i][0] != $paths[$i+1][0]) { - $done = true; - break; - } - } - - if (!$done) { - $commonPath .= $paths[0][0]; - - if ($paths[0][0] != DIRECTORY_SEPARATOR) { - $commonPath .= DIRECTORY_SEPARATOR; - } - - for ($i = 0; $i < $max; $i++) { - array_shift($paths[$i]); - } - } - } - - $original = array_keys($files); - $max = count($original); - - for ($i = 0; $i < $max; $i++) { - $files[join('/', $paths[$i])] = $files[$original[$i]]; - unset($files[$original[$i]]); - } - - ksort($files); - - return substr($commonPath, 0, -1); - } -} diff --git a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML.php b/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML.php deleted file mode 100644 index c67db46..0000000 --- a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML.php +++ /dev/null @@ -1,188 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Generates an HTML report from an PHP_CodeCoverage object. - * - * @category PHP - * @package CodeCoverage - * @author Sebastian Bergmann - * @copyright Sebastian Bergmann - * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License - * @link http://github.com/sebastianbergmann/php-code-coverage - * @since Class available since Release 1.0.0 - */ -class PHP_CodeCoverage_Report_HTML -{ - /** - * @var string - */ - private $templatePath; - - /** - * @var string - */ - private $generator; - - /** - * @var integer - */ - private $lowUpperBound; - - /** - * @var integer - */ - private $highLowerBound; - - /** - * Constructor. - * - * @param integer $lowUpperBound - * @param integer $highLowerBound - * @param string $generator - */ - public function __construct($lowUpperBound = 50, $highLowerBound = 90, $generator = '') - { - $this->generator = $generator; - $this->highLowerBound = $highLowerBound; - $this->lowUpperBound = $lowUpperBound; - - $this->templatePath = sprintf( - '%s%sHTML%sRenderer%sTemplate%s', - dirname(__FILE__), - DIRECTORY_SEPARATOR, - DIRECTORY_SEPARATOR, - DIRECTORY_SEPARATOR, - DIRECTORY_SEPARATOR - ); - } - - /** - * @param PHP_CodeCoverage $coverage - * @param string $target - */ - public function process(PHP_CodeCoverage $coverage, $target) - { - $target = $this->getDirectory($target); - $report = $coverage->getReport(); - unset($coverage); - - if (!isset($_SERVER['REQUEST_TIME'])) { - $_SERVER['REQUEST_TIME'] = time(); - } - - $date = date('D M j G:i:s T Y', $_SERVER['REQUEST_TIME']); - - $dashboard = new PHP_CodeCoverage_Report_HTML_Renderer_Dashboard( - $this->templatePath, - $this->generator, - $date, - $this->lowUpperBound, - $this->highLowerBound - ); - - $directory = new PHP_CodeCoverage_Report_HTML_Renderer_Directory( - $this->templatePath, - $this->generator, - $date, - $this->lowUpperBound, - $this->highLowerBound - ); - - $file = new PHP_CodeCoverage_Report_HTML_Renderer_File( - $this->templatePath, - $this->generator, - $date, - $this->lowUpperBound, - $this->highLowerBound - ); - - $directory->render($report, $target . 'index.html'); - $dashboard->render($report, $target . 'dashboard.html'); - - foreach ($report as $node) { - $id = $node->getId(); - - if ($node instanceof PHP_CodeCoverage_Report_Node_Directory) { - if (!file_exists($target . $id)) { - mkdir($target . $id, 0777, true); - } - - $directory->render($node, $target . $id . '/index.html'); - $dashboard->render($node, $target . $id . '/dashboard.html'); - } else { - $dir = dirname($target . $id); - - if (!file_exists($dir)) { - mkdir($dir, 0777, true); - } - - $file->render($node, $target . $id . '.html'); - } - } - - $this->copyFiles($target); - } - - /** - * @param string $target - */ - private function copyFiles($target) - { - $dir = $this->getDirectory($target . 'css'); - copy($this->templatePath . 'css/bootstrap.min.css', $dir . 'bootstrap.min.css'); - copy($this->templatePath . 'css/nv.d3.css', $dir . 'nv.d3.css'); - copy($this->templatePath . 'css/style.css', $dir . 'style.css'); - - $dir = $this->getDirectory($target . 'fonts'); - copy($this->templatePath . 'fonts/glyphicons-halflings-regular.eot', $dir . 'glyphicons-halflings-regular.eot'); - copy($this->templatePath . 'fonts/glyphicons-halflings-regular.svg', $dir . 'glyphicons-halflings-regular.svg'); - copy($this->templatePath . 'fonts/glyphicons-halflings-regular.ttf', $dir . 'glyphicons-halflings-regular.ttf'); - copy($this->templatePath . 'fonts/glyphicons-halflings-regular.woff', $dir . 'glyphicons-halflings-regular.woff'); - copy($this->templatePath . 'fonts/glyphicons-halflings-regular.woff2', $dir . 'glyphicons-halflings-regular.woff2'); - - $dir = $this->getDirectory($target . 'js'); - copy($this->templatePath . 'js/bootstrap.min.js', $dir . 'bootstrap.min.js'); - copy($this->templatePath . 'js/d3.min.js', $dir . 'd3.min.js'); - copy($this->templatePath . 'js/holder.js', $dir . 'holder.js'); - copy($this->templatePath . 'js/html5shiv.min.js', $dir . 'html5shiv.min.js'); - copy($this->templatePath . 'js/jquery.min.js', $dir . 'jquery.min.js'); - copy($this->templatePath . 'js/nv.d3.min.js', $dir . 'nv.d3.min.js'); - copy($this->templatePath . 'js/respond.min.js', $dir . 'respond.min.js'); - } - - /** - * @param string $directory - * @return string - * @throws PHP_CodeCoverage_Exception - * @since Method available since Release 1.2.0 - */ - private function getDirectory($directory) - { - if (substr($directory, -1, 1) != DIRECTORY_SEPARATOR) { - $directory .= DIRECTORY_SEPARATOR; - } - - if (is_dir($directory)) { - return $directory; - } - - if (@mkdir($directory, 0777, true)) { - return $directory; - } - - throw new PHP_CodeCoverage_Exception( - sprintf( - 'Directory "%s" does not exist.', - $directory - ) - ); - } -} diff --git a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer.php b/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer.php deleted file mode 100644 index 2b35f68..0000000 --- a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer.php +++ /dev/null @@ -1,274 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use SebastianBergmann\Environment\Runtime; - -/** - * Base class for PHP_CodeCoverage_Report_Node renderers. - * - * @category PHP - * @package CodeCoverage - * @author Sebastian Bergmann - * @copyright Sebastian Bergmann - * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License - * @link http://github.com/sebastianbergmann/php-code-coverage - * @since Class available since Release 1.1.0 - */ -abstract class PHP_CodeCoverage_Report_HTML_Renderer -{ - /** - * @var string - */ - protected $templatePath; - - /** - * @var string - */ - protected $generator; - - /** - * @var string - */ - protected $date; - - /** - * @var integer - */ - protected $lowUpperBound; - - /** - * @var integer - */ - protected $highLowerBound; - - /** - * @var string - */ - protected $version; - - /** - * Constructor. - * - * @param string $templatePath - * @param string $generator - * @param string $date - * @param integer $lowUpperBound - * @param integer $highLowerBound - */ - public function __construct($templatePath, $generator, $date, $lowUpperBound, $highLowerBound) - { - $version = new SebastianBergmann\Version('2.0.16', dirname(dirname(dirname(dirname(__DIR__))))); - - $this->templatePath = $templatePath; - $this->generator = $generator; - $this->date = $date; - $this->lowUpperBound = $lowUpperBound; - $this->highLowerBound = $highLowerBound; - $this->version = $version->getVersion(); - } - - /** - * @param Text_Template $template - * @param array $data - * @return string - */ - protected function renderItemTemplate(Text_Template $template, array $data) - { - $numSeperator = ' / '; - $classesBar = ' '; - $classesLevel = 'None'; - $classesNumber = ' '; - - if (isset($data['numClasses']) && $data['numClasses'] > 0) { - $classesLevel = $this->getColorLevel($data['testedClassesPercent']); - - $classesNumber = $data['numTestedClasses'] . $numSeperator . - $data['numClasses']; - - $classesBar = $this->getCoverageBar( - $data['testedClassesPercent'] - ); - } - - $methodsBar = ' '; - $methodsLevel = 'None'; - $methodsNumber = ' '; - - if ($data['numMethods'] > 0) { - $methodsLevel = $this->getColorLevel($data['testedMethodsPercent']); - - $methodsNumber = $data['numTestedMethods'] . $numSeperator . - $data['numMethods']; - - $methodsBar = $this->getCoverageBar( - $data['testedMethodsPercent'] - ); - } - - $linesBar = ' '; - $linesLevel = 'None'; - $linesNumber = ' '; - - if ($data['numExecutableLines'] > 0) { - $linesLevel = $this->getColorLevel($data['linesExecutedPercent']); - - $linesNumber = $data['numExecutedLines'] . $numSeperator . - $data['numExecutableLines']; - - $linesBar = $this->getCoverageBar( - $data['linesExecutedPercent'] - ); - } - - $template->setVar( - array( - 'icon' => isset($data['icon']) ? $data['icon'] : '', - 'crap' => isset($data['crap']) ? $data['crap'] : '', - 'name' => $data['name'], - 'lines_bar' => $linesBar, - 'lines_executed_percent' => $data['linesExecutedPercentAsString'], - 'lines_level' => $linesLevel, - 'lines_number' => $linesNumber, - 'methods_bar' => $methodsBar, - 'methods_tested_percent' => $data['testedMethodsPercentAsString'], - 'methods_level' => $methodsLevel, - 'methods_number' => $methodsNumber, - 'classes_bar' => $classesBar, - 'classes_tested_percent' => isset($data['testedClassesPercentAsString']) ? $data['testedClassesPercentAsString'] : '', - 'classes_level' => $classesLevel, - 'classes_number' => $classesNumber - ) - ); - - return $template->render(); - } - - /** - * @param Text_Template $template - * @param PHP_CodeCoverage_Report_Node $node - */ - protected function setCommonTemplateVariables(Text_Template $template, PHP_CodeCoverage_Report_Node $node) - { - $runtime = new Runtime; - - $template->setVar( - array( - 'id' => $node->getId(), - 'full_path' => $node->getPath(), - 'path_to_root' => $this->getPathToRoot($node), - 'breadcrumbs' => $this->getBreadcrumbs($node), - 'date' => $this->date, - 'version' => $this->version, - 'runtime_name' => $runtime->getName(), - 'runtime_version' => $runtime->getVersion(), - 'runtime_link' => $runtime->getVendorUrl(), - 'generator' => $this->generator, - 'low_upper_bound' => $this->lowUpperBound, - 'high_lower_bound' => $this->highLowerBound - ) - ); - } - - protected function getBreadcrumbs(PHP_CodeCoverage_Report_Node $node) - { - $breadcrumbs = ''; - $path = $node->getPathAsArray(); - $pathToRoot = array(); - $max = count($path); - - if ($node instanceof PHP_CodeCoverage_Report_Node_File) { - $max--; - } - - for ($i = 0; $i < $max; $i++) { - $pathToRoot[] = str_repeat('../', $i); - } - - foreach ($path as $step) { - if ($step !== $node) { - $breadcrumbs .= $this->getInactiveBreadcrumb( - $step, - array_pop($pathToRoot) - ); - } else { - $breadcrumbs .= $this->getActiveBreadcrumb($step); - } - } - - return $breadcrumbs; - } - - protected function getActiveBreadcrumb(PHP_CodeCoverage_Report_Node $node) - { - $buffer = sprintf( - '
  • %s
  • ' . "\n", - $node->getName() - ); - - if ($node instanceof PHP_CodeCoverage_Report_Node_Directory) { - $buffer .= '
  • (Dashboard)
  • ' . "\n"; - } - - return $buffer; - } - - protected function getInactiveBreadcrumb(PHP_CodeCoverage_Report_Node $node, $pathToRoot) - { - return sprintf( - '
  • %s
  • ' . "\n", - $pathToRoot, - $node->getName() - ); - } - - protected function getPathToRoot(PHP_CodeCoverage_Report_Node $node) - { - $id = $node->getId(); - $depth = substr_count($id, '/'); - - if ($id != 'index' && - $node instanceof PHP_CodeCoverage_Report_Node_Directory) { - $depth++; - } - - return str_repeat('../', $depth); - } - - protected function getCoverageBar($percent) - { - $level = $this->getColorLevel($percent); - - $template = new Text_Template( - $this->templatePath . 'coverage_bar.html', - '{{', - '}}' - ); - - $template->setVar(array('level' => $level, 'percent' => sprintf("%.2F", $percent))); - - return $template->render(); - } - - /** - * @param integer $percent - * @return string - */ - protected function getColorLevel($percent) - { - if ($percent < $this->lowUpperBound) { - return 'danger'; - } elseif ($percent >= $this->lowUpperBound && - $percent < $this->highLowerBound) { - return 'warning'; - } else { - return 'success'; - } - } -} diff --git a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Dashboard.php b/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Dashboard.php deleted file mode 100644 index deac0b7..0000000 --- a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Dashboard.php +++ /dev/null @@ -1,301 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Renders the dashboard for a PHP_CodeCoverage_Report_Node_Directory node. - * - * @category PHP - * @package CodeCoverage - * @author Sebastian Bergmann - * @copyright Sebastian Bergmann - * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License - * @link http://github.com/sebastianbergmann/php-code-coverage - * @since Class available since Release 1.1.0 - */ -class PHP_CodeCoverage_Report_HTML_Renderer_Dashboard extends PHP_CodeCoverage_Report_HTML_Renderer -{ - /** - * @param PHP_CodeCoverage_Report_Node_Directory $node - * @param string $file - */ - public function render(PHP_CodeCoverage_Report_Node_Directory $node, $file) - { - $classes = $node->getClassesAndTraits(); - $template = new Text_Template( - $this->templatePath . 'dashboard.html', - '{{', - '}}' - ); - - $this->setCommonTemplateVariables($template, $node); - - $baseLink = $node->getId() . '/'; - $complexity = $this->complexity($classes, $baseLink); - $coverageDistribution = $this->coverageDistribution($classes); - $insufficientCoverage = $this->insufficientCoverage($classes, $baseLink); - $projectRisks = $this->projectRisks($classes, $baseLink); - - $template->setVar( - array( - 'insufficient_coverage_classes' => $insufficientCoverage['class'], - 'insufficient_coverage_methods' => $insufficientCoverage['method'], - 'project_risks_classes' => $projectRisks['class'], - 'project_risks_methods' => $projectRisks['method'], - 'complexity_class' => $complexity['class'], - 'complexity_method' => $complexity['method'], - 'class_coverage_distribution' => $coverageDistribution['class'], - 'method_coverage_distribution' => $coverageDistribution['method'] - ) - ); - - $template->renderTo($file); - } - - /** - * Returns the data for the Class/Method Complexity charts. - * - * @param array $classes - * @param string $baseLink - * @return array - */ - protected function complexity(array $classes, $baseLink) - { - $result = array('class' => array(), 'method' => array()); - - foreach ($classes as $className => $class) { - foreach ($class['methods'] as $methodName => $method) { - if ($className != '*') { - $methodName = $className . '::' . $methodName; - } - - $result['method'][] = array( - $method['coverage'], - $method['ccn'], - sprintf( - '%s', - str_replace($baseLink, '', $method['link']), - $methodName - ) - ); - } - - $result['class'][] = array( - $class['coverage'], - $class['ccn'], - sprintf( - '%s', - str_replace($baseLink, '', $class['link']), - $className - ) - ); - } - - return array( - 'class' => json_encode($result['class']), - 'method' => json_encode($result['method']) - ); - } - - /** - * Returns the data for the Class / Method Coverage Distribution chart. - * - * @param array $classes - * @return array - */ - protected function coverageDistribution(array $classes) - { - $result = array( - 'class' => array( - '0%' => 0, - '0-10%' => 0, - '10-20%' => 0, - '20-30%' => 0, - '30-40%' => 0, - '40-50%' => 0, - '50-60%' => 0, - '60-70%' => 0, - '70-80%' => 0, - '80-90%' => 0, - '90-100%' => 0, - '100%' => 0 - ), - 'method' => array( - '0%' => 0, - '0-10%' => 0, - '10-20%' => 0, - '20-30%' => 0, - '30-40%' => 0, - '40-50%' => 0, - '50-60%' => 0, - '60-70%' => 0, - '70-80%' => 0, - '80-90%' => 0, - '90-100%' => 0, - '100%' => 0 - ) - ); - - foreach ($classes as $class) { - foreach ($class['methods'] as $methodName => $method) { - if ($method['coverage'] == 0) { - $result['method']['0%']++; - } elseif ($method['coverage'] == 100) { - $result['method']['100%']++; - } else { - $key = floor($method['coverage'] / 10) * 10; - $key = $key . '-' . ($key + 10) . '%'; - $result['method'][$key]++; - } - } - - if ($class['coverage'] == 0) { - $result['class']['0%']++; - } elseif ($class['coverage'] == 100) { - $result['class']['100%']++; - } else { - $key = floor($class['coverage'] / 10) * 10; - $key = $key . '-' . ($key + 10) . '%'; - $result['class'][$key]++; - } - } - - return array( - 'class' => json_encode(array_values($result['class'])), - 'method' => json_encode(array_values($result['method'])) - ); - } - - /** - * Returns the classes / methods with insufficient coverage. - * - * @param array $classes - * @param string $baseLink - * @return array - */ - protected function insufficientCoverage(array $classes, $baseLink) - { - $leastTestedClasses = array(); - $leastTestedMethods = array(); - $result = array('class' => '', 'method' => ''); - - foreach ($classes as $className => $class) { - foreach ($class['methods'] as $methodName => $method) { - if ($method['coverage'] < $this->highLowerBound) { - if ($className != '*') { - $key = $className . '::' . $methodName; - } else { - $key = $methodName; - } - - $leastTestedMethods[$key] = $method['coverage']; - } - } - - if ($class['coverage'] < $this->highLowerBound) { - $leastTestedClasses[$className] = $class['coverage']; - } - } - - asort($leastTestedClasses); - asort($leastTestedMethods); - - foreach ($leastTestedClasses as $className => $coverage) { - $result['class'] .= sprintf( - ' %s%d%%' . "\n", - str_replace($baseLink, '', $classes[$className]['link']), - $className, - $coverage - ); - } - - foreach ($leastTestedMethods as $methodName => $coverage) { - list($class, $method) = explode('::', $methodName); - - $result['method'] .= sprintf( - ' %s%d%%' . "\n", - str_replace($baseLink, '', $classes[$class]['methods'][$method]['link']), - $methodName, - $method, - $coverage - ); - } - - return $result; - } - - /** - * Returns the project risks according to the CRAP index. - * - * @param array $classes - * @param string $baseLink - * @return array - */ - protected function projectRisks(array $classes, $baseLink) - { - $classRisks = array(); - $methodRisks = array(); - $result = array('class' => '', 'method' => ''); - - foreach ($classes as $className => $class) { - foreach ($class['methods'] as $methodName => $method) { - if ($method['coverage'] < $this->highLowerBound && - $method['ccn'] > 1) { - if ($className != '*') { - $key = $className . '::' . $methodName; - } else { - $key = $methodName; - } - - $methodRisks[$key] = $method['crap']; - } - } - - if ($class['coverage'] < $this->highLowerBound && - $class['ccn'] > count($class['methods'])) { - $classRisks[$className] = $class['crap']; - } - } - - arsort($classRisks); - arsort($methodRisks); - - foreach ($classRisks as $className => $crap) { - $result['class'] .= sprintf( - ' %s%d' . "\n", - str_replace($baseLink, '', $classes[$className]['link']), - $className, - $crap - ); - } - - foreach ($methodRisks as $methodName => $crap) { - list($class, $method) = explode('::', $methodName); - - $result['method'] .= sprintf( - ' %s%d' . "\n", - str_replace($baseLink, '', $classes[$class]['methods'][$method]['link']), - $methodName, - $method, - $crap - ); - } - - return $result; - } - - protected function getActiveBreadcrumb(PHP_CodeCoverage_Report_Node $node) - { - return sprintf( - '
  • %s
  • ' . "\n" . - '
  • (Dashboard)
  • ' . "\n", - $node->getName() - ); - } -} diff --git a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Directory.php b/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Directory.php deleted file mode 100644 index 1e21d26..0000000 --- a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Directory.php +++ /dev/null @@ -1,103 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * Renders a PHP_CodeCoverage_Report_Node_Directory node. - * - * @category PHP - * @package CodeCoverage - * @author Sebastian Bergmann - * @copyright Sebastian Bergmann - * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License - * @link http://github.com/sebastianbergmann/php-code-coverage - * @since Class available since Release 1.1.0 - */ -class PHP_CodeCoverage_Report_HTML_Renderer_Directory extends PHP_CodeCoverage_Report_HTML_Renderer -{ - /** - * @param PHP_CodeCoverage_Report_Node_Directory $node - * @param string $file - */ - public function render(PHP_CodeCoverage_Report_Node_Directory $node, $file) - { - $template = new Text_Template($this->templatePath . 'directory.html', '{{', '}}'); - - $this->setCommonTemplateVariables($template, $node); - - $items = $this->renderItem($node, true); - - foreach ($node->getDirectories() as $item) { - $items .= $this->renderItem($item); - } - - foreach ($node->getFiles() as $item) { - $items .= $this->renderItem($item); - } - - $template->setVar( - array( - 'id' => $node->getId(), - 'items' => $items - ) - ); - - $template->renderTo($file); - } - - /** - * @param PHP_CodeCoverage_Report_Node $item - * @param boolean $total - * @return string - */ - protected function renderItem(PHP_CodeCoverage_Report_Node $item, $total = false) - { - $data = array( - 'numClasses' => $item->getNumClassesAndTraits(), - 'numTestedClasses' => $item->getNumTestedClassesAndTraits(), - 'numMethods' => $item->getNumMethods(), - 'numTestedMethods' => $item->getNumTestedMethods(), - 'linesExecutedPercent' => $item->getLineExecutedPercent(false), - 'linesExecutedPercentAsString' => $item->getLineExecutedPercent(), - 'numExecutedLines' => $item->getNumExecutedLines(), - 'numExecutableLines' => $item->getNumExecutableLines(), - 'testedMethodsPercent' => $item->getTestedMethodsPercent(false), - 'testedMethodsPercentAsString' => $item->getTestedMethodsPercent(), - 'testedClassesPercent' => $item->getTestedClassesAndTraitsPercent(false), - 'testedClassesPercentAsString' => $item->getTestedClassesAndTraitsPercent() - ); - - if ($total) { - $data['name'] = 'Total'; - } else { - if ($item instanceof PHP_CodeCoverage_Report_Node_Directory) { - $data['name'] = sprintf( - '%s', - $item->getName(), - $item->getName() - ); - - $data['icon'] = ' '; - } else { - $data['name'] = sprintf( - '%s', - $item->getName(), - $item->getName() - ); - - $data['icon'] = ' '; - } - } - - return $this->renderItemTemplate( - new Text_Template($this->templatePath . 'directory_item.html', '{{', '}}'), - $data - ); - } -} diff --git a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/File.php b/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/File.php deleted file mode 100644 index 907a39f..0000000 --- a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/File.php +++ /dev/null @@ -1,540 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -// @codeCoverageIgnoreStart -if (!defined('T_TRAIT')) { - define('T_TRAIT', 1001); -} - -if (!defined('T_INSTEADOF')) { - define('T_INSTEADOF', 1002); -} - -if (!defined('T_CALLABLE')) { - define('T_CALLABLE', 1003); -} - -if (!defined('T_FINALLY')) { - define('T_FINALLY', 1004); -} - -if (!defined('T_YIELD')) { - define('T_YIELD', 1005); -} -// @codeCoverageIgnoreEnd - -/** - * Renders a PHP_CodeCoverage_Report_Node_File node. - * - * @category PHP - * @package CodeCoverage - * @author Sebastian Bergmann - * @copyright Sebastian Bergmann - * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License - * @link http://github.com/sebastianbergmann/php-code-coverage - * @since Class available since Release 1.1.0 - */ -class PHP_CodeCoverage_Report_HTML_Renderer_File extends PHP_CodeCoverage_Report_HTML_Renderer -{ - /** - * Constructor. - * - * @param string $templatePath - * @param string $generator - * @param string $date - * @param integer $lowUpperBound - * @param integer $highLowerBound - */ - public function __construct($templatePath, $generator, $date, $lowUpperBound, $highLowerBound) - { - parent::__construct( - $templatePath, - $generator, - $date, - $lowUpperBound, - $highLowerBound - ); - } - - /** - * @param PHP_CodeCoverage_Report_Node_File $node - * @param string $file - */ - public function render(PHP_CodeCoverage_Report_Node_File $node, $file) - { - $template = new Text_Template($this->templatePath . 'file.html', '{{', '}}'); - - $template->setVar( - array( - 'items' => $this->renderItems($node), - 'lines' => $this->renderSource($node) - ) - ); - - $this->setCommonTemplateVariables($template, $node); - - $template->renderTo($file); - } - - /** - * @param PHP_CodeCoverage_Report_Node_File $node - * @return string - */ - protected function renderItems(PHP_CodeCoverage_Report_Node_File $node) - { - $template = new Text_Template($this->templatePath . 'file_item.html', '{{', '}}'); - - $methodItemTemplate = new Text_Template( - $this->templatePath . 'method_item.html', '{{', '}}' - ); - - $items = $this->renderItemTemplate( - $template, - array( - 'name' => 'Total', - 'numClasses' => $node->getNumClassesAndTraits(), - 'numTestedClasses' => $node->getNumTestedClassesAndTraits(), - 'numMethods' => $node->getNumMethods(), - 'numTestedMethods' => $node->getNumTestedMethods(), - 'linesExecutedPercent' => $node->getLineExecutedPercent(false), - 'linesExecutedPercentAsString' => $node->getLineExecutedPercent(), - 'numExecutedLines' => $node->getNumExecutedLines(), - 'numExecutableLines' => $node->getNumExecutableLines(), - 'testedMethodsPercent' => $node->getTestedMethodsPercent(false), - 'testedMethodsPercentAsString' => $node->getTestedMethodsPercent(), - 'testedClassesPercent' => $node->getTestedClassesAndTraitsPercent(false), - 'testedClassesPercentAsString' => $node->getTestedClassesAndTraitsPercent(), - 'crap' => 'CRAP' - ) - ); - - $items .= $this->renderFunctionItems( - $node->getFunctions(), - $methodItemTemplate - ); - - $items .= $this->renderTraitOrClassItems( - $node->getTraits(), - $template, - $methodItemTemplate - ); - - $items .= $this->renderTraitOrClassItems( - $node->getClasses(), - $template, - $methodItemTemplate - ); - - return $items; - } - - /** - * @param array $items - * @param Text_Template $template - * @param Text_Template $methodItemTemplate - * @return string - */ - protected function renderTraitOrClassItems(array $items, Text_Template $template, Text_Template $methodItemTemplate) - { - if (empty($items)) { - return ''; - } - - $buffer = ''; - - foreach ($items as $name => $item) { - $numMethods = count($item['methods']); - $numTestedMethods = 0; - - foreach ($item['methods'] as $method) { - if ($method['executedLines'] == $method['executableLines']) { - $numTestedMethods++; - } - } - - $buffer .= $this->renderItemTemplate( - $template, - array( - 'name' => $name, - 'numClasses' => 1, - 'numTestedClasses' => $numTestedMethods == $numMethods ? 1 : 0, - 'numMethods' => $numMethods, - 'numTestedMethods' => $numTestedMethods, - 'linesExecutedPercent' => PHP_CodeCoverage_Util::percent( - $item['executedLines'], - $item['executableLines'], - false - ), - 'linesExecutedPercentAsString' => PHP_CodeCoverage_Util::percent( - $item['executedLines'], - $item['executableLines'], - true - ), - 'numExecutedLines' => $item['executedLines'], - 'numExecutableLines' => $item['executableLines'], - 'testedMethodsPercent' => PHP_CodeCoverage_Util::percent( - $numTestedMethods, - $numMethods, - false - ), - 'testedMethodsPercentAsString' => PHP_CodeCoverage_Util::percent( - $numTestedMethods, - $numMethods, - true - ), - 'testedClassesPercent' => PHP_CodeCoverage_Util::percent( - $numTestedMethods == $numMethods ? 1 : 0, - 1, - false - ), - 'testedClassesPercentAsString' => PHP_CodeCoverage_Util::percent( - $numTestedMethods == $numMethods ? 1 : 0, - 1, - true - ), - 'crap' => $item['crap'] - ) - ); - - foreach ($item['methods'] as $method) { - $buffer .= $this->renderFunctionOrMethodItem( - $methodItemTemplate, $method, ' ' - ); - } - } - - return $buffer; - } - - /** - * @param array $functions - * @param Text_Template $template - * @return string - */ - protected function renderFunctionItems(array $functions, Text_Template $template) - { - if (empty($functions)) { - return ''; - } - - $buffer = ''; - - foreach ($functions as $function) { - $buffer .= $this->renderFunctionOrMethodItem( - $template, $function - ); - } - - return $buffer; - } - - /** - * @param Text_Template $template - * @return string - */ - protected function renderFunctionOrMethodItem(Text_Template $template, array $item, $indent = '') - { - $numTestedItems = $item['executedLines'] == $item['executableLines'] ? 1 : 0; - - return $this->renderItemTemplate( - $template, - array( - 'name' => sprintf( - '%s%s', - $indent, - $item['startLine'], - htmlspecialchars($item['signature']) - ), - 'numMethods' => 1, - 'numTestedMethods' => $numTestedItems, - 'linesExecutedPercent' => PHP_CodeCoverage_Util::percent( - $item['executedLines'], - $item['executableLines'], - false - ), - 'linesExecutedPercentAsString' => PHP_CodeCoverage_Util::percent( - $item['executedLines'], - $item['executableLines'], - true - ), - 'numExecutedLines' => $item['executedLines'], - 'numExecutableLines' => $item['executableLines'], - 'testedMethodsPercent' => PHP_CodeCoverage_Util::percent( - $numTestedItems, - 1, - false - ), - 'testedMethodsPercentAsString' => PHP_CodeCoverage_Util::percent( - $numTestedItems, - 1, - true - ), - 'crap' => $item['crap'] - ) - ); - } - - /** - * @param PHP_CodeCoverage_Report_Node_File $node - * @return string - */ - protected function renderSource(PHP_CodeCoverage_Report_Node_File $node) - { - $coverageData = $node->getCoverageData(); - $testData = $node->getTestData(); - $codeLines = $this->loadFile($node->getPath()); - $lines = ''; - $i = 1; - - foreach ($codeLines as $line) { - $numTests = ''; - $trClass = ''; - $popoverContent = ''; - $popoverTitle = ''; - - if (array_key_exists($i, $coverageData)) { - $numTests = count($coverageData[$i]); - - if ($coverageData[$i] === null) { - $trClass = ' class="warning"'; - } elseif ($numTests == 0) { - $trClass = ' class="danger"'; - } else { - $trClass = ' class="success popin"'; - $popoverContent = '
      '; - - if ($numTests > 1) { - $popoverTitle = $numTests . ' tests cover line ' . $i; - } else { - $popoverTitle = '1 test covers line ' . $i; - } - - foreach ($coverageData[$i] as $test) { - switch ($testData[$test]) { - case 0: { - $testCSS = ' class="success"'; - } - break; - - case 1: - case 2: { - $testCSS = ' class="warning"'; - } - break; - - case 3: { - $testCSS = ' class="danger"'; - } - break; - - case 4: { - $testCSS = ' class="danger"'; - } - break; - - default: { - $testCSS = ''; - } - } - - $popoverContent .= sprintf( - '%s', - - $testCSS, - htmlspecialchars($test) - ); - } - - $popoverContent .= '
    '; - } - } - - if (!empty($popoverTitle)) { - $popover = sprintf( - ' data-title="%s" data-content="%s" data-placement="bottom" data-html="true"', - $popoverTitle, - htmlspecialchars($popoverContent) - ); - } else { - $popover = ''; - } - - $lines .= sprintf( - ' %s' . "\n", - $trClass, - $popover, - $i, - $i, - $i, - $line - ); - - $i++; - } - - return $lines; - } - - /** - * @param string $file - * @return array - */ - protected function loadFile($file) - { - $buffer = file_get_contents($file); - $tokens = token_get_all($buffer); - $result = array(''); - $i = 0; - $stringFlag = false; - $fileEndsWithNewLine = substr($buffer, -1) == "\n"; - - unset($buffer); - - foreach ($tokens as $j => $token) { - if (is_string($token)) { - if ($token === '"' && $tokens[$j - 1] !== '\\') { - $result[$i] .= sprintf( - '%s', - - htmlspecialchars($token) - ); - - $stringFlag = !$stringFlag; - } else { - $result[$i] .= sprintf( - '%s', - - htmlspecialchars($token) - ); - } - - continue; - } - - list ($token, $value) = $token; - - $value = str_replace( - array("\t", ' '), - array('    ', ' '), - htmlspecialchars($value) - ); - - if ($value === "\n") { - $result[++$i] = ''; - } else { - $lines = explode("\n", $value); - - foreach ($lines as $jj => $line) { - $line = trim($line); - - if ($line !== '') { - if ($stringFlag) { - $colour = 'string'; - } else { - switch ($token) { - case T_INLINE_HTML: { - $colour = 'html'; - } - break; - - case T_COMMENT: - case T_DOC_COMMENT: { - $colour = 'comment'; - } - break; - - case T_ABSTRACT: - case T_ARRAY: - case T_AS: - case T_BREAK: - case T_CALLABLE: - case T_CASE: - case T_CATCH: - case T_CLASS: - case T_CLONE: - case T_CONTINUE: - case T_DEFAULT: - case T_ECHO: - case T_ELSE: - case T_ELSEIF: - case T_EMPTY: - case T_ENDDECLARE: - case T_ENDFOR: - case T_ENDFOREACH: - case T_ENDIF: - case T_ENDSWITCH: - case T_ENDWHILE: - case T_EXIT: - case T_EXTENDS: - case T_FINAL: - case T_FINALLY: - case T_FOREACH: - case T_FUNCTION: - case T_GLOBAL: - case T_IF: - case T_IMPLEMENTS: - case T_INCLUDE: - case T_INCLUDE_ONCE: - case T_INSTANCEOF: - case T_INSTEADOF: - case T_INTERFACE: - case T_ISSET: - case T_LOGICAL_AND: - case T_LOGICAL_OR: - case T_LOGICAL_XOR: - case T_NAMESPACE: - case T_NEW: - case T_PRIVATE: - case T_PROTECTED: - case T_PUBLIC: - case T_REQUIRE: - case T_REQUIRE_ONCE: - case T_RETURN: - case T_STATIC: - case T_THROW: - case T_TRAIT: - case T_TRY: - case T_UNSET: - case T_USE: - case T_VAR: - case T_WHILE: - case T_YIELD: { - $colour = 'keyword'; - } - break; - - default: { - $colour = 'default'; - } - } - } - - $result[$i] .= sprintf( - '%s', - - $colour, - $line - ); - } - - if (isset($lines[$jj + 1])) { - $result[++$i] = ''; - } - } - } - } - - if ($fileEndsWithNewLine) { - unset($result[count($result)-1]); - } - - return $result; - } -} diff --git a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Template/coverage_bar.html.dist b/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Template/coverage_bar.html.dist deleted file mode 100644 index 5a09c35..0000000 --- a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Template/coverage_bar.html.dist +++ /dev/null @@ -1,5 +0,0 @@ -
    -
    - {{percent}}% covered ({{level}}) -
    -
    diff --git a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Template/css/bootstrap.min.css b/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Template/css/bootstrap.min.css deleted file mode 100644 index 28f154d..0000000 --- a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Template/css/bootstrap.min.css +++ /dev/null @@ -1,5 +0,0 @@ -/*! - * Bootstrap v3.3.2 (http://getbootstrap.com) - * Copyright 2011-2015 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - *//*! normalize.css v3.0.2 | MIT License | git.io/normalize */html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0;font-size:2em}mark{color:#000;background:#ff0}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{height:0;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{margin:0;font:inherit;color:inherit}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}input{line-height:normal}input[type=checkbox],input[type=radio]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{padding:.35em .625em .75em;margin:0 2px;border:1px solid silver}legend{padding:0;border:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-spacing:0;border-collapse:collapse}td,th{padding:0}/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */@media print{*,:after,:before{color:#000!important;text-shadow:none!important;background:0 0!important;-webkit-box-shadow:none!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="javascript:"]:after,a[href^="#"]:after{content:""}blockquote,pre{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}img{max-width:100%!important}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}select{background:#fff!important}.navbar{display:none}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #ddd!important}}@font-face{font-family:'Glyphicons Halflings';src:url(../fonts/glyphicons-halflings-regular.eot);src:url(../fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'),url(../fonts/glyphicons-halflings-regular.woff2) format('woff2'),url(../fonts/glyphicons-halflings-regular.woff) format('woff'),url(../fonts/glyphicons-halflings-regular.ttf) format('truetype'),url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\2a"}.glyphicon-plus:before{content:"\2b"}.glyphicon-eur:before,.glyphicon-euro:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}.glyphicon-cd:before{content:"\e201"}.glyphicon-save-file:before{content:"\e202"}.glyphicon-open-file:before{content:"\e203"}.glyphicon-level-up:before{content:"\e204"}.glyphicon-copy:before{content:"\e205"}.glyphicon-paste:before{content:"\e206"}.glyphicon-alert:before{content:"\e209"}.glyphicon-equalizer:before{content:"\e210"}.glyphicon-king:before{content:"\e211"}.glyphicon-queen:before{content:"\e212"}.glyphicon-pawn:before{content:"\e213"}.glyphicon-bishop:before{content:"\e214"}.glyphicon-knight:before{content:"\e215"}.glyphicon-baby-formula:before{content:"\e216"}.glyphicon-tent:before{content:"\26fa"}.glyphicon-blackboard:before{content:"\e218"}.glyphicon-bed:before{content:"\e219"}.glyphicon-apple:before{content:"\f8ff"}.glyphicon-erase:before{content:"\e221"}.glyphicon-hourglass:before{content:"\231b"}.glyphicon-lamp:before{content:"\e223"}.glyphicon-duplicate:before{content:"\e224"}.glyphicon-piggy-bank:before{content:"\e225"}.glyphicon-scissors:before{content:"\e226"}.glyphicon-bitcoin:before{content:"\e227"}.glyphicon-yen:before{content:"\00a5"}.glyphicon-ruble:before{content:"\20bd"}.glyphicon-scale:before{content:"\e230"}.glyphicon-ice-lolly:before{content:"\e231"}.glyphicon-ice-lolly-tasted:before{content:"\e232"}.glyphicon-education:before{content:"\e233"}.glyphicon-option-horizontal:before{content:"\e234"}.glyphicon-option-vertical:before{content:"\e235"}.glyphicon-menu-hamburger:before{content:"\e236"}.glyphicon-modal-window:before{content:"\e237"}.glyphicon-oil:before{content:"\e238"}.glyphicon-grain:before{content:"\e239"}.glyphicon-sunglasses:before{content:"\e240"}.glyphicon-text-size:before{content:"\e241"}.glyphicon-text-color:before{content:"\e242"}.glyphicon-text-background:before{content:"\e243"}.glyphicon-object-align-top:before{content:"\e244"}.glyphicon-object-align-bottom:before{content:"\e245"}.glyphicon-object-align-horizontal:before{content:"\e246"}.glyphicon-object-align-left:before{content:"\e247"}.glyphicon-object-align-vertical:before{content:"\e248"}.glyphicon-object-align-right:before{content:"\e249"}.glyphicon-triangle-right:before{content:"\e250"}.glyphicon-triangle-left:before{content:"\e251"}.glyphicon-triangle-bottom:before{content:"\e252"}.glyphicon-triangle-top:before{content:"\e253"}.glyphicon-console:before{content:"\e254"}.glyphicon-superscript:before{content:"\e255"}.glyphicon-subscript:before{content:"\e256"}.glyphicon-menu-left:before{content:"\e257"}.glyphicon-menu-right:before{content:"\e258"}.glyphicon-menu-down:before{content:"\e259"}.glyphicon-menu-up:before{content:"\e260"}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#333;background-color:#fff}button,input,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#337ab7;text-decoration:none}a:focus,a:hover{color:#23527c;text-decoration:underline}a:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.carousel-inner>.item>a>img,.carousel-inner>.item>img,.img-responsive,.thumbnail a>img,.thumbnail>img{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{display:inline-block;max-width:100%;height:auto;padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{font-family:inherit;font-weight:500;line-height:1.1;color:inherit}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-weight:400;line-height:1;color:#777}.h1,.h2,.h3,h1,h2,h3{margin-top:20px;margin-bottom:10px}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small{font-size:65%}.h4,.h5,.h6,h4,h5,h6{margin-top:10px;margin-bottom:10px}.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-size:75%}.h1,h1{font-size:36px}.h2,h2{font-size:30px}.h3,h3{font-size:24px}.h4,h4{font-size:18px}.h5,h5{font-size:14px}.h6,h6{font-size:12px}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;font-weight:300;line-height:1.4}@media (min-width:768px){.lead{font-size:21px}}.small,small{font-size:85%}.mark,mark{padding:.2em;background-color:#fcf8e3}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#777}.text-primary{color:#337ab7}a.text-primary:hover{color:#286090}.text-success{color:#3c763d}a.text-success:hover{color:#2b542c}.text-info{color:#31708f}a.text-info:hover{color:#245269}.text-warning{color:#8a6d3b}a.text-warning:hover{color:#66512c}.text-danger{color:#a94442}a.text-danger:hover{color:#843534}.bg-primary{color:#fff;background-color:#337ab7}a.bg-primary:hover{background-color:#286090}.bg-success{background-color:#dff0d8}a.bg-success:hover{background-color:#c1e2b3}.bg-info{background-color:#d9edf7}a.bg-info:hover{background-color:#afd9ee}.bg-warning{background-color:#fcf8e3}a.bg-warning:hover{background-color:#f7ecb5}.bg-danger{background-color:#f2dede}a.bg-danger:hover{background-color:#e4b9b9}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}ol,ul{margin-top:0;margin-bottom:10px}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;margin-left:-5px;list-style:none}.list-inline>li{display:inline-block;padding-right:5px;padding-left:5px}dl{margin-top:0;margin-bottom:20px}dd,dt{line-height:1.42857143}dt{font-weight:700}dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[data-original-title],abbr[title]{cursor:help;border-bottom:1px dotted #777}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}blockquote ol:last-child,blockquote p:last-child,blockquote ul:last-child{margin-bottom:0}blockquote .small,blockquote footer,blockquote small{display:block;font-size:80%;line-height:1.42857143;color:#777}blockquote .small:before,blockquote footer:before,blockquote small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;text-align:right;border-right:5px solid #eee;border-left:0}.blockquote-reverse .small:before,.blockquote-reverse footer:before,.blockquote-reverse small:before,blockquote.pull-right .small:before,blockquote.pull-right footer:before,blockquote.pull-right small:before{content:''}.blockquote-reverse .small:after,.blockquote-reverse footer:after,.blockquote-reverse small:after,blockquote.pull-right .small:after,blockquote.pull-right footer:after,blockquote.pull-right small:after{content:'\00A0 \2014'}address{margin-bottom:20px;font-style:normal;line-height:1.42857143}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:4px}kbd{padding:2px 4px;font-size:90%;color:#fff;background-color:#333;border-radius:3px;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.25);box-shadow:inset 0 -1px 0 rgba(0,0,0,.25)}kbd kbd{padding:0;font-size:100%;font-weight:700;-webkit-box-shadow:none;box-shadow:none}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;color:#333;word-break:break-all;word-wrap:break-word;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.row{margin-right:-15px;margin-left:-15px}.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{position:relative;min-height:1px;padding-right:15px;padding-left:15px}.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0}@media (min-width:768px){.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width:992px){.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0}}@media (min-width:1200px){.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0}}table{background-color:transparent}caption{padding-top:8px;padding-bottom:8px;color:#777;text-align:left}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:20px}.table>tbody>tr>td,.table>tbody>tr>th,.table>tfoot>tr>td,.table>tfoot>tr>th,.table>thead>tr>td,.table>thead>tr>th{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>td,.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>td,.table>thead:first-child>tr:first-child>th{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed>tbody>tr>td,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>td,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>thead>tr>th{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>tbody>tr>td,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>td,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border:1px solid #ddd}.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border-bottom-width:2px}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}.table-hover>tbody>tr:hover{background-color:#f5f5f5}table col[class*=col-]{position:static;display:table-column;float:none}table td[class*=col-],table th[class*=col-]{position:static;display:table-cell;float:none}.table>tbody>tr.active>td,.table>tbody>tr.active>th,.table>tbody>tr>td.active,.table>tbody>tr>th.active,.table>tfoot>tr.active>td,.table>tfoot>tr.active>th,.table>tfoot>tr>td.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>thead>tr.active>th,.table>thead>tr>td.active,.table>thead>tr>th.active{background-color:#f5f5f5}.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr.active:hover>th,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover{background-color:#e8e8e8}.table>tbody>tr.success>td,.table>tbody>tr.success>th,.table>tbody>tr>td.success,.table>tbody>tr>th.success,.table>tfoot>tr.success>td,.table>tfoot>tr.success>th,.table>tfoot>tr>td.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>thead>tr.success>th,.table>thead>tr>td.success,.table>thead>tr>th.success{background-color:#dff0d8}.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr.success:hover>th,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover{background-color:#d0e9c6}.table>tbody>tr.info>td,.table>tbody>tr.info>th,.table>tbody>tr>td.info,.table>tbody>tr>th.info,.table>tfoot>tr.info>td,.table>tfoot>tr.info>th,.table>tfoot>tr>td.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>thead>tr.info>th,.table>thead>tr>td.info,.table>thead>tr>th.info{background-color:#d9edf7}.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr.info:hover>th,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover{background-color:#c4e3f3}.table>tbody>tr.warning>td,.table>tbody>tr.warning>th,.table>tbody>tr>td.warning,.table>tbody>tr>th.warning,.table>tfoot>tr.warning>td,.table>tfoot>tr.warning>th,.table>tfoot>tr>td.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>thead>tr.warning>th,.table>thead>tr>td.warning,.table>thead>tr>th.warning{background-color:#fcf8e3}.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr.warning:hover>th,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover{background-color:#faf2cc}.table>tbody>tr.danger>td,.table>tbody>tr.danger>th,.table>tbody>tr>td.danger,.table>tbody>tr>th.danger,.table>tfoot>tr.danger>td,.table>tfoot>tr.danger>th,.table>tfoot>tr>td.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>thead>tr.danger>th,.table>thead>tr>td.danger,.table>thead>tr>th.danger{background-color:#f2dede}.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr.danger:hover>th,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover{background-color:#ebcccc}.table-responsive{min-height:.01%;overflow-x:auto}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-y:hidden;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ddd}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>td,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>thead>tr>th{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:700}input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type=checkbox],input[type=radio]{margin:4px 0 0;margin-top:1px \9;line-height:normal}input[type=file]{display:block}input[type=range]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type=file]:focus,input[type=checkbox]:focus,input[type=radio]:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{display:block;padding-top:7px;font-size:14px;line-height:1.42857143;color:#555}.form-control{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.form-control::-moz-placeholder{color:#999;opacity:1}.form-control:-ms-input-placeholder{color:#999}.form-control::-webkit-input-placeholder{color:#999}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{cursor:not-allowed;background-color:#eee;opacity:1}textarea.form-control{height:auto}input[type=search]{-webkit-appearance:none}@media screen and (-webkit-min-device-pixel-ratio:0){input[type=date],input[type=time],input[type=datetime-local],input[type=month]{line-height:34px}.input-group-sm input[type=date],.input-group-sm input[type=time],.input-group-sm input[type=datetime-local],.input-group-sm input[type=month],input[type=date].input-sm,input[type=time].input-sm,input[type=datetime-local].input-sm,input[type=month].input-sm{line-height:30px}.input-group-lg input[type=date],.input-group-lg input[type=time],.input-group-lg input[type=datetime-local],.input-group-lg input[type=month],input[type=date].input-lg,input[type=time].input-lg,input[type=datetime-local].input-lg,input[type=month].input-lg{line-height:46px}}.form-group{margin-bottom:15px}.checkbox,.radio{position:relative;display:block;margin-top:10px;margin-bottom:10px}.checkbox label,.radio label{min-height:20px;padding-left:20px;margin-bottom:0;font-weight:400;cursor:pointer}.checkbox input[type=checkbox],.checkbox-inline input[type=checkbox],.radio input[type=radio],.radio-inline input[type=radio]{position:absolute;margin-top:4px \9;margin-left:-20px}.checkbox+.checkbox,.radio+.radio{margin-top:-5px}.checkbox-inline,.radio-inline{display:inline-block;padding-left:20px;margin-bottom:0;font-weight:400;vertical-align:middle;cursor:pointer}.checkbox-inline+.checkbox-inline,.radio-inline+.radio-inline{margin-top:0;margin-left:10px}fieldset[disabled] input[type=checkbox],fieldset[disabled] input[type=radio],input[type=checkbox].disabled,input[type=checkbox][disabled],input[type=radio].disabled,input[type=radio][disabled]{cursor:not-allowed}.checkbox-inline.disabled,.radio-inline.disabled,fieldset[disabled] .checkbox-inline,fieldset[disabled] .radio-inline{cursor:not-allowed}.checkbox.disabled label,.radio.disabled label,fieldset[disabled] .checkbox label,fieldset[disabled] .radio label{cursor:not-allowed}.form-control-static{padding-top:7px;padding-bottom:7px;margin-bottom:0}.form-control-static.input-lg,.form-control-static.input-sm{padding-right:0;padding-left:0}.input-sm{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-sm{height:30px;line-height:30px}select[multiple].input-sm,textarea.input-sm{height:auto}.form-group-sm .form-control{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.form-group-sm .form-control{height:30px;line-height:30px}select[multiple].form-group-sm .form-control,textarea.form-group-sm .form-control{height:auto}.form-group-sm .form-control-static{height:30px;padding:5px 10px;font-size:12px;line-height:1.5}.input-lg{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-lg{height:46px;line-height:46px}select[multiple].input-lg,textarea.input-lg{height:auto}.form-group-lg .form-control{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.form-group-lg .form-control{height:46px;line-height:46px}select[multiple].form-group-lg .form-control,textarea.form-group-lg .form-control{height:auto}.form-group-lg .form-control-static{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333}.has-feedback{position:relative}.has-feedback .form-control{padding-right:42.5px}.form-control-feedback{position:absolute;top:0;right:0;z-index:2;display:block;width:34px;height:34px;line-height:34px;text-align:center;pointer-events:none}.input-lg+.form-control-feedback{width:46px;height:46px;line-height:46px}.input-sm+.form-control-feedback{width:30px;height:30px;line-height:30px}.has-success .checkbox,.has-success .checkbox-inline,.has-success .control-label,.has-success .help-block,.has-success .radio,.has-success .radio-inline,.has-success.checkbox label,.has-success.checkbox-inline label,.has-success.radio label,.has-success.radio-inline label{color:#3c763d}.has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168}.has-success .input-group-addon{color:#3c763d;background-color:#dff0d8;border-color:#3c763d}.has-success .form-control-feedback{color:#3c763d}.has-warning .checkbox,.has-warning .checkbox-inline,.has-warning .control-label,.has-warning .help-block,.has-warning .radio,.has-warning .radio-inline,.has-warning.checkbox label,.has-warning.checkbox-inline label,.has-warning.radio label,.has-warning.radio-inline label{color:#8a6d3b}.has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b}.has-warning .input-group-addon{color:#8a6d3b;background-color:#fcf8e3;border-color:#8a6d3b}.has-warning .form-control-feedback{color:#8a6d3b}.has-error .checkbox,.has-error .checkbox-inline,.has-error .control-label,.has-error .help-block,.has-error .radio,.has-error .radio-inline,.has-error.checkbox label,.has-error.checkbox-inline label,.has-error.radio label,.has-error.radio-inline label{color:#a94442}.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483}.has-error .input-group-addon{color:#a94442;background-color:#f2dede;border-color:#a94442}.has-error .form-control-feedback{color:#a94442}.has-feedback label~.form-control-feedback{top:25px}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-static{display:inline-block}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .form-control,.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .checkbox,.form-inline .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .checkbox label,.form-inline .radio label{padding-left:0}.form-inline .checkbox input[type=checkbox],.form-inline .radio input[type=radio]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .checkbox,.form-horizontal .checkbox-inline,.form-horizontal .radio,.form-horizontal .radio-inline{padding-top:7px;margin-top:0;margin-bottom:0}.form-horizontal .checkbox,.form-horizontal .radio{min-height:27px}.form-horizontal .form-group{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.form-horizontal .control-label{padding-top:7px;margin-bottom:0;text-align:right}}.form-horizontal .has-feedback .form-control-feedback{right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{padding-top:14.33px}}@media (min-width:768px){.form-horizontal .form-group-sm .control-label{padding-top:6px}}.btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:4px}.btn.active.focus,.btn.active:focus,.btn.focus,.btn:active.focus,.btn:active:focus,.btn:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn.focus,.btn:focus,.btn:hover{color:#333;text-decoration:none}.btn.active,.btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{pointer-events:none;cursor:not-allowed;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none;opacity:.65}.btn-default{color:#333;background-color:#fff;border-color:#ccc}.btn-default.active,.btn-default.focus,.btn-default:active,.btn-default:focus,.btn-default:hover,.open>.dropdown-toggle.btn-default{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default.active,.btn-default:active,.open>.dropdown-toggle.btn-default{background-image:none}.btn-default.disabled,.btn-default.disabled.active,.btn-default.disabled.focus,.btn-default.disabled:active,.btn-default.disabled:focus,.btn-default.disabled:hover,.btn-default[disabled],.btn-default[disabled].active,.btn-default[disabled].focus,.btn-default[disabled]:active,.btn-default[disabled]:focus,.btn-default[disabled]:hover,fieldset[disabled] .btn-default,fieldset[disabled] .btn-default.active,fieldset[disabled] .btn-default.focus,fieldset[disabled] .btn-default:active,fieldset[disabled] .btn-default:focus,fieldset[disabled] .btn-default:hover{background-color:#fff;border-color:#ccc}.btn-default .badge{color:#fff;background-color:#333}.btn-primary{color:#fff;background-color:#337ab7;border-color:#2e6da4}.btn-primary.active,.btn-primary.focus,.btn-primary:active,.btn-primary:focus,.btn-primary:hover,.open>.dropdown-toggle.btn-primary{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary.active,.btn-primary:active,.open>.dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled,.btn-primary.disabled.active,.btn-primary.disabled.focus,.btn-primary.disabled:active,.btn-primary.disabled:focus,.btn-primary.disabled:hover,.btn-primary[disabled],.btn-primary[disabled].active,.btn-primary[disabled].focus,.btn-primary[disabled]:active,.btn-primary[disabled]:focus,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary,fieldset[disabled] .btn-primary.active,fieldset[disabled] .btn-primary.focus,fieldset[disabled] .btn-primary:active,fieldset[disabled] .btn-primary:focus,fieldset[disabled] .btn-primary:hover{background-color:#337ab7;border-color:#2e6da4}.btn-primary .badge{color:#337ab7;background-color:#fff}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success.active,.btn-success.focus,.btn-success:active,.btn-success:focus,.btn-success:hover,.open>.dropdown-toggle.btn-success{color:#fff;background-color:#449d44;border-color:#398439}.btn-success.active,.btn-success:active,.open>.dropdown-toggle.btn-success{background-image:none}.btn-success.disabled,.btn-success.disabled.active,.btn-success.disabled.focus,.btn-success.disabled:active,.btn-success.disabled:focus,.btn-success.disabled:hover,.btn-success[disabled],.btn-success[disabled].active,.btn-success[disabled].focus,.btn-success[disabled]:active,.btn-success[disabled]:focus,.btn-success[disabled]:hover,fieldset[disabled] .btn-success,fieldset[disabled] .btn-success.active,fieldset[disabled] .btn-success.focus,fieldset[disabled] .btn-success:active,fieldset[disabled] .btn-success:focus,fieldset[disabled] .btn-success:hover{background-color:#5cb85c;border-color:#4cae4c}.btn-success .badge{color:#5cb85c;background-color:#fff}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info.active,.btn-info.focus,.btn-info:active,.btn-info:focus,.btn-info:hover,.open>.dropdown-toggle.btn-info{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info.active,.btn-info:active,.open>.dropdown-toggle.btn-info{background-image:none}.btn-info.disabled,.btn-info.disabled.active,.btn-info.disabled.focus,.btn-info.disabled:active,.btn-info.disabled:focus,.btn-info.disabled:hover,.btn-info[disabled],.btn-info[disabled].active,.btn-info[disabled].focus,.btn-info[disabled]:active,.btn-info[disabled]:focus,.btn-info[disabled]:hover,fieldset[disabled] .btn-info,fieldset[disabled] .btn-info.active,fieldset[disabled] .btn-info.focus,fieldset[disabled] .btn-info:active,fieldset[disabled] .btn-info:focus,fieldset[disabled] .btn-info:hover{background-color:#5bc0de;border-color:#46b8da}.btn-info .badge{color:#5bc0de;background-color:#fff}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning.active,.btn-warning.focus,.btn-warning:active,.btn-warning:focus,.btn-warning:hover,.open>.dropdown-toggle.btn-warning{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning.active,.btn-warning:active,.open>.dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled,.btn-warning.disabled.active,.btn-warning.disabled.focus,.btn-warning.disabled:active,.btn-warning.disabled:focus,.btn-warning.disabled:hover,.btn-warning[disabled],.btn-warning[disabled].active,.btn-warning[disabled].focus,.btn-warning[disabled]:active,.btn-warning[disabled]:focus,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning,fieldset[disabled] .btn-warning.active,fieldset[disabled] .btn-warning.focus,fieldset[disabled] .btn-warning:active,fieldset[disabled] .btn-warning:focus,fieldset[disabled] .btn-warning:hover{background-color:#f0ad4e;border-color:#eea236}.btn-warning .badge{color:#f0ad4e;background-color:#fff}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger.active,.btn-danger.focus,.btn-danger:active,.btn-danger:focus,.btn-danger:hover,.open>.dropdown-toggle.btn-danger{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger.active,.btn-danger:active,.open>.dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled,.btn-danger.disabled.active,.btn-danger.disabled.focus,.btn-danger.disabled:active,.btn-danger.disabled:focus,.btn-danger.disabled:hover,.btn-danger[disabled],.btn-danger[disabled].active,.btn-danger[disabled].focus,.btn-danger[disabled]:active,.btn-danger[disabled]:focus,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger,fieldset[disabled] .btn-danger.active,fieldset[disabled] .btn-danger.focus,fieldset[disabled] .btn-danger:active,fieldset[disabled] .btn-danger:focus,fieldset[disabled] .btn-danger:hover{background-color:#d9534f;border-color:#d43f3a}.btn-danger .badge{color:#d9534f;background-color:#fff}.btn-link{font-weight:400;color:#337ab7;border-radius:0}.btn-link,.btn-link.active,.btn-link:active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:active,.btn-link:focus,.btn-link:hover{border-color:transparent}.btn-link:focus,.btn-link:hover{color:#23527c;text-decoration:underline;background-color:transparent}.btn-link[disabled]:focus,.btn-link[disabled]:hover,fieldset[disabled] .btn-link:focus,fieldset[disabled] .btn-link:hover{color:#777;text-decoration:none}.btn-group-lg>.btn,.btn-lg{padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.btn-group-sm>.btn,.btn-sm{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-group-xs>.btn,.btn-xs{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none;visibility:hidden}.collapse.in{display:block;visibility:visible}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition-timing-function:ease;-o-transition-timing-function:ease;transition-timing-function:ease;-webkit-transition-duration:.35s;-o-transition-duration:.35s;transition-duration:.35s;-webkit-transition-property:height,visibility;-o-transition-property:height,visibility;transition-property:height,visibility}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px solid;border-right:4px solid transparent;border-left:4px solid transparent}.dropdown,.dropup{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;font-size:14px;text-align:left;list-style:none;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175)}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.dropdown-menu>li>a:focus,.dropdown-menu>li>a:hover{color:#262626;text-decoration:none;background-color:#f5f5f5}.dropdown-menu>.active>a,.dropdown-menu>.active>a:focus,.dropdown-menu>.active>a:hover{color:#fff;text-decoration:none;background-color:#337ab7;outline:0}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{color:#777}.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{text-decoration:none;cursor:not-allowed;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{right:0;left:auto}.dropdown-menu-left{right:auto;left:0}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#777;white-space:nowrap}.dropdown-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{content:"";border-top:0;border-bottom:4px solid}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:2px}@media (min-width:768px){.navbar-right .dropdown-menu{right:0;left:auto}.navbar-right .dropdown-menu-left{right:auto;left:0}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;float:left}.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group-vertical>.btn:hover,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus,.btn-group>.btn:hover{z-index:2}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-right:8px;padding-left:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-right:12px;padding-left:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-left-radius:0;border-top-right-radius:0;border-bottom-left-radius:4px}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-top-right-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{display:table-cell;float:none;width:1%}.btn-group-justified>.btn-group .btn{width:100%}.btn-group-justified>.btn-group .dropdown-menu{left:auto}[data-toggle=buttons]>.btn input[type=checkbox],[data-toggle=buttons]>.btn input[type=radio],[data-toggle=buttons]>.btn-group>.btn input[type=checkbox],[data-toggle=buttons]>.btn-group>.btn input[type=radio]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*=col-]{float:none;padding-right:0;padding-left:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:46px;line-height:46px}select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn,textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn,textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn{height:auto}.input-group .form-control,.input-group-addon,.input-group-btn{display:table-cell}.input-group .form-control:not(:first-child):not(:last-child),.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:14px;font-weight:400;line-height:1;color:#555;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:4px}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px}.input-group-addon.input-lg{padding:10px 16px;font-size:18px;border-radius:6px}.input-group-addon input[type=checkbox],.input-group-addon input[type=radio]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn-group:not(:last-child)>.btn,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:first-child>.btn-group:not(:first-child)>.btn,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:active,.input-group-btn>.btn:focus,.input-group-btn>.btn:hover{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{margin-left:-1px}.nav{padding-left:0;margin-bottom:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:focus,.nav>li>a:hover{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#777}.nav>li.disabled>a:focus,.nav>li.disabled>a:hover{color:#777;text-decoration:none;cursor:not-allowed;background-color:transparent}.nav .open>a,.nav .open>a:focus,.nav .open>a:hover{background-color:#eee;border-color:#337ab7}.nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:focus,.nav-tabs>li.active>a:hover{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border-bottom-color:#fff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:focus,.nav-pills>li.active>a:hover{color:#fff;background-color:#337ab7}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border-bottom-color:#fff}}.tab-content>.tab-pane{display:none;visibility:hidden}.tab-content>.active{display:block;visibility:visible}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.navbar{position:relative;min-height:50px;margin-bottom:20px;border:1px solid transparent}@media (min-width:768px){.navbar{border-radius:4px}}@media (min-width:768px){.navbar-header{float:left}}.navbar-collapse{padding-right:15px;padding-left:15px;overflow-x:visible;-webkit-overflow-scrolling:touch;border-top:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1)}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;-webkit-box-shadow:none;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important;visibility:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse{padding-right:0;padding-left:0}}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:340px}@media (max-device-width:480px) and (orientation:landscape){.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:200px}}.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-bottom,.navbar-fixed-top{position:fixed;right:0;left:0;z-index:1030}@media (min-width:768px){.navbar-fixed-bottom,.navbar-fixed-top{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;height:50px;padding:15px 15px;font-size:18px;line-height:20px}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-brand>img{display:block}@media (min-width:768px){.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;padding:9px 10px;margin-top:8px;margin-right:15px;margin-bottom:8px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:7.5px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-nav .open .dropdown-menu .dropdown-header,.navbar-nav .open .dropdown-menu>li>a{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:20px}.navbar-nav .open .dropdown-menu>li>a:focus,.navbar-nav .open .dropdown-menu>li>a:hover{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}}.navbar-form{padding:10px 15px;margin-top:8px;margin-right:-15px;margin-bottom:8px;margin-left:-15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1)}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .form-control-static{display:inline-block}.navbar-form .input-group{display:inline-table;vertical-align:middle}.navbar-form .input-group .form-control,.navbar-form .input-group .input-group-addon,.navbar-form .input-group .input-group-btn{width:auto}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .checkbox,.navbar-form .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.navbar-form .checkbox label,.navbar-form .radio label{padding-left:0}.navbar-form .checkbox input[type=checkbox],.navbar-form .radio input[type=radio]{position:relative;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}.navbar-form .form-group:last-child{margin-bottom:0}}@media (min-width:768px){.navbar-form{width:auto;padding-top:0;padding-bottom:0;margin-right:0;margin-left:0;border:0;-webkit-box-shadow:none;box-shadow:none}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-left-radius:0;border-top-right-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{margin-bottom:0;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:8px;margin-bottom:8px}.navbar-btn.btn-sm{margin-top:10px;margin-bottom:10px}.navbar-btn.btn-xs{margin-top:14px;margin-bottom:14px}.navbar-text{margin-top:15px;margin-bottom:15px}@media (min-width:768px){.navbar-text{float:left;margin-right:15px;margin-left:15px}}@media (min-width:768px){.navbar-left{float:left!important}.navbar-right{float:right!important;margin-right:-15px}.navbar-right~.navbar-right{margin-right:0}}.navbar-default{background-color:#f8f8f8;border-color:#e7e7e7}.navbar-default .navbar-brand{color:#777}.navbar-default .navbar-brand:focus,.navbar-default .navbar-brand:hover{color:#5e5e5e;background-color:transparent}.navbar-default .navbar-text{color:#777}.navbar-default .navbar-nav>li>a{color:#777}.navbar-default .navbar-nav>li>a:focus,.navbar-default .navbar-nav>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:focus,.navbar-default .navbar-nav>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:focus,.navbar-default .navbar-nav>.disabled>a:hover{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:focus,.navbar-default .navbar-toggle:hover{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#888}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#e7e7e7}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:focus,.navbar-default .navbar-nav>.open>a:hover{color:#555;background-color:#e7e7e7}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#777}.navbar-default .navbar-link:hover{color:#333}.navbar-default .btn-link{color:#777}.navbar-default .btn-link:focus,.navbar-default .btn-link:hover{color:#333}.navbar-default .btn-link[disabled]:focus,.navbar-default .btn-link[disabled]:hover,fieldset[disabled] .navbar-default .btn-link:focus,fieldset[disabled] .navbar-default .btn-link:hover{color:#ccc}.navbar-inverse{background-color:#222;border-color:#080808}.navbar-inverse .navbar-brand{color:#9d9d9d}.navbar-inverse .navbar-brand:focus,.navbar-inverse .navbar-brand:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-text{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a:focus,.navbar-inverse .navbar-nav>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:focus,.navbar-inverse .navbar-nav>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:focus,.navbar-inverse .navbar-nav>.disabled>a:hover{color:#444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:focus,.navbar-inverse .navbar-toggle:hover{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:focus,.navbar-inverse .navbar-nav>.open>a:hover{color:#fff;background-color:#080808}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#444;background-color:transparent}}.navbar-inverse .navbar-link{color:#9d9d9d}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .btn-link{color:#9d9d9d}.navbar-inverse .btn-link:focus,.navbar-inverse .btn-link:hover{color:#fff}.navbar-inverse .btn-link[disabled]:focus,.navbar-inverse .btn-link[disabled]:hover,fieldset[disabled] .navbar-inverse .btn-link:focus,fieldset[disabled] .navbar-inverse .btn-link:hover{color:#444}.breadcrumb{padding:8px 15px;margin-bottom:20px;list-style:none;background-color:#f5f5f5;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{padding:0 5px;color:#ccc;content:"/\00a0"}.breadcrumb>.active{color:#777}.pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;margin-left:-1px;line-height:1.42857143;color:#337ab7;text-decoration:none;background-color:#fff;border:1px solid #ddd}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-top-left-radius:4px;border-bottom-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-top-right-radius:4px;border-bottom-right-radius:4px}.pagination>li>a:focus,.pagination>li>a:hover,.pagination>li>span:focus,.pagination>li>span:hover{color:#23527c;background-color:#eee;border-color:#ddd}.pagination>.active>a,.pagination>.active>a:focus,.pagination>.active>a:hover,.pagination>.active>span,.pagination>.active>span:focus,.pagination>.active>span:hover{z-index:2;color:#fff;cursor:default;background-color:#337ab7;border-color:#337ab7}.pagination>.disabled>a,.pagination>.disabled>a:focus,.pagination>.disabled>a:hover,.pagination>.disabled>span,.pagination>.disabled>span:focus,.pagination>.disabled>span:hover{color:#777;cursor:not-allowed;background-color:#fff;border-color:#ddd}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-top-left-radius:6px;border-bottom-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-top-right-radius:6px;border-bottom-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-top-left-radius:3px;border-bottom-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-top-right-radius:3px;border-bottom-right-radius:3px}.pager{padding-left:0;margin:20px 0;text-align:center;list-style:none}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.pager li>a:focus,.pager li>a:hover{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:focus,.pager .disabled>a:hover,.pager .disabled>span{color:#777;cursor:not-allowed;background-color:#fff}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}a.label:focus,a.label:hover{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#777}.label-default[href]:focus,.label-default[href]:hover{background-color:#5e5e5e}.label-primary{background-color:#337ab7}.label-primary[href]:focus,.label-primary[href]:hover{background-color:#286090}.label-success{background-color:#5cb85c}.label-success[href]:focus,.label-success[href]:hover{background-color:#449d44}.label-info{background-color:#5bc0de}.label-info[href]:focus,.label-info[href]:hover{background-color:#31b0d5}.label-warning{background-color:#f0ad4e}.label-warning[href]:focus,.label-warning[href]:hover{background-color:#ec971f}.label-danger{background-color:#d9534f}.label-danger[href]:focus,.label-danger[href]:hover{background-color:#c9302c}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;background-color:#777;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.btn-xs .badge{top:0;padding:1px 5px}a.badge:focus,a.badge:hover{color:#fff;text-decoration:none;cursor:pointer}.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#337ab7;background-color:#fff}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding:30px 15px;margin-bottom:30px;color:inherit;background-color:#eee}.jumbotron .h1,.jumbotron h1{color:inherit}.jumbotron p{margin-bottom:15px;font-size:21px;font-weight:200}.jumbotron>hr{border-top-color:#d5d5d5}.container .jumbotron,.container-fluid .jumbotron{border-radius:6px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding:48px 0}.container .jumbotron,.container-fluid .jumbotron{padding-right:60px;padding-left:60px}.jumbotron .h1,.jumbotron h1{font-size:63px}}.thumbnail{display:block;padding:4px;margin-bottom:20px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:border .2s ease-in-out;-o-transition:border .2s ease-in-out;transition:border .2s ease-in-out}.thumbnail a>img,.thumbnail>img{margin-right:auto;margin-left:auto}a.thumbnail.active,a.thumbnail:focus,a.thumbnail:hover{border-color:#337ab7}.thumbnail .caption{padding:9px;color:#333}.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:700}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable,.alert-dismissible{padding-right:35px}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#2b542c}.alert-info{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#245269}.alert-warning{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.alert-warning hr{border-top-color:#f7e1b5}.alert-warning .alert-link{color:#66512c}.alert-danger{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.alert-danger hr{border-top-color:#e4b9c0}.alert-danger .alert-link{color:#843534}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.progress-bar{float:left;width:0;height:100%;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#337ab7;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-webkit-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress-bar-striped,.progress-striped .progress-bar{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;background-size:40px 40px}.progress-bar.active,.progress.active .progress-bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#5cb85c}.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-info{background-color:#5bc0de}.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-warning{background-color:#f0ad4e}.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-danger{background-color:#d9534f}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.media{margin-top:15px}.media:first-child{margin-top:0}.media,.media-body{overflow:hidden;zoom:1}.media-body{width:10000px}.media-object{display:block}.media-right,.media>.pull-right{padding-left:10px}.media-left,.media>.pull-left{padding-right:10px}.media-body,.media-left,.media-right{display:table-cell;vertical-align:top}.media-middle{vertical-align:middle}.media-bottom{vertical-align:bottom}.media-heading{margin-top:0;margin-bottom:5px}.media-list{padding-left:0;list-style:none}.list-group{padding-left:0;margin-bottom:20px}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}a.list-group-item{color:#555}a.list-group-item .list-group-item-heading{color:#333}a.list-group-item:focus,a.list-group-item:hover{color:#555;text-decoration:none;background-color:#f5f5f5}.list-group-item.disabled,.list-group-item.disabled:focus,.list-group-item.disabled:hover{color:#777;cursor:not-allowed;background-color:#eee}.list-group-item.disabled .list-group-item-heading,.list-group-item.disabled:focus .list-group-item-heading,.list-group-item.disabled:hover .list-group-item-heading{color:inherit}.list-group-item.disabled .list-group-item-text,.list-group-item.disabled:focus .list-group-item-text,.list-group-item.disabled:hover .list-group-item-text{color:#777}.list-group-item.active,.list-group-item.active:focus,.list-group-item.active:hover{z-index:2;color:#fff;background-color:#337ab7;border-color:#337ab7}.list-group-item.active .list-group-item-heading,.list-group-item.active .list-group-item-heading>.small,.list-group-item.active .list-group-item-heading>small,.list-group-item.active:focus .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading>.small,.list-group-item.active:focus .list-group-item-heading>small,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading>.small,.list-group-item.active:hover .list-group-item-heading>small{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:focus .list-group-item-text,.list-group-item.active:hover .list-group-item-text{color:#c7ddef}.list-group-item-success{color:#3c763d;background-color:#dff0d8}a.list-group-item-success{color:#3c763d}a.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:focus,a.list-group-item-success:hover{color:#3c763d;background-color:#d0e9c6}a.list-group-item-success.active,a.list-group-item-success.active:focus,a.list-group-item-success.active:hover{color:#fff;background-color:#3c763d;border-color:#3c763d}.list-group-item-info{color:#31708f;background-color:#d9edf7}a.list-group-item-info{color:#31708f}a.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:focus,a.list-group-item-info:hover{color:#31708f;background-color:#c4e3f3}a.list-group-item-info.active,a.list-group-item-info.active:focus,a.list-group-item-info.active:hover{color:#fff;background-color:#31708f;border-color:#31708f}.list-group-item-warning{color:#8a6d3b;background-color:#fcf8e3}a.list-group-item-warning{color:#8a6d3b}a.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:focus,a.list-group-item-warning:hover{color:#8a6d3b;background-color:#faf2cc}a.list-group-item-warning.active,a.list-group-item-warning.active:focus,a.list-group-item-warning.active:hover{color:#fff;background-color:#8a6d3b;border-color:#8a6d3b}.list-group-item-danger{color:#a94442;background-color:#f2dede}a.list-group-item-danger{color:#a94442}a.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:focus,a.list-group-item-danger:hover{color:#a94442;background-color:#ebcccc}a.list-group-item-danger.active,a.list-group-item-danger.active:focus,a.list-group-item-danger.active:hover{color:#fff;background-color:#a94442;border-color:#a94442}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:20px;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}.panel-body{padding:15px}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-left-radius:3px;border-top-right-radius:3px}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:16px;color:inherit}.panel-title>.small,.panel-title>.small>a,.panel-title>a,.panel-title>small,.panel-title>small>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.list-group,.panel>.panel-collapse>.list-group{margin-bottom:0}.panel>.list-group .list-group-item,.panel>.panel-collapse>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child,.panel>.panel-collapse>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-left-radius:3px;border-top-right-radius:3px}.panel>.list-group:last-child .list-group-item:last-child,.panel>.panel-collapse>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.list-group+.panel-footer{border-top-width:0}.panel>.panel-collapse>.table,.panel>.table,.panel>.table-responsive>.table{margin-bottom:0}.panel>.panel-collapse>.table caption,.panel>.table caption,.panel>.table-responsive>.table caption{padding-right:15px;padding-left:15px}.panel>.table-responsive:first-child>.table:first-child,.panel>.table:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child,.panel>.table:first-child>thead:first-child>tr:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child{border-top-left-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child{border-top-right-radius:3px}.panel>.table-responsive:last-child>.table:last-child,.panel>.table:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:3px}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive,.panel>.table+.panel-body,.panel>.table-responsive+.panel-body{border-top:1px solid #ddd}.panel>.table>tbody:first-child>tr:first-child td,.panel>.table>tbody:first-child>tr:first-child th{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th{border-bottom:0}.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}.panel>.table-responsive{margin-bottom:0;border:0}.panel-group{margin-bottom:20px}.panel-group .panel{margin-bottom:0;border-radius:4px}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse>.list-group,.panel-group .panel-heading+.panel-collapse>.panel-body{border-top:1px solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.panel-default{border-color:#ddd}.panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.panel-default>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ddd}.panel-default>.panel-heading .badge{color:#f5f5f5;background-color:#333}.panel-default>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ddd}.panel-primary{border-color:#337ab7}.panel-primary>.panel-heading{color:#fff;background-color:#337ab7;border-color:#337ab7}.panel-primary>.panel-heading+.panel-collapse>.panel-body{border-top-color:#337ab7}.panel-primary>.panel-heading .badge{color:#337ab7;background-color:#fff}.panel-primary>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#337ab7}.panel-success{border-color:#d6e9c6}.panel-success>.panel-heading{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.panel-success>.panel-heading+.panel-collapse>.panel-body{border-top-color:#d6e9c6}.panel-success>.panel-heading .badge{color:#dff0d8;background-color:#3c763d}.panel-success>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#d6e9c6}.panel-info{border-color:#bce8f1}.panel-info>.panel-heading{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.panel-info>.panel-heading+.panel-collapse>.panel-body{border-top-color:#bce8f1}.panel-info>.panel-heading .badge{color:#d9edf7;background-color:#31708f}.panel-info>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#bce8f1}.panel-warning{border-color:#faebcc}.panel-warning>.panel-heading{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.panel-warning>.panel-heading+.panel-collapse>.panel-body{border-top-color:#faebcc}.panel-warning>.panel-heading .badge{color:#fcf8e3;background-color:#8a6d3b}.panel-warning>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#faebcc}.panel-danger{border-color:#ebccd1}.panel-danger>.panel-heading{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.panel-danger>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ebccd1}.panel-danger>.panel-heading .badge{color:#f2dede;background-color:#a94442}.panel-danger>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ebccd1}.embed-responsive{position:relative;display:block;height:0;padding:0;overflow:hidden}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive.embed-responsive-4by3{padding-bottom:75%}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);box-shadow:inset 0 1px 1px rgba(0,0,0,.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:21px;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;filter:alpha(opacity=20);opacity:.2}.close:focus,.close:hover{color:#000;text-decoration:none;cursor:pointer;filter:alpha(opacity=50);opacity:.5}button.close{-webkit-appearance:none;padding:0;cursor:pointer;background:0 0;border:0}.modal-open{overflow:hidden}.modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;display:none;overflow:hidden;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transition:-webkit-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out;-webkit-transform:translate(0,-25%);-ms-transform:translate(0,-25%);-o-transform:translate(0,-25%);transform:translate(0,-25%)}.modal.in .modal-dialog{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);-o-transform:translate(0,0);transform:translate(0,0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #999;border:1px solid rgba(0,0,0,.2);border-radius:6px;outline:0;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5)}.modal-backdrop{position:absolute;top:0;right:0;left:0;background-color:#000}.modal-backdrop.fade{filter:alpha(opacity=0);opacity:0}.modal-backdrop.in{filter:alpha(opacity=50);opacity:.5}.modal-header{min-height:16.43px;padding:15px;border-bottom:1px solid #e5e5e5}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.42857143}.modal-body{position:relative;padding:15px}.modal-footer{padding:15px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,.5);box-shadow:0 5px 15px rgba(0,0,0,.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.tooltip{position:absolute;z-index:1070;display:block;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:12px;font-weight:400;line-height:1.4;visibility:visible;filter:alpha(opacity=0);opacity:0}.tooltip.in{filter:alpha(opacity=90);opacity:.9}.tooltip.top{padding:5px 0;margin-top:-3px}.tooltip.right{padding:0 5px;margin-left:3px}.tooltip.bottom{padding:5px 0;margin-top:3px}.tooltip.left{padding:0 5px;margin-left:-3px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;text-decoration:none;background-color:#000;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-left .tooltip-arrow{right:5px;bottom:0;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-right .tooltip-arrow{bottom:0;left:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-left .tooltip-arrow{top:0;right:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-right .tooltip-arrow{top:0;left:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.popover{position:absolute;top:0;left:0;z-index:1060;display:none;max-width:276px;padding:1px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;font-weight:400;line-height:1.42857143;text-align:left;white-space:normal;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2)}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{padding:8px 14px;margin:0;font-size:14px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover>.arrow{border-width:11px}.popover>.arrow:after{content:"";border-width:10px}.popover.top>.arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,.25);border-bottom-width:0}.popover.top>.arrow:after{bottom:1px;margin-left:-10px;content:" ";border-top-color:#fff;border-bottom-width:0}.popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-right-color:#999;border-right-color:rgba(0,0,0,.25);border-left-width:0}.popover.right>.arrow:after{bottom:-10px;left:1px;content:" ";border-right-color:#fff;border-left-width:0}.popover.bottom>.arrow{top:-11px;left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,.25)}.popover.bottom>.arrow:after{top:1px;margin-left:-10px;content:" ";border-top-width:0;border-bottom-color:#fff}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,.25)}.popover.left>.arrow:after{right:1px;bottom:-10px;content:" ";border-right-width:0;border-left-color:#fff}.carousel{position:relative}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner>.item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>a>img,.carousel-inner>.item>img{line-height:1}@media all and (transform-3d),(-webkit-transform-3d){.carousel-inner>.item{-webkit-transition:-webkit-transform .6s ease-in-out;-o-transition:-o-transform .6s ease-in-out;transition:transform .6s ease-in-out;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000;perspective:1000}.carousel-inner>.item.active.right,.carousel-inner>.item.next{left:0;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}.carousel-inner>.item.active.left,.carousel-inner>.item.prev{left:0;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.carousel-inner>.item.active,.carousel-inner>.item.next.left,.carousel-inner>.item.prev.right{left:0;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;bottom:0;left:0;width:15%;font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6);filter:alpha(opacity=50);opacity:.5}.carousel-control.left{background-image:-webkit-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,.0001)));background-image:linear-gradient(to right,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);background-repeat:repeat-x}.carousel-control.right{right:0;left:auto;background-image:-webkit-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.0001)),to(rgba(0,0,0,.5)));background-image:linear-gradient(to right,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);background-repeat:repeat-x}.carousel-control:focus,.carousel-control:hover{color:#fff;text-decoration:none;filter:alpha(opacity=90);outline:0;opacity:.9}.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{position:absolute;top:50%;z-index:5;display:inline-block}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{left:50%;margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{right:50%;margin-right:-10px}.carousel-control .icon-next,.carousel-control .icon-prev{width:20px;height:20px;margin-top:-10px;font-family:serif;line-height:1}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;padding-left:0;margin-left:-30%;text-align:center;list-style:none}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;cursor:pointer;background-color:#000 \9;background-color:rgba(0,0,0,0);border:1px solid #fff;border-radius:10px}.carousel-indicators .active{width:12px;height:12px;margin:0;background-color:#fff}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{width:30px;height:30px;margin-top:-15px;font-size:30px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{margin-left:-15px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{margin-right:-15px}.carousel-caption{right:20%;left:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.btn-group-vertical>.btn-group:after,.btn-group-vertical>.btn-group:before,.btn-toolbar:after,.btn-toolbar:before,.clearfix:after,.clearfix:before,.container-fluid:after,.container-fluid:before,.container:after,.container:before,.dl-horizontal dd:after,.dl-horizontal dd:before,.form-horizontal .form-group:after,.form-horizontal .form-group:before,.modal-footer:after,.modal-footer:before,.nav:after,.nav:before,.navbar-collapse:after,.navbar-collapse:before,.navbar-header:after,.navbar-header:before,.navbar:after,.navbar:before,.pager:after,.pager:before,.panel-body:after,.panel-body:before,.row:after,.row:before{display:table;content:" "}.btn-group-vertical>.btn-group:after,.btn-toolbar:after,.clearfix:after,.container-fluid:after,.container:after,.dl-horizontal dd:after,.form-horizontal .form-group:after,.modal-footer:after,.nav:after,.navbar-collapse:after,.navbar-header:after,.navbar:after,.pager:after,.panel-body:after,.row:after{clear:both}.center-block{display:block;margin-right:auto;margin-left:auto}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.show{display:block!important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none!important;visibility:hidden!important}.affix{position:fixed}@-ms-viewport{width:device-width}.visible-lg,.visible-md,.visible-sm,.visible-xs{display:none!important}.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block{display:none!important}@media (max-width:767px){.visible-xs{display:block!important}table.visible-xs{display:table}tr.visible-xs{display:table-row!important}td.visible-xs,th.visible-xs{display:table-cell!important}}@media (max-width:767px){.visible-xs-block{display:block!important}}@media (max-width:767px){.visible-xs-inline{display:inline!important}}@media (max-width:767px){.visible-xs-inline-block{display:inline-block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block!important}table.visible-sm{display:table}tr.visible-sm{display:table-row!important}td.visible-sm,th.visible-sm{display:table-cell!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-block{display:block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline{display:inline!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline-block{display:inline-block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block!important}table.visible-md{display:table}tr.visible-md{display:table-row!important}td.visible-md,th.visible-md{display:table-cell!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-block{display:block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline{display:inline!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline-block{display:inline-block!important}}@media (min-width:1200px){.visible-lg{display:block!important}table.visible-lg{display:table}tr.visible-lg{display:table-row!important}td.visible-lg,th.visible-lg{display:table-cell!important}}@media (min-width:1200px){.visible-lg-block{display:block!important}}@media (min-width:1200px){.visible-lg-inline{display:inline!important}}@media (min-width:1200px){.visible-lg-inline-block{display:inline-block!important}}@media (max-width:767px){.hidden-xs{display:none!important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none!important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none!important}}@media (min-width:1200px){.hidden-lg{display:none!important}}.visible-print{display:none!important}@media print{.visible-print{display:block!important}table.visible-print{display:table}tr.visible-print{display:table-row!important}td.visible-print,th.visible-print{display:table-cell!important}}.visible-print-block{display:none!important}@media print{.visible-print-block{display:block!important}}.visible-print-inline{display:none!important}@media print{.visible-print-inline{display:inline!important}}.visible-print-inline-block{display:none!important}@media print{.visible-print-inline-block{display:inline-block!important}}@media print{.hidden-print{display:none!important}} \ No newline at end of file diff --git a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Template/css/nv.d3.css b/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Template/css/nv.d3.css deleted file mode 100644 index cae8348..0000000 --- a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Template/css/nv.d3.css +++ /dev/null @@ -1,769 +0,0 @@ - -/******************** - * HTML CSS - */ - - -.chartWrap { - margin: 0; - padding: 0; - overflow: hidden; -} - -/******************** - Box shadow and border radius styling -*/ -.nvtooltip.with-3d-shadow, .with-3d-shadow .nvtooltip { - -moz-box-shadow: 0 5px 10px rgba(0,0,0,.2); - -webkit-box-shadow: 0 5px 10px rgba(0,0,0,.2); - box-shadow: 0 5px 10px rgba(0,0,0,.2); - - -webkit-border-radius: 6px; - -moz-border-radius: 6px; - border-radius: 6px; -} - -/******************** - * TOOLTIP CSS - */ - -.nvtooltip { - position: absolute; - background-color: rgba(255,255,255,1.0); - padding: 1px; - border: 1px solid rgba(0,0,0,.2); - z-index: 10000; - - font-family: Arial; - font-size: 13px; - text-align: left; - pointer-events: none; - - white-space: nowrap; - - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - -/*Give tooltips that old fade in transition by - putting a "with-transitions" class on the container div. -*/ -.nvtooltip.with-transitions, .with-transitions .nvtooltip { - transition: opacity 250ms linear; - -moz-transition: opacity 250ms linear; - -webkit-transition: opacity 250ms linear; - - transition-delay: 250ms; - -moz-transition-delay: 250ms; - -webkit-transition-delay: 250ms; -} - -.nvtooltip.x-nvtooltip, -.nvtooltip.y-nvtooltip { - padding: 8px; -} - -.nvtooltip h3 { - margin: 0; - padding: 4px 14px; - line-height: 18px; - font-weight: normal; - background-color: rgba(247,247,247,0.75); - text-align: center; - - border-bottom: 1px solid #ebebeb; - - -webkit-border-radius: 5px 5px 0 0; - -moz-border-radius: 5px 5px 0 0; - border-radius: 5px 5px 0 0; -} - -.nvtooltip p { - margin: 0; - padding: 5px 14px; - text-align: center; -} - -.nvtooltip span { - display: inline-block; - margin: 2px 0; -} - -.nvtooltip table { - margin: 6px; - border-spacing:0; -} - - -.nvtooltip table td { - padding: 2px 9px 2px 0; - vertical-align: middle; -} - -.nvtooltip table td.key { - font-weight:normal; -} -.nvtooltip table td.value { - text-align: right; - font-weight: bold; -} - -.nvtooltip table tr.highlight td { - padding: 1px 9px 1px 0; - border-bottom-style: solid; - border-bottom-width: 1px; - border-top-style: solid; - border-top-width: 1px; -} - -.nvtooltip table td.legend-color-guide div { - width: 8px; - height: 8px; - vertical-align: middle; -} - -.nvtooltip .footer { - padding: 3px; - text-align: center; -} - - -.nvtooltip-pending-removal { - position: absolute; - pointer-events: none; -} - - -/******************** - * SVG CSS - */ - - -svg { - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - /* Trying to get SVG to act like a greedy block in all browsers */ - display: block; - width:100%; - height:100%; -} - - -svg text { - font: normal 12px Arial; -} - -svg .title { - font: bold 14px Arial; -} - -.nvd3 .nv-background { - fill: white; - fill-opacity: 0; - /* - pointer-events: none; - */ -} - -.nvd3.nv-noData { - font-size: 18px; - font-weight: bold; -} - - -/********** -* Brush -*/ - -.nv-brush .extent { - fill-opacity: .125; - shape-rendering: crispEdges; -} - - - -/********** -* Legend -*/ - -.nvd3 .nv-legend .nv-series { - cursor: pointer; -} - -.nvd3 .nv-legend .disabled circle { - fill-opacity: 0; -} - - - -/********** -* Axes -*/ -.nvd3 .nv-axis { - pointer-events:none; -} - -.nvd3 .nv-axis path { - fill: none; - stroke: #000; - stroke-opacity: .75; - shape-rendering: crispEdges; -} - -.nvd3 .nv-axis path.domain { - stroke-opacity: .75; -} - -.nvd3 .nv-axis.nv-x path.domain { - stroke-opacity: 0; -} - -.nvd3 .nv-axis line { - fill: none; - stroke: #e5e5e5; - shape-rendering: crispEdges; -} - -.nvd3 .nv-axis .zero line, -/*this selector may not be necessary*/ .nvd3 .nv-axis line.zero { - stroke-opacity: .75; -} - -.nvd3 .nv-axis .nv-axisMaxMin text { - font-weight: bold; -} - -.nvd3 .x .nv-axis .nv-axisMaxMin text, -.nvd3 .x2 .nv-axis .nv-axisMaxMin text, -.nvd3 .x3 .nv-axis .nv-axisMaxMin text { - text-anchor: middle -} - - - -/********** -* Brush -*/ - -.nv-brush .resize path { - fill: #eee; - stroke: #666; -} - - - -/********** -* Bars -*/ - -.nvd3 .nv-bars .negative rect { - zfill: brown; -} - -.nvd3 .nv-bars rect { - zfill: steelblue; - fill-opacity: .75; - - transition: fill-opacity 250ms linear; - -moz-transition: fill-opacity 250ms linear; - -webkit-transition: fill-opacity 250ms linear; -} - -.nvd3 .nv-bars rect.hover { - fill-opacity: 1; -} - -.nvd3 .nv-bars .hover rect { - fill: lightblue; -} - -.nvd3 .nv-bars text { - fill: rgba(0,0,0,0); -} - -.nvd3 .nv-bars .hover text { - fill: rgba(0,0,0,1); -} - - -/********** -* Bars -*/ - -.nvd3 .nv-multibar .nv-groups rect, -.nvd3 .nv-multibarHorizontal .nv-groups rect, -.nvd3 .nv-discretebar .nv-groups rect { - stroke-opacity: 0; - - transition: fill-opacity 250ms linear; - -moz-transition: fill-opacity 250ms linear; - -webkit-transition: fill-opacity 250ms linear; -} - -.nvd3 .nv-multibar .nv-groups rect:hover, -.nvd3 .nv-multibarHorizontal .nv-groups rect:hover, -.nvd3 .nv-discretebar .nv-groups rect:hover { - fill-opacity: 1; -} - -.nvd3 .nv-discretebar .nv-groups text, -.nvd3 .nv-multibarHorizontal .nv-groups text { - font-weight: bold; - fill: rgba(0,0,0,1); - stroke: rgba(0,0,0,0); -} - -/*********** -* Pie Chart -*/ - -.nvd3.nv-pie path { - stroke-opacity: 0; - transition: fill-opacity 250ms linear, stroke-width 250ms linear, stroke-opacity 250ms linear; - -moz-transition: fill-opacity 250ms linear, stroke-width 250ms linear, stroke-opacity 250ms linear; - -webkit-transition: fill-opacity 250ms linear, stroke-width 250ms linear, stroke-opacity 250ms linear; - -} - -.nvd3.nv-pie .nv-slice text { - stroke: #000; - stroke-width: 0; -} - -.nvd3.nv-pie path { - stroke: #fff; - stroke-width: 1px; - stroke-opacity: 1; -} - -.nvd3.nv-pie .hover path { - fill-opacity: .7; -} -.nvd3.nv-pie .nv-label { - pointer-events: none; -} -.nvd3.nv-pie .nv-label rect { - fill-opacity: 0; - stroke-opacity: 0; -} - -/********** -* Lines -*/ - -.nvd3 .nv-groups path.nv-line { - fill: none; - stroke-width: 1.5px; - /* - stroke-linecap: round; - shape-rendering: geometricPrecision; - - transition: stroke-width 250ms linear; - -moz-transition: stroke-width 250ms linear; - -webkit-transition: stroke-width 250ms linear; - - transition-delay: 250ms - -moz-transition-delay: 250ms; - -webkit-transition-delay: 250ms; - */ -} - -.nvd3 .nv-groups path.nv-line.nv-thin-line { - stroke-width: 1px; -} - - -.nvd3 .nv-groups path.nv-area { - stroke: none; - /* - stroke-linecap: round; - shape-rendering: geometricPrecision; - - stroke-width: 2.5px; - transition: stroke-width 250ms linear; - -moz-transition: stroke-width 250ms linear; - -webkit-transition: stroke-width 250ms linear; - - transition-delay: 250ms - -moz-transition-delay: 250ms; - -webkit-transition-delay: 250ms; - */ -} - -.nvd3 .nv-line.hover path { - stroke-width: 6px; -} - -/* -.nvd3.scatter .groups .point { - fill-opacity: 0.1; - stroke-opacity: 0.1; -} - */ - -.nvd3.nv-line .nvd3.nv-scatter .nv-groups .nv-point { - fill-opacity: 0; - stroke-opacity: 0; -} - -.nvd3.nv-scatter.nv-single-point .nv-groups .nv-point { - fill-opacity: .5 !important; - stroke-opacity: .5 !important; -} - - -.with-transitions .nvd3 .nv-groups .nv-point { - transition: stroke-width 250ms linear, stroke-opacity 250ms linear; - -moz-transition: stroke-width 250ms linear, stroke-opacity 250ms linear; - -webkit-transition: stroke-width 250ms linear, stroke-opacity 250ms linear; - -} - -.nvd3.nv-scatter .nv-groups .nv-point.hover, -.nvd3 .nv-groups .nv-point.hover { - stroke-width: 7px; - fill-opacity: .95 !important; - stroke-opacity: .95 !important; -} - - -.nvd3 .nv-point-paths path { - stroke: #aaa; - stroke-opacity: 0; - fill: #eee; - fill-opacity: 0; -} - - - -.nvd3 .nv-indexLine { - cursor: ew-resize; -} - - -/********** -* Distribution -*/ - -.nvd3 .nv-distribution { - pointer-events: none; -} - - - -/********** -* Scatter -*/ - -/* **Attempting to remove this for useVoronoi(false), need to see if it's required anywhere -.nvd3 .nv-groups .nv-point { - pointer-events: none; -} -*/ - -.nvd3 .nv-groups .nv-point.hover { - stroke-width: 20px; - stroke-opacity: .5; -} - -.nvd3 .nv-scatter .nv-point.hover { - fill-opacity: 1; -} - -/* -.nv-group.hover .nv-point { - fill-opacity: 1; -} -*/ - - -/********** -* Stacked Area -*/ - -.nvd3.nv-stackedarea path.nv-area { - fill-opacity: .7; - /* - stroke-opacity: .65; - fill-opacity: 1; - */ - stroke-opacity: 0; - - transition: fill-opacity 250ms linear, stroke-opacity 250ms linear; - -moz-transition: fill-opacity 250ms linear, stroke-opacity 250ms linear; - -webkit-transition: fill-opacity 250ms linear, stroke-opacity 250ms linear; - - /* - transition-delay: 500ms; - -moz-transition-delay: 500ms; - -webkit-transition-delay: 500ms; - */ - -} - -.nvd3.nv-stackedarea path.nv-area.hover { - fill-opacity: .9; - /* - stroke-opacity: .85; - */ -} -/* -.d3stackedarea .groups path { - stroke-opacity: 0; -} - */ - - - -.nvd3.nv-stackedarea .nv-groups .nv-point { - stroke-opacity: 0; - fill-opacity: 0; -} - -/* -.nvd3.nv-stackedarea .nv-groups .nv-point.hover { - stroke-width: 20px; - stroke-opacity: .75; - fill-opacity: 1; -}*/ - - - -/********** -* Line Plus Bar -*/ - -.nvd3.nv-linePlusBar .nv-bar rect { - fill-opacity: .75; -} - -.nvd3.nv-linePlusBar .nv-bar rect:hover { - fill-opacity: 1; -} - - -/********** -* Bullet -*/ - -.nvd3.nv-bullet { font: 10px sans-serif; } -.nvd3.nv-bullet .nv-measure { fill-opacity: .8; } -.nvd3.nv-bullet .nv-measure:hover { fill-opacity: 1; } -.nvd3.nv-bullet .nv-marker { stroke: #000; stroke-width: 2px; } -.nvd3.nv-bullet .nv-markerTriangle { stroke: #000; fill: #fff; stroke-width: 1.5px; } -.nvd3.nv-bullet .nv-tick line { stroke: #666; stroke-width: .5px; } -.nvd3.nv-bullet .nv-range.nv-s0 { fill: #eee; } -.nvd3.nv-bullet .nv-range.nv-s1 { fill: #ddd; } -.nvd3.nv-bullet .nv-range.nv-s2 { fill: #ccc; } -.nvd3.nv-bullet .nv-title { font-size: 14px; font-weight: bold; } -.nvd3.nv-bullet .nv-subtitle { fill: #999; } - - -.nvd3.nv-bullet .nv-range { - fill: #bababa; - fill-opacity: .4; -} -.nvd3.nv-bullet .nv-range:hover { - fill-opacity: .7; -} - - - -/********** -* Sparkline -*/ - -.nvd3.nv-sparkline path { - fill: none; -} - -.nvd3.nv-sparklineplus g.nv-hoverValue { - pointer-events: none; -} - -.nvd3.nv-sparklineplus .nv-hoverValue line { - stroke: #333; - stroke-width: 1.5px; - } - -.nvd3.nv-sparklineplus, -.nvd3.nv-sparklineplus g { - pointer-events: all; -} - -.nvd3 .nv-hoverArea { - fill-opacity: 0; - stroke-opacity: 0; -} - -.nvd3.nv-sparklineplus .nv-xValue, -.nvd3.nv-sparklineplus .nv-yValue { - /* - stroke: #666; - */ - stroke-width: 0; - font-size: .9em; - font-weight: normal; -} - -.nvd3.nv-sparklineplus .nv-yValue { - stroke: #f66; -} - -.nvd3.nv-sparklineplus .nv-maxValue { - stroke: #2ca02c; - fill: #2ca02c; -} - -.nvd3.nv-sparklineplus .nv-minValue { - stroke: #d62728; - fill: #d62728; -} - -.nvd3.nv-sparklineplus .nv-currentValue { - /* - stroke: #444; - fill: #000; - */ - font-weight: bold; - font-size: 1.1em; -} - -/********** -* historical stock -*/ - -.nvd3.nv-ohlcBar .nv-ticks .nv-tick { - stroke-width: 2px; -} - -.nvd3.nv-ohlcBar .nv-ticks .nv-tick.hover { - stroke-width: 4px; -} - -.nvd3.nv-ohlcBar .nv-ticks .nv-tick.positive { - stroke: #2ca02c; -} - -.nvd3.nv-ohlcBar .nv-ticks .nv-tick.negative { - stroke: #d62728; -} - -.nvd3.nv-historicalStockChart .nv-axis .nv-axislabel { - font-weight: bold; -} - -.nvd3.nv-historicalStockChart .nv-dragTarget { - fill-opacity: 0; - stroke: none; - cursor: move; -} - -.nvd3 .nv-brush .extent { - /* - cursor: ew-resize !important; - */ - fill-opacity: 0 !important; -} - -.nvd3 .nv-brushBackground rect { - stroke: #000; - stroke-width: .4; - fill: #fff; - fill-opacity: .7; -} - - - -/********** -* Indented Tree -*/ - - -/** - * TODO: the following 3 selectors are based on classes used in the example. I should either make them standard and leave them here, or move to a CSS file not included in the library - */ -.nvd3.nv-indentedtree .name { - margin-left: 5px; -} - -.nvd3.nv-indentedtree .clickable { - color: #08C; - cursor: pointer; -} - -.nvd3.nv-indentedtree span.clickable:hover { - color: #005580; - text-decoration: underline; -} - - -.nvd3.nv-indentedtree .nv-childrenCount { - display: inline-block; - margin-left: 5px; -} - -.nvd3.nv-indentedtree .nv-treeicon { - cursor: pointer; - /* - cursor: n-resize; - */ -} - -.nvd3.nv-indentedtree .nv-treeicon.nv-folded { - cursor: pointer; - /* - cursor: s-resize; - */ -} - -/********** -* Parallel Coordinates -*/ - -.nvd3 .background path { - fill: none; - stroke: #ccc; - stroke-opacity: .4; - shape-rendering: crispEdges; -} - -.nvd3 .foreground path { - fill: none; - stroke: steelblue; - stroke-opacity: .7; -} - -.nvd3 .brush .extent { - fill-opacity: .3; - stroke: #fff; - shape-rendering: crispEdges; -} - -.nvd3 .axis line, .axis path { - fill: none; - stroke: #000; - shape-rendering: crispEdges; -} - -.nvd3 .axis text { - text-shadow: 0 1px 0 #fff; -} - -/**** -Interactive Layer -*/ -.nvd3 .nv-interactiveGuideLine { - pointer-events:none; -} -.nvd3 line.nv-guideline { - stroke: #ccc; -} \ No newline at end of file diff --git a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Template/css/style.css b/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Template/css/style.css deleted file mode 100644 index ff146a5..0000000 --- a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Template/css/style.css +++ /dev/null @@ -1,114 +0,0 @@ -body { - padding-top: 10px; -} - -.popover { - max-width: none; -} - -.glyphicon { - margin-right:.25em; -} - -.table-bordered>thead>tr>td { - border-bottom-width: 1px; -} - -.table tbody>tr>td, .table thead>tr>td { - padding-top: 3px; - padding-bottom: 3px; -} - -.table-condensed tbody>tr>td { - padding-top: 0; - padding-bottom: 0; -} - -.table .progress { - margin-bottom: inherit; -} - -.table-borderless th, .table-borderless td { - border: 0 !important; -} - -.table tbody td.success, li.success, span.success { - background-color: #dff0d8; -} - -.table tbody tr.danger, .table tbody td.danger, li.danger, span.danger { - background-color: #f2dede; -} - -.table tbody td.warning, li.warning, span.warning { - background-color: #fcf8e3; -} - -.table tbody td.info { - background-color: #d9edf7; -} - -td.big { - width: 117px; -} - -td.small { -} - -td.codeLine { - font-family: monospace; - white-space: pre; -} - -td span.comment { - color: #888a85; -} - -td span.default { - color: #2e3436; -} - -td span.html { - color: #888a85; -} - -td span.keyword { - color: #2e3436; - font-weight: bold; -} - -pre span.string { - color: #2e3436; -} - -span.success, span.warning, span.danger { - margin-right: 2px; - padding-left: 10px; - padding-right: 10px; - text-align: center; -} - -#classCoverageDistribution, #classComplexity { - height: 200px; - width: 475px; -} - -#toplink { - position: fixed; - left: 5px; - bottom: 5px; - outline: 0; -} - -svg text { - font-family: "Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif; - font-size: 11px; - color: #666; - fill: #666; -} - -.scrollbox { - height:245px; - overflow-x:hidden; - overflow-y:scroll; -} \ No newline at end of file diff --git a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Template/dashboard.html.dist b/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Template/dashboard.html.dist deleted file mode 100644 index 3ae8ba1..0000000 --- a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Template/dashboard.html.dist +++ /dev/null @@ -1,286 +0,0 @@ - - - - - Dashboard for {{full_path}} - - - - - - - -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    -
    -

    Classes

    -
    -
    -
    -
    -

    Coverage Distribution

    -
    - -
    -
    -
    -

    Complexity

    -
    - -
    -
    -
    -
    -
    -

    Insufficient Coverage

    -
    - - - - - - - - -{{insufficient_coverage_classes}} - -
    ClassCoverage
    -
    -
    -
    -

    Project Risks

    -
    - - - - - - - - -{{project_risks_classes}} - -
    ClassCRAP
    -
    -
    -
    -
    -
    -

    Methods

    -
    -
    -
    -
    -

    Coverage Distribution

    -
    - -
    -
    -
    -

    Complexity

    -
    - -
    -
    -
    -
    -
    -

    Insufficient Coverage

    -
    - - - - - - - - -{{insufficient_coverage_methods}} - -
    MethodCoverage
    -
    -
    -
    -

    Project Risks

    -
    - - - - - - - - -{{project_risks_methods}} - -
    MethodCRAP
    -
    -
    -
    - -
    - - - - - - - - diff --git a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Template/directory.html.dist b/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Template/directory.html.dist deleted file mode 100644 index 8175df9..0000000 --- a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Template/directory.html.dist +++ /dev/null @@ -1,61 +0,0 @@ - - - - - Code Coverage for {{full_path}} - - - - - - -
    -
    -
    -
    - -
    -
    -
    -
    -
    - - - - - - - - - - - - - - -{{items}} - -
     
    Code Coverage
     
    Lines
    Functions and Methods
    Classes and Traits
    - -
    - - - - - diff --git a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Template/directory_item.html.dist b/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Template/directory_item.html.dist deleted file mode 100644 index 78dbb35..0000000 --- a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Template/directory_item.html.dist +++ /dev/null @@ -1,13 +0,0 @@ - - {{icon}}{{name}} - {{lines_bar}} -
    {{lines_executed_percent}}
    -
    {{lines_number}}
    - {{methods_bar}} -
    {{methods_tested_percent}}
    -
    {{methods_number}}
    - {{classes_bar}} -
    {{classes_tested_percent}}
    -
    {{classes_number}}
    - - diff --git a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Template/file.html.dist b/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Template/file.html.dist deleted file mode 100644 index 6827bd1..0000000 --- a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Template/file.html.dist +++ /dev/null @@ -1,90 +0,0 @@ - - - - - Code Coverage for {{full_path}} - - - - - - -
    -
    -
    -
    - -
    -
    -
    -
    -
    - - - - - - - - - - - - - - -{{items}} - -
     
    Code Coverage
     
    Classes and Traits
    Functions and Methods
    Lines
    - - -{{lines}} - -
    - -
    - - - - - - diff --git a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Template/file_item.html.dist b/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Template/file_item.html.dist deleted file mode 100644 index 756fdd6..0000000 --- a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Template/file_item.html.dist +++ /dev/null @@ -1,14 +0,0 @@ - - {{name}} - {{classes_bar}} -
    {{classes_tested_percent}}
    -
    {{classes_number}}
    - {{methods_bar}} -
    {{methods_tested_percent}}
    -
    {{methods_number}}
    - {{crap}} - {{lines_bar}} -
    {{lines_executed_percent}}
    -
    {{lines_number}}
    - - diff --git a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Template/fonts/glyphicons-halflings-regular.eot b/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Template/fonts/glyphicons-halflings-regular.eot deleted file mode 100644 index b93a495..0000000 Binary files a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Template/fonts/glyphicons-halflings-regular.eot and /dev/null differ diff --git a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Template/fonts/glyphicons-halflings-regular.svg b/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Template/fonts/glyphicons-halflings-regular.svg deleted file mode 100644 index 94fb549..0000000 --- a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Template/fonts/glyphicons-halflings-regular.svg +++ /dev/null @@ -1,288 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Template/fonts/glyphicons-halflings-regular.ttf b/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Template/fonts/glyphicons-halflings-regular.ttf deleted file mode 100644 index 1f85312..0000000 Binary files a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Template/fonts/glyphicons-halflings-regular.ttf and /dev/null differ diff --git a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Template/fonts/glyphicons-halflings-regular.woff b/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Template/fonts/glyphicons-halflings-regular.woff deleted file mode 100644 index 9e61285..0000000 Binary files a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Template/fonts/glyphicons-halflings-regular.woff and /dev/null differ diff --git a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Template/fonts/glyphicons-halflings-regular.woff2 b/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Template/fonts/glyphicons-halflings-regular.woff2 deleted file mode 100644 index 64539b5..0000000 Binary files a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Template/fonts/glyphicons-halflings-regular.woff2 and /dev/null differ diff --git a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Template/js/bootstrap.min.js b/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Template/js/bootstrap.min.js deleted file mode 100644 index c6d3692..0000000 --- a/core/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Template/js/bootstrap.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * Bootstrap v3.3.2 (http://getbootstrap.com) - * Copyright 2011-2015 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - */ -if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.2",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a(f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.2",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")&&(c.prop("checked")&&this.$element.hasClass("active")?a=!1:b.find(".active").removeClass("active")),a&&c.prop("checked",!this.$element.hasClass("active")).trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active"));a&&this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),c.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=this.sliding=this.interval=this.$active=this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.2",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));return a>this.$items.length-1||0>a?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&"show"==b&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a(this.options.trigger).filter('[href="#'+b.id+'"], [data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.2",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0,trigger:'[data-toggle="collapse"]'},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":a.extend({},e.data(),{trigger:this});c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){b&&3===b.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=c(d),f={relatedTarget:this};e.hasClass("open")&&(e.trigger(b=a.Event("hide.bs.dropdown",f)),b.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger("hidden.bs.dropdown",f)))}))}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.2",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a('