diff --git a/vendor/phpspec/phpspec/src/PhpSpec/Formatter/Html/Template/ReportLine.html b/app/database/production.sqlite similarity index 100% rename from vendor/phpspec/phpspec/src/PhpSpec/Formatter/Html/Template/ReportLine.html rename to app/database/production.sqlite diff --git a/public/mez.zip b/public/mez.zip new file mode 100644 index 0000000..f453f97 Binary files /dev/null and b/public/mez.zip differ diff --git a/vendor/d11wtq/boris/CONTRIBUTING.md b/vendor/d11wtq/boris/CONTRIBUTING.md new file mode 100644 index 0000000..5567975 --- /dev/null +++ b/vendor/d11wtq/boris/CONTRIBUTING.md @@ -0,0 +1,14 @@ +# Contribution Guidelines + +## Rules + +There are a few basic ground-rules for contributors: + +1. **No `--force` pushes** or modifying the Git history in any way. +2. **External API changes and significant modifications** should be subject to a **pull request** to solicit feedback from other contributors. +3. Use a non-`master` branch for ongoing work. +4. Adhere to existing code style as much as possible. + +## Releases + +Declaring formal releases remains the prerogative of the project maintainer. diff --git a/vendor/d11wtq/boris/release.php b/vendor/d11wtq/boris/release.php new file mode 100644 index 0000000..7fafeeb --- /dev/null +++ b/vendor/d11wtq/boris/release.php @@ -0,0 +1,150 @@ +#!/usr/bin/env php + + * + * Copyright © 2013-2014 Chris Corbyn. + */ + +/* Generate releases in Github */ + +namespace Boris; + +require __DIR__ . '/lib/autoload.php'; + +$args = getopt('hv:', array( + 'help', + 'version:' +)); + +if (count($args) != 1) { + help(); + exit(1); +} + +foreach ($args as $opt => $value) { + switch ($opt) { + case 'v': + case 'version': + version($value); + exit(0); + + case 'h': + case 'help': + help(); + exit(0); + + default: + unknown($opt); + exit(1); + } +} + +function help() +{ + echo << $to) { - if (! isset($object[$from])) { - continue; - } - - $result[$to] = $object[$from]; - } - - return $result; - } - - /** - * Normalize path. - * - * @param string $path - * - * @throws LogicException - * - * @return string - */ - public static function normalizePath($path) - { - // Remove any kind of funky unicode whitespace - $normalized = preg_replace('#\p{C}+|^\./#u', '', $path); - - $normalized = static::normalizeRelativePath($normalized); - - if (preg_match('#/\.{2}|^\.{2}/#', $normalized)) { - throw new LogicException('Path is outside of the defined root, path: ['.$path.'], resolved: ['.$normalized.']'); - } - - // Replace any double directory separators - $normalized = preg_replace('#\\\{2,}#', '\\', trim($normalized, '\\')); - $normalized = preg_replace('#/{2,}#', '/', trim($normalized, '/')); - - return $normalized; - } - - /** - * Normalize relative directories in a path. - * - * @param string $path - * - * @return string - */ - public static function normalizeRelativePath($path) - { - // Path remove self referring paths ("/./"). - $path = preg_replace('#/\.(?=/)|^\./|\./$#', '', $path); - - // Regex for resolving relative paths - $regex = '#/*[^/\.]+/\.\.#Uu'; - - while (preg_match($regex, $path)) { - $path = preg_replace($regex, '', $path); - } - - return $path; - } - - /** - * Normalize prefix. - * - * @param string $prefix - * @param string $separator - * - * @return string normalized path - */ - public static function normalizePrefix($prefix, $separator) - { - return rtrim($prefix, $separator).$separator; - } - - /** - * Get content size. - * - * @param string $contents - * - * @return int content size - */ - public static function contentSize($contents) - { - return mb_strlen($contents, '8bit'); - } - - /** - * Guess MIME Type based on the path of the file and it's content. - * - * @param string $path - * @param string $content - * - * @return string|null MIME Type or NULL if no extension detected - */ - public static function guessMimeType($path, $content) - { - $mimeType = MimeType::detectByContent($content); - - if (empty($mimeType) || $mimeType === 'text/plain') { - $extension = pathinfo($path, PATHINFO_EXTENSION); - - if ($extension) { - $mimeType = MimeType::detectByFileExtension($extension) ?: 'text/plain'; - } - } - - return $mimeType; - } - - /** - * Emulate directories. - * - * @param array $listing - * - * @return array listing with emulated directories - */ - public static function emulateDirectories(array $listing) - { - $directories = []; - $listedDirectories = []; - - foreach ($listing as $object) { - list($directories, $listedDirectories) = static::emulateObjectDirectories($object, $directories, $listedDirectories); - } - - $directories = array_diff(array_unique($directories), array_unique($listedDirectories)); - - foreach ($directories as $directory) { - $listing[] = static::pathinfo($directory) + ['type' => 'dir']; - } - - return $listing; - } - - /** - * Ensure a Config instance. - * - * @param string|null|array|Config $config - * - * @return Config config instance - * - * @throw LogicException - */ - public static function ensureConfig($config) - { - if ($config === null) { - return new Config(); - } - - if ($config instanceof Config) { - return $config; - } - - // Backwards compatibility - if (is_string($config)) { - $config = ['visibility' => $config]; - } - - if (is_array($config)) { - return new Config($config); - } - - throw new LogicException('A config should either be an array or a Flysystem\Config object.'); - } - - /** - * Rewind a stream. - * - * @param resource $resource - */ - public static function rewindStream($resource) - { - if (ftell($resource) !== 0) { - rewind($resource); - } - } - - /** - * Get the size of a stream. - * - * @param resource $resource - * - * @return int stream size - */ - public static function getStreamSize($resource) - { - $stat = fstat($resource); - - return $stat['size']; - } - - /** - * Emulate the directories of a single object. - * - * @param array $object - * @param array $directories - * @param array $listedDirectories - * - * @return array - */ - protected static function emulateObjectDirectories(array $object, array $directories, array $listedDirectories) - { - if (empty($object['dirname'])) { - return [$directories, $listedDirectories]; - } - - $parent = $object['dirname']; - - while (! empty($parent) && ! in_array($parent, $directories)) { - $directories[] = $parent; - - $parent = static::dirname($parent); - } - - if (isset($object['type']) && $object['type'] === 'dir') { - $listedDirectories[] = $object['path']; - - return [$directories, $listedDirectories]; - } - - return [$directories, $listedDirectories]; - } -} diff --git a/vendor/league/flysystem/src/Util/MimeType.php b/vendor/league/flysystem/src/Util/MimeType.php deleted file mode 100644 index a3f173c..0000000 --- a/vendor/league/flysystem/src/Util/MimeType.php +++ /dev/null @@ -1,195 +0,0 @@ -buffer($content); - - return $mimeType ?: null; - } - - /** - * Detects MIME Type based on file extension. - * - * @param string $extension - * - * @return string|null MIME Type or NULL if no extension detected - */ - public static function detectByFileExtension($extension) - { - static $extensionToMimeTypeMap; - - if (! $extensionToMimeTypeMap) { - $extensionToMimeTypeMap = static::getExtensionToMimeTypeMap(); - } - - if (isset($extensionToMimeTypeMap[$extension])) { - return $extensionToMimeTypeMap[$extension]; - } - } - - /** - * @return array Map of file extension to MIME Type - */ - public static function getExtensionToMimeTypeMap() - { - return [ - 'hqx' => 'application/mac-binhex40', - 'cpt' => 'application/mac-compactpro', - 'csv' => 'text/x-comma-separated-values', - 'bin' => 'application/octet-stream', - 'dms' => 'application/octet-stream', - 'lha' => 'application/octet-stream', - 'lzh' => 'application/octet-stream', - 'exe' => 'application/octet-stream', - 'class' => 'application/octet-stream', - 'psd' => 'application/x-photoshop', - 'so' => 'application/octet-stream', - 'sea' => 'application/octet-stream', - 'dll' => 'application/octet-stream', - 'oda' => 'application/oda', - 'pdf' => 'application/pdf', - 'ai' => 'application/pdf', - 'eps' => 'application/postscript', - 'ps' => 'application/postscript', - 'smi' => 'application/smil', - 'smil' => 'application/smil', - 'mif' => 'application/vnd.mif', - 'xls' => 'application/vnd.ms-excel', - 'ppt' => 'application/powerpoint', - 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', - 'wbxml' => 'application/wbxml', - 'wmlc' => 'application/wmlc', - 'dcr' => 'application/x-director', - 'dir' => 'application/x-director', - 'dxr' => 'application/x-director', - 'dvi' => 'application/x-dvi', - 'gtar' => 'application/x-gtar', - 'gz' => 'application/x-gzip', - 'gzip' => 'application/x-gzip', - 'php' => 'application/x-httpd-php', - 'php4' => 'application/x-httpd-php', - 'php3' => 'application/x-httpd-php', - 'phtml' => 'application/x-httpd-php', - 'phps' => 'application/x-httpd-php-source', - 'js' => 'application/javascript', - 'swf' => 'application/x-shockwave-flash', - 'sit' => 'application/x-stuffit', - 'tar' => 'application/x-tar', - 'tgz' => 'application/x-tar', - 'z' => 'application/x-compress', - 'xhtml' => 'application/xhtml+xml', - 'xht' => 'application/xhtml+xml', - 'zip' => 'application/x-zip', - 'rar' => 'application/x-rar', - 'mid' => 'audio/midi', - 'midi' => 'audio/midi', - 'mpga' => 'audio/mpeg', - 'mp2' => 'audio/mpeg', - 'mp3' => 'audio/mpeg', - 'aif' => 'audio/x-aiff', - 'aiff' => 'audio/x-aiff', - 'aifc' => 'audio/x-aiff', - 'ram' => 'audio/x-pn-realaudio', - 'rm' => 'audio/x-pn-realaudio', - 'rpm' => 'audio/x-pn-realaudio-plugin', - 'ra' => 'audio/x-realaudio', - 'rv' => 'video/vnd.rn-realvideo', - 'wav' => 'audio/x-wav', - 'jpg' => 'image/jpeg', - 'jpeg' => 'image/jpeg', - 'jpe' => 'image/jpeg', - 'png' => 'image/png', - 'gif' => 'image/gif', - 'bmp' => 'image/bmp', - 'tiff' => 'image/tiff', - 'tif' => 'image/tiff', - 'css' => 'text/css', - 'html' => 'text/html', - 'htm' => 'text/html', - 'shtml' => 'text/html', - 'txt' => 'text/plain', - 'text' => 'text/plain', - 'log' => 'text/plain', - 'rtx' => 'text/richtext', - 'rtf' => 'text/rtf', - 'xml' => 'application/xml', - 'xsl' => 'application/xml', - 'mpeg' => 'video/mpeg', - 'mpg' => 'video/mpeg', - 'mpe' => 'video/mpeg', - 'qt' => 'video/quicktime', - 'mov' => 'video/quicktime', - 'avi' => 'video/x-msvideo', - 'movie' => 'video/x-sgi-movie', - 'doc' => 'application/msword', - 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', - 'dot' => 'application/msword', - 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', - 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', - 'word' => 'application/msword', - 'xl' => 'application/excel', - 'eml' => 'message/rfc822', - 'json' => 'application/json', - 'pem' => 'application/x-x509-user-cert', - 'p10' => 'application/x-pkcs10', - 'p12' => 'application/x-pkcs12', - 'p7a' => 'application/x-pkcs7-signature', - 'p7c' => 'application/pkcs7-mime', - 'p7m' => 'application/pkcs7-mime', - 'p7r' => 'application/x-pkcs7-certreqresp', - 'p7s' => 'application/pkcs7-signature', - 'crt' => 'application/x-x509-ca-cert', - 'crl' => 'application/pkix-crl', - 'der' => 'application/x-x509-ca-cert', - 'kdb' => 'application/octet-stream', - 'pgp' => 'application/pgp', - 'gpg' => 'application/gpg-keys', - 'sst' => 'application/octet-stream', - 'csr' => 'application/octet-stream', - 'rsa' => 'application/x-pkcs7', - 'cer' => 'application/pkix-cert', - '3g2' => 'video/3gpp2', - '3gp' => 'video/3gp', - 'mp4' => 'video/mp4', - 'm4a' => 'audio/x-m4a', - 'f4v' => 'video/mp4', - 'webm' => 'video/webm', - 'aac' => 'audio/x-acc', - 'm4u' => 'application/vnd.mpegurl', - 'm3u' => 'text/plain', - 'xspf' => 'application/xspf+xml', - 'vlc' => 'application/videolan', - 'wmv' => 'video/x-ms-wmv', - 'au' => 'audio/x-au', - 'ac3' => 'audio/ac3', - 'flac' => 'audio/x-flac', - 'ogg' => 'audio/ogg', - 'kmz' => 'application/vnd.google-earth.kmz', - 'kml' => 'application/vnd.google-earth.kml+xml', - 'ics' => 'text/calendar', - 'zsh' => 'text/x-scriptzsh', - '7zip' => 'application/x-7z-compressed', - 'cdr' => 'application/cdr', - 'wma' => 'audio/x-ms-wma', - 'jar' => 'application/java-archive', - ]; - } -} diff --git a/vendor/monolog/monolog/.php_cs b/vendor/monolog/monolog/.php_cs new file mode 100644 index 0000000..2511e98 --- /dev/null +++ b/vendor/monolog/monolog/.php_cs @@ -0,0 +1,15 @@ +files() + ->name('*.php') + ->in(__DIR__.'/src') + ->in(__DIR__.'/tests') +; + +return Symfony\CS\Config\Config::create() + ->fixers(array( + 'psr0', 'encoding', 'short_tag', 'braces', 'elseif', 'eof_ending', 'function_declaration', 'indentation', 'line_after_namespace', 'linefeed', 'lowercase_constants', 'lowercase_keywords', 'multiple_use', 'php_closing_tag', 'trailing_spaces', 'visibility', 'duplicate_semicolon', 'extra_empty_lines', 'include', 'namespace_no_leading_whitespace', 'object_operator', 'operators_spaces', 'phpdoc_params', 'return', 'single_array_no_trailing_comma', 'spaces_cast', 'standardize_not_equal', 'ternary_spaces', 'unused_use', 'whitespacy_lines', + )) + ->finder($finder) +; diff --git a/vendor/monolog/monolog/CHANGELOG.mdown b/vendor/monolog/monolog/CHANGELOG.mdown index 47042c7..cf8db7b 100644 --- a/vendor/monolog/monolog/CHANGELOG.mdown +++ b/vendor/monolog/monolog/CHANGELOG.mdown @@ -1,3 +1,18 @@ +### 1.13.1 (2015-03-09) + + * Fixed regression in HipChat requiring a new token to be created + +### 1.13.0 (2015-03-05) + + * Added Registry::hasLogger to check for the presence of a logger instance + * Added context.user support to RavenHandler + * Added HipChat API v2 support in the HipChatHandler + * Added NativeMailerHandler::addParameter to pass params to the mail() process + * Added context data to SlackHandler when $includeContextAndExtra is true + * Added ability to customize the Swift_Message per-email in SwiftMailerHandler + * Fixed SwiftMailerHandler to lazily create message instances if a callback is provided + * Fixed serialization of INF and NaN values in Normalizer and LineFormatter + ### 1.12.0 (2014-12-29) * Break: HandlerInterface::isHandling now receives a partial record containing only a level key. This was always the intent and does not break any Monolog handler but is strictly speaking a BC break and you should check if you relied on any other field in your own handlers. diff --git a/vendor/monolog/monolog/README.mdown b/vendor/monolog/monolog/README.mdown index add476a..7ac9904 100644 --- a/vendor/monolog/monolog/README.mdown +++ b/vendor/monolog/monolog/README.mdown @@ -238,6 +238,13 @@ Utilities - _ChannelLevelActivationStrategy_: Activates a FingersCrossedHandler when a certain log level is reached, depending on which channel received the log record. +Third Party Packages +-------------------- + +Third party handlers, formatters and processors are +[listed in the wiki](https://github.com/Seldaek/monolog/wiki/Third-Party-Packages). You +can also add your own there if you publish one. + About ===== @@ -258,12 +265,14 @@ Frameworks Integration can be used very easily with Monolog since it implements the interface. - [Symfony2](http://symfony.com) comes out of the box with Monolog. - [Silex](http://silex.sensiolabs.org/) comes out of the box with Monolog. -- [Laravel 4](http://laravel.com/) comes out of the box with Monolog. +- [Laravel 4 & 5](http://laravel.com/) come out of the box with Monolog. - [PPI](http://www.ppi.io/) comes out of the box with Monolog. - [CakePHP](http://cakephp.org/) is usable with Monolog via the [cakephp-monolog](https://github.com/jadb/cakephp-monolog) plugin. - [Slim](http://www.slimframework.com/) is usable with Monolog via the [Slim-Monolog](https://github.com/Flynsarmy/Slim-Monolog) log writer. - [XOOPS 2.6](http://xoops.org/) comes out of the box with Monolog. - [Aura.Web_Project](https://github.com/auraphp/Aura.Web_Project) comes out of the box with Monolog. +- [Nette Framework](http://nette.org/en/) can be used with Monolog via [Kdyby/Monolog](https://github.com/Kdyby/Monolog) extension. +- [Proton Micro Framework](https://github.com/alexbilbie/Proton) comes out of the box with Monolog. Author ------ diff --git a/vendor/monolog/monolog/composer.json b/vendor/monolog/monolog/composer.json index 4370423..9fec07a 100644 --- a/vendor/monolog/monolog/composer.json +++ b/vendor/monolog/monolog/composer.json @@ -23,7 +23,8 @@ "ruflin/elastica": "0.90.*", "doctrine/couchdb": "~1.0@dev", "aws/aws-sdk-php": "~2.4, >2.4.8", - "videlalvaro/php-amqplib": "~2.4" + "videlalvaro/php-amqplib": "~2.4", + "swiftmailer/swiftmailer": "~5.3" }, "suggest": { "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", @@ -44,7 +45,10 @@ }, "extra": { "branch-alias": { - "dev-master": "1.12.x-dev" + "dev-master": "1.13.x-dev" } + }, + "scripts": { + "test": "phpunit" } } diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php index 8d01c64..1e43175 100644 --- a/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php +++ b/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php @@ -67,19 +67,29 @@ public function __construct($systemName = null, $extraPrefix = null, $contextPre public function format(array $record) { $record = parent::format($record); + + if (!isset($record['datetime'], $record['message'], $record['level'])) { + throw new \InvalidArgumentException('The record should at least contain datetime, message and level keys, '.var_export($record, true).' given'); + } + $message = new Message(); $message ->setTimestamp($record['datetime']) ->setShortMessage((string) $record['message']) - ->setFacility($record['channel']) ->setHost($this->systemName) - ->setLine(isset($record['extra']['line']) ? $record['extra']['line'] : null) - ->setFile(isset($record['extra']['file']) ? $record['extra']['file'] : null) ->setLevel($this->logLevels[$record['level']]); - // Do not duplicate these values in the additional fields - unset($record['extra']['line']); - unset($record['extra']['file']); + if (isset($record['channel'])) { + $message->setFacility($record['channel']); + } + if (isset($record['extra']['line'])) { + $message->setLine($record['extra']['line']); + unset($record['extra']['line']); + } + if (isset($record['extra']['file'])) { + $message->setFile($record['extra']['file']); + unset($record['extra']['file']); + } foreach ($record['extra'] as $key => $val) { $message->setAdditional($this->extraPrefix . $key, is_scalar($val) ? $val : $this->toJson($val)); diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php index 7963dbf..e5a1d2c 100644 --- a/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php +++ b/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php @@ -39,7 +39,7 @@ public function __construct($batchMode = self::BATCH_MODE_JSON, $appendNewline = * The batch mode option configures the formatting style for * multiple records. By default, multiple records will be * formatted as a JSON-encoded array. However, for - * compatibility with some API endpoints, alternive styles + * compatibility with some API endpoints, alternative styles * are available. * * @return int diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php index beafea6..654e790 100644 --- a/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php +++ b/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php @@ -58,6 +58,15 @@ public function formatBatch(array $records) protected function normalize($data) { if (null === $data || is_scalar($data)) { + if (is_float($data)) { + if (is_infinite($data)) { + return ($data > 0 ? '' : '-') . 'INF'; + } + if (is_nan($data)) { + return 'NaN'; + } + } + return $data; } diff --git a/vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php index 43190b9..bee6903 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php @@ -26,7 +26,7 @@ class BrowserConsoleHandler extends AbstractProcessingHandler /** * {@inheritDoc} * - * Formatted output may contain some formatting markers to be transfered to `console.log` using the %c format. + * Formatted output may contain some formatting markers to be transferred to `console.log` using the %c format. * * Example of formatted string: * diff --git a/vendor/monolog/monolog/src/Monolog/Handler/HipChatHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/HipChatHandler.php index 29614d3..185e86e 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/HipChatHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/HipChatHandler.php @@ -43,7 +43,7 @@ class HipChatHandler extends SocketHandler private $token; /** - * @var array + * @var string */ private $room; @@ -53,7 +53,7 @@ class HipChatHandler extends SocketHandler private $name; /** - * @var boolean + * @var bool */ private $notify; @@ -62,14 +62,19 @@ class HipChatHandler extends SocketHandler */ private $format; + /** + * @var string + */ + private $host; + /** * @param string $token HipChat API Token * @param string $room The room that should be alerted of the message (Id or Name) * @param string $name Name used in the "from" field * @param bool $notify Trigger a notification in clients or not * @param int $level The minimum logging level at which this handler will be triggered - * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not - * @param Boolean $useSSL Whether to connect via SSL. + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + * @param bool $useSSL Whether to connect via SSL. * @param string $format The format of the messages (default to text, can be set to html if you have html in the messages) * @param string $host The HipChat server hostname. */ @@ -87,6 +92,7 @@ public function __construct($token, $room, $name = 'Monolog', $notify = false, $ $this->notify = $notify; $this->room = $room; $this->format = $format; + $this->host = $host; } /** @@ -131,7 +137,7 @@ private function buildContent($record) private function buildHeader($content) { $header = "POST /v1/rooms/message?format=json&auth_token=".$this->token." HTTP/1.1\r\n"; - $header .= "Host: api.hipchat.com\r\n"; + $header .= "Host: {$this->host}\r\n"; $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; $header .= "Content-Length: " . strlen($content) . "\r\n"; $header .= "\r\n"; @@ -229,19 +235,19 @@ private function combineRecords($records) } $messages[] = $record['message']; - $messgeStr = implode(PHP_EOL, $messages); + $messageStr = implode(PHP_EOL, $messages); $formattedMessages[] = $this->getFormatter()->format($record); $formattedMessageStr = implode('', $formattedMessages); $batchRecord = array( - 'message' => $messgeStr, + 'message' => $messageStr, 'formatted' => $formattedMessageStr, 'context' => array(), 'extra' => array(), ); if (!$this->validateStringLength($batchRecord['formatted'], static::MAXIMUM_MESSAGE_LENGTH)) { - // Pop the last message and implode the remainging messages + // Pop the last message and implode the remaining messages $lastMessage = array_pop($messages); $lastFormattedMessage = array_pop($formattedMessages); $batchRecord['message'] = implode(PHP_EOL, $messages); diff --git a/vendor/monolog/monolog/src/Monolog/Handler/LogEntriesHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/LogEntriesHandler.php index 8bf388b..bd56230 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/LogEntriesHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/LogEntriesHandler.php @@ -29,7 +29,7 @@ class LogEntriesHandler extends SocketHandler * @param int $level The minimum logging level to trigger this handler * @param boolean $bubble Whether or not messages that are handled should bubble up the stack. * - * @throws MissingExtensionExcpetion If SSL encryption is set to true and OpenSSL is missing + * @throws MissingExtensionException If SSL encryption is set to true and OpenSSL is missing */ public function __construct($token, $useSSL = true, $level = Logger::DEBUG, $bubble = true) { @@ -37,7 +37,7 @@ public function __construct($token, $useSSL = true, $level = Logger::DEBUG, $bub throw new MissingExtensionException('The OpenSSL PHP plugin is required to use SSL encrypted connection for LogEntriesHandler'); } - $endpoint = $useSSL ? 'ssl://api.logentries.com:20000' : 'data.logentries.com:80'; + $endpoint = $useSSL ? 'ssl://data.logentries.com:443' : 'data.logentries.com:80'; parent::__construct($endpoint, $level, $bubble); $this->logToken = $token; } diff --git a/vendor/monolog/monolog/src/Monolog/Handler/MailHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/MailHandler.php index 8629272..50ed638 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/MailHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/MailHandler.php @@ -40,7 +40,7 @@ public function handleBatch(array $records) /** * Send a mail with the given content * - * @param string $content + * @param string $content formatted email body to be sent * @param array $records the array of log records that formed this content */ abstract protected function send($content, array $records); diff --git a/vendor/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php index 0fe6b64..5118a0e 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php @@ -39,6 +39,12 @@ class NativeMailerHandler extends MailHandler */ protected $headers = array(); + /** + * Optional parameters for the message + * @var array + */ + protected $parameters = array(); + /** * The wordwrap length for the message * @var integer @@ -78,7 +84,7 @@ public function __construct($to, $subject, $from, $level = Logger::ERROR, $bubbl * Add headers to the message * * @param string|array $headers Custom added headers - * @return null + * @return self */ public function addHeader($headers) { @@ -88,6 +94,21 @@ public function addHeader($headers) } $this->headers[] = $header; } + + return $this; + } + + /** + * Add parameters to the message + * + * @param string|array $parameters Custom added parameters + * @return self + */ + public function addParameter($parameters) + { + $this->parameters = array_merge($this->parameters, (array) $parameters); + + return $this; } /** @@ -102,7 +123,7 @@ protected function send($content, array $records) $headers .= 'MIME-Version: 1.0' . "\r\n"; } foreach ($this->to as $to) { - mail($to, $this->subject, $content, $headers); + mail($to, $this->subject, $content, $headers, implode(' ', $this->parameters)); } } @@ -145,7 +166,7 @@ public function setContentType($contentType) public function setEncoding($encoding) { if (strpos($encoding, "\n") !== false || strpos($encoding, "\r") !== false) { - throw new \InvalidArgumentException('The content type can not contain newline characters to prevent email header injection'); + throw new \InvalidArgumentException('The encoding can not contain newline characters to prevent email header injection'); } $this->encoding = $encoding; diff --git a/vendor/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php index 9807410..0c26794 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php @@ -14,9 +14,11 @@ use Monolog\Logger; /** - * Class to record a log on a NewRelic application + * Class to record a log on a NewRelic application. + * Enabling New Relic High Security mode may prevent capture of useful information. * * @see https://docs.newrelic.com/docs/agents/php-agent + * @see https://docs.newrelic.com/docs/accounts-partnerships/accounts/security/high-security */ class NewRelicHandler extends AbstractProcessingHandler { diff --git a/vendor/monolog/monolog/src/Monolog/Handler/RavenHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/RavenHandler.php index f5743cd..69da8ca 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/RavenHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/RavenHandler.php @@ -127,6 +127,8 @@ public function getBatchFormatter() */ protected function write(array $record) { + // ensures user context is empty + $this->ravenClient->user_context(null); $options = array(); $options['level'] = $this->logLevels[$record['level']]; $options['tags'] = array(); @@ -146,6 +148,10 @@ protected function write(array $record) } if (!empty($record['context'])) { $options['extra']['context'] = $record['context']; + if (!empty($record['context']['user'])) { + $this->ravenClient->user_context($record['context']['user']); + unset($options['extra']['context']['user']); + } } if (!empty($record['extra'])) { $options['extra']['extra'] = $record['extra']; diff --git a/vendor/monolog/monolog/src/Monolog/Handler/SamplingHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/SamplingHandler.php index 487e26f..9509ae3 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/SamplingHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/SamplingHandler.php @@ -11,7 +11,6 @@ namespace Monolog\Handler; - /** * Sampling handler * diff --git a/vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php index e3c8e11..7328dee 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php @@ -53,16 +53,16 @@ class SlackHandler extends SocketHandler private $useAttachment; /** - * Whether the the message that is added to Slack as attachment is in a short style (or not) + * Whether the the context/extra messages added to Slack as attachments are in a short style * @var bool */ private $useShortAttachment; /** - * Whether the attachment should include extra data (or not) + * Whether the attachment should include context and extra data * @var bool */ - private $includeExtra; + private $includeContextAndExtra; /** * @var LineFormatter @@ -70,15 +70,17 @@ class SlackHandler extends SocketHandler private $lineFormatter; /** - * @param string $token Slack API token - * @param string $channel Slack channel (encoded ID or name) - * @param string $username Name of a bot - * @param bool $useAttachment Whether the message should be added to Slack as attachment (plain text otherwise) - * @param string|null $iconEmoji The emoji name to use (or null) - * @param int $level The minimum logging level at which this handler will be triggered - * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + * @param string $token Slack API token + * @param string $channel Slack channel (encoded ID or name) + * @param string $username Name of a bot + * @param bool $useAttachment Whether the message should be added to Slack as attachment (plain text otherwise) + * @param string|null $iconEmoji The emoji name to use (or null) + * @param int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + * @param bool $useShortAttachment Whether the the context/extra messages added to Slack as attachments are in a short style + * @param bool $includeContextAndExtra Whether the attachment should include context and extra data */ - public function __construct($token, $channel, $username = 'Monolog', $useAttachment = true, $iconEmoji = null, $level = Logger::CRITICAL, $bubble = true, $useShortAttachment = false, $includeExtra = false) + public function __construct($token, $channel, $username = 'Monolog', $useAttachment = true, $iconEmoji = null, $level = Logger::CRITICAL, $bubble = true, $useShortAttachment = false, $includeContextAndExtra = false) { if (!extension_loaded('openssl')) { throw new MissingExtensionException('The OpenSSL PHP extension is required to use the SlackHandler'); @@ -92,8 +94,8 @@ public function __construct($token, $channel, $username = 'Monolog', $useAttachm $this->iconEmoji = trim($iconEmoji, ':'); $this->useAttachment = $useAttachment; $this->useShortAttachment = $useShortAttachment; - $this->includeExtra = $includeExtra; - if ($this->includeExtra) { + $this->includeContextAndExtra = $includeContextAndExtra; + if ($this->includeContextAndExtra) { $this->lineFormatter = new LineFormatter; } } @@ -156,19 +158,44 @@ private function buildContent($record) ); } - if ($this->includeExtra) { - $extra = ''; - foreach ($record['extra'] as $var => $val) { - $extra .= $var.': '.$this->lineFormatter->stringify($val)." | "; + if ($this->includeContextAndExtra) { + if (!empty($record['extra'])) { + if ($this->useShortAttachment) { + $attachment['fields'][] = array( + 'title' => "Extra", + 'value' => $this->stringify($record['extra']), + 'short' => $this->useShortAttachment + ); + } else { + // Add all extra fields as individual fields in attachment + foreach ($record['extra'] as $var => $val) { + $attachment['fields'][] = array( + 'title' => $var, + 'value' => $val, + 'short' => $this->useShortAttachment + ); + } + } } - $extra = rtrim($extra, " |"); - - $attachment['fields'][] = array( - 'title' => "Extra", - 'value' => $extra, - 'short' => false - ); + if (!empty($record['context'])) { + if ($this->useShortAttachment) { + $attachment['fields'][] = array( + 'title' => "Context", + 'value' => $this->stringify($record['context']), + 'short' => $this->useShortAttachment + ); + } else { + // Add all context fields as individual fields in attachment + foreach ($record['context'] as $var => $val) { + $attachment['fields'][] = array( + 'title' => $var, + 'value' => $val, + 'short' => $this->useShortAttachment + ); + } + } + } } $dataArray['attachments'] = json_encode(array($attachment)); @@ -231,4 +258,23 @@ protected function getAttachmentColor($level) return '#e3e4e6'; } } + + /** + * Stringifies an array of key/value pairs to be used in attachment fields + * + * @param array $fields + * @access protected + * @return string + */ + protected function stringify($fields) + { + $string = ''; + foreach ($fields as $var => $val) { + $string .= $var.': '.$this->lineFormatter->stringify($val)." | "; + } + + $string = rtrim($string, " |"); + + return $string; + } } diff --git a/vendor/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php index af321db..003a1a2 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php @@ -21,7 +21,7 @@ class SwiftMailerHandler extends MailHandler { protected $mailer; - protected $message; + private $messageTemplate; /** * @param \Swift_Mailer $mailer The mailer to use @@ -32,14 +32,9 @@ class SwiftMailerHandler extends MailHandler public function __construct(\Swift_Mailer $mailer, $message, $level = Logger::ERROR, $bubble = true) { parent::__construct($level, $bubble); - $this->mailer = $mailer; - if (!$message instanceof \Swift_Message && is_callable($message)) { - $message = call_user_func($message); - } - if (!$message instanceof \Swift_Message) { - throw new \InvalidArgumentException('You must provide either a Swift_Message instance or a callable returning it'); - } - $this->message = $message; + + $this->mailer = $mailer; + $this->messageTemplate = $message; } /** @@ -47,10 +42,46 @@ public function __construct(\Swift_Mailer $mailer, $message, $level = Logger::ER */ protected function send($content, array $records) { - $message = clone $this->message; + $this->mailer->send($this->buildMessage($content, $records)); + } + + /** + * Creates instance of Swift_Message to be sent + * + * @param string $content formatted email body to be sent + * @param array $records Log records that formed the content + * @return \Swift_Message + */ + protected function buildMessage($content, array $records) + { + $message = null; + if ($this->messageTemplate instanceof \Swift_Message) { + $message = clone $this->messageTemplate; + } else if (is_callable($this->messageTemplate)) { + $message = call_user_func($this->messageTemplate, $content, $records); + } + + if (!$message instanceof \Swift_Message) { + throw new \InvalidArgumentException('Could not resolve message as instance of Swift_Message or a callable returning it'); + } + $message->setBody($content); $message->setDate(time()); - $this->mailer->send($message); + return $message; + } + + /** + * BC getter, to be removed in 2.0 + */ + public function __get($name) + { + if ($name === 'message') { + trigger_error('SwiftMailerHandler->message is deprecated, use ->buildMessage() instead to retrieve the message', E_USER_DEPRECATED); + + return $this->buildMessage(null, array()); + } + + throw new \InvalidArgumentException('Invalid property '.$name); } } diff --git a/vendor/monolog/monolog/src/Monolog/Registry.php b/vendor/monolog/monolog/src/Monolog/Registry.php index a3eba07..923b774 100644 --- a/vendor/monolog/monolog/src/Monolog/Registry.php +++ b/vendor/monolog/monolog/src/Monolog/Registry.php @@ -63,6 +63,22 @@ public static function addLogger(Logger $logger, $name = null, $overwrite = fals self::$loggers[$name] = $logger; } + /** + * Checks if such logging channel exists by name or instance + * + * @param string|Logger $logger Name or logger instance + */ + public static function hasLogger($logger) + { + if ($logger instanceof Logger) { + $index = array_search($logger, self::$loggers, true); + + return false !== $index; + } else { + return isset(self::$loggers[$logger]); + } + } + /** * Removes instance from registry by name or instance * diff --git a/vendor/monolog/monolog/tests/Monolog/Formatter/GelfMessageFormatterTest.php b/vendor/monolog/monolog/tests/Monolog/Formatter/GelfMessageFormatterTest.php index 3f47a09..6ac1485 100644 --- a/vendor/monolog/monolog/tests/Monolog/Formatter/GelfMessageFormatterTest.php +++ b/vendor/monolog/monolog/tests/Monolog/Formatter/GelfMessageFormatterTest.php @@ -80,6 +80,21 @@ public function testFormatWithFileAndLine() $this->assertEquals(14, $message->getLine()); } + /** + * @covers Monolog\Formatter\GelfMessageFormatter::format + * @expectedException InvalidArgumentException + */ + public function testFormatInvalidFails() + { + $formatter = new GelfMessageFormatter(); + $record = array( + 'level' => Logger::ERROR, + 'level_name' => 'ERROR', + ); + + $formatter->format($record); + } + /** * @covers Monolog\Formatter\GelfMessageFormatter::format */ diff --git a/vendor/monolog/monolog/tests/Monolog/Formatter/NormalizerFormatterTest.php b/vendor/monolog/monolog/tests/Monolog/Formatter/NormalizerFormatterTest.php index 00bbb24..75dae89 100644 --- a/vendor/monolog/monolog/tests/Monolog/Formatter/NormalizerFormatterTest.php +++ b/vendor/monolog/monolog/tests/Monolog/Formatter/NormalizerFormatterTest.php @@ -28,6 +28,9 @@ public function testFormat() 'context' => array( 'foo' => 'bar', 'baz' => 'qux', + 'inf' => INF, + '-inf' => -INF, + 'nan' => acos(4), ), )); @@ -45,6 +48,9 @@ public function testFormat() 'context' => array( 'foo' => 'bar', 'baz' => 'qux', + 'inf' => 'INF', + '-inf' => '-INF', + 'nan' => 'NaN', ) ), $formatted); } diff --git a/vendor/monolog/monolog/tests/Monolog/Functional/Handler/FirePHPHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Functional/Handler/FirePHPHandlerTest.php deleted file mode 100644 index 7e4e7eb..0000000 --- a/vendor/monolog/monolog/tests/Monolog/Functional/Handler/FirePHPHandlerTest.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -spl_autoload_register(function ($class) { - $file = __DIR__.'/../../../../src/'.strtr($class, '\\', '/').'.php'; - if (file_exists($file)) { - require $file; - - return true; - } -}); - -use Monolog\Logger; -use Monolog\Handler\FirePHPHandler; -use Monolog\Handler\ChromePHPHandler; - -$logger = new Logger('firephp'); -$logger->pushHandler(new FirePHPHandler); -$logger->pushHandler(new ChromePHPHandler()); - -$logger->addDebug('Debug'); -$logger->addInfo('Info'); -$logger->addWarning('Warning'); -$logger->addError('Error'); diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/GelfHandlerLegacyTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/GelfHandlerLegacyTest.php index d60a6db..9d007b1 100644 --- a/vendor/monolog/monolog/tests/Monolog/Handler/GelfHandlerLegacyTest.php +++ b/vendor/monolog/monolog/tests/Monolog/Handler/GelfHandlerLegacyTest.php @@ -23,6 +23,8 @@ public function setUp() if (!class_exists('Gelf\MessagePublisher') || !class_exists('Gelf\Message')) { $this->markTestSkipped("mlehner/gelf-php not installed"); } + + require_once __DIR__ . '/GelfMockMessagePublisher.php'; } /** @@ -43,7 +45,7 @@ protected function getHandler($messagePublisher) protected function getMessagePublisher() { - return new MockMessagePublisher('localhost'); + return new GelfMockMessagePublisher('localhost'); } public function testDebug() diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/GelfMockMessagePublisher.php b/vendor/monolog/monolog/tests/Monolog/Handler/GelfMockMessagePublisher.php new file mode 100644 index 0000000..873d92f --- /dev/null +++ b/vendor/monolog/monolog/tests/Monolog/Handler/GelfMockMessagePublisher.php @@ -0,0 +1,25 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Gelf\MessagePublisher; +use Gelf\Message; + +class GelfMockMessagePublisher extends MessagePublisher +{ + public function publish(Message $message) + { + $this->lastMessage = $message; + } + + public $lastMessage = null; +} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/HipChatHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/HipChatHandlerTest.php index d58386a..49f1dfb 100644 --- a/vendor/monolog/monolog/tests/Monolog/Handler/HipChatHandlerTest.php +++ b/vendor/monolog/monolog/tests/Monolog/Handler/HipChatHandlerTest.php @@ -35,6 +35,18 @@ public function testWriteHeader() return $content; } + public function testWriteCustomHostHeader() + { + $this->createHandler('myToken', 'room1', 'Monolog', false, 'hipchat.foo.bar'); + $this->handler->handle($this->getRecord(Logger::CRITICAL, 'test1')); + fseek($this->res, 0); + $content = fread($this->res, 1024); + + $this->assertRegexp('/POST \/v1\/rooms\/message\?format=json&auth_token=.* HTTP\/1.1\\r\\nHost: hipchat.foo.bar\\r\\nContent-Type: application\/x-www-form-urlencoded\\r\\nContent-Length: \d{2,4}\\r\\n\\r\\n/', $content); + + return $content; + } + /** * @depends testWriteHeader */ @@ -129,9 +141,9 @@ public function provideBatchRecords() ); } - private function createHandler($token = 'myToken', $room = 'room1', $name = 'Monolog', $notify = false) + private function createHandler($token = 'myToken', $room = 'room1', $name = 'Monolog', $notify = false, $host = 'api.hipchat.com') { - $constructorArgs = array($token, $room, $name, $notify, Logger::DEBUG); + $constructorArgs = array($token, $room, $name, $notify, Logger::DEBUG, true, true, 'text', $host); $this->res = fopen('php://memory', 'a'); $this->handler = $this->getMock( '\Monolog\Handler\HipChatHandler', diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/NewRelicHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/NewRelicHandlerTest.php index 2201490..4eda615 100644 --- a/vendor/monolog/monolog/tests/Monolog/Handler/NewRelicHandlerTest.php +++ b/vendor/monolog/monolog/tests/Monolog/Handler/NewRelicHandlerTest.php @@ -136,7 +136,7 @@ public function testTheTransactionNameIsNullByDefault() $this->assertEquals(null, self::$transactionName); } - public function testTheTransactionNameCanBeInjectedFromtheConstructor() + public function testTheTransactionNameCanBeInjectedFromTheConstructor() { $handler = new StubNewRelicHandler(Logger::DEBUG, false, null, false, 'myTransaction'); $handler->handle($this->getRecord(Logger::ERROR, 'log message')); diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/RavenHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/RavenHandlerTest.php index 8fe8696..c7b4136 100644 --- a/vendor/monolog/monolog/tests/Monolog/Handler/RavenHandlerTest.php +++ b/vendor/monolog/monolog/tests/Monolog/Handler/RavenHandlerTest.php @@ -85,6 +85,26 @@ public function testTag() $this->assertEquals($tags, $ravenClient->lastData['tags']); } + public function testUserContext() + { + $ravenClient = $this->getRavenClient(); + $handler = $this->getHandler($ravenClient); + + $user = array( + 'id' => '123', + 'email' => 'test@test.com' + ); + $record = $this->getRecord(Logger::INFO, "test", array('user' => $user)); + + $handler->handle($record); + $this->assertEquals($user, $ravenClient->context->user); + + $secondRecord = $this->getRecord(Logger::INFO, "test without user"); + + $handler->handle($secondRecord); + $this->assertNull($ravenClient->context->user); + } + public function testException() { $ravenClient = $this->getRavenClient(); diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/SwiftMailerHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/SwiftMailerHandlerTest.php new file mode 100644 index 0000000..ac88522 --- /dev/null +++ b/vendor/monolog/monolog/tests/Monolog/Handler/SwiftMailerHandlerTest.php @@ -0,0 +1,65 @@ +mailer = $this + ->getMockBuilder('Swift_Mailer') + ->disableOriginalConstructor() + ->getMock(); + } + + public function testMessageCreationIsLazyWhenUsingCallback() + { + $this->mailer->expects($this->never()) + ->method('send'); + + $callback = function () { + throw new \RuntimeException('Swift_Message creation callback should not have been called in this test'); + }; + $handler = new SwiftMailerHandler($this->mailer, $callback); + + $records = array( + $this->getRecord(Logger::DEBUG), + $this->getRecord(Logger::INFO), + ); + $handler->handleBatch($records); + } + + public function testMessageCanBeCustomizedGivenLoggedData() + { + // Wire Mailer to expect a specific Swift_Message with a customized Subject + $expectedMessage = new \Swift_Message(); + $this->mailer->expects($this->once()) + ->method('send') + ->with($this->callback(function ($value) use ($expectedMessage) { + return $value instanceof \Swift_Message + && $value->getSubject() === 'Emergency' + && $value === $expectedMessage; + })); + + // Callback dynamically changes subject based on number of logged records + $callback = function ($content, array $records) use ($expectedMessage) { + $subject = count($records) > 0 ? 'Emergency' : 'Normal'; + $expectedMessage->setSubject($subject); + + return $expectedMessage; + }; + $handler = new SwiftMailerHandler($this->mailer, $callback); + + // Logging 1 record makes this an Emergency + $records = array( + $this->getRecord(Logger::EMERGENCY), + ); + $handler->handleBatch($records); + } +} diff --git a/vendor/monolog/monolog/tests/Monolog/RegistryTest.php b/vendor/monolog/monolog/tests/Monolog/RegistryTest.php new file mode 100644 index 0000000..29925f8 --- /dev/null +++ b/vendor/monolog/monolog/tests/Monolog/RegistryTest.php @@ -0,0 +1,63 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog; + + +class RegistryTest extends \PHPUnit_Framework_TestCase +{ + protected function setUp() + { + Registry::clear(); + } + + /** + * @dataProvider hasLoggerProvider + * @covers Monolog\Registry::hasLogger + */ + public function testHasLogger(array $loggersToAdd, array $loggersToCheck, array $expectedResult) + { + foreach ($loggersToAdd as $loggerToAdd) { + Registry::addLogger($loggerToAdd); + } + foreach ($loggersToCheck as $index => $loggerToCheck) { + $this->assertSame($expectedResult[$index], Registry::hasLogger($loggerToCheck)); + } + } + + public function hasLoggerProvider() + { + $logger1 = new Logger('test1'); + $logger2 = new Logger('test2'); + $logger3 = new Logger('test3'); + + return array( + // only instances + array( + array($logger1), + array($logger1, $logger2), + array(true, false), + ), + // only names + array( + array($logger1), + array('test1', 'test2'), + array(true, false), + ), + // mixed case + array( + array($logger1, $logger2), + array('test1', $logger2, 'test3', $logger3), + array(true, true, false, false), + ), + ); + } +} diff --git a/vendor/mtdowling/cron-expression/LICENSE b/vendor/mtdowling/cron-expression/LICENSE deleted file mode 100644 index c6d88ac..0000000 --- a/vendor/mtdowling/cron-expression/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2011 Michael Dowling and contributors - -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/vendor/mtdowling/cron-expression/README.md b/vendor/mtdowling/cron-expression/README.md deleted file mode 100644 index 1571e5d..0000000 --- a/vendor/mtdowling/cron-expression/README.md +++ /dev/null @@ -1,82 +0,0 @@ -PHP Cron Expression Parser -========================== - -[![Latest Stable Version](https://poser.pugx.org/mtdowling/cron-expression/v/stable.png)](https://packagist.org/packages/mtdowling/cron-expression) [![Total Downloads](https://poser.pugx.org/mtdowling/cron-expression/downloads.png)](https://packagist.org/packages/mtdowling/cron-expression) [![Build Status](https://secure.travis-ci.org/mtdowling/cron-expression.png)](http://travis-ci.org/mtdowling/cron-expression) - -The PHP cron expression parser can parse a CRON expression, determine if it is -due to run, calculate the next run date of the expression, and calculate the previous -run date of the expression. You can calculate dates far into the future or past by -skipping n number of matching dates. - -The parser can handle increments of ranges (e.g. */12, 2-59/3), intervals (e.g. 0-9), -lists (e.g. 1,2,3), W to find the nearest weekday for a given day of the month, L to -find the last day of the month, L to find the last given weekday of a month, and hash -(#) to find the nth weekday of a given month. - -Installing -========== - -Add the dependency to your project: - -```bash -composer require mtdowling/cron-expression -``` - -Usage -===== -```php -isDue(); -echo $cron->getNextRunDate()->format('Y-m-d H:i:s'); -echo $cron->getPreviousRunDate()->format('Y-m-d H:i:s'); - -// Works with complex expressions -$cron = Cron\CronExpression::factory('3-59/15 2,6-12 */15 1 2-5'); -echo $cron->getNextRunDate()->format('Y-m-d H:i:s'); - -// Calculate a run date two iterations into the future -$cron = Cron\CronExpression::factory('@daily'); -echo $cron->getNextRunDate(null, 2)->format('Y-m-d H:i:s'); - -// Calculate a run date relative to a specific time -$cron = Cron\CronExpression::factory('@monthly'); -echo $cron->getNextRunDate('2010-01-12 00:00:00')->format('Y-m-d H:i:s'); -``` - -CRON Expressions -================ - -A CRON expression is a string representing the schedule for a particular command to execute. The parts of a CRON schedule are as follows: - - * * * * * * - - - - - - - - | | | | | | - | | | | | + year [optional] - | | | | +----- day of week (0 - 7) (Sunday=0 or 7) - | | | +---------- month (1 - 12) - | | +--------------- day of month (1 - 31) - | +-------------------- hour (0 - 23) - +------------------------- min (0 - 59) - -Requirements -============ - -- PHP 5.3+ -- PHPUnit is required to run the unit tests -- Composer is required to run the unit tests - -CHANGELOG -========= - -1.0.3 (2013-11-23) ------------------- - -* Only set default timezone if the given $currentTime is not a DateTime instance ([#34](https://github.com/mtdowling/cron-expression/issues/34)) -* Fixes issue [#28](https://github.com/mtdowling/cron-expression/issues/28) where PHP increments of ranges were failing due to PHP casting hyphens to 0 -* Now supports expressions with any number of extra spaces, tabs, or newlines -* Using static instead of self in `CronExpression::factory` diff --git a/vendor/mtdowling/cron-expression/composer.json b/vendor/mtdowling/cron-expression/composer.json deleted file mode 100644 index 62c0d89..0000000 --- a/vendor/mtdowling/cron-expression/composer.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "mtdowling/cron-expression", - "type": "library", - "description": "CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due", - "keywords": ["cron", "schedule"], - "license": "MIT", - "authors": [{ - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }], - "require": { - "php": ">=5.3.2" - }, - "require-dev": { - "phpunit/phpunit": "4.*" - }, - "autoload": { - "psr-0": { - "Cron": "src/" - } - } -} \ No newline at end of file diff --git a/vendor/mtdowling/cron-expression/phpunit.xml.dist b/vendor/mtdowling/cron-expression/phpunit.xml.dist deleted file mode 100644 index fb8a552..0000000 --- a/vendor/mtdowling/cron-expression/phpunit.xml.dist +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - ./tests - - - - - - ./src/Cron - - - - diff --git a/vendor/mtdowling/cron-expression/src/Cron/AbstractField.php b/vendor/mtdowling/cron-expression/src/Cron/AbstractField.php deleted file mode 100644 index c0616a2..0000000 --- a/vendor/mtdowling/cron-expression/src/Cron/AbstractField.php +++ /dev/null @@ -1,104 +0,0 @@ -isIncrementsOfRanges($value)) { - return $this->isInIncrementsOfRanges($dateValue, $value); - } elseif ($this->isRange($value)) { - return $this->isInRange($dateValue, $value); - } - - return $value == '*' || $dateValue == $value; - } - - /** - * Check if a value is a range - * - * @param string $value Value to test - * - * @return bool - */ - public function isRange($value) - { - return strpos($value, '-') !== false; - } - - /** - * Check if a value is an increments of ranges - * - * @param string $value Value to test - * - * @return bool - */ - public function isIncrementsOfRanges($value) - { - return strpos($value, '/') !== false; - } - - /** - * Test if a value is within a range - * - * @param string $dateValue Set date value - * @param string $value Value to test - * - * @return bool - */ - public function isInRange($dateValue, $value) - { - $parts = array_map('trim', explode('-', $value, 2)); - - return $dateValue >= $parts[0] && $dateValue <= $parts[1]; - } - - /** - * Test if a value is within an increments of ranges (offset[-to]/step size) - * - * @param string $dateValue Set date value - * @param string $value Value to test - * - * @return bool - */ - public function isInIncrementsOfRanges($dateValue, $value) - { - $parts = array_map('trim', explode('/', $value, 2)); - $stepSize = isset($parts[1]) ? $parts[1] : 0; - if (($parts[0] == '*' || $parts[0] === '0') && 0 !== $stepSize) { - return (int) $dateValue % $stepSize == 0; - } - - $range = explode('-', $parts[0], 2); - $offset = $range[0]; - $to = isset($range[1]) ? $range[1] : $dateValue; - // Ensure that the date value is within the range - if ($dateValue < $offset || $dateValue > $to) { - return false; - } - - if ($dateValue > $offset && 0 === $stepSize) { - return false; - } - - for ($i = $offset; $i <= $to; $i+= $stepSize) { - if ($i == $dateValue) { - return true; - } - } - - return false; - } -} diff --git a/vendor/mtdowling/cron-expression/src/Cron/CronExpression.php b/vendor/mtdowling/cron-expression/src/Cron/CronExpression.php deleted file mode 100644 index ce90f29..0000000 --- a/vendor/mtdowling/cron-expression/src/Cron/CronExpression.php +++ /dev/null @@ -1,332 +0,0 @@ - '0 0 1 1 *', - '@annually' => '0 0 1 1 *', - '@monthly' => '0 0 1 * *', - '@weekly' => '0 0 * * 0', - '@daily' => '0 0 * * *', - '@hourly' => '0 * * * *' - ); - - if (isset($mappings[$expression])) { - $expression = $mappings[$expression]; - } - - return new static($expression, $fieldFactory ?: new FieldFactory()); - } - - /** - * Parse a CRON expression - * - * @param string $expression CRON expression (e.g. '8 * * * *') - * @param FieldFactory $fieldFactory Factory to create cron fields - */ - public function __construct($expression, FieldFactory $fieldFactory) - { - $this->fieldFactory = $fieldFactory; - $this->setExpression($expression); - } - - /** - * Set or change the CRON expression - * - * @param string $value CRON expression (e.g. 8 * * * *) - * - * @return CronExpression - * @throws \InvalidArgumentException if not a valid CRON expression - */ - public function setExpression($value) - { - $this->cronParts = preg_split('/\s/', $value, -1, PREG_SPLIT_NO_EMPTY); - if (count($this->cronParts) < 5) { - throw new \InvalidArgumentException( - $value . ' is not a valid CRON expression' - ); - } - - foreach ($this->cronParts as $position => $part) { - $this->setPart($position, $part); - } - - return $this; - } - - /** - * Set part of the CRON expression - * - * @param int $position The position of the CRON expression to set - * @param string $value The value to set - * - * @return CronExpression - * @throws \InvalidArgumentException if the value is not valid for the part - */ - public function setPart($position, $value) - { - if (!$this->fieldFactory->getField($position)->validate($value)) { - throw new \InvalidArgumentException( - 'Invalid CRON field value ' . $value . ' as position ' . $position - ); - } - - $this->cronParts[$position] = $value; - - return $this; - } - - /** - * Get a next run date relative to the current date or a specific date - * - * @param string|\DateTime $currentTime Relative calculation date - * @param int $nth Number of matches to skip before returning a - * matching next run date. 0, the default, will return the current - * date and time if the next run date falls on the current date and - * time. Setting this value to 1 will skip the first match and go to - * the second match. Setting this value to 2 will skip the first 2 - * matches and so on. - * @param bool $allowCurrentDate Set to TRUE to return the current date if - * it matches the cron expression. - * - * @return \DateTime - * @throws \RuntimeException on too many iterations - */ - public function getNextRunDate($currentTime = 'now', $nth = 0, $allowCurrentDate = false) - { - return $this->getRunDate($currentTime, $nth, false, $allowCurrentDate); - } - - /** - * Get a previous run date relative to the current date or a specific date - * - * @param string|\DateTime $currentTime Relative calculation date - * @param int $nth Number of matches to skip before returning - * @param bool $allowCurrentDate Set to TRUE to return the - * current date if it matches the cron expression - * - * @return \DateTime - * @throws \RuntimeException on too many iterations - * @see Cron\CronExpression::getNextRunDate - */ - public function getPreviousRunDate($currentTime = 'now', $nth = 0, $allowCurrentDate = false) - { - return $this->getRunDate($currentTime, $nth, true, $allowCurrentDate); - } - - /** - * Get multiple run dates starting at the current date or a specific date - * - * @param int $total Set the total number of dates to calculate - * @param string|\DateTime $currentTime Relative calculation date - * @param bool $invert Set to TRUE to retrieve previous dates - * @param bool $allowCurrentDate Set to TRUE to return the - * current date if it matches the cron expression - * - * @return array Returns an array of run dates - */ - public function getMultipleRunDates($total, $currentTime = 'now', $invert = false, $allowCurrentDate = false) - { - $matches = array(); - for ($i = 0; $i < max(0, $total); $i++) { - $matches[] = $this->getRunDate($currentTime, $i, $invert, $allowCurrentDate); - } - - return $matches; - } - - /** - * Get all or part of the CRON expression - * - * @param string $part Specify the part to retrieve or NULL to get the full - * cron schedule string. - * - * @return string|null Returns the CRON expression, a part of the - * CRON expression, or NULL if the part was specified but not found - */ - public function getExpression($part = null) - { - if (null === $part) { - return implode(' ', $this->cronParts); - } elseif (array_key_exists($part, $this->cronParts)) { - return $this->cronParts[$part]; - } - - return null; - } - - /** - * Helper method to output the full expression. - * - * @return string Full CRON expression - */ - public function __toString() - { - return $this->getExpression(); - } - - /** - * Determine if the cron is due to run based on the current date or a - * specific date. This method assumes that the current number of - * seconds are irrelevant, and should be called once per minute. - * - * @param string|\DateTime $currentTime Relative calculation date - * - * @return bool Returns TRUE if the cron is due to run or FALSE if not - */ - public function isDue($currentTime = 'now') - { - if ('now' === $currentTime) { - $currentDate = date('Y-m-d H:i'); - $currentTime = strtotime($currentDate); - } elseif ($currentTime instanceof \DateTime) { - $currentDate = clone $currentTime; - // Ensure time in 'current' timezone is used - $currentDate->setTimezone(new \DateTimeZone(date_default_timezone_get())); - $currentDate = $currentDate->format('Y-m-d H:i'); - $currentTime = strtotime($currentDate); - } else { - $currentTime = new \DateTime($currentTime); - $currentTime->setTime($currentTime->format('H'), $currentTime->format('i'), 0); - $currentDate = $currentTime->format('Y-m-d H:i'); - $currentTime = $currentTime->getTimeStamp(); - } - - try { - return $this->getNextRunDate($currentDate, 0, true)->getTimestamp() == $currentTime; - } catch (\Exception $e) { - return false; - } - } - - /** - * Get the next or previous run date of the expression relative to a date - * - * @param string|\DateTime $currentTime Relative calculation date - * @param int $nth Number of matches to skip before returning - * @param bool $invert Set to TRUE to go backwards in time - * @param bool $allowCurrentDate Set to TRUE to return the - * current date if it matches the cron expression - * - * @return \DateTime - * @throws \RuntimeException on too many iterations - */ - protected function getRunDate($currentTime = null, $nth = 0, $invert = false, $allowCurrentDate = false) - { - if ($currentTime instanceof \DateTime) { - $currentDate = clone $currentTime; - } else { - $currentDate = new \DateTime($currentTime ?: 'now'); - $currentDate->setTimezone(new \DateTimeZone(date_default_timezone_get())); - } - - $currentDate->setTime($currentDate->format('H'), $currentDate->format('i'), 0); - $nextRun = clone $currentDate; - $nth = (int) $nth; - - // We don't have to satisfy * or null fields - $parts = array(); - $fields = array(); - foreach (self::$order as $position) { - $part = $this->getExpression($position); - if (null === $part || '*' === $part) { - continue; - } - $parts[$position] = $part; - $fields[$position] = $this->fieldFactory->getField($position); - } - - // Set a hard limit to bail on an impossible date - for ($i = 0; $i < 1000; $i++) { - - foreach ($parts as $position => $part) { - $satisfied = false; - // Get the field object used to validate this part - $field = $fields[$position]; - // Check if this is singular or a list - if (strpos($part, ',') === false) { - $satisfied = $field->isSatisfiedBy($nextRun, $part); - } else { - foreach (array_map('trim', explode(',', $part)) as $listPart) { - if ($field->isSatisfiedBy($nextRun, $listPart)) { - $satisfied = true; - break; - } - } - } - - // If the field is not satisfied, then start over - if (!$satisfied) { - $field->increment($nextRun, $invert); - continue 2; - } - } - - // Skip this match if needed - if ((!$allowCurrentDate && $nextRun == $currentDate) || --$nth > -1) { - $this->fieldFactory->getField(0)->increment($nextRun, $invert); - continue; - } - - return $nextRun; - } - - // @codeCoverageIgnoreStart - throw new \RuntimeException('Impossible CRON expression'); - // @codeCoverageIgnoreEnd - } -} diff --git a/vendor/mtdowling/cron-expression/src/Cron/DayOfMonthField.php b/vendor/mtdowling/cron-expression/src/Cron/DayOfMonthField.php deleted file mode 100644 index 86129c9..0000000 --- a/vendor/mtdowling/cron-expression/src/Cron/DayOfMonthField.php +++ /dev/null @@ -1,103 +0,0 @@ - - */ -class DayOfMonthField extends AbstractField -{ - /** - * Get the nearest day of the week for a given day in a month - * - * @param int $currentYear Current year - * @param int $currentMonth Current month - * @param int $targetDay Target day of the month - * - * @return \DateTime Returns the nearest date - */ - private static function getNearestWeekday($currentYear, $currentMonth, $targetDay) - { - $tday = str_pad($targetDay, 2, '0', STR_PAD_LEFT); - $target = \DateTime::createFromFormat('Y-m-d', "$currentYear-$currentMonth-$tday"); - $currentWeekday = (int) $target->format('N'); - - if ($currentWeekday < 6) { - return $target; - } - - $lastDayOfMonth = $target->format('t'); - - foreach (array(-1, 1, -2, 2) as $i) { - $adjusted = $targetDay + $i; - if ($adjusted > 0 && $adjusted <= $lastDayOfMonth) { - $target->setDate($currentYear, $currentMonth, $adjusted); - if ($target->format('N') < 6 && $target->format('m') == $currentMonth) { - return $target; - } - } - } - } - - public function isSatisfiedBy(\DateTime $date, $value) - { - // ? states that the field value is to be skipped - if ($value == '?') { - return true; - } - - $fieldValue = $date->format('d'); - - // Check to see if this is the last day of the month - if ($value == 'L') { - return $fieldValue == $date->format('t'); - } - - // Check to see if this is the nearest weekday to a particular value - if (strpos($value, 'W')) { - // Parse the target day - $targetDay = substr($value, 0, strpos($value, 'W')); - // Find out if the current day is the nearest day of the week - return $date->format('j') == self::getNearestWeekday( - $date->format('Y'), - $date->format('m'), - $targetDay - )->format('j'); - } - - return $this->isSatisfied($date->format('d'), $value); - } - - public function increment(\DateTime $date, $invert = false) - { - if ($invert) { - $date->modify('previous day'); - $date->setTime(23, 59); - } else { - $date->modify('next day'); - $date->setTime(0, 0); - } - - return $this; - } - - public function validate($value) - { - return (bool) preg_match('/^[\*,\/\-\?LW0-9A-Za-z]+$/', $value); - } -} diff --git a/vendor/mtdowling/cron-expression/src/Cron/DayOfWeekField.php b/vendor/mtdowling/cron-expression/src/Cron/DayOfWeekField.php deleted file mode 100644 index 8e33b19..0000000 --- a/vendor/mtdowling/cron-expression/src/Cron/DayOfWeekField.php +++ /dev/null @@ -1,134 +0,0 @@ -convertLiterals($value); - - $currentYear = $date->format('Y'); - $currentMonth = $date->format('m'); - $lastDayOfMonth = $date->format('t'); - - // Find out if this is the last specific weekday of the month - if (strpos($value, 'L')) { - $weekday = str_replace('7', '0', substr($value, 0, strpos($value, 'L'))); - $tdate = clone $date; - $tdate->setDate($currentYear, $currentMonth, $lastDayOfMonth); - while ($tdate->format('w') != $weekday) { - $tdate->setDate($currentYear, $currentMonth, --$lastDayOfMonth); - } - - return $date->format('j') == $lastDayOfMonth; - } - - // Handle # hash tokens - if (strpos($value, '#')) { - list($weekday, $nth) = explode('#', $value); - - // 0 and 7 are both Sunday, however 7 matches date('N') format ISO-8601 - if ($weekday === '0') { - $weekday = 7; - } - - // Validate the hash fields - if ($weekday < 0 || $weekday > 7) { - throw new \InvalidArgumentException("Weekday must be a value between 0 and 7. {$weekday} given"); - } - if ($nth > 5) { - throw new \InvalidArgumentException('There are never more than 5 of a given weekday in a month'); - } - // The current weekday must match the targeted weekday to proceed - if ($date->format('N') != $weekday) { - return false; - } - - $tdate = clone $date; - $tdate->setDate($currentYear, $currentMonth, 1); - $dayCount = 0; - $currentDay = 1; - while ($currentDay < $lastDayOfMonth + 1) { - if ($tdate->format('N') == $weekday) { - if (++$dayCount >= $nth) { - break; - } - } - $tdate->setDate($currentYear, $currentMonth, ++$currentDay); - } - - return $date->format('j') == $currentDay; - } - - // Handle day of the week values - if (strpos($value, '-')) { - $parts = explode('-', $value); - if ($parts[0] == '7') { - $parts[0] = '0'; - } elseif ($parts[1] == '0') { - $parts[1] = '7'; - } - $value = implode('-', $parts); - } - - // Test to see which Sunday to use -- 0 == 7 == Sunday - $format = in_array(7, str_split($value)) ? 'N' : 'w'; - $fieldValue = $date->format($format); - - return $this->isSatisfied($fieldValue, $value); - } - - public function increment(\DateTime $date, $invert = false) - { - if ($invert) { - $date->modify('-1 day'); - $date->setTime(23, 59, 0); - } else { - $date->modify('+1 day'); - $date->setTime(0, 0, 0); - } - - return $this; - } - - public function validate($value) - { - $value = $this->convertLiterals($value); - - foreach (explode(',', $value) as $expr) { - if (!preg_match('/^(\*|[0-7](L?|#[1-5]))([\/\,\-][0-7]+)*$/', $expr)) { - return false; - } - } - - return true; - } - - private function convertLiterals($string) - { - return str_ireplace( - array('SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT'), - range(0, 6), - $string - ); - } -} diff --git a/vendor/mtdowling/cron-expression/src/Cron/FieldFactory.php b/vendor/mtdowling/cron-expression/src/Cron/FieldFactory.php deleted file mode 100644 index 5aa86f6..0000000 --- a/vendor/mtdowling/cron-expression/src/Cron/FieldFactory.php +++ /dev/null @@ -1,55 +0,0 @@ -fields[$position])) { - switch ($position) { - case 0: - $this->fields[$position] = new MinutesField(); - break; - case 1: - $this->fields[$position] = new HoursField(); - break; - case 2: - $this->fields[$position] = new DayOfMonthField(); - break; - case 3: - $this->fields[$position] = new MonthField(); - break; - case 4: - $this->fields[$position] = new DayOfWeekField(); - break; - case 5: - $this->fields[$position] = new YearField(); - break; - default: - throw new \InvalidArgumentException( - $position . ' is not a valid position' - ); - } - } - - return $this->fields[$position]; - } -} diff --git a/vendor/mtdowling/cron-expression/src/Cron/FieldInterface.php b/vendor/mtdowling/cron-expression/src/Cron/FieldInterface.php deleted file mode 100644 index 3823fbf..0000000 --- a/vendor/mtdowling/cron-expression/src/Cron/FieldInterface.php +++ /dev/null @@ -1,39 +0,0 @@ -isSatisfied($date->format('H'), $value); - } - - public function increment(\DateTime $date, $invert = false) - { - // Change timezone to UTC temporarily. This will - // allow us to go back or forwards and hour even - // if DST will be changed between the hours. - $timezone = $date->getTimezone(); - $date->setTimezone(new \DateTimeZone('UTC')); - if ($invert) { - $date->modify('-1 hour'); - $date->setTime($date->format('H'), 59); - } else { - $date->modify('+1 hour'); - $date->setTime($date->format('H'), 0); - } - $date->setTimezone($timezone); - - return $this; - } - - public function validate($value) - { - return (bool) preg_match('/^[\*,\/\-0-9]+$/', $value); - } -} diff --git a/vendor/mtdowling/cron-expression/src/Cron/MinutesField.php b/vendor/mtdowling/cron-expression/src/Cron/MinutesField.php deleted file mode 100644 index cfa2b09..0000000 --- a/vendor/mtdowling/cron-expression/src/Cron/MinutesField.php +++ /dev/null @@ -1,30 +0,0 @@ -isSatisfied($date->format('i'), $value); - } - - public function increment(\DateTime $date, $invert = false) - { - if ($invert) { - $date->modify('-1 minute'); - } else { - $date->modify('+1 minute'); - } - - return $this; - } - - public function validate($value) - { - return (bool) preg_match('/^[\*,\/\-0-9]+$/', $value); - } -} diff --git a/vendor/mtdowling/cron-expression/src/Cron/MonthField.php b/vendor/mtdowling/cron-expression/src/Cron/MonthField.php deleted file mode 100644 index 0205c17..0000000 --- a/vendor/mtdowling/cron-expression/src/Cron/MonthField.php +++ /dev/null @@ -1,44 +0,0 @@ -isSatisfied($date->format('m'), $value); - } - - public function increment(DateTime $date, $invert = false) - { - if ($invert) { - $date->modify('last day of previous month'); - $date->setTime(23, 59); - } else { - $date->modify('first day of next month'); - $date->setTime(0, 0); - } - - return $this; - } - - public function validate($value) - { - return (bool) preg_match('/^[\*,\/\-0-9A-Z]+$/', $value); - } -} diff --git a/vendor/mtdowling/cron-expression/src/Cron/YearField.php b/vendor/mtdowling/cron-expression/src/Cron/YearField.php deleted file mode 100644 index b526dde..0000000 --- a/vendor/mtdowling/cron-expression/src/Cron/YearField.php +++ /dev/null @@ -1,34 +0,0 @@ -isSatisfied($date->format('Y'), $value); - } - - public function increment(\DateTime $date, $invert = false) - { - if ($invert) { - $date->modify('-1 year'); - $date->setDate($date->format('Y'), 12, 31); - $date->setTime(23, 59, 0); - } else { - $date->modify('+1 year'); - $date->setDate($date->format('Y'), 1, 1); - $date->setTime(0, 0, 0); - } - - return $this; - } - - public function validate($value) - { - return (bool) preg_match('/^[\*,\/\-0-9]+$/', $value); - } -} diff --git a/vendor/mtdowling/cron-expression/tests/Cron/AbstractFieldTest.php b/vendor/mtdowling/cron-expression/tests/Cron/AbstractFieldTest.php deleted file mode 100644 index 5272106..0000000 --- a/vendor/mtdowling/cron-expression/tests/Cron/AbstractFieldTest.php +++ /dev/null @@ -1,84 +0,0 @@ - - */ -class AbstractFieldTest extends \PHPUnit_Framework_TestCase -{ - /** - * @covers Cron\AbstractField::isRange - */ - public function testTestsIfRange() - { - $f = new DayOfWeekField(); - $this->assertTrue($f->isRange('1-2')); - $this->assertFalse($f->isRange('2')); - } - - /** - * @covers Cron\AbstractField::isIncrementsOfRanges - */ - public function testTestsIfIncrementsOfRanges() - { - $f = new DayOfWeekField(); - $this->assertFalse($f->isIncrementsOfRanges('1-2')); - $this->assertFalse($f->isIncrementsOfRanges('1-2')); - $this->assertTrue($f->isIncrementsOfRanges('1/2')); - $this->assertTrue($f->isIncrementsOfRanges('*/2')); - $this->assertTrue($f->isIncrementsOfRanges('3-12/2')); - } - - /** - * @covers Cron\AbstractField::isInRange - */ - public function testTestsIfInRange() - { - $f = new DayOfWeekField(); - $this->assertTrue($f->isInRange(1, '1-2')); - $this->assertTrue($f->isInRange(2, '1-2')); - $this->assertTrue($f->isInRange(5, '4-12')); - $this->assertFalse($f->isInRange(3, '4-12')); - $this->assertFalse($f->isInRange(13, '4-12')); - } - - /** - * @covers Cron\AbstractField::isInIncrementsOfRanges - */ - public function testTestsIfInIncrementsOfRanges() - { - $f = new DayOfWeekField(); - $this->assertTrue($f->isInIncrementsOfRanges(3, '3-59/2')); - $this->assertTrue($f->isInIncrementsOfRanges(13, '3-59/2')); - $this->assertTrue($f->isInIncrementsOfRanges(15, '3-59/2')); - $this->assertTrue($f->isInIncrementsOfRanges(14, '*/2')); - $this->assertFalse($f->isInIncrementsOfRanges(2, '3-59/13')); - $this->assertFalse($f->isInIncrementsOfRanges(14, '*/13')); - $this->assertFalse($f->isInIncrementsOfRanges(14, '3-59/2')); - $this->assertFalse($f->isInIncrementsOfRanges(3, '2-59')); - $this->assertFalse($f->isInIncrementsOfRanges(3, '2')); - $this->assertFalse($f->isInIncrementsOfRanges(3, '*')); - - $this->assertTrue($f->isInIncrementsOfRanges(4, '4/10')); - $this->assertTrue($f->isInIncrementsOfRanges(14, '4/10')); - $this->assertTrue($f->isInIncrementsOfRanges(34, '4/10')); - } - - /** - * @covers Cron\AbstractField::isSatisfied - */ - public function testTestsIfSatisfied() - { - $f = new DayOfWeekField(); - $this->assertTrue($f->isSatisfied('12', '3-13')); - $this->assertTrue($f->isSatisfied('15', '3-59/12')); - $this->assertTrue($f->isSatisfied('12', '*')); - $this->assertTrue($f->isSatisfied('12', '12')); - $this->assertFalse($f->isSatisfied('12', '3-11')); - $this->assertFalse($f->isSatisfied('12', '3-59/13')); - $this->assertFalse($f->isSatisfied('12', '11')); - } -} diff --git a/vendor/mtdowling/cron-expression/tests/Cron/CronExpressionTest.php b/vendor/mtdowling/cron-expression/tests/Cron/CronExpressionTest.php deleted file mode 100644 index 013b701..0000000 --- a/vendor/mtdowling/cron-expression/tests/Cron/CronExpressionTest.php +++ /dev/null @@ -1,376 +0,0 @@ - - */ -class CronExpressionTest extends \PHPUnit_Framework_TestCase -{ - /** - * @covers Cron\CronExpression::factory - */ - public function testFactoryRecognizesTemplates() - { - $this->assertEquals('0 0 1 1 *', CronExpression::factory('@annually')->getExpression()); - $this->assertEquals('0 0 1 1 *', CronExpression::factory('@yearly')->getExpression()); - $this->assertEquals('0 0 * * 0', CronExpression::factory('@weekly')->getExpression()); - } - - /** - * @covers Cron\CronExpression::__construct - * @covers Cron\CronExpression::getExpression - * @covers Cron\CronExpression::__toString - */ - public function testParsesCronSchedule() - { - // '2010-09-10 12:00:00' - $cron = CronExpression::factory('1 2-4 * 4,5,6 */3'); - $this->assertEquals('1', $cron->getExpression(CronExpression::MINUTE)); - $this->assertEquals('2-4', $cron->getExpression(CronExpression::HOUR)); - $this->assertEquals('*', $cron->getExpression(CronExpression::DAY)); - $this->assertEquals('4,5,6', $cron->getExpression(CronExpression::MONTH)); - $this->assertEquals('*/3', $cron->getExpression(CronExpression::WEEKDAY)); - $this->assertEquals('1 2-4 * 4,5,6 */3', $cron->getExpression()); - $this->assertEquals('1 2-4 * 4,5,6 */3', (string) $cron); - $this->assertNull($cron->getExpression('foo')); - - try { - $cron = CronExpression::factory('A 1 2 3 4'); - $this->fail('Validation exception not thrown'); - } catch (InvalidArgumentException $e) { - } - } - - /** - * @covers Cron\CronExpression::__construct - * @covers Cron\CronExpression::getExpression - * @dataProvider scheduleWithDifferentSeparatorsProvider - */ - public function testParsesCronScheduleWithAnySpaceCharsAsSeparators($schedule, array $expected) - { - $cron = CronExpression::factory($schedule); - $this->assertEquals($expected[0], $cron->getExpression(CronExpression::MINUTE)); - $this->assertEquals($expected[1], $cron->getExpression(CronExpression::HOUR)); - $this->assertEquals($expected[2], $cron->getExpression(CronExpression::DAY)); - $this->assertEquals($expected[3], $cron->getExpression(CronExpression::MONTH)); - $this->assertEquals($expected[4], $cron->getExpression(CronExpression::WEEKDAY)); - $this->assertEquals($expected[5], $cron->getExpression(CronExpression::YEAR)); - } - - /** - * Data provider for testParsesCronScheduleWithAnySpaceCharsAsSeparators - * - * @return array - */ - public static function scheduleWithDifferentSeparatorsProvider() - { - return array( - array("*\t*\t*\t*\t*\t*", array('*', '*', '*', '*', '*', '*')), - array("* * * * * *", array('*', '*', '*', '*', '*', '*')), - array("* \t * \t * \t * \t * \t *", array('*', '*', '*', '*', '*', '*')), - array("*\t \t*\t \t*\t \t*\t \t*\t \t*", array('*', '*', '*', '*', '*', '*')), - ); - } - - /** - * @covers Cron\CronExpression::__construct - * @covers Cron\CronExpression::setExpression - * @covers Cron\CronExpression::setPart - * @expectedException InvalidArgumentException - */ - public function testInvalidCronsWillFail() - { - // Only four values - $cron = CronExpression::factory('* * * 1'); - } - - /** - * @covers Cron\CronExpression::setPart - * @expectedException InvalidArgumentException - */ - public function testInvalidPartsWillFail() - { - // Only four values - $cron = CronExpression::factory('* * * * *'); - $cron->setPart(1, 'abc'); - } - - /** - * Data provider for cron schedule - * - * @return array - */ - public function scheduleProvider() - { - return array( - array('*/2 */2 * * *', '2015-08-10 21:47:27', '2015-08-10 22:00:00', false), - array('* * * * *', '2015-08-10 21:50:37', '2015-08-10 21:50:00', true), - array('* 20,21,22 * * *', '2015-08-10 21:50:00', '2015-08-10 21:50:00', true), - // Handles CSV values - array('* 20,22 * * *', '2015-08-10 21:50:00', '2015-08-10 22:00:00', false), - // CSV values can be complex - array('* 5,21-22 * * *', '2015-08-10 21:50:00', '2015-08-10 21:50:00', true), - array('7-9 * */9 * *', '2015-08-10 22:02:33', '2015-08-18 00:07:00', false), - // 15th minute, of the second hour, every 15 days, in January, every Friday - array('1 * * * 7', '2015-08-10 21:47:27', '2015-08-16 00:01:00', false), - // Test with exact times - array('47 21 * * *', strtotime('2015-08-10 21:47:30'), '2015-08-10 21:47:00', true), - // Test Day of the week (issue #1) - // According cron implementation, 0|7 = sunday, 1 => monday, etc - array('* * * * 0', strtotime('2011-06-15 23:09:00'), '2011-06-19 00:00:00', false), - array('* * * * 7', strtotime('2011-06-15 23:09:00'), '2011-06-19 00:00:00', false), - array('* * * * 1', strtotime('2011-06-15 23:09:00'), '2011-06-20 00:00:00', false), - // Should return the sunday date as 7 equals 0 - array('0 0 * * MON,SUN', strtotime('2011-06-15 23:09:00'), '2011-06-19 00:00:00', false), - array('0 0 * * 1,7', strtotime('2011-06-15 23:09:00'), '2011-06-19 00:00:00', false), - array('0 0 * * 0-4', strtotime('2011-06-15 23:09:00'), '2011-06-16 00:00:00', false), - array('0 0 * * 7-4', strtotime('2011-06-15 23:09:00'), '2011-06-16 00:00:00', false), - array('0 0 * * 4-7', strtotime('2011-06-15 23:09:00'), '2011-06-16 00:00:00', false), - array('0 0 * * 7-3', strtotime('2011-06-15 23:09:00'), '2011-06-19 00:00:00', false), - array('0 0 * * 3-7', strtotime('2011-06-15 23:09:00'), '2011-06-16 00:00:00', false), - array('0 0 * * 3-7', strtotime('2011-06-18 23:09:00'), '2011-06-19 00:00:00', false), - // Test lists of values and ranges (Abhoryo) - array('0 0 * * 2-7', strtotime('2011-06-20 23:09:00'), '2011-06-21 00:00:00', false), - array('0 0 * * 0,2-6', strtotime('2011-06-20 23:09:00'), '2011-06-21 00:00:00', false), - array('0 0 * * 2-7', strtotime('2011-06-18 23:09:00'), '2011-06-19 00:00:00', false), - array('0 0 * * 4-7', strtotime('2011-07-19 00:00:00'), '2011-07-21 00:00:00', false), - // Test increments of ranges - array('0-12/4 * * * *', strtotime('2011-06-20 12:04:00'), '2011-06-20 12:04:00', true), - array('4-59/2 * * * *', strtotime('2011-06-20 12:04:00'), '2011-06-20 12:04:00', true), - array('4-59/2 * * * *', strtotime('2011-06-20 12:06:00'), '2011-06-20 12:06:00', true), - array('4-59/3 * * * *', strtotime('2011-06-20 12:06:00'), '2011-06-20 12:07:00', false), - //array('0 0 * * 0,2-6', strtotime('2011-06-20 23:09:00'), '2011-06-21 00:00:00', false), - // Test Day of the Week and the Day of the Month (issue #1) - array('0 0 1 1 0', strtotime('2011-06-15 23:09:00'), '2012-01-01 00:00:00', false), - array('0 0 1 JAN 0', strtotime('2011-06-15 23:09:00'), '2012-01-01 00:00:00', false), - array('0 0 1 * 0', strtotime('2011-06-15 23:09:00'), '2012-01-01 00:00:00', false), - array('0 0 L * *', strtotime('2011-07-15 00:00:00'), '2011-07-31 00:00:00', false), - // Test the W day of the week modifier for day of the month field - array('0 0 2W * *', strtotime('2011-07-01 00:00:00'), '2011-07-01 00:00:00', true), - array('0 0 1W * *', strtotime('2011-05-01 00:00:00'), '2011-05-02 00:00:00', false), - array('0 0 1W * *', strtotime('2011-07-01 00:00:00'), '2011-07-01 00:00:00', true), - array('0 0 3W * *', strtotime('2011-07-01 00:00:00'), '2011-07-04 00:00:00', false), - array('0 0 16W * *', strtotime('2011-07-01 00:00:00'), '2011-07-15 00:00:00', false), - array('0 0 28W * *', strtotime('2011-07-01 00:00:00'), '2011-07-28 00:00:00', false), - array('0 0 30W * *', strtotime('2011-07-01 00:00:00'), '2011-07-29 00:00:00', false), - array('0 0 31W * *', strtotime('2011-07-01 00:00:00'), '2011-07-29 00:00:00', false), - // Test the year field - array('* * * * * 2012', strtotime('2011-05-01 00:00:00'), '2012-01-01 00:00:00', false), - // Test the last weekday of a month - array('* * * * 5L', strtotime('2011-07-01 00:00:00'), '2011-07-29 00:00:00', false), - array('* * * * 6L', strtotime('2011-07-01 00:00:00'), '2011-07-30 00:00:00', false), - array('* * * * 7L', strtotime('2011-07-01 00:00:00'), '2011-07-31 00:00:00', false), - array('* * * * 1L', strtotime('2011-07-24 00:00:00'), '2011-07-25 00:00:00', false), - array('* * * * TUEL', strtotime('2011-07-24 00:00:00'), '2011-07-26 00:00:00', false), - array('* * * 1 5L', strtotime('2011-12-25 00:00:00'), '2012-01-27 00:00:00', false), - // Test the hash symbol for the nth weekday of a given month - array('* * * * 5#2', strtotime('2011-07-01 00:00:00'), '2011-07-08 00:00:00', false), - array('* * * * 5#1', strtotime('2011-07-01 00:00:00'), '2011-07-01 00:00:00', true), - array('* * * * 3#4', strtotime('2011-07-01 00:00:00'), '2011-07-27 00:00:00', false), - ); - } - - /** - * @covers Cron\CronExpression::isDue - * @covers Cron\CronExpression::getNextRunDate - * @covers Cron\DayOfMonthField - * @covers Cron\DayOfWeekField - * @covers Cron\MinutesField - * @covers Cron\HoursField - * @covers Cron\MonthField - * @covers Cron\YearField - * @covers Cron\CronExpression::getRunDate - * @dataProvider scheduleProvider - */ - public function testDeterminesIfCronIsDue($schedule, $relativeTime, $nextRun, $isDue) - { - $relativeTimeString = is_int($relativeTime) ? date('Y-m-d H:i:s', $relativeTime) : $relativeTime; - - // Test next run date - $cron = CronExpression::factory($schedule); - if (is_string($relativeTime)) { - $relativeTime = new DateTime($relativeTime); - } elseif (is_int($relativeTime)) { - $relativeTime = date('Y-m-d H:i:s', $relativeTime); - } - $this->assertEquals($isDue, $cron->isDue($relativeTime)); - $next = $cron->getNextRunDate($relativeTime, 0, true); - $this->assertEquals(new DateTime($nextRun), $next); - } - - /** - * @covers Cron\CronExpression::isDue - */ - public function testIsDueHandlesDifferentDates() - { - $cron = CronExpression::factory('* * * * *'); - $this->assertTrue($cron->isDue()); - $this->assertTrue($cron->isDue('now')); - $this->assertTrue($cron->isDue(new DateTime('now'))); - $this->assertTrue($cron->isDue(date('Y-m-d H:i'))); - } - - /** - * @covers Cron\CronExpression::isDue - */ - public function testIsDueHandlesDifferentTimezones() - { - $cron = CronExpression::factory('0 15 * * 3'); //Wednesday at 15:00 - $date = '2014-01-01 15:00'; //Wednesday - $utc = new \DateTimeZone('UTC'); - $amsterdam = new \DateTimeZone('Europe/Amsterdam'); - $tokyo = new \DateTimeZone('Asia/Tokyo'); - - date_default_timezone_set('UTC'); - $this->assertTrue($cron->isDue(new DateTime($date, $utc))); - $this->assertFalse($cron->isDue(new DateTime($date, $amsterdam))); - $this->assertFalse($cron->isDue(new DateTime($date, $tokyo))); - - date_default_timezone_set('Europe/Amsterdam'); - $this->assertFalse($cron->isDue(new DateTime($date, $utc))); - $this->assertTrue($cron->isDue(new DateTime($date, $amsterdam))); - $this->assertFalse($cron->isDue(new DateTime($date, $tokyo))); - - date_default_timezone_set('Asia/Tokyo'); - $this->assertFalse($cron->isDue(new DateTime($date, $utc))); - $this->assertFalse($cron->isDue(new DateTime($date, $amsterdam))); - $this->assertTrue($cron->isDue(new DateTime($date, $tokyo))); - } - - /** - * @covers Cron\CronExpression::getPreviousRunDate - */ - public function testCanGetPreviousRunDates() - { - $cron = CronExpression::factory('* * * * *'); - $next = $cron->getNextRunDate('now'); - $two = $cron->getNextRunDate('now', 1); - $this->assertEquals($next, $cron->getPreviousRunDate($two)); - - $cron = CronExpression::factory('* */2 * * *'); - $next = $cron->getNextRunDate('now'); - $two = $cron->getNextRunDate('now', 1); - $this->assertEquals($next, $cron->getPreviousRunDate($two)); - - $cron = CronExpression::factory('* * * */2 *'); - $next = $cron->getNextRunDate('now'); - $two = $cron->getNextRunDate('now', 1); - $this->assertEquals($next, $cron->getPreviousRunDate($two)); - } - - /** - * @covers Cron\CronExpression::getMultipleRunDates - */ - public function testProvidesMultipleRunDates() - { - $cron = CronExpression::factory('*/2 * * * *'); - $this->assertEquals(array( - new DateTime('2008-11-09 00:00:00'), - new DateTime('2008-11-09 00:02:00'), - new DateTime('2008-11-09 00:04:00'), - new DateTime('2008-11-09 00:06:00') - ), $cron->getMultipleRunDates(4, '2008-11-09 00:00:00', false, true)); - } - - /** - * @covers Cron\CronExpression - */ - public function testCanIterateOverNextRuns() - { - $cron = CronExpression::factory('@weekly'); - $nextRun = $cron->getNextRunDate("2008-11-09 08:00:00"); - $this->assertEquals($nextRun, new DateTime("2008-11-16 00:00:00")); - - // true is cast to 1 - $nextRun = $cron->getNextRunDate("2008-11-09 00:00:00", true, true); - $this->assertEquals($nextRun, new DateTime("2008-11-16 00:00:00")); - - // You can iterate over them - $nextRun = $cron->getNextRunDate($cron->getNextRunDate("2008-11-09 00:00:00", 1, true), 1, true); - $this->assertEquals($nextRun, new DateTime("2008-11-23 00:00:00")); - - // You can skip more than one - $nextRun = $cron->getNextRunDate("2008-11-09 00:00:00", 2, true); - $this->assertEquals($nextRun, new DateTime("2008-11-23 00:00:00")); - $nextRun = $cron->getNextRunDate("2008-11-09 00:00:00", 3, true); - $this->assertEquals($nextRun, new DateTime("2008-11-30 00:00:00")); - } - - /** - * @covers Cron\CronExpression::getRunDate - */ - public function testSkipsCurrentDateByDefault() - { - $cron = CronExpression::factory('* * * * *'); - $current = new DateTime('now'); - $next = $cron->getNextRunDate($current); - $nextPrev = $cron->getPreviousRunDate($next); - $this->assertEquals($current->format('Y-m-d H:i:00'), $nextPrev->format('Y-m-d H:i:s')); - } - - /** - * @covers Cron\CronExpression::getRunDate - * @ticket 7 - */ - public function testStripsForSeconds() - { - $cron = CronExpression::factory('* * * * *'); - $current = new DateTime('2011-09-27 10:10:54'); - $this->assertEquals('2011-09-27 10:11:00', $cron->getNextRunDate($current)->format('Y-m-d H:i:s')); - } - - /** - * @covers Cron\CronExpression::getRunDate - */ - public function testFixesPhpBugInDateIntervalMonth() - { - $cron = CronExpression::factory('0 0 27 JAN *'); - $this->assertEquals('2011-01-27 00:00:00', $cron->getPreviousRunDate('2011-08-22 00:00:00')->format('Y-m-d H:i:s')); - } - - public function testIssue29() - { - $cron = CronExpression::factory('@weekly'); - $this->assertEquals( - '2013-03-10 00:00:00', - $cron->getPreviousRunDate('2013-03-17 00:00:00')->format('Y-m-d H:i:s') - ); - } - - /** - * @see https://github.com/mtdowling/cron-expression/issues/20 - */ - public function testIssue20() { - $e = CronExpression::factory('* * * * MON#1'); - $this->assertTrue($e->isDue(new DateTime('2014-04-07 00:00:00'))); - $this->assertFalse($e->isDue(new DateTime('2014-04-14 00:00:00'))); - $this->assertFalse($e->isDue(new DateTime('2014-04-21 00:00:00'))); - - $e = CronExpression::factory('* * * * SAT#2'); - $this->assertFalse($e->isDue(new DateTime('2014-04-05 00:00:00'))); - $this->assertTrue($e->isDue(new DateTime('2014-04-12 00:00:00'))); - $this->assertFalse($e->isDue(new DateTime('2014-04-19 00:00:00'))); - - $e = CronExpression::factory('* * * * SUN#3'); - $this->assertFalse($e->isDue(new DateTime('2014-04-13 00:00:00'))); - $this->assertTrue($e->isDue(new DateTime('2014-04-20 00:00:00'))); - $this->assertFalse($e->isDue(new DateTime('2014-04-27 00:00:00'))); - } - - /** - * @covers Cron\CronExpression::getRunDate - */ - public function testKeepOriginalTime() - { - $now = new \DateTime; - $strNow = $now->format(\DateTime::ISO8601); - $cron = CronExpression::factory('0 0 * * *'); - $cron->getPreviousRunDate($now); - $this->assertEquals($strNow, $now->format(\DateTime::ISO8601)); - } -} diff --git a/vendor/mtdowling/cron-expression/tests/Cron/DayOfMonthFieldTest.php b/vendor/mtdowling/cron-expression/tests/Cron/DayOfMonthFieldTest.php deleted file mode 100644 index 94afbb0..0000000 --- a/vendor/mtdowling/cron-expression/tests/Cron/DayOfMonthFieldTest.php +++ /dev/null @@ -1,50 +0,0 @@ - - */ -class DayOfMonthFieldTest extends \PHPUnit_Framework_TestCase -{ - /** - * @covers Cron\DayOfMonthField::validate - */ - public function testValdatesField() - { - $f = new DayOfMonthField(); - $this->assertTrue($f->validate('1')); - $this->assertTrue($f->validate('*')); - $this->assertTrue($f->validate('*/3,1,1-12')); - $this->assertTrue($f->validate('5W,L')); - $this->assertFalse($f->validate('1.')); - } - - /** - * @covers Cron\DayOfMonthField::isSatisfiedBy - */ - public function testChecksIfSatisfied() - { - $f = new DayOfMonthField(); - $this->assertTrue($f->isSatisfiedBy(new DateTime(), '?')); - } - - /** - * @covers Cron\DayOfMonthField::increment - */ - public function testIncrementsDate() - { - $d = new DateTime('2011-03-15 11:15:00'); - $f = new DayOfMonthField(); - $f->increment($d); - $this->assertEquals('2011-03-16 00:00:00', $d->format('Y-m-d H:i:s')); - - $d = new DateTime('2011-03-15 11:15:00'); - $f->increment($d, true); - $this->assertEquals('2011-03-14 23:59:00', $d->format('Y-m-d H:i:s')); - } -} diff --git a/vendor/mtdowling/cron-expression/tests/Cron/DayOfWeekFieldTest.php b/vendor/mtdowling/cron-expression/tests/Cron/DayOfWeekFieldTest.php deleted file mode 100644 index 703a517..0000000 --- a/vendor/mtdowling/cron-expression/tests/Cron/DayOfWeekFieldTest.php +++ /dev/null @@ -1,116 +0,0 @@ - - */ -class DayOfWeekFieldTest extends \PHPUnit_Framework_TestCase -{ - /** - * @covers Cron\DayOfWeekField::validate - */ - public function testValidatesField() - { - $f = new DayOfWeekField(); - $this->assertTrue($f->validate('1')); - $this->assertTrue($f->validate('*')); - $this->assertTrue($f->validate('*/3,1,1-12')); - $this->assertTrue($f->validate('SUN-2')); - $this->assertFalse($f->validate('1.')); - } - - /** - * @covers Cron\DayOfWeekField::isSatisfiedBy - */ - public function testChecksIfSatisfied() - { - $f = new DayOfWeekField(); - $this->assertTrue($f->isSatisfiedBy(new DateTime(), '?')); - } - - /** - * @covers Cron\DayOfWeekField::increment - */ - public function testIncrementsDate() - { - $d = new DateTime('2011-03-15 11:15:00'); - $f = new DayOfWeekField(); - $f->increment($d); - $this->assertEquals('2011-03-16 00:00:00', $d->format('Y-m-d H:i:s')); - - $d = new DateTime('2011-03-15 11:15:00'); - $f->increment($d, true); - $this->assertEquals('2011-03-14 23:59:00', $d->format('Y-m-d H:i:s')); - } - - /** - * @covers Cron\DayOfWeekField::isSatisfiedBy - * @expectedException InvalidArgumentException - * @expectedExceptionMessage Weekday must be a value between 0 and 7. 12 given - */ - public function testValidatesHashValueWeekday() - { - $f = new DayOfWeekField(); - $this->assertTrue($f->isSatisfiedBy(new DateTime(), '12#1')); - } - - /** - * @covers Cron\DayOfWeekField::isSatisfiedBy - * @expectedException InvalidArgumentException - * @expectedExceptionMessage There are never more than 5 of a given weekday in a month - */ - public function testValidatesHashValueNth() - { - $f = new DayOfWeekField(); - $this->assertTrue($f->isSatisfiedBy(new DateTime(), '3#6')); - } - - /** - * @covers Cron\DayOfWeekField::validate - */ - public function testValidateWeekendHash() - { - $f = new DayOfWeekField(); - $this->assertTrue($f->validate('MON#1')); - $this->assertTrue($f->validate('TUE#2')); - $this->assertTrue($f->validate('WED#3')); - $this->assertTrue($f->validate('THU#4')); - $this->assertTrue($f->validate('FRI#5')); - $this->assertTrue($f->validate('SAT#1')); - $this->assertTrue($f->validate('SUN#3')); - $this->assertTrue($f->validate('MON#1,MON#3')); - } - - /** - * @covers Cron\DayOfWeekField::isSatisfiedBy - */ - public function testHandlesZeroAndSevenDayOfTheWeekValues() - { - $f = new DayOfWeekField(); - $this->assertTrue($f->isSatisfiedBy(new DateTime('2011-09-04 00:00:00'), '0-2')); - $this->assertTrue($f->isSatisfiedBy(new DateTime('2011-09-04 00:00:00'), '6-0')); - - $this->assertTrue($f->isSatisfiedBy(new DateTime('2014-04-20 00:00:00'), 'SUN')); - $this->assertTrue($f->isSatisfiedBy(new DateTime('2014-04-20 00:00:00'), 'SUN#3')); - $this->assertTrue($f->isSatisfiedBy(new DateTime('2014-04-20 00:00:00'), '0#3')); - $this->assertTrue($f->isSatisfiedBy(new DateTime('2014-04-20 00:00:00'), '7#3')); - } - - /** - * @see https://github.com/mtdowling/cron-expression/issues/47 - */ - public function testIssue47() { - $f = new DayOfWeekField(); - $this->assertFalse($f->validate('mon,')); - $this->assertFalse($f->validate('mon-')); - $this->assertFalse($f->validate('*/2,')); - $this->assertFalse($f->validate('-mon')); - $this->assertFalse($f->validate(',1')); - $this->assertFalse($f->validate('*-')); - $this->assertFalse($f->validate(',-')); - } -} diff --git a/vendor/mtdowling/cron-expression/tests/Cron/FieldFactoryTest.php b/vendor/mtdowling/cron-expression/tests/Cron/FieldFactoryTest.php deleted file mode 100644 index ec087b1..0000000 --- a/vendor/mtdowling/cron-expression/tests/Cron/FieldFactoryTest.php +++ /dev/null @@ -1,42 +0,0 @@ - - */ -class FieldFactoryTest extends \PHPUnit_Framework_TestCase -{ - /** - * @covers Cron\FieldFactory::getField - */ - public function testRetrievesFieldInstances() - { - $mappings = array( - 0 => 'Cron\MinutesField', - 1 => 'Cron\HoursField', - 2 => 'Cron\DayOfMonthField', - 3 => 'Cron\MonthField', - 4 => 'Cron\DayOfWeekField', - 5 => 'Cron\YearField' - ); - - $f = new FieldFactory(); - - foreach ($mappings as $position => $class) { - $this->assertEquals($class, get_class($f->getField($position))); - } - } - - /** - * @covers Cron\FieldFactory::getField - * @expectedException InvalidArgumentException - */ - public function testValidatesFieldPosition() - { - $f = new FieldFactory(); - $f->getField(-1); - } -} diff --git a/vendor/mtdowling/cron-expression/tests/Cron/HoursFieldTest.php b/vendor/mtdowling/cron-expression/tests/Cron/HoursFieldTest.php deleted file mode 100644 index 48bd135..0000000 --- a/vendor/mtdowling/cron-expression/tests/Cron/HoursFieldTest.php +++ /dev/null @@ -1,38 +0,0 @@ - - */ -class HoursFieldTest extends \PHPUnit_Framework_TestCase -{ - /** - * @covers Cron\HoursField::validate - */ - public function testValdatesField() - { - $f = new HoursField(); - $this->assertTrue($f->validate('1')); - $this->assertTrue($f->validate('*')); - $this->assertTrue($f->validate('*/3,1,1-12')); - } - - /** - * @covers Cron\HoursField::increment - */ - public function testIncrementsDate() - { - $d = new DateTime('2011-03-15 11:15:00'); - $f = new HoursField(); - $f->increment($d); - $this->assertEquals('2011-03-15 12:00:00', $d->format('Y-m-d H:i:s')); - - $d->setTime(11, 15, 0); - $f->increment($d, true); - $this->assertEquals('2011-03-15 10:59:00', $d->format('Y-m-d H:i:s')); - } -} diff --git a/vendor/mtdowling/cron-expression/tests/Cron/MinutesFieldTest.php b/vendor/mtdowling/cron-expression/tests/Cron/MinutesFieldTest.php deleted file mode 100644 index 82ce966..0000000 --- a/vendor/mtdowling/cron-expression/tests/Cron/MinutesFieldTest.php +++ /dev/null @@ -1,36 +0,0 @@ - - */ -class MinutesFieldTest extends \PHPUnit_Framework_TestCase -{ - /** - * @covers Cron\MinutesField::validate - */ - public function testValdatesField() - { - $f = new MinutesField(); - $this->assertTrue($f->validate('1')); - $this->assertTrue($f->validate('*')); - $this->assertTrue($f->validate('*/3,1,1-12')); - } - - /** - * @covers Cron\MinutesField::increment - */ - public function testIncrementsDate() - { - $d = new DateTime('2011-03-15 11:15:00'); - $f = new MinutesField(); - $f->increment($d); - $this->assertEquals('2011-03-15 11:16:00', $d->format('Y-m-d H:i:s')); - $f->increment($d, true); - $this->assertEquals('2011-03-15 11:15:00', $d->format('Y-m-d H:i:s')); - } -} diff --git a/vendor/mtdowling/cron-expression/tests/Cron/MonthFieldTest.php b/vendor/mtdowling/cron-expression/tests/Cron/MonthFieldTest.php deleted file mode 100644 index 82878f8..0000000 --- a/vendor/mtdowling/cron-expression/tests/Cron/MonthFieldTest.php +++ /dev/null @@ -1,61 +0,0 @@ - - */ -class MonthFieldTest extends \PHPUnit_Framework_TestCase -{ - /** - * @covers Cron\MonthField::validate - */ - public function testValdatesField() - { - $f = new MonthField(); - $this->assertTrue($f->validate('12')); - $this->assertTrue($f->validate('*')); - $this->assertTrue($f->validate('*/10,2,1-12')); - $this->assertFalse($f->validate('1.fix-regexp')); - } - - /** - * @covers Cron\MonthField::increment - */ - public function testIncrementsDate() - { - $d = new DateTime('2011-03-15 11:15:00'); - $f = new MonthField(); - $f->increment($d); - $this->assertEquals('2011-04-01 00:00:00', $d->format('Y-m-d H:i:s')); - - $d = new DateTime('2011-03-15 11:15:00'); - $f->increment($d, true); - $this->assertEquals('2011-02-28 23:59:00', $d->format('Y-m-d H:i:s')); - } - - /** - * @covers Cron\MonthField::increment - */ - public function testIncrementsYearAsNeeded() - { - $f = new MonthField(); - $d = new DateTime('2011-12-15 00:00:00'); - $f->increment($d); - $this->assertEquals('2012-01-01 00:00:00', $d->format('Y-m-d H:i:s')); - } - - /** - * @covers Cron\MonthField::increment - */ - public function testDecrementsYearAsNeeded() - { - $f = new MonthField(); - $d = new DateTime('2011-01-15 00:00:00'); - $f->increment($d, true); - $this->assertEquals('2010-12-31 23:59:00', $d->format('Y-m-d H:i:s')); - } -} diff --git a/vendor/mtdowling/cron-expression/tests/Cron/YearFieldTest.php b/vendor/mtdowling/cron-expression/tests/Cron/YearFieldTest.php deleted file mode 100644 index e7bcacb..0000000 --- a/vendor/mtdowling/cron-expression/tests/Cron/YearFieldTest.php +++ /dev/null @@ -1,36 +0,0 @@ - - */ -class YearFieldTest extends \PHPUnit_Framework_TestCase -{ - /** - * @covers Cron\YearField::validate - */ - public function testValdatesField() - { - $f = new YearField(); - $this->assertTrue($f->validate('2011')); - $this->assertTrue($f->validate('*')); - $this->assertTrue($f->validate('*/10,2012,1-12')); - } - - /** - * @covers Cron\YearField::increment - */ - public function testIncrementsDate() - { - $d = new DateTime('2011-03-15 11:15:00'); - $f = new YearField(); - $f->increment($d); - $this->assertEquals('2012-01-01 00:00:00', $d->format('Y-m-d H:i:s')); - $f->increment($d, true); - $this->assertEquals('2011-12-31 23:59:00', $d->format('Y-m-d H:i:s')); - } -} diff --git a/vendor/nesbot/carbon/composer.json b/vendor/nesbot/carbon/composer.json index 7b67c08..0ab0f54 100644 --- a/vendor/nesbot/carbon/composer.json +++ b/vendor/nesbot/carbon/composer.json @@ -7,7 +7,7 @@ "time", "DateTime" ], - "homepage": "https://github.com/briannesbitt/Carbon", + "homepage": "http://carbon.nesbot.com", "license": "MIT", "authors": [ { diff --git a/vendor/nesbot/carbon/history.md b/vendor/nesbot/carbon/history.md deleted file mode 100644 index d0f0159..0000000 --- a/vendor/nesbot/carbon/history.md +++ /dev/null @@ -1,112 +0,0 @@ -1.13.0 / 2014-09-25 -=================== -* Fixed diffInDaysFiltered() bug. -* Removed default param from formatLocalized() (thanks @vlakoff) -* Various refactorings (thanks @lucasmichot @euromark) -* Updated toXXXString() methods to be camel cased (thanks @euromark) -* Now using 4 spaces for indent. (thanks @lucasmichot @euromark) - -1.12.0 / 2014-09-09 -=================== -* Add new functions diffInDaysFiltered(), diffInWeekdays() and diffInWeekendDays() (thanks @m4tthumphrey) -* Fixed XofQuarter methods when moving to a month that doesn't have that day it jumps forward #168 -* Support for microseconds during instantiation and copy. Be aware that microseconds are ignored for doing any of the math. -* Microsecond getter. -* Various refactorings (thanks @lucasmichot @lorenzo) - -1.11.0 / 2014-08-25 -=================== -* Added isSameDay() (thanks @enkelmedia) -* Added diffInWeeks(), maxValue() and minValue() (thanks @lucasmichot) -* Improved accuracy of diffForHumans() by using 30/7 for weeks and moving the floor() call to outside the loop. Fixed tests that just look better now as a result. -* Improved readme with common formats example output (thanks @troyharvey) -* Various internal refactors (thanks @lucasmichot) - -1.10.0 / 2014-07-17 -=================== -* Changed @return Carbon phpdocs to static for better IDE typehint when extending Carbon -* Fixed Carbon.php download link -* Added 5.6 and HHVM to test coverage -* Fixed issue with isPast() returning true for now() -* Added getter for weekOfMonth - -1.9.0 / 2014-05-12 -================== -* Changed self references to static to allow for easier child classes -* Fixed a couple of tests to account for London DST -* Fixed a test that failed due to inconsistent DateTime COOKIE strings - -1.8.0 / 2014-01-06 -================== -* Added .gitattributes file to to ignore some files on export (thanks @lucasmichot) -* Removed unnecessary __set tz/timezone switch -* Added min() / max() (thanks @lucasmichot) -* Fixed startOfWeek() / endOfWeek() when crossing year boundary. -* Fixed bug in detecting relative keywords in ctor parameter when using a test now - -1.7.0 / 2013-12-04 -================== -* Added startOfYear() / endOfYear() (thanks @semalead) -* Added average() (thanks @semalead) - -1.6.0 / 2013-11-23 -================== -* Fixed "Cannot access property ::$toStringFormat" when extending Carbon and type juggling to a string occurs - -1.5.0 / 2013-11-21 -================== -* Diff for humans now shows 2 weeks ago instead of 14 days ago -* Added a local getter to test if the instance is in the local timezone -* Added a utc getter to check if the instance is in UTC timezone -* Fixed dst comment / phpdoc and psr issues -* Optimize timezone getters (thanks @semalead) -* Added static __toString formatting (thanks @cviebrock and @anlutro) - -1.4.0 / 2013-09-08 -================== -* Corrected various PHPdocs -* formatLocalized() is now more OS independent -* Improved diff methods -* Test now can be mocked using a relative term - -1.3.0 / 2013-08-21 -================== - - * Added modifier methods firstOfMonth(), lastOfMonth(), nthOfMonth(), next(), previous(), and so on - * Added modifiers startOfWeek() and endOfWeek() - * Added testing helpers to allow mocking of new Carbon(), new Carbon('now') and Carbon::now() - * Added formatLocalized() to format a string using strftime() with the current locale - * Improved diffInSeconds() - * Improved [add|sub][Years|Months|Days|Hours|Minutes|Seconds|Weeks] - * Docblocks everywhere ;( - * Magic class properties - * Added PHP 5.5 to travis test coverage - * General Code cleanup - -1.2.0 / 2012-10-14 -================== - - * Added history.md - * Implemented __isset() (thanks @flevour) - * Simplified tomorrow()/yesterday() to rely on today()... more DRY - * Simplified __set() and fixed exception text - * Updated readme - -1.1.0 / 2012-09-16 -================== - - * Updated composer.json - * Added better error messaging for failed readme generation - * Fixed readme typos - * Added static helpers `today()`, `tomorrow()`, `yesterday()` - * Simplified `now()` code - -1.0.1 / 2012-09-10 -================== - - * Added travis-ci.org - -1.0.0 / 2012-09-10 -================== - - * Initial release diff --git a/vendor/nesbot/carbon/readme.md b/vendor/nesbot/carbon/readme.md index 7f8ba78..7fc85c8 100644 --- a/vendor/nesbot/carbon/readme.md +++ b/vendor/nesbot/carbon/readme.md @@ -1,10 +1,8 @@ -> **This file is autogenerated. Please see the [Contributing](#about-contributing) section from more information.** - # Carbon [![Latest Stable Version](https://poser.pugx.org/nesbot/carbon/v/stable.png)](https://packagist.org/packages/nesbot/carbon) [![Total Downloads](https://poser.pugx.org/nesbot/carbon/downloads.png)](https://packagist.org/packages/nesbot/carbon) [![Build Status](https://secure.travis-ci.org/briannesbitt/Carbon.png)](http://travis-ci.org/briannesbitt/Carbon) -A simple API extension for DateTime with PHP 5.3+ +A simple PHP API extension for DateTime. [http://carbon.nesbot.com](http://carbon.nesbot.com) ```php printf("Right now is %s", Carbon::now()->toDateTimeString()); @@ -43,52 +41,18 @@ echo Carbon::now()->subMinutes(2)->diffForHumans(); // '2 minutes ago' $daysSinceEpoch = Carbon::createFromTimeStamp(0)->diffInDays(); ``` -## README Contents - -* [Installation](#install) - * [Requirements](#requirements) - * [With composer](#install-composer) - * [Without composer](#install-nocomposer) -* [API](#api) - * [Instantiation](#api-instantiation) - * [Testing Aids](#api-testing) - * [Getters](#api-getters) - * [Setters](#api-setters) - * [Fluent Setters](#api-settersfluent) - * [IsSet](#api-isset) - * [String Formatting and Localization](#api-formatting) - * [Common Formats](#api-commonformats) - * [Comparison](#api-comparison) - * [Addition and Subtraction](#api-addsub) - * [Difference](#api-difference) - * [Difference for Humans](#api-humandiff) - * [Modifiers](#api-modifiers) - * [Constants](#api-constants) -* [About](#about) - * [Contributing](#about-contributing) - * [Author](#about-author) - * [License](#about-license) - * [History](#about-history) - * [Why the name Carbon?](#about-whyname) - - ## Installation - -### Requirements - -- Any flavour of PHP 5.3+ should do -- [optional] PHPUnit to execute the test suite - - ### With Composer -The easiest way to install Carbon is via [composer](http://getcomposer.org/). Create the following `composer.json` file and run the `php composer.phar install` command to install it. +``` +$ composer require nesbot/carbon +``` ```json { "require": { - "nesbot/Carbon": "*" + "nesbot/carbon": "~1.14" } } ``` @@ -115,786 +79,3 @@ use Carbon\Carbon; printf("Now: %s", Carbon::now()); ``` - - -## API - -The Carbon class is [inherited](http://php.net/manual/en/keyword.extends.php) from the PHP [DateTime](http://www.php.net/manual/en/class.datetime.php) class. - -```php - **Note: I live in Ottawa, Ontario, Canada and if the timezone is not specified in the examples then the default of 'America/Toronto' is to be assumed. Typically Ottawa is -0500 but when daylight savings time is on we are -0400.** - -Special care has been taken to ensure timezones are handled correctly, and where appropriate are based on the underlying DateTime implementation. For example all comparisons are done in UTC or in the timezone of the datetime being used. - -```php -$dtToronto = Carbon::createFromDate(2012, 1, 1, 'America/Toronto'); -$dtVancouver = Carbon::createFromDate(2012, 1, 1, 'America/Vancouver'); - -echo $dtVancouver->diffInHours($dtToronto); // 3 -``` - -Also `is` comparisons are done in the timezone of the provided Carbon instance. For example my current timezone is -13 hours from Tokyo. So `Carbon::now('Asia/Tokyo')->isToday()` would only return false for any time past 1 PM my time. This doesn't make sense since `now()` in tokyo is always today in Tokyo. Thus the comparison to `now()` is done in the same timezone as the current instance. - - -### Instantiation - -There are several different methods available to create a new instance of Carbon. First there is a constructor. It overrides the [parent constructor](http://www.php.net/manual/en/datetime.construct.php) and you are best to read about the first parameter from the PHP manual and understand the date/time string formats it accepts. You'll hopefully find yourself rarely using the constructor but rather relying on the explicit static methods for improved readability. - -```php -$carbon = new Carbon(); // equivalent to Carbon::now() -$carbon = new Carbon('first day of January 2008', 'America/Vancouver'); -echo get_class($carbon); // 'Carbon\Carbon' -``` - -You'll notice above that the timezone (2nd) parameter was passed as a string rather than a `\DateTimeZone` instance. All DateTimeZone parameters have been augmented so you can pass a DateTimeZone instance or a string and the timezone will be created for you. This is again shown in the next example which also introduces the `now()` function. - -```php -$now = Carbon::now(); - -$nowInLondonTz = Carbon::now(new DateTimeZone('Europe/London')); - -// or just pass the timezone as a string -$nowInLondonTz = Carbon::now('Europe/London'); -``` - -If you really love your fluid method calls and get frustrated by the extra line or ugly pair of brackets necessary when using the constructor you'll enjoy the `parse` method. - -```php -echo (new Carbon('first day of December 2008'))->addWeeks(2); // 2008-12-15 00:00:00 -echo Carbon::parse('first day of December 2008')->addWeeks(2); // 2008-12-15 00:00:00 -``` - -To accompany `now()`, a few other static instantiation helpers exist to create widely known instances. The only thing to really notice here is that `today()`, `tomorrow()` and `yesterday()`, besides behaving as expected, all accept a timezone parameter and each has their time value set to `00:00:00`. - -```php -$now = Carbon::now(); -echo $now; // 2014-09-24 23:55:55 -$today = Carbon::today(); -echo $today; // 2014-09-24 00:00:00 -$tomorrow = Carbon::tomorrow('Europe/London'); -echo $tomorrow; // 2014-09-26 00:00:00 -$yesterday = Carbon::yesterday(); -echo $yesterday; // 2014-09-23 00:00:00 -``` - -The next group of static helpers are the `createXXX()` helpers. Most of the static `create` functions allow you to provide as many or as few arguments as you want and will provide default values for all others. Generally default values are the current date, time or timezone. Higher values will wrap appropriately but invalid values will throw an `InvalidArgumentException` with an informative message. The message is obtained from an [DateTime::getLastErrors()](http://php.net/manual/en/datetime.getlasterrors.php) call. - -```php -Carbon::createFromDate($year, $month, $day, $tz); -Carbon::createFromTime($hour, $minute, $second, $tz); -Carbon::create($year, $month, $day, $hour, $minute, $second, $tz); -``` - -`createFromDate()` will default the time to now. `createFromTime()` will default the date to today. `create()` will default any null parameter to the current respective value. As before, the `$tz` defaults to the current timezone and otherwise can be a DateTimeZone instance or simply a string timezone value. The only special case for default values (mimicking the underlying PHP library) occurs when an hour value is specified but no minutes or seconds, they will get defaulted to 0. - -```php -$xmasThisYear = Carbon::createFromDate(null, 12, 25); // Year defaults to current year -$Y2K = Carbon::create(2000, 1, 1, 0, 0, 0); -$alsoY2K = Carbon::create(1999, 12, 31, 24); -$noonLondonTz = Carbon::createFromTime(12, 0, 0, 'Europe/London'); - -// A two digit minute could not be found -try { Carbon::create(1975, 5, 21, 22, -2, 0); } catch(InvalidArgumentException $x) { echo $x->getMessage(); } -``` - -```php -Carbon::createFromFormat($format, $time, $tz); -``` - -`createFromFormat()` is mostly a wrapper for the base php function [DateTime::createFromFormat](http://php.net/manual/en/datetime.createfromformat.php). The difference being again the `$tz` argument can be a DateTimeZone instance or a string timezone value. Also, if there are errors with the format this function will call the `DateTime::getLastErrors()` method and then throw a `InvalidArgumentException` with the errors as the message. If you look at the source for the `createXX()` functions above, they all make a call to `createFromFormat()`. - -```php -echo Carbon::createFromFormat('Y-m-d H', '1975-05-21 22')->toDateTimeString(); // 1975-05-21 22:00:00 -``` - -The final two create functions are for working with [unix timestamps](http://en.wikipedia.org/wiki/Unix_time). The first will create a Carbon instance equal to the given timestamp and will set the timezone as well or default it to the current timezone. The second, `createFromTimestampUTC()`, is different in that the timezone will remain UTC (GMT). The second acts the same as `Carbon::createFromFormat('@'.$timestamp)` but I have just made it a little more explicit. Negative timestamps are also allowed. - -```php -echo Carbon::createFromTimeStamp(-1)->toDateTimeString(); // 1969-12-31 18:59:59 -echo Carbon::createFromTimeStamp(-1, 'Europe/London')->toDateTimeString(); // 1970-01-01 00:59:59 -echo Carbon::createFromTimeStampUTC(-1)->toDateTimeString(); // 1969-12-31 23:59:59 -``` - -You can also create a `copy()` of an existing Carbon instance. As expected the date, time and timezone values are all copied to the new instance. - -```php -$dt = Carbon::now(); -echo $dt->diffInYears($dt->copy()->addYear()); // 1 - -// $dt was unchanged and still holds the value of Carbon:now() -``` - -Finally, if you find yourself inheriting a `\DateTime` instance from another library, fear not! You can create a `Carbon` instance via a friendly `instance()` function. - -```php -$dt = new \DateTime('first day of January 2008'); // <== instance from another API -$carbon = Carbon::instance($dt); -echo get_class($carbon); // 'Carbon\Carbon' -echo $carbon->toDateTimeString(); // 2008-01-01 00:00:00 -``` - -A quick note about microseconds. The PHP DateTime object allows you to set a microsecond value but ignores it for all of its date math. As of 1.12.0 Carbon now supports microseconds during instantiation or copy operations as well as by default with the `format()` method. - -```php -$dt = Carbon::parse('1975-05-21 22:23:00.123456'); -echo $dt->micro; // 123456 -echo $dt->copy()->micro; // 123456 -``` - -Ever need to loop through some dates to find the earliest or latest date? Didn't know what to set your initial maximum/minimum values to? There are now two helpers for this to make your decision simple: - -```php -echo Carbon::maxValue(); // '2038-01-18 22:14:07' -echo Carbon::minValue(); // '1901-12-13 15:45:52' -``` - - -### Testing Aids - -The testing methods allow you to set a Carbon instance (real or mock) to be returned when a "now" instance is created. The provided instance will be returned specifically under the following conditions: -- A call to the static now() method, ex. Carbon::now() -- When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) -- When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') - -```php -$knownDate = Carbon::create(2001, 5, 21, 12); // create testing date -Carbon::setTestNow($knownDate); // set the mock (of course this could be a real mock object) -echo Carbon::now(); // 2001-05-21 12:00:00 -echo new Carbon(); // 2001-05-21 12:00:00 -echo Carbon::parse(); // 2001-05-21 12:00:00 -echo new Carbon('now'); // 2001-05-21 12:00:00 -echo Carbon::parse('now'); // 2001-05-21 12:00:00 -var_dump(Carbon::hasTestNow()); // bool(true) -Carbon::setTestNow(); // clear the mock -var_dump(Carbon::hasTestNow()); // bool(false) -echo Carbon::now(); // 2014-09-24 23:55:55 -``` - -A more meaning full example: - -```php -class SeasonalProduct -{ - protected $price; - - public function __construct($price) - { - $this->price = $price; - } - - public function getPrice() { - $multiplier = 1; - if (Carbon::now()->month == 12) { - $multiplier = 2; - } - - return $this->price * $multiplier; - } -} - -$product = new SeasonalProduct(100); -Carbon::setTestNow(Carbon::parse('first day of March 2000')); -echo $product->getPrice(); // 100 -Carbon::setTestNow(Carbon::parse('first day of December 2000')); -echo $product->getPrice(); // 200 -Carbon::setTestNow(Carbon::parse('first day of May 2000')); -echo $product->getPrice(); // 100 -Carbon::setTestNow(); -``` - -Relative phrases are also mocked according to the given "now" instance. - -```php -$knownDate = Carbon::create(2001, 5, 21, 12); // create testing date -Carbon::setTestNow($knownDate); // set the mock -echo new Carbon('tomorrow'); // 2001-05-22 00:00:00 -echo new Carbon('yesterday'); // 2001-05-20 00:00:00 -echo new Carbon('next wednesday'); // 2001-05-23 00:00:00 -echo new Carbon('last friday'); // 2001-05-18 00:00:00 -echo new Carbon('this thursday'); // 2001-05-24 00:00:00 -Carbon::setTestNow(); // always clear it ! -``` - -The list of words that are considered to be relative modifiers are: -- this -- next -- last -- tomorrow -- yesterday -- + -- - -- first -- last -- ago - -Be aware that similar to the next(), previous() and modify() methods some of these relative modifiers will set the time to 00:00:00. - - -### Getters - -The getters are implemented via PHP's `__get()` method. This enables you to access the value as if it was a property rather than a function call. - -```php -$dt = Carbon::parse('2012-9-5 23:26:11.123789'); - -// These getters specifically return integers, ie intval() -var_dump($dt->year); // int(2012) -var_dump($dt->month); // int(9) -var_dump($dt->day); // int(5) -var_dump($dt->hour); // int(23) -var_dump($dt->minute); // int(26) -var_dump($dt->second); // int(11) -var_dump($dt->micro); // int(123789) -var_dump($dt->dayOfWeek); // int(3) -var_dump($dt->dayOfYear); // int(248) -var_dump($dt->weekOfMonth); // int(1) -var_dump($dt->weekOfYear); // int(36) -var_dump($dt->daysInMonth); // int(30) -var_dump($dt->timestamp); // int(1346901971) -var_dump(Carbon::createFromDate(1975, 5, 21)->age); // int(39) calculated vs now in the same tz -var_dump($dt->quarter); // int(3) - -// Returns an int of seconds difference from UTC (+/- sign included) -var_dump(Carbon::createFromTimestampUTC(0)->offset); // int(0) -var_dump(Carbon::createFromTimestamp(0)->offset); // int(-18000) - -// Returns an int of hours difference from UTC (+/- sign included) -var_dump(Carbon::createFromTimestamp(0)->offsetHours); // int(-5) - -// Indicates if day light savings time is on -var_dump(Carbon::createFromDate(2012, 1, 1)->dst); // bool(false) -var_dump(Carbon::createFromDate(2012, 9, 1)->dst); // bool(true) - -// Indicates if the instance is in the same timezone as the local timezone -var_dump(Carbon::now()->local); // bool(true) -var_dump(Carbon::now('America/Vancouver')->local); // bool(false) - -// Indicates if the instance is in the UTC timezone -var_dump(Carbon::now()->utc); // bool(false) -var_dump(Carbon::now('Europe/London')->utc); // bool(false) -var_dump(Carbon::createFromTimestampUTC(0)->utc); // bool(true) - -// Gets the DateTimeZone instance -echo get_class(Carbon::now()->timezone); // DateTimeZone -echo get_class(Carbon::now()->tz); // DateTimeZone - -// Gets the DateTimeZone instance name, shortcut for ->timezone->getName() -echo Carbon::now()->timezoneName; // America/Toronto -echo Carbon::now()->tzName; // America/Toronto -``` - - -### Setters - -The following setters are implemented via PHP's `__set()` method. Its good to take note here that none of the setters, with the obvious exception of explicitly setting the timezone, will change the timezone of the instance. Specifically, setting the timestamp will not set the corresponding timezone to UTC. - -```php -$dt = Carbon::now(); - -$dt->year = 1975; -$dt->month = 13; // would force year++ and month = 1 -$dt->month = 5; -$dt->day = 21; -$dt->hour = 22; -$dt->minute = 32; -$dt->second = 5; - -$dt->timestamp = 169957925; // This will not change the timezone - -// Set the timezone via DateTimeZone instance or string -$dt->timezone = new DateTimeZone('Europe/London'); -$dt->timezone = 'Europe/London'; -$dt->tz = 'Europe/London'; -``` - - -### Fluent Setters - -No arguments are optional for the setters, but there are enough variety in the function definitions that you shouldn't need them anyway. Its good to take note here that none of the setters, with the obvious exception of explicitly setting the timezone, will change the timezone of the instance. Specifically, setting the timestamp will not set the corresponding timezone to UTC. - -```php -$dt = Carbon::now(); - -$dt->year(1975)->month(5)->day(21)->hour(22)->minute(32)->second(5)->toDateTimeString(); -$dt->setDate(1975, 5, 21)->setTime(22, 32, 5)->toDateTimeString(); -$dt->setDateTime(1975, 5, 21, 22, 32, 5)->toDateTimeString(); - -$dt->timestamp(169957925)->timezone('Europe/London'); - -$dt->tz('America/Toronto')->setTimezone('America/Vancouver'); -``` - - -### IsSet - -The PHP function `__isset()` is implemented. This was done as some external systems (ex. [Twig](http://twig.sensiolabs.org/doc/recipes.html#using-dynamic-object-properties)) validate the existence of a property before using it. This is done using the `isset()` or `empty()` method. You can read more about these on the PHP site: [__isset()](http://www.php.net/manual/en/language.oop5.overloading.php#object.isset), [isset()](http://www.php.net/manual/en/function.isset.php), [empty()](http://www.php.net/manual/en/function.empty.php). - -```php -var_dump(isset(Carbon::now()->iDoNotExist)); // bool(false) -var_dump(isset(Carbon::now()->hour)); // bool(true) -var_dump(empty(Carbon::now()->iDoNotExist)); // bool(true) -var_dump(empty(Carbon::now()->year)); // bool(false) -``` - - -### String Formatting and Localization - -All of the available `toXXXString()` methods rely on the base class method [DateTime::format()](http://php.net/manual/en/datetime.format.php). You'll notice the `__toString()` method is defined which allows a Carbon instance to be printed as a pretty date time string when used in a string context. - -```php -$dt = Carbon::create(1975, 12, 25, 14, 15, 16); - -var_dump($dt->toDateTimeString() == $dt); // bool(true) => uses __toString() -echo $dt->toDateString(); // 1975-12-25 -echo $dt->toFormattedDateString(); // Dec 25, 1975 -echo $dt->toTimeString(); // 14:15:16 -echo $dt->toDateTimeString(); // 1975-12-25 14:15:16 -echo $dt->toDayDateTimeString(); // Thu, Dec 25, 1975 2:15 PM - -// ... of course format() is still available -echo $dt->format('l jS \\of F Y h:i:s A'); // Thursday 25th of December 1975 02:15:16 PM -``` - -You can also set the default __toString() format (which defaults to `Y-m-d H:i:s`) thats used when [type juggling](http://php.net/manual/en/language.types.type-juggling.php) occurs. - -```php -Carbon::setToStringFormat('jS \o\f F, Y g:i:s a'); -echo $dt; // 25th of December, 1975 2:15:16 pm -Carbon::resetToStringFormat(); -echo $dt; // 1975-12-25 14:15:16 -``` - -Unfortunately the base class DateTime does not have any localization support. To begin localization support a `formatLocalized($format)` method has been added. The implementation makes a call to [strftime](http://www.php.net/strftime) using the current instance timestamp. If you first set the current locale with [setlocale()](http://www.php.net/setlocale) then the string returned will be formatted in the correct locale. - -```php -setlocale(LC_TIME, 'German'); -echo $dt->formatLocalized('%A %d %B %Y'); // Donnerstag 25 Dezember 1975 -setlocale(LC_TIME, ''); -echo $dt->formatLocalized('%A %d %B %Y'); // Thursday 25 December 1975 -``` - - -## Common Formats - -The following are wrappers for the common formats provided in the [DateTime class](http://www.php.net/manual/en/class.datetime.php). - -```php -$dt = Carbon::now(); - -// $dt->toAtomString() is the same as $dt->format(DateTime::ATOM); -echo $dt->toAtomString(); // 1975-12-25T14:15:16-05:00 -echo $dt->toCookieString(); // Thursday, 25-Dec-1975 14:15:16 EST -echo $dt->toIso8601String(); // 1975-12-25T14:15:16-0500 -echo $dt->toRfc822String(); // Thu, 25 Dec 75 14:15:16 -0500 -echo $dt->toRfc850String(); // Thursday, 25-Dec-75 14:15:16 EST -echo $dt->toRfc1036String(); // Thu, 25 Dec 75 14:15:16 -0500 -echo $dt->toRfc1123String(); // Thu, 25 Dec 1975 14:15:16 -0500 -echo $dt->toRfc2822String(); // Thu, 25 Dec 1975 14:15:16 -0500 -echo $dt->toRfc3339String(); // 1975-12-25T14:15:16-05:00 -echo $dt->toRssString(); // Thu, 25 Dec 1975 14:15:16 -0500 -echo $dt->toW3cString(); // 1975-12-25T14:15:16-05:00 -``` - - -### Comparison - -Simple comparison is offered up via the following functions. Remember that the comparison is done in the UTC timezone so things aren't always as they seem. - -```php -echo Carbon::now()->tzName; // America/Toronto -$first = Carbon::create(2012, 9, 5, 23, 26, 11); -$second = Carbon::create(2012, 9, 5, 20, 26, 11, 'America/Vancouver'); - -echo $first->toDateTimeString(); // 2012-09-05 23:26:11 -echo $first->tzName; // America/Toronto -echo $second->toDateTimeString(); // 2012-09-05 20:26:11 -echo $second->tzName; // America/Vancouver - -var_dump($first->eq($second)); // bool(true) -var_dump($first->ne($second)); // bool(false) -var_dump($first->gt($second)); // bool(false) -var_dump($first->gte($second)); // bool(true) -var_dump($first->lt($second)); // bool(false) -var_dump($first->lte($second)); // bool(true) - -$first->setDateTime(2012, 1, 1, 0, 0, 0); -$second->setDateTime(2012, 1, 1, 0, 0, 0); // Remember tz is 'America/Vancouver' - -var_dump($first->eq($second)); // bool(false) -var_dump($first->ne($second)); // bool(true) -var_dump($first->gt($second)); // bool(false) -var_dump($first->gte($second)); // bool(false) -var_dump($first->lt($second)); // bool(true) -var_dump($first->lte($second)); // bool(true) -``` - -To determine if the current instance is between two other instances you can use the aptly named `between()` method. The third parameter indicates if an equal to comparison should be done. The default is true which determines if its between or equal to the boundaries. - -```php -$first = Carbon::create(2012, 9, 5, 1); -$second = Carbon::create(2012, 9, 5, 5); -var_dump(Carbon::create(2012, 9, 5, 3)->between($first, $second)); // bool(true) -var_dump(Carbon::create(2012, 9, 5, 5)->between($first, $second)); // bool(true) -var_dump(Carbon::create(2012, 9, 5, 5)->between($first, $second, false)); // bool(false) -``` - -Woah! Did you forget min() and max() ? Nope. That is covered as well by the suitably named `min()` and `max()` methods. As usual the default parameter is now if null is specified. - -```php -$dt1 = Carbon::create(2012, 1, 1, 0, 0, 0); -$dt2 = Carbon::create(2014, 1, 30, 0, 0, 0); -echo $dt1->min($dt2); // 2012-01-01 00:00:00 - -$dt1 = Carbon::create(2012, 1, 1, 0, 0, 0); -$dt2 = Carbon::create(2014, 1, 30, 0, 0, 0); -echo $dt1->max($dt2); // 2014-01-30 00:00:00 - -// now is the default param -$dt1 = Carbon::create(2000, 1, 1, 0, 0, 0); -echo $dt1->max(); // 2014-09-24 23:55:55 -``` - -To handle the most used cases there are some simple helper functions that hopefully are obvious from their names. For the methods that compare to `now()` (ex. isToday()) in some manner the `now()` is created in the same timezone as the instance. - -```php -$dt = Carbon::now(); - -$dt->isWeekday(); -$dt->isWeekend(); -$dt->isYesterday(); -$dt->isToday(); -$dt->isTomorrow(); -$dt->isFuture(); -$dt->isPast(); -$dt->isLeapYear(); -$dt->isSameDay(Carbon::now()); -``` - - -### Addition and Subtraction - -The default DateTime provides a couple of different methods for easily adding and subtracting time. There is `modify()`, `add()` and `sub()`. `modify()` takes a *magical* date/time format string, 'last day of next month', that it parses and applies the modification while `add()` and `sub()` use a `DateInterval` class thats not so obvious, `new \DateInterval('P6YT5M')`. Hopefully using these fluent functions will be more clear and easier to read after not seeing your code for a few weeks. But of course I don't make you choose since the base class functions are still available. - -```php -$dt = Carbon::create(2012, 1, 31, 0); - -echo $dt->toDateTimeString(); // 2012-01-31 00:00:00 - -echo $dt->addYears(5); // 2017-01-31 00:00:00 -echo $dt->addYear(); // 2018-01-31 00:00:00 -echo $dt->subYear(); // 2017-01-31 00:00:00 -echo $dt->subYears(5); // 2012-01-31 00:00:00 - -echo $dt->addMonths(60); // 2017-01-31 00:00:00 -echo $dt->addMonth(); // 2017-03-03 00:00:00 equivalent of $dt->month($dt->month + 1); so it wraps -echo $dt->subMonth(); // 2017-02-03 00:00:00 -echo $dt->subMonths(60); // 2012-02-03 00:00:00 - -echo $dt->addDays(29); // 2012-03-03 00:00:00 -echo $dt->addDay(); // 2012-03-04 00:00:00 -echo $dt->subDay(); // 2012-03-03 00:00:00 -echo $dt->subDays(29); // 2012-02-03 00:00:00 - -echo $dt->addWeekdays(4); // 2012-02-09 00:00:00 -echo $dt->addWeekday(); // 2012-02-10 00:00:00 -echo $dt->subWeekday(); // 2012-02-09 00:00:00 -echo $dt->subWeekdays(4); // 2012-02-03 00:00:00 - -echo $dt->addWeeks(3); // 2012-02-24 00:00:00 -echo $dt->addWeek(); // 2012-03-02 00:00:00 -echo $dt->subWeek(); // 2012-02-24 00:00:00 -echo $dt->subWeeks(3); // 2012-02-03 00:00:00 - -echo $dt->addHours(24); // 2012-02-04 00:00:00 -echo $dt->addHour(); // 2012-02-04 01:00:00 -echo $dt->subHour(); // 2012-02-04 00:00:00 -echo $dt->subHours(24); // 2012-02-03 00:00:00 - -echo $dt->addMinutes(61); // 2012-02-03 01:01:00 -echo $dt->addMinute(); // 2012-02-03 01:02:00 -echo $dt->subMinute(); // 2012-02-03 01:01:00 -echo $dt->subMinutes(61); // 2012-02-03 00:00:00 - -echo $dt->addSeconds(61); // 2012-02-03 00:01:01 -echo $dt->addSecond(); // 2012-02-03 00:01:02 -echo $dt->subSecond(); // 2012-02-03 00:01:01 -echo $dt->subSeconds(61); // 2012-02-03 00:00:00 -``` - -For fun you can also pass negative values to `addXXX()`, in fact that's how `subXXX()` is implemented. - - -### Difference - -These functions always return the **total difference** expressed in the specified time requested. This differs from the base class `diff()` function where an interval of 61 seconds would be returned as 1 minute and 1 second via a `DateInterval` instance. The `diffInMinutes()` function would simply return 1. All values are truncated and not rounded. Each function below has a default first parameter which is the Carbon instance to compare to, or null if you want to use `now()`. The 2nd parameter again is optional and indicates if you want the return value to be the absolute value or a relative value that might have a `-` (negative) sign if the passed in date is less than the current instance. This will default to true, return the absolute value. The comparisons are done in UTC. - -```php -// Carbon::diffInYears(Carbon $dt = null, $abs = true) - -echo Carbon::now('America/Vancouver')->diffInSeconds(Carbon::now('Europe/London')); // 0 - -$dtOttawa = Carbon::createFromDate(2000, 1, 1, 'America/Toronto'); -$dtVancouver = Carbon::createFromDate(2000, 1, 1, 'America/Vancouver'); -echo $dtOttawa->diffInHours($dtVancouver); // 3 - -echo $dtOttawa->diffInHours($dtVancouver, false); // 3 -echo $dtVancouver->diffInHours($dtOttawa, false); // -3 - -$dt = Carbon::create(2012, 1, 31, 0); -echo $dt->diffInDays($dt->copy()->addMonth()); // 31 -echo $dt->diffInDays($dt->copy()->subMonth(), false); // -31 - -$dt = Carbon::create(2012, 4, 30, 0); -echo $dt->diffInDays($dt->copy()->addMonth()); // 30 -echo $dt->diffInDays($dt->copy()->addWeek()); // 7 - -$dt = Carbon::create(2012, 1, 1, 0); -echo $dt->diffInMinutes($dt->copy()->addSeconds(59)); // 0 -echo $dt->diffInMinutes($dt->copy()->addSeconds(60)); // 1 -echo $dt->diffInMinutes($dt->copy()->addSeconds(119)); // 1 -echo $dt->diffInMinutes($dt->copy()->addSeconds(120)); // 2 -``` - -There is also a special `diffInDaysFiltered()` method to help you filter the difference by days. For example to count the weekend days between two instances: - -```php -$dt = Carbon::create(2014, 1, 1); -$dt2 = Carbon::create(2014, 12, 31); -$daysForExtraCoding = $dt->diffInDaysFiltered(function(Carbon $date) { - return $date->isWeekend(); -}, $dt2); - -echo $daysForExtraCoding; // 104 - -// others that are defined -// diffInYears(), diffInMonths(), diffInWeeks() -// diffInDays(), diffInWeekdays(), diffInWeekendDays() -// diffInHours(), diffInMinutes(), diffInSeconds() -``` - - -### Difference for Humans - -It is easier for humans to read `1 month ago` compared to 30 days ago. This is a common function seen in most date libraries so I thought I would add it here as well. It uses approximations for a month being 4 weeks. The lone argument for the function is the other Carbon instance to diff against, and of course it defaults to `now()` if not specified. - -This method will add a phrase after the difference value relative to the instance and the passed in instance. There are 4 possibilities: - -* When comparing a value in the past to default now: - * 1 hour ago - * 5 months ago - -* When comparing a value in the future to default now: - * 1 hour from now - * 5 months from now - -* When comparing a value in the past to another value: - * 1 hour before - * 5 months before - -* When comparing a value in the future to another value: - * 1 hour after - * 5 months after - -```php -// The most typical usage is for comments -// The instance is the date the comment was created and its being compared to default now() -echo Carbon::now()->subDays(5)->diffForHumans(); // 5 days ago - -echo Carbon::now()->diffForHumans(Carbon::now()->subYear()); // 1 year after - -$dt = Carbon::createFromDate(2011, 8, 1); - -echo $dt->diffForHumans($dt->copy()->addMonth()); // 1 month before -echo $dt->diffForHumans($dt->copy()->subMonth()); // 1 month after - -echo Carbon::now()->addSeconds(5)->diffForHumans(); // 5 seconds from now - -echo Carbon::now()->subDays(24)->diffForHumans(); // 3 weeks ago -``` - - -### Modifiers - -These group of methods perform helpful modifications to the current instance. Most of them are self explanatory from their names... or at least should be. You'll also notice that the startOfXXX(), next() and previous() methods set the time to 00:00:00 and the endOfXXX() methods set the time to 23:59:59. - -The only one slightly different is the `average()` function. It moves your instance to the middle date between itself and the provided Carbon argument. - -```php -$dt = Carbon::create(2012, 1, 31, 12, 0, 0); -echo $dt->startOfDay(); // 2012-01-31 00:00:00 - -$dt = Carbon::create(2012, 1, 31, 12, 0, 0); -echo $dt->endOfDay(); // 2012-01-31 23:59:59 - -$dt = Carbon::create(2012, 1, 31, 12, 0, 0); -echo $dt->startOfMonth(); // 2012-01-01 00:00:00 - -$dt = Carbon::create(2012, 1, 31, 12, 0, 0); -echo $dt->endOfMonth(); // 2012-01-31 23:59:59 - -$dt = Carbon::create(2012, 1, 31, 12, 0, 0); -echo $dt->startOfYear(); // 2012-01-01 00:00:00 - -$dt = Carbon::create(2012, 1, 31, 12, 0, 0); -echo $dt->endOfYear(); // 2012-12-31 23:59:59 - -$dt = Carbon::create(2012, 1, 31, 12, 0, 0); -echo $dt->startOfDecade(); // 2010-01-01 00:00:00 - -$dt = Carbon::create(2012, 1, 31, 12, 0, 0); -echo $dt->endOfDecade(); // 2019-12-31 23:59:59 - -$dt = Carbon::create(2012, 1, 31, 12, 0, 0); -echo $dt->startOfCentury(); // 2000-01-01 00:00:00 - -$dt = Carbon::create(2012, 1, 31, 12, 0, 0); -echo $dt->endOfCentury(); // 2099-12-31 23:59:59 - -$dt = Carbon::create(2012, 1, 31, 12, 0, 0); -echo $dt->startOfWeek(); // 2012-01-30 00:00:00 -var_dump($dt->dayOfWeek == Carbon::MONDAY); // bool(true) : ISO8601 week starts on Monday - -$dt = Carbon::create(2012, 1, 31, 12, 0, 0); -echo $dt->endOfWeek(); // 2012-02-05 23:59:59 -var_dump($dt->dayOfWeek == Carbon::SUNDAY); // bool(true) : ISO8601 week ends on Sunday - -$dt = Carbon::create(2012, 1, 31, 12, 0, 0); -echo $dt->next(Carbon::WEDNESDAY); // 2012-02-01 00:00:00 -var_dump($dt->dayOfWeek == Carbon::WEDNESDAY); // bool(true) - -$dt = Carbon::create(2012, 1, 1, 12, 0, 0); -echo $dt->next(); // 2012-01-08 00:00:00 - -$dt = Carbon::create(2012, 1, 31, 12, 0, 0); -echo $dt->previous(Carbon::WEDNESDAY); // 2012-01-25 00:00:00 -var_dump($dt->dayOfWeek == Carbon::WEDNESDAY); // bool(true) - -$dt = Carbon::create(2012, 1, 1, 12, 0, 0); -echo $dt->previous(); // 2011-12-25 00:00:00 - -$start = Carbon::create(2014, 1, 1, 0, 0, 0); -$end = Carbon::create(2014, 1, 30, 0, 0, 0); -echo $start->average($end); // 2014-01-15 12:00:00 - -// others that are defined that are similar -// firstOfMonth(), lastOfMonth(), nthOfMonth() -// firstOfQuarter(), lastOfQuarter(), nthOfQuarter() -// firstOfYear(), lastOfYear(), nthOfYear() - -``` - - -### Constants - -The following constants are defined in the Carbon class. - -// These getters specifically return integers, ie intval() -var_dump(Carbon::SUNDAY); // int(0) -var_dump(Carbon::MONDAY); // int(1) -var_dump(Carbon::TUESDAY); // int(2) -var_dump(Carbon::WEDNESDAY); // int(3) -var_dump(Carbon::THURSDAY); // int(4) -var_dump(Carbon::FRIDAY); // int(5) -var_dump(Carbon::SATURDAY); // int(6) - -var_dump(Carbon::YEARS_PER_CENTURY); // int(100) -var_dump(Carbon::YEARS_PER_DECADE); // int(10) -var_dump(Carbon::MONTHS_PER_YEAR); // int(12) -var_dump(Carbon::WEEKS_PER_YEAR); // int(52) -var_dump(Carbon::DAYS_PER_WEEK); // int(7) -var_dump(Carbon::HOURS_PER_DAY); // int(24) -var_dump(Carbon::MINUTES_PER_HOUR); // int(60) -var_dump(Carbon::SECONDS_PER_MINUTE); // int(60) - -```php -$dt = Carbon::createFromDate(2012, 10, 6); -if ($dt->dayOfWeek === Carbon::SATURDAY) { - echo 'Place bets on Ottawa Senators Winning!'; -} -``` - - -## About - - -### Contributing - -I hate reading a readme.md file that has code errors and/or sample output that is incorrect. I tried something new with this project and wrote a quick readme parser that can **lint** sample source code or **execute** and inject the actual result into a generated readme. - -> **Don't make changes to the `readme.md` directly!!** - -Change the `readme.src.md` and then use the `readme.php` to generate the new `readme.md` file. It can be run at the command line using `php readme.php` from the project root. Maybe someday I'll extract this out to another project or at least run it with a post receive hook, but for now its just a local tool, deal with it. - -The commands are quickly explained below. To see some examples you can view the raw `readme.src.md` file in this repo. - -`{{::lint()}}` - -The `lint` command is meant for confirming the code is valid and will `eval()` the code passed into the function. Assuming there were no errors, the executed source code will then be injected back into the text replacing out the `{{::lint()}}`. When you look at the raw `readme.src.md` you will see that the code can span several lines. Remember the code is executed in the context of the running script so any variables will be available for the rest of the file. - - {{::lint($var = 'brian nesbitt';)}} => $var = 'brian nesbitt'; - -> As mentioned the `$var` can later be echo'd and you would get 'brian nesbitt' as all of the source is executed in the same scope. - -`{{varName::exec()}}` and `{{varName_eval}}` - -The `exec` command begins by performing an `eval()` on the code passed into the function. The executed source code will then be injected back into the text replacing out the `{{varName::exec()}}`. This will also create a variable named `varName_eval` that you can then place anywhere in the file and it will get replaced with the output of the `eval()`. You can use any type of output (`echo`, `printf`, `var_dump` etc) statement to return the result value as an output buffer is setup to capture the output. - - {{exVarName::exec(echo $var;)}} => echo $var; - {{exVarName_eval}} => brian nesbitt // $var is still set from above - -`/*pad()*/` - -The `pad()` is a special source modifier. This will pad the code block to the indicated number of characters using spaces. Its particularly handy for aligning `//` comments when showing results. - - {{exVarName1::exec(echo 12345;/*pad(20)*/)}} // {{exVarName1_eval}} - {{exVarName2::exec(echo 6;/*pad(20)*/)}} // {{exVarName2_eval}} - -... would generate to: - - echo 12345; // 12345 - echo 6; // 6 - -Apart from the readme the typical steps can be used to contribute your own improvements. - -* Fork -* Clone -* PHPUnit -* Branch -* PHPUnit -* Code -* PHPUnit -* Commit -* Push -* Pull request -* Relax and play Castle Crashers - - -### Author - -Brian Nesbitt - - - - -### License - -Carbon is licensed under the MIT License - see the `LICENSE` file for details - - -### History - -You can view the history of the Carbon project in the [history file](https://github.com/briannesbitt/Carbon/blob/master/history.md). - - -### Why the name Carbon? - -Read about [Carbon Dating](http://en.wikipedia.org/wiki/Radiocarbon_dating) - -![](https://cruel-carlota.pagodabox.com/55ce479cc1edc5e0cc5b4b6f9a7a9200) diff --git a/vendor/nesbot/carbon/src/Carbon/Carbon.php b/vendor/nesbot/carbon/src/Carbon/Carbon.php index 90ea4da..5f66a4e 100644 --- a/vendor/nesbot/carbon/src/Carbon/Carbon.php +++ b/vendor/nesbot/carbon/src/Carbon/Carbon.php @@ -22,6 +22,7 @@ * A simple API extension for DateTime * * @property integer $year + * @property integer $yearIso * @property integer $month * @property integer $day * @property integer $hour @@ -31,7 +32,7 @@ * @property-read integer $micro * @property-read integer $dayOfWeek 0 (for Sunday) through 6 (for Saturday) * @property-read integer $dayOfYear 0 through 365 - * @property-read integer $weekOfMonth 1 through 6 + * @property-read integer $weekOfMonth 1 through 5 * @property-read integer $weekOfYear ISO-8601 week number of year, weeks starting on Monday * @property-read integer $daysInMonth number of days in the given month * @property-read integer $age does a diffInYears() with default parameters @@ -132,7 +133,7 @@ class Carbon extends DateTime /** * Creates a DateTimeZone from a string or a DateTimeZone * - * @param DateTimeZone|string $object + * @param DateTimeZone|string|null $object * * @return DateTimeZone * @@ -140,6 +141,11 @@ class Carbon extends DateTime */ protected static function safeCreateDateTimeZone($object) { + if ($object === null) { + // Don't return null... avoid Bug #52063 in PHP <5.3.6 + return new DateTimeZone(date_default_timezone_get()); + } + if ($object instanceof DateTimeZone) { return $object; } @@ -186,11 +192,7 @@ public function __construct($time = null, $tz = null) $time = $testInstance->toDateTimeString(); } - if ($tz !== null) { - parent::__construct($time, static::safeCreateDateTimeZone($tz)); - } else { - parent::__construct($time); - } + parent::__construct($time, static::safeCreateDateTimeZone($tz)); } /** @@ -435,66 +437,52 @@ public function copy() */ public function __get($name) { - switch ($name) { - case 'year': - case 'month': - case 'day': - case 'hour': - case 'minute': - case 'second': - case 'micro': - case 'dayOfWeek': - case 'dayOfYear': - case 'weekOfYear': - case 'daysInMonth': - case 'timestamp': - $formats = array( - 'year' => 'Y', - 'month' => 'n', - 'day' => 'j', - 'hour' => 'G', - 'minute' => 'i', - 'second' => 's', - 'micro' => 'u', - 'dayOfWeek' => 'w', - 'dayOfYear' => 'z', - 'weekOfYear' => 'W', - 'daysInMonth' => 't', - 'timestamp' => 'U', - ); - + switch (true) { + case array_key_exists($name, $formats = array( + 'year' => 'Y', + 'yearIso' => 'o', + 'month' => 'n', + 'day' => 'j', + 'hour' => 'G', + 'minute' => 'i', + 'second' => 's', + 'micro' => 'u', + 'dayOfWeek' => 'w', + 'dayOfYear' => 'z', + 'weekOfYear' => 'W', + 'daysInMonth' => 't', + 'timestamp' => 'U', + )): return (int) $this->format($formats[$name]); - case 'weekOfMonth': - return (int) ceil($this->day / self::DAYS_PER_WEEK); + case $name === 'weekOfMonth': + return (int) ceil($this->day / static::DAYS_PER_WEEK); - case 'age': + case $name === 'age': return (int) $this->diffInYears(); - case 'quarter': + case $name === 'quarter': return (int) ceil($this->month / 3); - case 'offset': + case $name === 'offset': return $this->getOffset(); - case 'offsetHours': - return $this->getOffset() / self::SECONDS_PER_MINUTE / self::MINUTES_PER_HOUR; + case $name === 'offsetHours': + return $this->getOffset() / static::SECONDS_PER_MINUTE / static::MINUTES_PER_HOUR; - case 'dst': + case $name === 'dst': return $this->format('I') == '1'; - case 'local': + case $name === 'local': return $this->offset == $this->copy()->setTimezone(date_default_timezone_get())->offset; - case 'utc': + case $name === 'utc': return $this->offset == 0; - case 'timezone': - case 'tz': + case $name === 'timezone' || $name === 'tz': return $this->getTimezone(); - case 'timezoneName': - case 'tzName': + case $name === 'timezoneName' || $name === 'tzName': return $this->getTimezone()->getName(); default: @@ -532,27 +520,27 @@ public function __set($name, $value) { switch ($name) { case 'year': - parent::setDate($value, $this->month, $this->day); + $this->setDate($value, $this->month, $this->day); break; case 'month': - parent::setDate($this->year, $value, $this->day); + $this->setDate($this->year, $value, $this->day); break; case 'day': - parent::setDate($this->year, $this->month, $value); + $this->setDate($this->year, $this->month, $value); break; case 'hour': - parent::setTime($value, $this->minute, $this->second); + $this->setTime($value, $this->minute, $this->second); break; case 'minute': - parent::setTime($this->hour, $value, $this->second); + $this->setTime($this->hour, $value, $this->second); break; case 'second': - parent::setTime($this->hour, $this->minute, $value); + $this->setTime($this->hour, $this->minute, $value); break; case 'timestamp': @@ -611,22 +599,6 @@ public function day($value) return $this; } - /** - * Set the date all together - * - * @param integer $year - * @param integer $month - * @param integer $day - * - * @return static - */ - public function setDate($year, $month, $day) - { - parent::setDate($year, $month, $day); - - return $this; - } - /** * Set the instance's hour * @@ -669,22 +641,6 @@ public function second($value) return $this; } - /** - * Set the time all together - * - * @param integer $hour - * @param integer $minute - * @param integer $second - * - * @return static - */ - public function setTime($hour, $minute, $second = 0) - { - parent::setTime($hour, $minute, $second); - - return $this; - } - /** * Set the date and time all together * @@ -840,10 +796,10 @@ public function formatLocalized($format) // Check for Windows to find and replace the %e // modifier correctly if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') { - $format = preg_replace('#(?timestamp); + return strftime($format, strtotime($this)); } /** @@ -852,7 +808,7 @@ public function formatLocalized($format) */ public static function resetToStringFormat() { - static::setToStringFormat(self::DEFAULT_TO_STRING_FORMAT); + static::setToStringFormat(static::DEFAULT_TO_STRING_FORMAT); } /** @@ -932,7 +888,7 @@ public function toDayDateTimeString() */ public function toAtomString() { - return $this->format(self::ATOM); + return $this->format(static::ATOM); } /** @@ -942,7 +898,7 @@ public function toAtomString() */ public function toCookieString() { - return $this->format(self::COOKIE); + return $this->format(static::COOKIE); } /** @@ -952,7 +908,7 @@ public function toCookieString() */ public function toIso8601String() { - return $this->format(self::ISO8601); + return $this->format(static::ISO8601); } /** @@ -962,7 +918,7 @@ public function toIso8601String() */ public function toRfc822String() { - return $this->format(self::RFC822); + return $this->format(static::RFC822); } /** @@ -972,7 +928,7 @@ public function toRfc822String() */ public function toRfc850String() { - return $this->format(self::RFC850); + return $this->format(static::RFC850); } /** @@ -982,7 +938,7 @@ public function toRfc850String() */ public function toRfc1036String() { - return $this->format(self::RFC1036); + return $this->format(static::RFC1036); } /** @@ -992,7 +948,7 @@ public function toRfc1036String() */ public function toRfc1123String() { - return $this->format(self::RFC1123); + return $this->format(static::RFC1123); } /** @@ -1002,7 +958,7 @@ public function toRfc1123String() */ public function toRfc2822String() { - return $this->format(self::RFC2822); + return $this->format(static::RFC2822); } /** @@ -1012,7 +968,7 @@ public function toRfc2822String() */ public function toRfc3339String() { - return $this->format(self::RFC3339); + return $this->format(static::RFC3339); } /** @@ -1022,7 +978,7 @@ public function toRfc3339String() */ public function toRssString() { - return $this->format(self::RSS); + return $this->format(static::RSS); } /** @@ -1032,7 +988,7 @@ public function toRssString() */ public function toW3cString() { - return $this->format(self::W3C); + return $this->format(static::W3C); } /////////////////////////////////////////////////////////////////// @@ -1170,7 +1126,7 @@ public function max(Carbon $dt = null) */ public function isWeekday() { - return ($this->dayOfWeek != self::SUNDAY && $this->dayOfWeek != self::SATURDAY); + return ($this->dayOfWeek != static::SUNDAY && $this->dayOfWeek != static::SATURDAY); } /** @@ -1348,6 +1304,57 @@ public function subMonths($value) return $this->addMonths(-1 * $value); } + /** + * Add months without overflowing to the instance. Positive $value + * travels forward while negative $value travels into the past. + * + * @param integer $value + * + * @return static + */ + public function addMonthsNoOverflow($value) + { + $date = $this->copy()->addMonths($value); + + if ($date->day != $this->day) { + $date->day(1)->subMonth()->day($date->daysInMonth); + } + + return $date; + } + + /** + * Add a month with no overflow to the instance + * + * @return static + */ + public function addMonthNoOverflow() + { + return $this->addMonthsNoOverflow(1); + } + + /** + * Remove a month with no overflow from the instance + * + * @return static + */ + public function subMonthNoOverflow() + { + return $this->addMonthsNoOverflow(-1); + } + + /** + * Remove months with no overflow from the instance + * + * @param integer $value + * + * @return static + */ + public function subMonthsNoOverflow($value) + { + return $this->addMonthsNoOverflow(-1 * $value); + } + /** * Add days to the instance. Positive $value travels forward while * negative $value travels into the past. @@ -1649,7 +1656,7 @@ public function diffInMonths(Carbon $dt = null, $abs = true) { $dt = ($dt === null) ? static::now($this->tz) : $dt; - return $this->diffInYears($dt, $abs) * self::MONTHS_PER_YEAR + $this->diff($dt, $abs)->format('%r%m'); + return $this->diffInYears($dt, $abs) * static::MONTHS_PER_YEAR + $this->diff($dt, $abs)->format('%r%m'); } /** @@ -1662,7 +1669,7 @@ public function diffInMonths(Carbon $dt = null, $abs = true) */ public function diffInWeeks(Carbon $dt = null, $abs = true) { - return (int) ($this->diffInDays($dt, $abs) / self::DAYS_PER_WEEK); + return (int) ($this->diffInDays($dt, $abs) / static::DAYS_PER_WEEK); } /** @@ -1691,24 +1698,24 @@ public function diffInDays(Carbon $dt = null, $abs = true) */ public function diffInDaysFiltered(Closure $callback, Carbon $dt = null, $abs = true) { - $start = $this; - $end = ($dt === null) ? static::now($this->tz) : $dt; - $inverse = false; - - if ($end < $start) { - $start = $end; - $end = $this; - $inverse = true; - } - - $period = new DatePeriod($start, new DateInterval('P1D'), $end); - $days = array_filter(iterator_to_array($period), function (DateTime $date) use ($callback) { + $start = $this; + $end = ($dt === null) ? static::now($this->tz) : $dt; + $inverse = false; + + if ($end < $start) { + $start = $end; + $end = $this; + $inverse = true; + } + + $period = new DatePeriod($start, new DateInterval('P1D'), $end); + $days = array_filter(iterator_to_array($period), function (DateTime $date) use ($callback) { return call_user_func($callback, Carbon::instance($date)); }); - $diff = count($days); + $diff = count($days); - return $inverse && !$abs ? -$diff : $diff; + return $inverse && !$abs ? -$diff : $diff; } /** @@ -1721,7 +1728,7 @@ public function diffInDaysFiltered(Closure $callback, Carbon $dt = null, $abs = */ public function diffInWeekdays(Carbon $dt = null, $abs = true) { - return $this->diffInDaysFiltered(function (Carbon $date) { + return $this->diffInDaysFiltered(function (Carbon $date) { return $date->isWeekday(); }, $dt, $abs); } @@ -1736,7 +1743,7 @@ public function diffInWeekdays(Carbon $dt = null, $abs = true) */ public function diffInWeekendDays(Carbon $dt = null, $abs = true) { - return $this->diffInDaysFiltered(function (Carbon $date) { + return $this->diffInDaysFiltered(function (Carbon $date) { return $date->isWeekend(); }, $dt, $abs); } @@ -1751,7 +1758,7 @@ public function diffInWeekendDays(Carbon $dt = null, $abs = true) */ public function diffInHours(Carbon $dt = null, $abs = true) { - return (int) ($this->diffInSeconds($dt, $abs) / self::SECONDS_PER_MINUTE / self::MINUTES_PER_HOUR); + return (int) ($this->diffInSeconds($dt, $abs) / static::SECONDS_PER_MINUTE / static::MINUTES_PER_HOUR); } /** @@ -1764,7 +1771,7 @@ public function diffInHours(Carbon $dt = null, $abs = true) */ public function diffInMinutes(Carbon $dt = null, $abs = true) { - return (int) ($this->diffInSeconds($dt, $abs) / self::SECONDS_PER_MINUTE); + return (int) ($this->diffInSeconds($dt, $abs) / static::SECONDS_PER_MINUTE); } /** @@ -1777,11 +1784,32 @@ public function diffInMinutes(Carbon $dt = null, $abs = true) */ public function diffInSeconds(Carbon $dt = null, $abs = true) { - $value = (($dt === null) ? time() : $dt->getTimestamp()) - $this->getTimestamp(); + $dt = ($dt === null) ? static::now($this->tz) : $dt; + $value = $dt->getTimestamp() - $this->getTimestamp(); return $abs ? abs($value) : $value; } + /** + * The number of seconds since midnight. + * + * @return integer + */ + public function secondsSinceMidnight() + { + return $this->diffInSeconds($this->copy()->startOfDay()); + } + + /** + * The number of seconds until 23:23:59. + * + * @return integer + */ + public function secondsUntilEndOfDay() + { + return $this->diffInSeconds($this->copy()->endOfDay()); + } + /** * Get the difference in a human readable format. * @@ -1802,10 +1830,11 @@ public function diffInSeconds(Carbon $dt = null, $abs = true) * 5 months after * * @param Carbon $other + * @param bool $absolute removes time difference modifiers ago, after, etc * * @return string */ - public function diffForHumans(Carbon $other = null) + public function diffForHumans(Carbon $other = null, $absolute = false) { $isNow = $other === null; @@ -1813,32 +1842,43 @@ public function diffForHumans(Carbon $other = null) $other = static::now($this->tz); } - $isFuture = $this->gt($other); + $diffInterval = $this->diff($other); - $delta = $other->diffInSeconds($this); + switch (true) { + case ($diffInterval->y > 0): + $unit = 'year'; + $delta = $diffInterval->y; + break; - // a little weeks per month, 365 days per year... good enough!! - $divs = array( - 'second' => self::SECONDS_PER_MINUTE, - 'minute' => self::MINUTES_PER_HOUR, - 'hour' => self::HOURS_PER_DAY, - 'day' => self::DAYS_PER_WEEK, - 'week' => 30 / self::DAYS_PER_WEEK, - 'month' => self::MONTHS_PER_YEAR - ); + case ($diffInterval->m > 0): + $unit = 'month'; + $delta = $diffInterval->m; + break; - $unit = 'year'; + case ($diffInterval->d > 0): + $unit = 'day'; + $delta = $diffInterval->d; + if ($delta >= self::DAYS_PER_WEEK) { + $unit = 'week'; + $delta = floor($delta / self::DAYS_PER_WEEK); + } + break; - foreach ($divs as $divUnit => $divValue) { - if ($delta < $divValue) { - $unit = $divUnit; + case ($diffInterval->h > 0): + $unit = 'hour'; + $delta = $diffInterval->h; break; - } - $delta = $delta / $divValue; - } + case ($diffInterval->i > 0): + $unit = 'minute'; + $delta = $diffInterval->i; + break; - $delta = (int) $delta; + default: + $delta = $diffInterval->s; + $unit = 'second'; + break; + } if ($delta == 0) { $delta = 1; @@ -1847,6 +1887,12 @@ public function diffForHumans(Carbon $other = null) $txt = $delta . ' ' . $unit; $txt .= $delta == 1 ? '' : 's'; + if ($absolute) { + return $txt; + } + + $isFuture = $diffInterval->invert === 1; + if ($isNow) { if ($isFuture) { return $txt . ' from now'; @@ -1913,8 +1959,8 @@ public function endOfMonth() */ public function startOfYear() { - return $this->month(1)->startOfMonth(); - } + return $this->month(1)->startOfMonth(); + } /** * Resets the date to end of the year and time to 23:59:59 @@ -1923,7 +1969,7 @@ public function startOfYear() */ public function endOfYear() { - return $this->month(self::MONTHS_PER_YEAR)->endOfMonth(); + return $this->month(static::MONTHS_PER_YEAR)->endOfMonth(); } /** @@ -1933,7 +1979,7 @@ public function endOfYear() */ public function startOfDecade() { - return $this->startOfYear()->year($this->year - $this->year % self::YEARS_PER_DECADE); + return $this->startOfYear()->year($this->year - $this->year % static::YEARS_PER_DECADE); } /** @@ -1943,7 +1989,7 @@ public function startOfDecade() */ public function endOfDecade() { - return $this->endOfYear()->year($this->year - $this->year % self::YEARS_PER_DECADE + self::YEARS_PER_DECADE - 1); + return $this->endOfYear()->year($this->year - $this->year % static::YEARS_PER_DECADE + static::YEARS_PER_DECADE - 1); } /** @@ -1953,7 +1999,7 @@ public function endOfDecade() */ public function startOfCentury() { - return $this->startOfYear()->year($this->year - $this->year % self::YEARS_PER_CENTURY); + return $this->startOfYear()->year($this->year - $this->year % static::YEARS_PER_CENTURY); } /** @@ -1963,7 +2009,7 @@ public function startOfCentury() */ public function endOfCentury() { - return $this->endOfYear()->year($this->year - $this->year % self::YEARS_PER_CENTURY + self::YEARS_PER_CENTURY - 1); + return $this->endOfYear()->year($this->year - $this->year % static::YEARS_PER_CENTURY + static::YEARS_PER_CENTURY - 1); } /** @@ -1973,8 +2019,11 @@ public function endOfCentury() */ public function startOfWeek() { - if ($this->dayOfWeek != self::MONDAY) $this->previous(self::MONDAY); - return $this->startOfDay(); + if ($this->dayOfWeek != static::MONDAY) { + $this->previous(static::MONDAY); + } + + return $this->startOfDay(); } /** @@ -1984,8 +2033,11 @@ public function startOfWeek() */ public function endOfWeek() { - if ($this->dayOfWeek != self::SUNDAY) $this->next(self::SUNDAY); - return $this->endOfDay(); + if ($this->dayOfWeek != static::SUNDAY) { + $this->next(static::SUNDAY); + } + + return $this->endOfDay(); } /** @@ -2004,7 +2056,7 @@ public function next($dayOfWeek = null) $dayOfWeek = $this->dayOfWeek; } - return $this->startOfDay()->modify('next ' . self::$days[$dayOfWeek]); + return $this->startOfDay()->modify('next ' . static::$days[$dayOfWeek]); } /** @@ -2023,7 +2075,7 @@ public function previous($dayOfWeek = null) $dayOfWeek = $this->dayOfWeek; } - return $this->startOfDay()->modify('last ' . self::$days[$dayOfWeek]); + return $this->startOfDay()->modify('last ' . static::$days[$dayOfWeek]); } /** @@ -2044,7 +2096,7 @@ public function firstOfMonth($dayOfWeek = null) return $this->day(1); } - return $this->modify('first ' . self::$days[$dayOfWeek] . ' of ' . $this->format('F') . ' ' . $this->year); + return $this->modify('first ' . static::$days[$dayOfWeek] . ' of ' . $this->format('F') . ' ' . $this->year); } /** @@ -2065,7 +2117,7 @@ public function lastOfMonth($dayOfWeek = null) return $this->day($this->daysInMonth); } - return $this->modify('last ' . self::$days[$dayOfWeek] . ' of ' . $this->format('F') . ' ' . $this->year); + return $this->modify('last ' . static::$days[$dayOfWeek] . ' of ' . $this->format('F') . ' ' . $this->year); } /** @@ -2083,7 +2135,7 @@ public function nthOfMonth($nth, $dayOfWeek) { $dt = $this->copy()->firstOfMonth(); $check = $dt->format('Y-m'); - $dt->modify('+' . $nth . ' ' . self::$days[$dayOfWeek]); + $dt->modify('+' . $nth . ' ' . static::$days[$dayOfWeek]); return ($dt->format('Y-m') === $check) ? $this->modify($dt) : false; } @@ -2134,7 +2186,7 @@ public function nthOfQuarter($nth, $dayOfWeek) $dt = $this->copy()->day(1)->month($this->quarter * 3); $last_month = $dt->month; $year = $dt->year; - $dt->firstOfQuarter()->modify('+' . $nth . ' ' . self::$days[$dayOfWeek]); + $dt->firstOfQuarter()->modify('+' . $nth . ' ' . static::$days[$dayOfWeek]); return ($last_month < $dt->month || $year !== $dt->year) ? false : $this->modify($dt); } @@ -2166,7 +2218,7 @@ public function firstOfYear($dayOfWeek = null) */ public function lastOfYear($dayOfWeek = null) { - return $this->month(self::MONTHS_PER_YEAR)->lastOfMonth($dayOfWeek); + return $this->month(static::MONTHS_PER_YEAR)->lastOfMonth($dayOfWeek); } /** @@ -2182,7 +2234,7 @@ public function lastOfYear($dayOfWeek = null) */ public function nthOfYear($nth, $dayOfWeek) { - $dt = $this->copy()->firstOfYear()->modify('+' . $nth . ' ' . self::$days[$dayOfWeek]); + $dt = $this->copy()->firstOfYear()->modify('+' . $nth . ' ' . static::$days[$dayOfWeek]); return $this->year == $dt->year ? $this->modify($dt) : false; } @@ -2200,4 +2252,16 @@ public function average(Carbon $dt = null) return $this->addSeconds((int) ($this->diffInSeconds($dt, false) / 2)); } + + /** + * Check if its the birthday. Compares the date/month values of the two dates. + * + * @param Carbon $dt + * + * @return boolean + */ + public function isBirthday(Carbon $dt) + { + return $this->format('md') === $dt->format('md'); + } } diff --git a/vendor/nesbot/carbon/tests/AddTest.php b/vendor/nesbot/carbon/tests/AddTest.php index 557cfad..bd28fe3 100644 --- a/vendor/nesbot/carbon/tests/AddTest.php +++ b/vendor/nesbot/carbon/tests/AddTest.php @@ -58,6 +58,27 @@ public function testAddMonthWithOverflow() $this->assertSame(3, Carbon::createFromDate(2012, 1, 31)->addMonth()->month); } + public function testAddMonthsNoOverflowPositive() + { + $this->assertSame('2012-02-29', Carbon::createFromDate(2012, 1, 31)->addMonthNoOverflow()->toDateString()); + $this->assertSame('2012-03-31', Carbon::createFromDate(2012, 1, 31)->addMonthsNoOverflow(2)->toDateString()); + $this->assertSame('2012-03-29', Carbon::createFromDate(2012, 2, 29)->addMonthNoOverflow()->toDateString()); + $this->assertSame('2012-02-29', Carbon::createFromDate(2011, 12, 31)->addMonthsNoOverflow(2)->toDateString()); + } + + public function testAddMonthsNoOverflowZero() + { + $this->assertSame(12, Carbon::createFromDate(1975, 12)->addMonths(0)->month); + } + + public function testAddMonthsNoOverflowNegative() + { + $this->assertSame('2012-01-29', Carbon::createFromDate(2012, 2, 29)->addMonthsNoOverflow(-1)->toDateString()); + $this->assertSame('2012-01-31', Carbon::createFromDate(2012, 3, 31)->addMonthsNoOverflow(-2)->toDateString()); + $this->assertSame('2012-02-29', Carbon::createFromDate(2012, 3, 31)->addMonthsNoOverflow(-1)->toDateString()); + $this->assertSame('2011-12-31', Carbon::createFromDate(2012, 1, 31)->addMonthsNoOverflow(-1)->toDateString()); + } + public function testAddDaysPositive() { $this->assertSame(1, Carbon::createFromDate(1975, 5, 31)->addDays(1)->day); diff --git a/vendor/nesbot/carbon/tests/ComparisonTest.php b/vendor/nesbot/carbon/tests/ComparisonTest.php index f2f72f7..c40bf8c 100644 --- a/vendor/nesbot/carbon/tests/ComparisonTest.php +++ b/vendor/nesbot/carbon/tests/ComparisonTest.php @@ -189,4 +189,12 @@ public function testMaxWithInstance() $dt2 = Carbon::create(2099, 12, 31, 23, 59, 59)->max($dt1); $this->assertCarbon($dt2, 2099, 12, 31, 23, 59, 59); } + public function testIsBirthday() + { + $dt1 = Carbon::createFromDate(1987, 4, 23); + $dt2 = Carbon::createFromDate(2014, 9, 26); + $dt3 = Carbon::createFromDate(2014, 4, 23); + $this->assertFalse($dt2->isBirthday($dt1)); + $this->assertTrue($dt3->isBirthday($dt1)); + } } diff --git a/vendor/nesbot/carbon/tests/ConstructTest.php b/vendor/nesbot/carbon/tests/ConstructTest.php index dae07d5..7ef3af7 100644 --- a/vendor/nesbot/carbon/tests/ConstructTest.php +++ b/vendor/nesbot/carbon/tests/ConstructTest.php @@ -17,8 +17,8 @@ public function testCreatesAnInstanceDefaultToNow() { $c = new Carbon(); $now = Carbon::now(); - $this->assertEquals('Carbon\Carbon', get_class($c)); - $this->assertEquals($now->tzName, $c->tzName); + $this->assertInstanceOfCarbon($c); + $this->assertSame($now->tzName, $c->tzName); $this->assertCarbon($c, $now->year, $now->month, $now->day, $now->hour, $now->minute, $now->second); } @@ -26,8 +26,8 @@ public function testParseCreatesAnInstanceDefaultToNow() { $c = Carbon::parse(); $now = Carbon::now(); - $this->assertEquals('Carbon\Carbon', get_class($c)); - $this->assertEquals($now->tzName, $c->tzName); + $this->assertInstanceOfCarbon($c); + $this->assertSame($now->tzName, $c->tzName); $this->assertCarbon($c, $now->year, $now->month, $now->day, $now->hour, $now->minute, $now->second); } diff --git a/vendor/nesbot/carbon/tests/CreateFromTimestampTest.php b/vendor/nesbot/carbon/tests/CreateFromTimestampTest.php index 0323bab..108faac 100644 --- a/vendor/nesbot/carbon/tests/CreateFromTimestampTest.php +++ b/vendor/nesbot/carbon/tests/CreateFromTimestampTest.php @@ -39,7 +39,7 @@ public function testCreateFromTimestampWithString() { $d = Carbon::createFromTimestamp(0, 'UTC'); $this->assertCarbon($d, 1970, 1, 1, 0, 0, 0); - $this->assertTrue($d->offset === 0); + $this->assertSame(0, $d->offset); $this->assertSame('UTC', $d->tzName); } @@ -47,6 +47,6 @@ public function testCreateFromTimestampGMTDoesNotUseDefaultTimezone() { $d = Carbon::createFromTimestampUTC(0); $this->assertCarbon($d, 1970, 1, 1, 0, 0, 0); - $this->assertTrue($d->offset === 0); + $this->assertSame(0, $d->offset); } } diff --git a/vendor/nesbot/carbon/tests/DiffTest.php b/vendor/nesbot/carbon/tests/DiffTest.php index d354c15..cf44a59 100644 --- a/vendor/nesbot/carbon/tests/DiffTest.php +++ b/vendor/nesbot/carbon/tests/DiffTest.php @@ -103,8 +103,7 @@ public function testDiffInDaysEnsureIsTruncated() public function testDiffInDaysFilteredPositiveWithMutated() { $dt = Carbon::createFromDate(2000, 1, 1); - $this->assertSame(5, $dt->diffInDaysFiltered(function (Carbon $date) - { + $this->assertSame(5, $dt->diffInDaysFiltered(function (Carbon $date) { return $date->dayOfWeek === 1; }, $dt->copy()->endOfMonth())); } @@ -114,8 +113,7 @@ public function testDiffInDaysFilteredPositiveWithSecondObject() $dt1 = Carbon::createFromDate(2000, 1, 1); $dt2 = Carbon::createFromDate(2000, 1, 31); - $this->assertSame(5, $dt1->diffInDaysFiltered(function (Carbon $date) - { + $this->assertSame(5, $dt1->diffInDaysFiltered(function (Carbon $date) { return $date->dayOfWeek === Carbon::SUNDAY; }, $dt2)); } @@ -123,8 +121,7 @@ public function testDiffInDaysFilteredPositiveWithSecondObject() public function testDiffInDaysFilteredNegativeNoSignWithMutated() { $dt = Carbon::createFromDate(2000, 1, 31); - $this->assertSame(5, $dt->diffInDaysFiltered(function (Carbon $date) - { + $this->assertSame(5, $dt->diffInDaysFiltered(function (Carbon $date) { return $date->dayOfWeek === Carbon::SUNDAY; }, $dt->copy()->startOfMonth())); } @@ -134,8 +131,7 @@ public function testDiffInDaysFilteredNegativeNoSignWithSecondObject() $dt1 = Carbon::createFromDate(2000, 1, 31); $dt2 = Carbon::createFromDate(2000, 1, 1); - $this->assertSame(5, $dt1->diffInDaysFiltered(function (Carbon $date) - { + $this->assertSame(5, $dt1->diffInDaysFiltered(function (Carbon $date) { return $date->dayOfWeek === Carbon::SUNDAY; }, $dt2)); } @@ -143,8 +139,7 @@ public function testDiffInDaysFilteredNegativeNoSignWithSecondObject() public function testDiffInDaysFilteredNegativeWithSignWithMutated() { $dt = Carbon::createFromDate(2000, 1, 31); - $this->assertSame(-5, $dt->diffInDaysFiltered(function (Carbon $date) - { + $this->assertSame(-5, $dt->diffInDaysFiltered(function (Carbon $date) { return $date->dayOfWeek === 1; }, $dt->copy()->startOfMonth(), false)); } @@ -154,8 +149,7 @@ public function testDiffInDaysFilteredNegativeWithSignWithSecondObject() $dt1 = Carbon::createFromDate(2000, 1, 31); $dt2 = Carbon::createFromDate(2000, 1, 1); - $this->assertSame(-5, $dt1->diffInDaysFiltered(function (Carbon $date) - { + $this->assertSame(-5, $dt1->diffInDaysFiltered(function (Carbon $date) { return $date->dayOfWeek === Carbon::SUNDAY; }, $dt2, false)); } @@ -282,7 +276,9 @@ public function testDiffInHoursNegativeNoSign() public function testDiffInHoursVsDefaultNow() { + Carbon::setTestNow(Carbon::create(2012, 1, 15)); $this->assertSame(48, Carbon::now()->subDays(2)->diffInHours()); + Carbon::setTestNow(); } public function testDiffInHoursEnsureIsTruncated() @@ -424,14 +420,18 @@ public function testDiffForHumansNowAndHour() public function testDiffForHumansNowAndHours() { + Carbon::setTestNow(Carbon::create(2012, 1, 15)); $d = Carbon::now()->subHours(2); $this->assertSame('2 hours ago', $d->diffForHumans()); + Carbon::setTestNow(); } public function testDiffForHumansNowAndNearlyDay() { + Carbon::setTestNow(Carbon::create(2012, 1, 15)); $d = Carbon::now()->subHours(23); $this->assertSame('23 hours ago', $d->diffForHumans()); + Carbon::setTestNow(); } public function testDiffForHumansNowAndDay() @@ -472,10 +472,12 @@ public function testDiffForHumansNowAndNearlyMonth() public function testDiffForHumansNowAndMonth() { + Carbon::setTestNow(Carbon::create(2012, 1, 1)); $d = Carbon::now()->subWeeks(4); $this->assertSame('4 weeks ago', $d->diffForHumans()); $d = Carbon::now()->subMonth(); $this->assertSame('1 month ago', $d->diffForHumans()); + Carbon::setTestNow(); } public function testDiffForHumansNowAndMonths() @@ -552,8 +554,10 @@ public function testDiffForHumansNowAndFutureHours() public function testDiffForHumansNowAndNearlyFutureDay() { + Carbon::setTestNow(Carbon::create(2012, 1, 1)); $d = Carbon::now()->addHours(23); $this->assertSame('23 hours from now', $d->diffForHumans()); + Carbon::setTestNow(); } public function testDiffForHumansNowAndFutureDay() @@ -594,16 +598,20 @@ public function testDiffForHumansNowAndNearlyFutureMonth() public function testDiffForHumansNowAndFutureMonth() { + Carbon::setTestNow(Carbon::create(2012, 1, 1)); $d = Carbon::now()->addWeeks(4); $this->assertSame('4 weeks from now', $d->diffForHumans()); $d = Carbon::now()->addMonth(); $this->assertSame('1 month from now', $d->diffForHumans()); + Carbon::setTestNow(); } public function testDiffForHumansNowAndFutureMonths() { + Carbon::setTestNow(Carbon::create(2012, 1, 1)); $d = Carbon::now()->addMonths(2); $this->assertSame('2 months from now', $d->diffForHumans()); + Carbon::setTestNow(); } public function testDiffForHumansNowAndNearlyFutureYear() @@ -674,8 +682,10 @@ public function testDiffForHumansOtherAndHours() public function testDiffForHumansOtherAndNearlyDay() { + Carbon::setTestNow(Carbon::create(2012, 1, 1)); $d = Carbon::now()->addHours(23); $this->assertSame('23 hours before', Carbon::now()->diffForHumans($d)); + Carbon::setTestNow(); } public function testDiffForHumansOtherAndDay() @@ -716,16 +726,20 @@ public function testDiffForHumansOtherAndNearlyMonth() public function testDiffForHumansOtherAndMonth() { + Carbon::setTestNow(Carbon::create(2012, 1, 1)); $d = Carbon::now()->addWeeks(4); $this->assertSame('4 weeks before', Carbon::now()->diffForHumans($d)); $d = Carbon::now()->addMonth(); $this->assertSame('1 month before', Carbon::now()->diffForHumans($d)); + Carbon::setTestNow(); } public function testDiffForHumansOtherAndMonths() { + Carbon::setTestNow(Carbon::create(2012, 1, 1)); $d = Carbon::now()->addMonths(2); $this->assertSame('2 months before', Carbon::now()->diffForHumans($d)); + Carbon::setTestNow(); } public function testDiffForHumansOtherAndNearlyYear() @@ -796,8 +810,10 @@ public function testDiffForHumansOtherAndFutureHours() public function testDiffForHumansOtherAndNearlyFutureDay() { + Carbon::setTestNow(Carbon::create(2012, 1, 15)); $d = Carbon::now()->subHours(23); $this->assertSame('23 hours after', Carbon::now()->diffForHumans($d)); + Carbon::setTestNow(); } public function testDiffForHumansOtherAndFutureDay() @@ -838,10 +854,12 @@ public function testDiffForHumansOtherAndNearlyFutureMonth() public function testDiffForHumansOtherAndFutureMonth() { + Carbon::setTestNow(Carbon::create(2012, 1, 1)); $d = Carbon::now()->subWeeks(4); $this->assertSame('4 weeks after', Carbon::now()->diffForHumans($d)); $d = Carbon::now()->subMonth(); $this->assertSame('1 month after', Carbon::now()->diffForHumans($d)); + Carbon::setTestNow(); } public function testDiffForHumansOtherAndFutureMonths() @@ -867,4 +885,69 @@ public function testDiffForHumansOtherAndFutureYears() $d = Carbon::now()->subYears(2); $this->assertSame('2 years after', Carbon::now()->diffForHumans($d)); } + + public function testDiffForHumansAbsoluteSeconds() + { + $d = Carbon::now()->subSeconds(59); + $this->assertSame('59 seconds', Carbon::now()->diffForHumans($d, true)); + $d = Carbon::now()->addSeconds(59); + $this->assertSame('59 seconds', Carbon::now()->diffForHumans($d, true)); + } + + public function testDiffForHumansAbsoluteMinutes() + { + $d = Carbon::now()->subMinutes(30); + $this->assertSame('30 minutes', Carbon::now()->diffForHumans($d, true)); + $d = Carbon::now()->addMinutes(30); + $this->assertSame('30 minutes', Carbon::now()->diffForHumans($d, true)); + } + + public function testDiffForHumansAbsoluteHours() + { + $d = Carbon::now()->subHours(3); + $this->assertSame('3 hours', Carbon::now()->diffForHumans($d, true)); + $d = Carbon::now()->addHours(3); + $this->assertSame('3 hours', Carbon::now()->diffForHumans($d, true)); + } + + public function testDiffForHumansAbsoluteDays() + { + $d = Carbon::now()->subDays(2); + $this->assertSame('2 days', Carbon::now()->diffForHumans($d, true)); + $d = Carbon::now()->addDays(2); + $this->assertSame('2 days', Carbon::now()->diffForHumans($d, true)); + } + + public function testDiffForHumansAbsoluteWeeks() + { + $d = Carbon::now()->subWeeks(2); + $this->assertSame('2 weeks', Carbon::now()->diffForHumans($d, true)); + $d = Carbon::now()->addWeeks(2); + $this->assertSame('2 weeks', Carbon::now()->diffForHumans($d, true)); + } + + public function testDiffForHumansAbsoluteMonths() + { + Carbon::setTestNow(Carbon::create(2012, 1, 1)); + $d = Carbon::now()->subMonths(2); + $this->assertSame('2 months', Carbon::now()->diffForHumans($d, true)); + $d = Carbon::now()->addMonths(2); + $this->assertSame('2 months', Carbon::now()->diffForHumans($d, true)); + Carbon::setTestNow(); + } + + public function testDiffForHumansAbsoluteYears() + { + $d = Carbon::now()->subYears(1); + $this->assertSame('1 year', Carbon::now()->diffForHumans($d, true)); + $d = Carbon::now()->addYears(1); + $this->assertSame('1 year', Carbon::now()->diffForHumans($d, true)); + } + + public function testDiffForHumansWithShorterMonthShouldStillBeAMonth() + { + $feb15 = Carbon::parse('2015-02-15'); + $mar15 = Carbon::parse('2015-03-15'); + $this->assertSame('1 month after', $mar15->diffForHumans($feb15)); + } } diff --git a/vendor/nesbot/carbon/tests/GettersTest.php b/vendor/nesbot/carbon/tests/GettersTest.php index 4d4939c..fca8942 100644 --- a/vendor/nesbot/carbon/tests/GettersTest.php +++ b/vendor/nesbot/carbon/tests/GettersTest.php @@ -24,6 +24,12 @@ public function testYearGetter() $d = Carbon::create(1234, 5, 6, 7, 8, 9); $this->assertSame(1234, $d->year); } + + public function testYearIsoGetter() + { + $d = Carbon::createFromDate(2012, 12, 31); + $this->assertSame(2013, $d->yearIso); + } public function testMonthGetter() { diff --git a/vendor/nesbot/carbon/tests/RelativeTest.php b/vendor/nesbot/carbon/tests/RelativeTest.php index 7722fad..1e0993c 100644 --- a/vendor/nesbot/carbon/tests/RelativeTest.php +++ b/vendor/nesbot/carbon/tests/RelativeTest.php @@ -39,7 +39,7 @@ public function testSecondsUntilEndOfDay() $d = Carbon::create(2014, 10, 24, 12, 34, 56); $this->assertSame(41103, $d->secondsUntilEndOfDay()); - $d = Carbon::create(2014, 10, 24, 0, 0, 0); + $d = Carbon::create(2014, 10, 24, 0, 0, 0); $this->assertSame(86399, $d->secondsUntilEndOfDay()); } } diff --git a/vendor/nesbot/carbon/tests/SettersTest.php b/vendor/nesbot/carbon/tests/SettersTest.php index 5917638..54f5f5a 100644 --- a/vendor/nesbot/carbon/tests/SettersTest.php +++ b/vendor/nesbot/carbon/tests/SettersTest.php @@ -92,6 +92,17 @@ public function testTimeSetter() $this->assertSame(0, $d->second); } + public function testTimeSetterWithChaining() + { + $d = Carbon::now(); + $d->setTime(2, 2, 2)->setTime(1, 1, 1); + $this->assertInstanceOf('Carbon\Carbon', $d); + $this->assertSame(1, $d->second); + $d->setTime(2, 2, 2)->setTime(1, 1); + $this->assertInstanceOf('Carbon\Carbon', $d); + $this->assertSame(0, $d->second); + } + public function testTimeSetterWithZero() { $d = Carbon::now(); @@ -113,6 +124,16 @@ public function testDateTimeSetterWithZero() $this->assertSame(0, $d->second); } + public function testDateTimeSetterWithChaining() + { + $d = Carbon::now(); + $d->setDateTime(2013, 9, 24, 17, 4, 29); + $this->assertInstanceOf('Carbon\Carbon', $d); + $d->setDateTime(2014, 10, 25, 18, 5, 30); + $this->assertInstanceOf('Carbon\Carbon', $d); + $this->assertCarbon($d, 2014, 10, 25, 18, 5, 30); + } + public function testSecondSetterWithWrap() { $d = Carbon::now(); @@ -144,12 +165,14 @@ public function testTimezoneWithInvalidTimezone() try { $d->timezone = 'sdf'; $this->fail('InvalidArgumentException was not been raised.'); - } catch (InvalidArgumentException $expected) {} + } catch (InvalidArgumentException $expected) { + } try { $d->timezone('sdf'); $this->fail('InvalidArgumentException was not been raised.'); - } catch (InvalidArgumentException $expected) {} + } catch (InvalidArgumentException $expected) { + } } public function testTzWithInvalidTimezone() { @@ -158,12 +181,14 @@ public function testTzWithInvalidTimezone() try { $d->tz = 'sdf'; $this->fail('InvalidArgumentException was not been raised.'); - } catch (InvalidArgumentException $expected) {} + } catch (InvalidArgumentException $expected) { + } try { $d->tz('sdf'); $this->fail('InvalidArgumentException was not been raised.'); - } catch (InvalidArgumentException $expected) {} + } catch (InvalidArgumentException $expected) { + } } public function testSetTimezoneUsingString() { diff --git a/vendor/nesbot/carbon/tests/StringsTest.php b/vendor/nesbot/carbon/tests/StringsTest.php index 7abe05a..b3cc2fe 100644 --- a/vendor/nesbot/carbon/tests/StringsTest.php +++ b/vendor/nesbot/carbon/tests/StringsTest.php @@ -11,7 +11,9 @@ use Carbon\Carbon; -class MyCarbon extends Carbon {} +class MyCarbon extends Carbon +{ +} class StringsTest extends TestFixture { @@ -65,6 +67,11 @@ public function testToLocalizedFormattedDateString() *****************/ } + public function testToLocalizedFormattedTimezonedDateString() + { + $d = Carbon::create(1975, 12, 25, 14, 15, 16, 'Europe/London'); + $this->assertSame('Thursday 25 December 1975 14:15', $d->formatLocalized('%A %d %B %Y %H:%M')); + } public function testToTimeString() { $d = Carbon::create(1975, 12, 25, 14, 15, 16); @@ -94,10 +101,11 @@ public function testToAtomString() public function testToCOOKIEString() { $d = Carbon::create(1975, 12, 25, 14, 15, 16); - if( \DateTime::COOKIE === 'l, d-M-y H:i:s T' ) + if (\DateTime::COOKIE === 'l, d-M-y H:i:s T') { $cookieString = 'Thursday, 25-Dec-75 14:15:16 EST'; - else + } else { $cookieString = 'Thursday, 25-Dec-1975 14:15:16 EST'; + } $this->assertSame($cookieString, $d->toCOOKIEString()); } @@ -123,8 +131,8 @@ public function testToRfc1036String() } public function testToRfc1123String() { - $d = Carbon::create(1975, 12, 25, 14, 15, 16); - $this->assertSame('Thu, 25 Dec 1975 14:15:16 -0500', $d->toRfc1123String()); + $d = Carbon::create(1975, 12, 25, 14, 15, 16); + $this->assertSame('Thu, 25 Dec 1975 14:15:16 -0500', $d->toRfc1123String()); } public function testToRfc2822String() { diff --git a/vendor/nesbot/carbon/tests/TestFixture.php b/vendor/nesbot/carbon/tests/TestFixture.php index a6d9f71..8c547c0 100644 --- a/vendor/nesbot/carbon/tests/TestFixture.php +++ b/vendor/nesbot/carbon/tests/TestFixture.php @@ -48,4 +48,9 @@ protected function assertCarbon(Carbon $d, $year, $month, $day, $hour = null, $m $this->assertSame($second, $d->second, 'Carbon->second'); } } + + protected function assertInstanceOfCarbon($d) + { + $this->assertInstanceOf('Carbon\Carbon', $d); + } } diff --git a/vendor/nesbot/carbon/tests/TestingAidsTest.php b/vendor/nesbot/carbon/tests/TestingAidsTest.php index e4c3155..458cdff 100644 --- a/vendor/nesbot/carbon/tests/TestingAidsTest.php +++ b/vendor/nesbot/carbon/tests/TestingAidsTest.php @@ -65,42 +65,42 @@ public function testParseRelativeWithTestValueSet() $notNow = Carbon::parse('2013-09-01 05:15:05'); Carbon::setTestNow($notNow); - $this->assertEquals('2013-09-01 05:10:05', Carbon::parse('5 minutes ago')->toDateTimeString()); - - $this->assertEquals('2013-08-25 05:15:05', Carbon::parse('1 week ago')->toDateTimeString()); - - $this->assertEquals('2013-09-02 00:00:00', Carbon::parse('tomorrow')->toDateTimeString()); - $this->assertEquals('2013-08-31 00:00:00', Carbon::parse('yesterday')->toDateTimeString()); - - $this->assertEquals('2013-09-02 05:15:05', Carbon::parse('+1 day')->toDateTimeString()); - $this->assertEquals('2013-08-31 05:15:05', Carbon::parse('-1 day')->toDateTimeString()); - - $this->assertEquals('2013-09-02 00:00:00', Carbon::parse('next monday')->toDateTimeString()); - $this->assertEquals('2013-09-03 00:00:00', Carbon::parse('next tuesday')->toDateTimeString()); - $this->assertEquals('2013-09-04 00:00:00', Carbon::parse('next wednesday')->toDateTimeString()); - $this->assertEquals('2013-09-05 00:00:00', Carbon::parse('next thursday')->toDateTimeString()); - $this->assertEquals('2013-09-06 00:00:00', Carbon::parse('next friday')->toDateTimeString()); - $this->assertEquals('2013-09-07 00:00:00', Carbon::parse('next saturday')->toDateTimeString()); - $this->assertEquals('2013-09-08 00:00:00', Carbon::parse('next sunday')->toDateTimeString()); - - $this->assertEquals('2013-08-26 00:00:00', Carbon::parse('last monday')->toDateTimeString()); - $this->assertEquals('2013-08-27 00:00:00', Carbon::parse('last tuesday')->toDateTimeString()); - $this->assertEquals('2013-08-28 00:00:00', Carbon::parse('last wednesday')->toDateTimeString()); - $this->assertEquals('2013-08-29 00:00:00', Carbon::parse('last thursday')->toDateTimeString()); - $this->assertEquals('2013-08-30 00:00:00', Carbon::parse('last friday')->toDateTimeString()); - $this->assertEquals('2013-08-31 00:00:00', Carbon::parse('last saturday')->toDateTimeString()); - $this->assertEquals('2013-08-25 00:00:00', Carbon::parse('last sunday')->toDateTimeString()); - - $this->assertEquals('2013-09-02 00:00:00', Carbon::parse('this monday')->toDateTimeString()); - $this->assertEquals('2013-09-03 00:00:00', Carbon::parse('this tuesday')->toDateTimeString()); - $this->assertEquals('2013-09-04 00:00:00', Carbon::parse('this wednesday')->toDateTimeString()); - $this->assertEquals('2013-09-05 00:00:00', Carbon::parse('this thursday')->toDateTimeString()); - $this->assertEquals('2013-09-06 00:00:00', Carbon::parse('this friday')->toDateTimeString()); - $this->assertEquals('2013-09-07 00:00:00', Carbon::parse('this saturday')->toDateTimeString()); - $this->assertEquals('2013-09-01 00:00:00', Carbon::parse('this sunday')->toDateTimeString()); - - $this->assertEquals('2013-10-01 05:15:05', Carbon::parse('first day of next month')->toDateTimeString()); - $this->assertEquals('2013-09-30 05:15:05', Carbon::parse('last day of this month')->toDateTimeString()); + $this->assertSame('2013-09-01 05:10:05', Carbon::parse('5 minutes ago')->toDateTimeString()); + + $this->assertSame('2013-08-25 05:15:05', Carbon::parse('1 week ago')->toDateTimeString()); + + $this->assertSame('2013-09-02 00:00:00', Carbon::parse('tomorrow')->toDateTimeString()); + $this->assertSame('2013-08-31 00:00:00', Carbon::parse('yesterday')->toDateTimeString()); + + $this->assertSame('2013-09-02 05:15:05', Carbon::parse('+1 day')->toDateTimeString()); + $this->assertSame('2013-08-31 05:15:05', Carbon::parse('-1 day')->toDateTimeString()); + + $this->assertSame('2013-09-02 00:00:00', Carbon::parse('next monday')->toDateTimeString()); + $this->assertSame('2013-09-03 00:00:00', Carbon::parse('next tuesday')->toDateTimeString()); + $this->assertSame('2013-09-04 00:00:00', Carbon::parse('next wednesday')->toDateTimeString()); + $this->assertSame('2013-09-05 00:00:00', Carbon::parse('next thursday')->toDateTimeString()); + $this->assertSame('2013-09-06 00:00:00', Carbon::parse('next friday')->toDateTimeString()); + $this->assertSame('2013-09-07 00:00:00', Carbon::parse('next saturday')->toDateTimeString()); + $this->assertSame('2013-09-08 00:00:00', Carbon::parse('next sunday')->toDateTimeString()); + + $this->assertSame('2013-08-26 00:00:00', Carbon::parse('last monday')->toDateTimeString()); + $this->assertSame('2013-08-27 00:00:00', Carbon::parse('last tuesday')->toDateTimeString()); + $this->assertSame('2013-08-28 00:00:00', Carbon::parse('last wednesday')->toDateTimeString()); + $this->assertSame('2013-08-29 00:00:00', Carbon::parse('last thursday')->toDateTimeString()); + $this->assertSame('2013-08-30 00:00:00', Carbon::parse('last friday')->toDateTimeString()); + $this->assertSame('2013-08-31 00:00:00', Carbon::parse('last saturday')->toDateTimeString()); + $this->assertSame('2013-08-25 00:00:00', Carbon::parse('last sunday')->toDateTimeString()); + + $this->assertSame('2013-09-02 00:00:00', Carbon::parse('this monday')->toDateTimeString()); + $this->assertSame('2013-09-03 00:00:00', Carbon::parse('this tuesday')->toDateTimeString()); + $this->assertSame('2013-09-04 00:00:00', Carbon::parse('this wednesday')->toDateTimeString()); + $this->assertSame('2013-09-05 00:00:00', Carbon::parse('this thursday')->toDateTimeString()); + $this->assertSame('2013-09-06 00:00:00', Carbon::parse('this friday')->toDateTimeString()); + $this->assertSame('2013-09-07 00:00:00', Carbon::parse('this saturday')->toDateTimeString()); + $this->assertSame('2013-09-01 00:00:00', Carbon::parse('this sunday')->toDateTimeString()); + + $this->assertSame('2013-10-01 05:15:05', Carbon::parse('first day of next month')->toDateTimeString()); + $this->assertSame('2013-09-30 05:15:05', Carbon::parse('last day of this month')->toDateTimeString()); } public function testParseRelativeWithMinusSignsInDate() @@ -108,8 +108,8 @@ public function testParseRelativeWithMinusSignsInDate() $notNow = Carbon::parse('2013-09-01 05:15:05'); Carbon::setTestNow($notNow); - $this->assertEquals('2000-01-03 00:00:00', Carbon::parse('2000-1-3')->toDateTimeString()); - $this->assertEquals('2000-10-10 00:00:00', Carbon::parse('2000-10-10')->toDateTimeString()); + $this->assertSame('2000-01-03 00:00:00', Carbon::parse('2000-1-3')->toDateTimeString()); + $this->assertSame('2000-10-10 00:00:00', Carbon::parse('2000-10-10')->toDateTimeString()); } public function testTimeZoneWithTestValueSet() @@ -117,8 +117,8 @@ public function testTimeZoneWithTestValueSet() $notNow = Carbon::parse('2013-07-01 12:00:00', 'America/New_York'); Carbon::setTestNow($notNow); - $this->assertEquals('2013-07-01T12:00:00-0400', Carbon::parse('now')->toIso8601String()); - $this->assertEquals('2013-07-01T11:00:00-0500', Carbon::parse('now', 'America/Mexico_City')->toIso8601String()); - $this->assertEquals('2013-07-01T09:00:00-0700', Carbon::parse('now', 'America/Vancouver')->toIso8601String()); + $this->assertSame('2013-07-01T12:00:00-0400', Carbon::parse('now')->toIso8601String()); + $this->assertSame('2013-07-01T11:00:00-0500', Carbon::parse('now', 'America/Mexico_City')->toIso8601String()); + $this->assertSame('2013-07-01T09:00:00-0700', Carbon::parse('now', 'America/Vancouver')->toIso8601String()); } } diff --git a/vendor/nikic/php-parser/UPGRADE-1.0.md b/vendor/nikic/php-parser/UPGRADE-1.0.md deleted file mode 100644 index 6a9ee26..0000000 --- a/vendor/nikic/php-parser/UPGRADE-1.0.md +++ /dev/null @@ -1,121 +0,0 @@ -Upgrading from PHP-Parser 0.9 to 1.0 -==================================== - -### PHP version requirements - -PHP-Parser now requires PHP 5.3 or newer to run. It is however still possible to *parse* PHP 5.2 source code, while -running on a newer version. - -### Move to namespaced names - -The library has been moved to use namespaces with the `PhpParser` vendor prefix. However, the old names using -underscores are still available as aliases, as such most code should continue running on the new version without -further changes. - -Old (still works, but discouraged): - -```php -$parser = new \PHPParser_Parser(new \PHPParser_Lexer_Emulative); -$prettyPrinter = new \PHPParser_PrettyPrinter_Default; -``` - -New: - -```php -$parser = new \PhpParser\Parser(new PhpParser\Lexer\Emulative); -$prettyPrinter = new \PhpParser\PrettyPrinter\Standard; -``` - -Note that the `PHPParser` prefix was changed to `PhpParser`. While PHP class names are technically case-insensitive, -the autoloader will not be able to load `PHPParser\Parser` or other case variants. - -Due to conflicts with reserved keywords, some class names now end with an underscore, e.g. `PHPParser_Node_Stmt_Class` -is now `PhpParser\Node\Stmt\Class_`. (But as usual, the old name is still available.) - -### Changes to `Node::getType()` - -The `Node::getType()` method continues to return names using underscores instead of namespace separators and also does -not contain the trailing underscore that may be present in the class name. As such its output will not change in many -cases. - -However, some node classes have been moved to a different namespace or renamed, which will result in a different -`Node::getType()` output: - -``` -Expr_AssignBitwiseAnd => Expr_AssignOp_BitwiseAnd -Expr_AssignBitwiseOr => Expr_AssignOp_BitwiseOr -Expr_AssignBitwiseXor => Expr_AssignOp_BitwiseXor -Expr_AssignConcat => Expr_AssignOp_Concat -Expr_AssignDiv => Expr_AssignOp_Div -Expr_AssignMinus => Expr_AssignOp_Minus -Expr_AssignMod => Expr_AssignOp_Mod -Expr_AssignMul => Expr_AssignOp_Mul -Expr_AssignPlus => Expr_AssignOp_Plus -Expr_AssignShiftLeft => Expr_AssignOp_ShiftLeft -Expr_AssignShiftRight => Expr_AssignOp_ShiftRight - -Expr_BitwiseAnd => Expr_BinaryOp_BitwiseAnd -Expr_BitwiseOr => Expr_BinaryOp_BitwiseOr -Expr_BitwiseXor => Expr_BinaryOp_BitwiseXor -Expr_BooleanAnd => Expr_BinaryOp_BooleanAnd -Expr_BooleanOr => Expr_BinaryOp_BooleanOr -Expr_Concat => Expr_BinaryOp_Concat -Expr_Div => Expr_BinaryOp_Div -Expr_Equal => Expr_BinaryOp_Equal -Expr_Greater => Expr_BinaryOp_Greater -Expr_GreaterOrEqual => Expr_BinaryOp_GreaterOrEqual -Expr_Identical => Expr_BinaryOp_Identical -Expr_LogicalAnd => Expr_BinaryOp_LogicalAnd -Expr_LogicalOr => Expr_BinaryOp_LogicalOr -Expr_LogicalXor => Expr_BinaryOp_LogicalXor -Expr_Minus => Expr_BinaryOp_Minus -Expr_Mod => Expr_BinaryOp_Mod -Expr_Mul => Expr_BinaryOp_Mul -Expr_NotEqual => Expr_BinaryOp_NotEqual -Expr_NotIdentical => Expr_BinaryOp_NotIdentical -Expr_Plus => Expr_BinaryOp_Plus -Expr_ShiftLeft => Expr_BinaryOp_ShiftLeft -Expr_ShiftRight => Expr_BinaryOp_ShiftRight -Expr_Smaller => Expr_BinaryOp_Smaller -Expr_SmallerOrEqual => Expr_BinaryOp_SmallerOrEqual - -Scalar_ClassConst => Scalar_MagicConst_Class -Scalar_DirConst => Scalar_MagicConst_Dir -Scalar_FileConst => Scalar_MagicConst_File -Scalar_FuncConst => Scalar_MagicConst_Function -Scalar_LineConst => Scalar_MagicConst_Line -Scalar_MethodConst => Scalar_MagicConst_Method -Scalar_NSConst => Scalar_MagicConst_Namespace -Scalar_TraitConst => Scalar_MagicConst_Trait -``` - -These changes may affect custom pretty printers and code comparing the return value of `Node::getType()` to specific -strings. - -### Miscellaneous - - * The classes `Template` and `TemplateLoader` have been removed. You should use some other [code generation][code_gen] - project built on top of PHP-Parser instead. - - * The `PrettyPrinterAbstract::pStmts()` method now emits a leading newline if the statement list is not empty. - Custom pretty printers should remove the explicit newline before `pStmts()` calls. - - Old: - - ```php - public function pStmt_Trait(PHPParser_Node_Stmt_Trait $node) { - return 'trait ' . $node->name - . "\n" . '{' . "\n" . $this->pStmts($node->stmts) . "\n" . '}'; - } - ``` - - New: - - ```php - public function pStmt_Trait(Stmt\Trait_ $node) { - return 'trait ' . $node->name - . "\n" . '{' . $this->pStmts($node->stmts) . "\n" . '}'; - } - ``` - - [code_gen]: https://github.com/nikic/PHP-Parser/wiki/Projects-using-the-PHP-Parser#code-generation \ No newline at end of file diff --git a/vendor/nikic/php-parser/bin/php-parse.php b/vendor/nikic/php-parser/bin/php-parse.php deleted file mode 100644 index 193ecec..0000000 --- a/vendor/nikic/php-parser/bin/php-parse.php +++ /dev/null @@ -1,144 +0,0 @@ -addVisitor(new PhpParser\NodeVisitor\NameResolver); - -foreach ($files as $file) { - if (strpos($file, ' Code $code\n"; - } else { - if (!file_exists($file)) { - die("File $file does not exist.\n"); - } - - $code = file_get_contents($file); - echo "====> File $file:\n"; - } - - try { - $stmts = $parser->parse($code); - } catch (PhpParser\Error $e) { - die("==> Parse Error: {$e->getMessage()}\n"); - } - - foreach ($operations as $operation) { - if ('dump' === $operation) { - echo "==> Node dump:\n"; - echo $dumper->dump($stmts), "\n"; - } elseif ('pretty-print' === $operation) { - echo "==> Pretty print:\n"; - echo $prettyPrinter->prettyPrintFile($stmts), "\n"; - } elseif ('serialize-xml' === $operation) { - echo "==> Serialized XML:\n"; - echo $serializer->serialize($stmts), "\n"; - } elseif ('var-dump' === $operation) { - echo "==> var_dump():\n"; - var_dump($stmts); - } elseif ('resolve-names' === $operation) { - echo "==> Resolved names.\n"; - $stmts = $traverser->traverse($stmts); - } - } -} - -function showHelp($error) { - die($error . "\n\n" . - <<name = $name; + + $this->type = 0; + $this->returnByRef = false; + $this->params = array(); + $this->stmts = array(); } /** * Makes the method public. * - * @return $this The builder instance (for fluid interface) + * @return PHPParser_Builder_Method The builder instance (for fluid interface) */ public function makePublic() { - $this->setModifier(Stmt\Class_::MODIFIER_PUBLIC); + $this->setModifier(PHPParser_Node_Stmt_Class::MODIFIER_PUBLIC); return $this; } @@ -35,10 +37,10 @@ public function makePublic() { /** * Makes the method protected. * - * @return $this The builder instance (for fluid interface) + * @return PHPParser_Builder_Method The builder instance (for fluid interface) */ public function makeProtected() { - $this->setModifier(Stmt\Class_::MODIFIER_PROTECTED); + $this->setModifier(PHPParser_Node_Stmt_Class::MODIFIER_PROTECTED); return $this; } @@ -46,10 +48,10 @@ public function makeProtected() { /** * Makes the method private. * - * @return $this The builder instance (for fluid interface) + * @return PHPParser_Builder_Method The builder instance (for fluid interface) */ public function makePrivate() { - $this->setModifier(Stmt\Class_::MODIFIER_PRIVATE); + $this->setModifier(PHPParser_Node_Stmt_Class::MODIFIER_PRIVATE); return $this; } @@ -57,10 +59,10 @@ public function makePrivate() { /** * Makes the method static. * - * @return $this The builder instance (for fluid interface) + * @return PHPParser_Builder_Method The builder instance (for fluid interface) */ public function makeStatic() { - $this->setModifier(Stmt\Class_::MODIFIER_STATIC); + $this->setModifier(PHPParser_Node_Stmt_Class::MODIFIER_STATIC); return $this; } @@ -68,14 +70,14 @@ public function makeStatic() { /** * Makes the method abstract. * - * @return $this The builder instance (for fluid interface) + * @return PHPParser_Builder_Method The builder instance (for fluid interface) */ public function makeAbstract() { if (!empty($this->stmts)) { - throw new \LogicException('Cannot make method with statements abstract'); + throw new LogicException('Cannot make method with statements abstract'); } - $this->setModifier(Stmt\Class_::MODIFIER_ABSTRACT); + $this->setModifier(PHPParser_Node_Stmt_Class::MODIFIER_ABSTRACT); $this->stmts = null; // abstract methods don't have statements return $this; @@ -84,10 +86,55 @@ public function makeAbstract() { /** * Makes the method final. * - * @return $this The builder instance (for fluid interface) + * @return PHPParser_Builder_Method The builder instance (for fluid interface) */ public function makeFinal() { - $this->setModifier(Stmt\Class_::MODIFIER_FINAL); + $this->setModifier(PHPParser_Node_Stmt_Class::MODIFIER_FINAL); + + return $this; + } + + /** + * Make the method return by reference. + * + * @return PHPParser_Builder_Method The builder instance (for fluid interface) + */ + public function makeReturnByRef() { + $this->returnByRef = true; + + return $this; + } + + /** + * Adds a parameter. + * + * @param PHPParser_Node_Param|PHPParser_Builder_Param $param The parameter to add + * + * @return PHPParser_Builder_Method The builder instance (for fluid interface) + */ + public function addParam($param) { + $param = $this->normalizeNode($param); + + if (!$param instanceof PHPParser_Node_Param) { + throw new LogicException(sprintf('Expected parameter node, got "%s"', $param->getType())); + } + + $this->params[] = $param; + + return $this; + } + + /** + * Adds multiple parameters. + * + * @param array $params The parameters to add + * + * @return PHPParser_Builder_Method The builder instance (for fluid interface) + */ + public function addParams(array $params) { + foreach ($params as $param) { + $this->addParam($param); + } return $this; } @@ -95,13 +142,13 @@ public function makeFinal() { /** * Adds a statement. * - * @param Node|PhpParser\Builder $stmt The statement to add + * @param PHPParser_Node|PHPParser_Builder $stmt The statement to add * - * @return $this The builder instance (for fluid interface) + * @return PHPParser_Builder_Method The builder instance (for fluid interface) */ public function addStmt($stmt) { if (null === $this->stmts) { - throw new \LogicException('Cannot add statements to an abstract method'); + throw new LogicException('Cannot add statements to an abstract method'); } $this->stmts[] = $this->normalizeNode($stmt); @@ -109,17 +156,32 @@ public function addStmt($stmt) { return $this; } + /** + * Adds multiple statements. + * + * @param array $stmts The statements to add + * + * @return PHPParser_Builder_Method The builder instance (for fluid interface) + */ + public function addStmts(array $stmts) { + foreach ($stmts as $stmt) { + $this->addStmt($stmt); + } + + return $this; + } + /** * Returns the built method node. * - * @return Stmt\ClassMethod The built method node + * @return PHPParser_Node_Stmt_ClassMethod The built method node */ public function getNode() { - return new Stmt\ClassMethod($this->name, array( - 'type' => $this->type !== 0 ? $this->type : Stmt\Class_::MODIFIER_PUBLIC, + return new PHPParser_Node_Stmt_ClassMethod($this->name, array( + 'type' => $this->type !== 0 ? $this->type : PHPParser_Node_Stmt_Class::MODIFIER_PUBLIC, 'byRef' => $this->returnByRef, 'params' => $this->params, 'stmts' => $this->stmts, - ), $this->attributes); + )); } } \ No newline at end of file diff --git a/vendor/nikic/php-parser/lib/PHPParser/Builder/Param.php b/vendor/nikic/php-parser/lib/PHPParser/Builder/Param.php index af910c2..4c217a9 100644 --- a/vendor/nikic/php-parser/lib/PHPParser/Builder/Param.php +++ b/vendor/nikic/php-parser/lib/PHPParser/Builder/Param.php @@ -1,17 +1,12 @@ name = $name; + + $this->default = null; + $this->type = null; + $this->byRef = false; } /** @@ -27,7 +26,7 @@ public function __construct($name) { * * @param mixed $value Default value to use * - * @return $this The builder instance (for fluid interface) + * @return PHPParser_Builder_Param The builder instance (for fluid interface) */ public function setDefault($value) { $this->default = $this->normalizeValue($value); @@ -38,9 +37,9 @@ public function setDefault($value) { /** * Sets type hint for the parameter. * - * @param string|Node\Name $type Type hint to use + * @param string|PHPParser_Node_Name $type Type hint to use * - * @return $this The builder instance (for fluid interface) + * @return PHPParser_Builder_Param The builder instance (for fluid interface) */ public function setTypeHint($type) { if ($type === 'array' || $type === 'callable') { @@ -55,7 +54,7 @@ public function setTypeHint($type) { /** * Make the parameter accept the value by reference. * - * @return $this The builder instance (for fluid interface) + * @return PHPParser_Builder_Param The builder instance (for fluid interface) */ public function makeByRef() { $this->byRef = true; @@ -66,10 +65,10 @@ public function makeByRef() { /** * Returns the built parameter node. * - * @return Node\Param The built parameter node + * @return PHPParser_Node_Param The built parameter node */ public function getNode() { - return new Node\Param( + return new PHPParser_Node_Param( $this->name, $this->default, $this->type, $this->byRef ); } diff --git a/vendor/nikic/php-parser/lib/PHPParser/Builder/Property.php b/vendor/nikic/php-parser/lib/PHPParser/Builder/Property.php index 2d59d4c..806632c 100644 --- a/vendor/nikic/php-parser/lib/PHPParser/Builder/Property.php +++ b/vendor/nikic/php-parser/lib/PHPParser/Builder/Property.php @@ -1,17 +1,11 @@ name = $name; + + $this->type = 0; + $this->default = null; } /** * Makes the property public. * - * @return $this The builder instance (for fluid interface) + * @return PHPParser_Builder_Property The builder instance (for fluid interface) */ public function makePublic() { - $this->setModifier(Stmt\Class_::MODIFIER_PUBLIC); + $this->setModifier(PHPParser_Node_Stmt_Class::MODIFIER_PUBLIC); return $this; } @@ -36,10 +33,10 @@ public function makePublic() { /** * Makes the property protected. * - * @return $this The builder instance (for fluid interface) + * @return PHPParser_Builder_Property The builder instance (for fluid interface) */ public function makeProtected() { - $this->setModifier(Stmt\Class_::MODIFIER_PROTECTED); + $this->setModifier(PHPParser_Node_Stmt_Class::MODIFIER_PROTECTED); return $this; } @@ -47,10 +44,10 @@ public function makeProtected() { /** * Makes the property private. * - * @return $this The builder instance (for fluid interface) + * @return PHPParser_Builder_Property The builder instance (for fluid interface) */ public function makePrivate() { - $this->setModifier(Stmt\Class_::MODIFIER_PRIVATE); + $this->setModifier(PHPParser_Node_Stmt_Class::MODIFIER_PRIVATE); return $this; } @@ -58,10 +55,10 @@ public function makePrivate() { /** * Makes the property static. * - * @return $this The builder instance (for fluid interface) + * @return PHPParser_Builder_Property The builder instance (for fluid interface) */ public function makeStatic() { - $this->setModifier(Stmt\Class_::MODIFIER_STATIC); + $this->setModifier(PHPParser_Node_Stmt_Class::MODIFIER_STATIC); return $this; } @@ -71,7 +68,7 @@ public function makeStatic() { * * @param mixed $value Default value to use * - * @return $this The builder instance (for fluid interface) + * @return PHPParser_Builder_Property The builder instance (for fluid interface) */ public function setDefault($value) { $this->default = $this->normalizeValue($value); @@ -79,33 +76,17 @@ public function setDefault($value) { return $this; } - /** - * Sets doc comment for the property. - * - * @param PhpParser\Comment\Doc|string $docComment Doc comment to set - * - * @return $this The builder instance (for fluid interface) - */ - public function setDocComment($docComment) { - $this->attributes = array( - 'comments' => array($this->normalizeDocComment($docComment)) - ); - - return $this; - } - /** * Returns the built class node. * - * @return Stmt\Property The built property node + * @return PHPParser_Node_Stmt_Property The built property node */ public function getNode() { - return new Stmt\Property( - $this->type !== 0 ? $this->type : Stmt\Class_::MODIFIER_PUBLIC, + return new PHPParser_Node_Stmt_Property( + $this->type !== 0 ? $this->type : PHPParser_Node_Stmt_Class::MODIFIER_PUBLIC, array( - new Stmt\PropertyProperty($this->name, $this->default) - ), - $this->attributes + new PHPParser_Node_Stmt_PropertyProperty($this->name, $this->default) + ) ); } } \ No newline at end of file diff --git a/vendor/nikic/php-parser/lib/PHPParser/BuilderFactory.php b/vendor/nikic/php-parser/lib/PHPParser/BuilderFactory.php index 2f7b47b..48941dc 100644 --- a/vendor/nikic/php-parser/lib/PHPParser/BuilderFactory.php +++ b/vendor/nikic/php-parser/lib/PHPParser/BuilderFactory.php @@ -1,63 +1,36 @@ tokenMap = $this->createTokenMap(); // map of tokens to drop while lexing (the map is only used for isset lookup, // that's why the value is simply set to 1; the value is never actually used.) $this->dropTokens = array_fill_keys(array(T_WHITESPACE, T_OPEN_TAG), 1); - - // the usedAttributes member is a map of the used attribute names to a dummy - // value (here "true") - $options += array( - 'usedAttributes' => array('comments', 'startLine', 'endLine'), - ); - $this->usedAttributes = array_fill_keys($options['usedAttributes'], true); } /** @@ -45,7 +27,7 @@ public function __construct(array $options = array()) { * * @param string $code The source code to lex * - * @throws Error on lexing errors (unterminated comment or unexpected character) + * @throws PHPParser_Error on lexing errors (unterminated comment or unexpected character) */ public function startLexing($code) { $scream = ini_set('xdebug.scream', 0); @@ -59,16 +41,17 @@ public function startLexing($code) { $this->code = $code; // keep the code around for __halt_compiler() handling $this->pos = -1; $this->line = 1; - $this->filePos = 0; } protected function resetErrors() { // set error_get_last() to defined state by forcing an undefined variable error - set_error_handler(function() { return false; }, 0); + set_error_handler(array($this, 'dummyErrorHandler'), 0); @$undefinedVariable; restore_error_handler(); } + private function dummyErrorHandler() { return false; } + protected function handleErrors() { $error = error_get_last(); @@ -76,14 +59,14 @@ protected function handleErrors() { '~^Unterminated comment starting line ([0-9]+)$~', $error['message'], $matches )) { - throw new Error('Unterminated comment', $matches[1]); + throw new PHPParser_Error('Unterminated comment', $matches[1]); } if (preg_match( '~^Unexpected character in input: \'(.)\' \(ASCII=([0-9]+)\)~s', $error['message'], $matches )) { - throw new Error(sprintf( + throw new PHPParser_Error(sprintf( 'Unexpected character "%s" (ASCII %d)', $matches[1], $matches[2] )); @@ -91,26 +74,13 @@ protected function handleErrors() { // PHP cuts error message after null byte, so need special case if (preg_match('~^Unexpected character in input: \'$~', $error['message'])) { - throw new Error('Unexpected null byte'); + throw new PHPParser_Error('Unexpected null byte'); } } /** * Fetches the next token. * - * The available attributes are determined by the 'usedAttributes' option, which can - * be specified in the constructor. The following attributes are supported: - * - * * 'comments' => Array of PhpParser\Comment or PhpParser\Comment\Doc instances, - * representing all comments that occurred between the previous - * non-discarded token and the current one. - * * 'startLine' => Line in which the node starts. - * * 'endLine' => Line in which the node ends. - * * 'startTokenPos' => Offset into the token array of the first token in the node. - * * 'endTokenPos' => Offset into the token array of the last token in the node. - * * 'startFilePos' => Offset into the code string of the first character that is part of the node. - * * 'endFilePos' => Offset into the code string of the last character that is part of the node - * * @param mixed $value Variable to store token content in * @param mixed $startAttributes Variable to store start attributes in * @param mixed $endAttributes Variable to store end attributes in @@ -124,66 +94,29 @@ public function getNextToken(&$value = null, &$startAttributes = null, &$endAttr while (isset($this->tokens[++$this->pos])) { $token = $this->tokens[$this->pos]; - if (isset($this->usedAttributes['startTokenPos'])) { - $startAttributes['startTokenPos'] = $this->pos; - } - if (isset($this->usedAttributes['startFilePos'])) { - $startAttributes['startFilePos'] = $this->filePos; - } - if (is_string($token)) { + $startAttributes['startLine'] = $this->line; + $endAttributes['endLine'] = $this->line; + // bug in token_get_all if ('b"' === $token) { $value = 'b"'; - $this->filePos += 2; - $id = ord('"'); + return ord('"'); } else { $value = $token; - $this->filePos += 1; - $id = ord($token); - } - - if (isset($this->usedAttributes['startLine'])) { - $startAttributes['startLine'] = $this->line; + return ord($token); } - if (isset($this->usedAttributes['endLine'])) { - $endAttributes['endLine'] = $this->line; - } - if (isset($this->usedAttributes['endTokenPos'])) { - $endAttributes['endTokenPos'] = $this->pos; - } - if (isset($this->usedAttributes['endFilePos'])) { - $endAttributes['endFilePos'] = $this->filePos - 1; - } - - return $id; } else { $this->line += substr_count($token[1], "\n"); - $this->filePos += strlen($token[1]); if (T_COMMENT === $token[0]) { - if (isset($this->usedAttributes['comments'])) { - $startAttributes['comments'][] = new Comment($token[1], $token[2]); - } + $startAttributes['comments'][] = new PHPParser_Comment($token[1], $token[2]); } elseif (T_DOC_COMMENT === $token[0]) { - if (isset($this->usedAttributes['comments'])) { - $startAttributes['comments'][] = new Comment\Doc($token[1], $token[2]); - } + $startAttributes['comments'][] = new PHPParser_Comment_Doc($token[1], $token[2]); } elseif (!isset($this->dropTokens[$token[0]])) { $value = $token[1]; - - if (isset($this->usedAttributes['startLine'])) { - $startAttributes['startLine'] = $token[2]; - } - if (isset($this->usedAttributes['endLine'])) { - $endAttributes['endLine'] = $this->line; - } - if (isset($this->usedAttributes['endTokenPos'])) { - $endAttributes['endTokenPos'] = $this->pos; - } - if (isset($this->usedAttributes['endFilePos'])) { - $endAttributes['endFilePos'] = $this->filePos - 1; - } + $startAttributes['startLine'] = $token[2]; + $endAttributes['endLine'] = $this->line; return $this->tokenMap[$token[0]]; } @@ -196,20 +129,6 @@ public function getNextToken(&$value = null, &$startAttributes = null, &$endAttr return 0; } - /** - * Returns the token array for current code. - * - * The token array is in the same format as provided by the - * token_get_all() function and does not discard tokens (i.e. - * whitespace and comments are included). The token position - * attributes are against this token array. - * - * @return array Array of tokens in token_get_all() format - */ - public function getTokens() { - return $this->tokens; - } - /** * Handles __halt_compiler() by returning the text after it. * @@ -233,7 +152,7 @@ public function handleHaltCompiler() { // this simplifies the situation, by not allowing any comments // in between of the tokens. if (!preg_match('~\s*\(\s*\)\s*(?:;|\?>\r?\n?)~', $textAfter, $matches)) { - throw new Error('__HALT_COMPILER must be followed by "();"'); + throw new PHPParser_Error('__HALT_COMPILER must be followed by "();"'); } // prevent the lexer from returning any further tokens @@ -260,26 +179,21 @@ protected function createTokenMap() { for ($i = 256; $i < 1000; ++$i) { // T_DOUBLE_COLON is equivalent to T_PAAMAYIM_NEKUDOTAYIM if (T_DOUBLE_COLON === $i) { - $tokenMap[$i] = Parser::T_PAAMAYIM_NEKUDOTAYIM; + $tokenMap[$i] = PHPParser_Parser::T_PAAMAYIM_NEKUDOTAYIM; // T_OPEN_TAG_WITH_ECHO with dropped T_OPEN_TAG results in T_ECHO } elseif(T_OPEN_TAG_WITH_ECHO === $i) { - $tokenMap[$i] = Parser::T_ECHO; + $tokenMap[$i] = PHPParser_Parser::T_ECHO; // T_CLOSE_TAG is equivalent to ';' } elseif(T_CLOSE_TAG === $i) { $tokenMap[$i] = ord(';'); // and the others can be mapped directly } elseif ('UNKNOWN' !== ($name = token_name($i)) - && defined($name = 'PhpParser\Parser::' . $name) + && defined($name = 'PHPParser_Parser::' . $name) ) { $tokenMap[$i] = constant($name); } } - // HHVM uses a special token for numbers that overflow to double - if (defined('T_ONUMBER')) { - $tokenMap[T_ONUMBER] = Parser::T_DNUMBER; - } - return $tokenMap; } } diff --git a/vendor/nikic/php-parser/lib/PHPParser/Node.php b/vendor/nikic/php-parser/lib/PHPParser/Node.php index a28ccc1..c47d49d 100644 --- a/vendor/nikic/php-parser/lib/PHPParser/Node.php +++ b/vendor/nikic/php-parser/lib/PHPParser/Node.php @@ -1,8 +1,6 @@ $key, diff --git a/vendor/nikic/php-parser/lib/PHPParser/Node/Expr/BitwiseNot.php b/vendor/nikic/php-parser/lib/PHPParser/Node/Expr/BitwiseNot.php index bc2e76f..635d200 100644 --- a/vendor/nikic/php-parser/lib/PHPParser/Node/Expr/BitwiseNot.php +++ b/vendor/nikic/php-parser/lib/PHPParser/Node/Expr/BitwiseNot.php @@ -1,21 +1,17 @@ $expr diff --git a/vendor/nikic/php-parser/lib/PHPParser/Node/Expr/BooleanNot.php b/vendor/nikic/php-parser/lib/PHPParser/Node/Expr/BooleanNot.php index 7e53324..0a8a24c 100644 --- a/vendor/nikic/php-parser/lib/PHPParser/Node/Expr/BooleanNot.php +++ b/vendor/nikic/php-parser/lib/PHPParser/Node/Expr/BooleanNot.php @@ -1,21 +1,17 @@ $expr diff --git a/vendor/nikic/php-parser/lib/PHPParser/Node/Expr/Cast.php b/vendor/nikic/php-parser/lib/PHPParser/Node/Expr/Cast.php index d483999..562cccc 100644 --- a/vendor/nikic/php-parser/lib/PHPParser/Node/Expr/Cast.php +++ b/vendor/nikic/php-parser/lib/PHPParser/Node/Expr/Cast.php @@ -1,21 +1,17 @@ $expr diff --git a/vendor/nikic/php-parser/lib/PHPParser/Node/Expr/Cast/Bool.php b/vendor/nikic/php-parser/lib/PHPParser/Node/Expr/Cast/Bool.php index 232fc75..ca311da 100644 --- a/vendor/nikic/php-parser/lib/PHPParser/Node/Expr/Cast/Bool.php +++ b/vendor/nikic/php-parser/lib/PHPParser/Node/Expr/Cast/Bool.php @@ -1,9 +1,5 @@ false : Whether the closure is static - * 'byRef' => false : Whether to return by reference + * 'stmts' => array(): Statements * 'params' => array(): Parameters * 'uses' => array(): use()s - * 'stmts' => array(): Statements + * 'byRef' => false : Whether to return by reference + * 'static' => false : Whether the closure is static * @param array $attributes Additional attributes */ public function __construct(array $subNodes = array(), array $attributes = array()) { parent::__construct( - array( - 'static' => isset($subNodes['static']) ? $subNodes['static'] : false, - 'byRef' => isset($subNodes['byRef']) ? $subNodes['byRef'] : false, - 'params' => isset($subNodes['params']) ? $subNodes['params'] : array(), - 'uses' => isset($subNodes['uses']) ? $subNodes['uses'] : array(), - 'stmts' => isset($subNodes['stmts']) ? $subNodes['stmts'] : array(), + $subNodes + array( + 'stmts' => array(), + 'params' => array(), + 'uses' => array(), + 'byRef' => false, + 'static' => false, ), $attributes ); diff --git a/vendor/nikic/php-parser/lib/PHPParser/Node/Expr/ErrorSuppress.php b/vendor/nikic/php-parser/lib/PHPParser/Node/Expr/ErrorSuppress.php index 817ad0c..7222529 100644 --- a/vendor/nikic/php-parser/lib/PHPParser/Node/Expr/ErrorSuppress.php +++ b/vendor/nikic/php-parser/lib/PHPParser/Node/Expr/ErrorSuppress.php @@ -1,21 +1,17 @@ $expr diff --git a/vendor/nikic/php-parser/lib/PHPParser/Node/Expr/MethodCall.php b/vendor/nikic/php-parser/lib/PHPParser/Node/Expr/MethodCall.php index 13f35ce..89187e2 100644 --- a/vendor/nikic/php-parser/lib/PHPParser/Node/Expr/MethodCall.php +++ b/vendor/nikic/php-parser/lib/PHPParser/Node/Expr/MethodCall.php @@ -1,26 +1,21 @@ $var, diff --git a/vendor/nikic/php-parser/lib/PHPParser/Node/Expr/PostDec.php b/vendor/nikic/php-parser/lib/PHPParser/Node/Expr/PostDec.php index 8563a1a..2fdcfad 100644 --- a/vendor/nikic/php-parser/lib/PHPParser/Node/Expr/PostDec.php +++ b/vendor/nikic/php-parser/lib/PHPParser/Node/Expr/PostDec.php @@ -1,21 +1,17 @@ $var diff --git a/vendor/nikic/php-parser/lib/PHPParser/Node/Expr/PostInc.php b/vendor/nikic/php-parser/lib/PHPParser/Node/Expr/PostInc.php index 30275d9..93968ff 100644 --- a/vendor/nikic/php-parser/lib/PHPParser/Node/Expr/PostInc.php +++ b/vendor/nikic/php-parser/lib/PHPParser/Node/Expr/PostInc.php @@ -1,21 +1,17 @@ $var diff --git a/vendor/nikic/php-parser/lib/PHPParser/Node/Expr/PropertyFetch.php b/vendor/nikic/php-parser/lib/PHPParser/Node/Expr/PropertyFetch.php index 21aa11b..f77756e 100644 --- a/vendor/nikic/php-parser/lib/PHPParser/Node/Expr/PropertyFetch.php +++ b/vendor/nikic/php-parser/lib/PHPParser/Node/Expr/PropertyFetch.php @@ -1,23 +1,19 @@ $var, diff --git a/vendor/nikic/php-parser/lib/PHPParser/Node/Expr/ShellExec.php b/vendor/nikic/php-parser/lib/PHPParser/Node/Expr/ShellExec.php index ae00422..86fd2e2 100644 --- a/vendor/nikic/php-parser/lib/PHPParser/Node/Expr/ShellExec.php +++ b/vendor/nikic/php-parser/lib/PHPParser/Node/Expr/ShellExec.php @@ -1,19 +1,15 @@ $cond, diff --git a/vendor/nikic/php-parser/lib/PHPParser/Node/Expr/UnaryMinus.php b/vendor/nikic/php-parser/lib/PHPParser/Node/Expr/UnaryMinus.php index 116f3bf..1bf6edd 100644 --- a/vendor/nikic/php-parser/lib/PHPParser/Node/Expr/UnaryMinus.php +++ b/vendor/nikic/php-parser/lib/PHPParser/Node/Expr/UnaryMinus.php @@ -1,21 +1,17 @@ $expr diff --git a/vendor/nikic/php-parser/lib/PHPParser/Node/Expr/Variable.php b/vendor/nikic/php-parser/lib/PHPParser/Node/Expr/Variable.php index 3a4d3bc..8e3ac26 100644 --- a/vendor/nikic/php-parser/lib/PHPParser/Node/Expr/Variable.php +++ b/vendor/nikic/php-parser/lib/PHPParser/Node/Expr/Variable.php @@ -1,18 +1,14 @@ parts; } - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'When changing a name you need to pass either a string, an array or a Name node' ); } diff --git a/vendor/nikic/php-parser/lib/PHPParser/Node/Name/FullyQualified.php b/vendor/nikic/php-parser/lib/PHPParser/Node/Name/FullyQualified.php index 97cc111..5531ad1 100644 --- a/vendor/nikic/php-parser/lib/PHPParser/Node/Name/FullyQualified.php +++ b/vendor/nikic/php-parser/lib/PHPParser/Node/Name/FullyQualified.php @@ -1,8 +1,6 @@ value pair node. * - * @param string $key Key - * @param Node\Expr $value Value - * @param array $attributes Additional attributes + * @param string $key Key + * @param PHPParser_Node_Expr $value Value + * @param array $attributes Additional attributes */ - public function __construct($key, Node\Expr $value, array $attributes = array()) { + public function __construct($key, PHPParser_Node_Expr $value, array $attributes = array()) { parent::__construct( array( 'key' => $key, diff --git a/vendor/nikic/php-parser/lib/PHPParser/Node/Stmt/HaltCompiler.php b/vendor/nikic/php-parser/lib/PHPParser/Node/Stmt/HaltCompiler.php index 79d4ff3..0f4c4b1 100644 --- a/vendor/nikic/php-parser/lib/PHPParser/Node/Stmt/HaltCompiler.php +++ b/vendor/nikic/php-parser/lib/PHPParser/Node/Stmt/HaltCompiler.php @@ -1,13 +1,9 @@ $type, @@ -42,18 +24,18 @@ public function __construct($type, array $props, array $attributes = array()) { } public function isPublic() { - return (bool) ($this->type & Class_::MODIFIER_PUBLIC); + return (bool) ($this->type & PHPParser_Node_Stmt_Class::MODIFIER_PUBLIC); } public function isProtected() { - return (bool) ($this->type & Class_::MODIFIER_PROTECTED); + return (bool) ($this->type & PHPParser_Node_Stmt_Class::MODIFIER_PROTECTED); } public function isPrivate() { - return (bool) ($this->type & Class_::MODIFIER_PRIVATE); + return (bool) ($this->type & PHPParser_Node_Stmt_Class::MODIFIER_PRIVATE); } public function isStatic() { - return (bool) ($this->type & Class_::MODIFIER_STATIC); + return (bool) ($this->type & PHPParser_Node_Stmt_Class::MODIFIER_STATIC); } -} +} \ No newline at end of file diff --git a/vendor/nikic/php-parser/lib/PHPParser/Node/Stmt/TraitUseAdaptation.php b/vendor/nikic/php-parser/lib/PHPParser/Node/Stmt/TraitUseAdaptation.php index 05c3bfd..63b2b27 100644 --- a/vendor/nikic/php-parser/lib/PHPParser/Node/Stmt/TraitUseAdaptation.php +++ b/vendor/nikic/php-parser/lib/PHPParser/Node/Stmt/TraitUseAdaptation.php @@ -1,13 +1,5 @@ getLast(); } if ('self' == $alias || 'parent' == $alias) { - throw new Error(sprintf( + throw new PHPParser_Error(sprintf( 'Cannot use %s as %s because \'%2$s\' is a special class name', $name, $alias )); diff --git a/vendor/nikic/php-parser/lib/PHPParser/NodeAbstract.php b/vendor/nikic/php-parser/lib/PHPParser/NodeAbstract.php index 93cd7bc..e7d0456 100644 --- a/vendor/nikic/php-parser/lib/PHPParser/NodeAbstract.php +++ b/vendor/nikic/php-parser/lib/PHPParser/NodeAbstract.php @@ -1,8 +1,6 @@ getAttribute('comments'); @@ -68,7 +66,7 @@ public function getDocComment() { } $lastComment = $comments[count($comments) - 1]; - if (!$lastComment instanceof Comment\Doc) { + if (!$lastComment instanceof PHPParser_Comment_Doc) { return null; } @@ -122,6 +120,6 @@ public function __unset($name) { unset($this->subNodes[$name]); } public function getIterator() { - return new \ArrayIterator($this->subNodes); + return new ArrayIterator($this->subNodes); } } \ No newline at end of file diff --git a/vendor/nikic/php-parser/lib/PHPParser/NodeTraverserInterface.php b/vendor/nikic/php-parser/lib/PHPParser/NodeTraverserInterface.php index 0752de2..898eaa0 100644 --- a/vendor/nikic/php-parser/lib/PHPParser/NodeTraverserInterface.php +++ b/vendor/nikic/php-parser/lib/PHPParser/NodeTraverserInterface.php @@ -1,47 +1,20 @@ semValue = $this->semStack[$this->stackPos]; - } - - protected function reduceRule1($attributes) { - $this->semValue = $this->handleNamespaces($this->semStack[$this->stackPos-(1-1)]); - } - - protected function reduceRule2($attributes) { - if (is_array($this->semStack[$this->stackPos-(2-2)])) { $this->semValue = array_merge($this->semStack[$this->stackPos-(2-1)], $this->semStack[$this->stackPos-(2-2)]); } else { $this->semStack[$this->stackPos-(2-1)][] = $this->semStack[$this->stackPos-(2-2)]; $this->semValue = $this->semStack[$this->stackPos-(2-1)]; }; - } - - protected function reduceRule3($attributes) { - $this->semValue = array(); - } - - protected function reduceRule4($attributes) { - $this->semValue = array($this->semStack[$this->stackPos-(1-1)]); - } - - protected function reduceRule5($attributes) { - $this->semStack[$this->stackPos-(3-1)][] = $this->semStack[$this->stackPos-(3-3)]; $this->semValue = $this->semStack[$this->stackPos-(3-1)]; - } + protected $yyval; + protected $yyastk; + protected $stackPos; + protected $lexer; + + /** + * Creates a parser instance. + * + * @param PHPParser_Lexer $lexer A lexer + */ + public function __construct(PHPParser_Lexer $lexer) { + $this->lexer = $lexer; + } + + /** + * Parses PHP code into a node tree. + * + * @param string $code The source code to parse + * + * @return PHPParser_Node[] Array of statements + */ + public function parse($code) { + $this->lexer->startLexing($code); + + // We start off with no lookahead-token + $tokenId = self::TOKEN_NONE; + + // The attributes for a node are taken from the first and last token of the node. + // From the first token only the startAttributes are taken and from the last only + // the endAttributes. Both are merged using the array union operator (+). + $startAttributes = array('startLine' => 1); + $endAttributes = array(); + + // In order to figure out the attributes for the starting token, we have to keep + // them in a stack + $attributeStack = array($startAttributes); + + // Start off in the initial state and keep a stack of previous states + $state = 0; + $stateStack = array($state); + + // AST stack (?) + $this->yyastk = array(); + + // Current position in the stack(s) + $this->stackPos = 0; + + for (;;) { + if (self::$yybase[$state] == 0) { + $yyn = self::$yydefault[$state]; + } else { + if ($tokenId === self::TOKEN_NONE) { + // Fetch the next token id from the lexer and fetch additional info by-ref. + // The end attributes are fetched into a temporary variable and only set once the token is really + // shifted (not during read). Otherwise you would sometimes get off-by-one errors, when a rule is + // reduced after a token was read but not yet shifted. + $origTokenId = $this->lexer->getNextToken($tokenValue, $startAttributes, $nextEndAttributes); + + // map the lexer token id to the internally used token id's + $tokenId = $origTokenId >= 0 && $origTokenId < self::TOKEN_MAP_SIZE + ? self::$translate[$origTokenId] + : self::TOKEN_INVALID; + + if ($tokenId === self::TOKEN_INVALID) { + throw new RangeException(sprintf( + 'The lexer returned an invalid token (id=%d, value=%s)', + $origTokenId, $tokenValue + )); + } + + $attributeStack[$this->stackPos] = $startAttributes; + } - protected function reduceRule6($attributes) { - $this->semValue = new Node\Name($this->semStack[$this->stackPos-(1-1)], $attributes); - } + if ((($yyn = self::$yybase[$state] + $tokenId) >= 0 + && $yyn < self::YYLAST && self::$yycheck[$yyn] == $tokenId + || ($state < self::YY2TBLSTATE + && ($yyn = self::$yybase[$state + self::YYNLSTATES] + $tokenId) >= 0 + && $yyn < self::YYLAST + && self::$yycheck[$yyn] == $tokenId)) + && ($yyn = self::$yyaction[$yyn]) != self::YYDEFAULT) { + /* + * >= YYNLSTATE: shift and reduce + * > 0: shift + * = 0: accept + * < 0: reduce + * = -YYUNEXPECTED: error + */ + if ($yyn > 0) { + /* shift */ + ++$this->stackPos; + + $stateStack[$this->stackPos] = $state = $yyn; + $this->yyastk[$this->stackPos] = $tokenValue; + $attributeStack[$this->stackPos] = $startAttributes; + $endAttributes = $nextEndAttributes; + $tokenId = self::TOKEN_NONE; + + if ($yyn < self::YYNLSTATES) + continue; + + /* $yyn >= YYNLSTATES means shift-and-reduce */ + $yyn -= self::YYNLSTATES; + } else { + $yyn = -$yyn; + } + } else { + $yyn = self::$yydefault[$state]; + } + } - protected function reduceRule7($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(1-1)]; - } + for (;;) { + /* reduce/error */ + if ($yyn == 0) { + /* accept */ + return $this->yyval; + } elseif ($yyn != self::YYUNEXPECTED) { + /* reduce */ + try { + $this->{'yyn' . $yyn}( + $attributeStack[$this->stackPos - self::$yylen[$yyn]] + + $endAttributes + ); + } catch (PHPParser_Error $e) { + if (-1 === $e->getRawLine()) { + $e->setRawLine($startAttributes['startLine']); + } + + throw $e; + } + + /* Goto - shift nonterminal */ + $this->stackPos -= self::$yylen[$yyn]; + $yyn = self::$yylhs[$yyn]; + if (($yyp = self::$yygbase[$yyn] + $stateStack[$this->stackPos]) >= 0 + && $yyp < self::YYGLAST + && self::$yygcheck[$yyp] == $yyn) { + $state = self::$yygoto[$yyp]; + } else { + $state = self::$yygdefault[$yyn]; + } + + ++$this->stackPos; + + $stateStack[$this->stackPos] = $state; + $this->yyastk[$this->stackPos] = $this->yyval; + $attributeStack[$this->stackPos] = $startAttributes; + } else { + /* error */ + $expected = array(); + + $base = self::$yybase[$state]; + for ($i = 0; $i < self::TOKEN_MAP_SIZE; ++$i) { + $n = $base + $i; + if ($n >= 0 && $n < self::YYLAST && self::$yycheck[$n] == $i + || $state < self::YY2TBLSTATE + && ($n = self::$yybase[$state + self::YYNLSTATES] + $i) >= 0 + && $n < self::YYLAST && self::$yycheck[$n] == $i + ) { + if (self::$yyaction[$n] != self::YYUNEXPECTED) { + if (count($expected) == 4) { + /* Too many expected tokens */ + $expected = array(); + break; + } + + $expected[] = self::$terminals[$i]; + } + } + } + + $expectedString = ''; + if ($expected) { + $expectedString = ', expecting ' . implode(' or ', $expected); + } + + throw new PHPParser_Error( + 'Syntax error, unexpected ' . self::$terminals[$tokenId] . $expectedString, + $startAttributes['startLine'] + ); + } - protected function reduceRule8($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(1-1)]; + if ($state < self::YYNLSTATES) + break; + /* >= YYNLSTATES means shift-and-reduce */ + $yyn = $state - self::YYNLSTATES; + } + } } - protected function reduceRule9($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(1-1)]; + protected function yyn0() { + $this->yyval = $this->yyastk[$this->stackPos]; } - protected function reduceRule10($attributes) { - $this->semValue = new Node\Stmt\HaltCompiler($this->lexer->handleHaltCompiler(), $attributes); + protected function yyn1($attributes) { + $this->yyval = PHPParser_Node_Stmt_Namespace::postprocess($this->yyastk[$this->stackPos-(1-1)]); } - protected function reduceRule11($attributes) { - $this->semValue = new Node\Stmt\Namespace_($this->semStack[$this->stackPos-(3-2)], null, $attributes); + protected function yyn2($attributes) { + if (is_array($this->yyastk[$this->stackPos-(2-2)])) { $this->yyval = array_merge($this->yyastk[$this->stackPos-(2-1)], $this->yyastk[$this->stackPos-(2-2)]); } else { $this->yyastk[$this->stackPos-(2-1)][] = $this->yyastk[$this->stackPos-(2-2)]; $this->yyval = $this->yyastk[$this->stackPos-(2-1)]; }; } - protected function reduceRule12($attributes) { - $this->semValue = new Node\Stmt\Namespace_($this->semStack[$this->stackPos-(5-2)], $this->semStack[$this->stackPos-(5-4)], $attributes); + protected function yyn3($attributes) { + $this->yyval = array(); } - protected function reduceRule13($attributes) { - $this->semValue = new Node\Stmt\Namespace_(null, $this->semStack[$this->stackPos-(4-3)], $attributes); + protected function yyn4($attributes) { + $this->yyval = array($this->yyastk[$this->stackPos-(1-1)]); } - protected function reduceRule14($attributes) { - $this->semValue = new Node\Stmt\Use_($this->semStack[$this->stackPos-(3-2)], Node\Stmt\Use_::TYPE_NORMAL, $attributes); + protected function yyn5($attributes) { + $this->yyastk[$this->stackPos-(3-1)][] = $this->yyastk[$this->stackPos-(3-3)]; $this->yyval = $this->yyastk[$this->stackPos-(3-1)]; } - protected function reduceRule15($attributes) { - $this->semValue = new Node\Stmt\Use_($this->semStack[$this->stackPos-(4-3)], Node\Stmt\Use_::TYPE_FUNCTION, $attributes); + protected function yyn6($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(1-1)]; } - protected function reduceRule16($attributes) { - $this->semValue = new Node\Stmt\Use_($this->semStack[$this->stackPos-(4-3)], Node\Stmt\Use_::TYPE_CONSTANT, $attributes); + protected function yyn7($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(1-1)]; } - protected function reduceRule17($attributes) { - $this->semValue = new Node\Stmt\Const_($this->semStack[$this->stackPos-(3-2)], $attributes); + protected function yyn8($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(1-1)]; } - protected function reduceRule18($attributes) { - $this->semStack[$this->stackPos-(3-1)][] = $this->semStack[$this->stackPos-(3-3)]; $this->semValue = $this->semStack[$this->stackPos-(3-1)]; + protected function yyn9($attributes) { + $this->yyval = new PHPParser_Node_Stmt_HaltCompiler($this->lexer->handleHaltCompiler(), $attributes); } - protected function reduceRule19($attributes) { - $this->semValue = array($this->semStack[$this->stackPos-(1-1)]); + protected function yyn10($attributes) { + $this->yyval = new PHPParser_Node_Stmt_Namespace(new PHPParser_Node_Name($this->yyastk[$this->stackPos-(3-2)], $attributes), null, $attributes); } - protected function reduceRule20($attributes) { - $this->semValue = new Node\Stmt\UseUse($this->semStack[$this->stackPos-(1-1)], null, $attributes); + protected function yyn11($attributes) { + $this->yyval = new PHPParser_Node_Stmt_Namespace(new PHPParser_Node_Name($this->yyastk[$this->stackPos-(5-2)], $attributes), $this->yyastk[$this->stackPos-(5-4)], $attributes); } - protected function reduceRule21($attributes) { - $this->semValue = new Node\Stmt\UseUse($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn12($attributes) { + $this->yyval = new PHPParser_Node_Stmt_Namespace(null, $this->yyastk[$this->stackPos-(4-3)], $attributes); } - protected function reduceRule22($attributes) { - $this->semValue = new Node\Stmt\UseUse($this->semStack[$this->stackPos-(2-2)], null, $attributes); + protected function yyn13($attributes) { + $this->yyval = new PHPParser_Node_Stmt_Use($this->yyastk[$this->stackPos-(3-2)], $attributes); } - protected function reduceRule23($attributes) { - $this->semValue = new Node\Stmt\UseUse($this->semStack[$this->stackPos-(4-2)], $this->semStack[$this->stackPos-(4-4)], $attributes); + protected function yyn14($attributes) { + $this->yyval = new PHPParser_Node_Stmt_Const($this->yyastk[$this->stackPos-(3-2)], $attributes); } - protected function reduceRule24($attributes) { - $this->semStack[$this->stackPos-(3-1)][] = $this->semStack[$this->stackPos-(3-3)]; $this->semValue = $this->semStack[$this->stackPos-(3-1)]; + protected function yyn15($attributes) { + $this->yyastk[$this->stackPos-(3-1)][] = $this->yyastk[$this->stackPos-(3-3)]; $this->yyval = $this->yyastk[$this->stackPos-(3-1)]; } - protected function reduceRule25($attributes) { - $this->semValue = array($this->semStack[$this->stackPos-(1-1)]); + protected function yyn16($attributes) { + $this->yyval = array($this->yyastk[$this->stackPos-(1-1)]); } - protected function reduceRule26($attributes) { - $this->semValue = new Node\Const_($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn17($attributes) { + $this->yyval = new PHPParser_Node_Stmt_UseUse(new PHPParser_Node_Name($this->yyastk[$this->stackPos-(1-1)], $attributes), null, $attributes); } - protected function reduceRule27($attributes) { - if (is_array($this->semStack[$this->stackPos-(2-2)])) { $this->semValue = array_merge($this->semStack[$this->stackPos-(2-1)], $this->semStack[$this->stackPos-(2-2)]); } else { $this->semStack[$this->stackPos-(2-1)][] = $this->semStack[$this->stackPos-(2-2)]; $this->semValue = $this->semStack[$this->stackPos-(2-1)]; }; + protected function yyn18($attributes) { + $this->yyval = new PHPParser_Node_Stmt_UseUse(new PHPParser_Node_Name($this->yyastk[$this->stackPos-(3-1)], $attributes), $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule28($attributes) { - $this->semValue = array(); + protected function yyn19($attributes) { + $this->yyval = new PHPParser_Node_Stmt_UseUse(new PHPParser_Node_Name($this->yyastk[$this->stackPos-(2-2)], $attributes), null, $attributes); } - protected function reduceRule29($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(1-1)]; + protected function yyn20($attributes) { + $this->yyval = new PHPParser_Node_Stmt_UseUse(new PHPParser_Node_Name($this->yyastk[$this->stackPos-(4-2)], $attributes), $this->yyastk[$this->stackPos-(4-4)], $attributes); } - protected function reduceRule30($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(1-1)]; + protected function yyn21($attributes) { + $this->yyastk[$this->stackPos-(3-1)][] = $this->yyastk[$this->stackPos-(3-3)]; $this->yyval = $this->yyastk[$this->stackPos-(3-1)]; } - protected function reduceRule31($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(1-1)]; + protected function yyn22($attributes) { + $this->yyval = array($this->yyastk[$this->stackPos-(1-1)]); } - protected function reduceRule32($attributes) { - throw new Error('__HALT_COMPILER() can only be used from the outermost scope'); + protected function yyn23($attributes) { + $this->yyval = new PHPParser_Node_Const($this->yyastk[$this->stackPos-(3-1)], $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule33($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(3-2)]; + protected function yyn24($attributes) { + if (is_array($this->yyastk[$this->stackPos-(2-2)])) { $this->yyval = array_merge($this->yyastk[$this->stackPos-(2-1)], $this->yyastk[$this->stackPos-(2-2)]); } else { $this->yyastk[$this->stackPos-(2-1)][] = $this->yyastk[$this->stackPos-(2-2)]; $this->yyval = $this->yyastk[$this->stackPos-(2-1)]; }; } - protected function reduceRule34($attributes) { - $this->semValue = new Node\Stmt\If_($this->semStack[$this->stackPos-(5-2)], array('stmts' => is_array($this->semStack[$this->stackPos-(5-3)]) ? $this->semStack[$this->stackPos-(5-3)] : array($this->semStack[$this->stackPos-(5-3)]), 'elseifs' => $this->semStack[$this->stackPos-(5-4)], 'else' => $this->semStack[$this->stackPos-(5-5)]), $attributes); + protected function yyn25($attributes) { + $this->yyval = array(); } - protected function reduceRule35($attributes) { - $this->semValue = new Node\Stmt\If_($this->semStack[$this->stackPos-(8-2)], array('stmts' => $this->semStack[$this->stackPos-(8-4)], 'elseifs' => $this->semStack[$this->stackPos-(8-5)], 'else' => $this->semStack[$this->stackPos-(8-6)]), $attributes); + protected function yyn26($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(1-1)]; } - protected function reduceRule36($attributes) { - $this->semValue = new Node\Stmt\While_($this->semStack[$this->stackPos-(3-2)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn27($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(1-1)]; } - protected function reduceRule37($attributes) { - $this->semValue = new Node\Stmt\Do_($this->semStack[$this->stackPos-(5-4)], is_array($this->semStack[$this->stackPos-(5-2)]) ? $this->semStack[$this->stackPos-(5-2)] : array($this->semStack[$this->stackPos-(5-2)]), $attributes); + protected function yyn28($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(1-1)]; } - protected function reduceRule38($attributes) { - $this->semValue = new Node\Stmt\For_(array('init' => $this->semStack[$this->stackPos-(9-3)], 'cond' => $this->semStack[$this->stackPos-(9-5)], 'loop' => $this->semStack[$this->stackPos-(9-7)], 'stmts' => $this->semStack[$this->stackPos-(9-9)]), $attributes); + protected function yyn29($attributes) { + throw new PHPParser_Error('__HALT_COMPILER() can only be used from the outermost scope'); } - protected function reduceRule39($attributes) { - $this->semValue = new Node\Stmt\Switch_($this->semStack[$this->stackPos-(3-2)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn30($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(3-2)]; } - protected function reduceRule40($attributes) { - $this->semValue = new Node\Stmt\Break_(null, $attributes); + protected function yyn31($attributes) { + $this->yyval = new PHPParser_Node_Stmt_If($this->yyastk[$this->stackPos-(5-2)], array('stmts' => is_array($this->yyastk[$this->stackPos-(5-3)]) ? $this->yyastk[$this->stackPos-(5-3)] : array($this->yyastk[$this->stackPos-(5-3)]), 'elseifs' => $this->yyastk[$this->stackPos-(5-4)], 'else' => $this->yyastk[$this->stackPos-(5-5)]), $attributes); } - protected function reduceRule41($attributes) { - $this->semValue = new Node\Stmt\Break_($this->semStack[$this->stackPos-(3-2)], $attributes); + protected function yyn32($attributes) { + $this->yyval = new PHPParser_Node_Stmt_If($this->yyastk[$this->stackPos-(8-2)], array('stmts' => $this->yyastk[$this->stackPos-(8-4)], 'elseifs' => $this->yyastk[$this->stackPos-(8-5)], 'else' => $this->yyastk[$this->stackPos-(8-6)]), $attributes); } - protected function reduceRule42($attributes) { - $this->semValue = new Node\Stmt\Continue_(null, $attributes); + protected function yyn33($attributes) { + $this->yyval = new PHPParser_Node_Stmt_While($this->yyastk[$this->stackPos-(3-2)], $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule43($attributes) { - $this->semValue = new Node\Stmt\Continue_($this->semStack[$this->stackPos-(3-2)], $attributes); + protected function yyn34($attributes) { + $this->yyval = new PHPParser_Node_Stmt_Do($this->yyastk[$this->stackPos-(5-4)], is_array($this->yyastk[$this->stackPos-(5-2)]) ? $this->yyastk[$this->stackPos-(5-2)] : array($this->yyastk[$this->stackPos-(5-2)]), $attributes); } - protected function reduceRule44($attributes) { - $this->semValue = new Node\Stmt\Return_(null, $attributes); + protected function yyn35($attributes) { + $this->yyval = new PHPParser_Node_Stmt_For(array('init' => $this->yyastk[$this->stackPos-(9-3)], 'cond' => $this->yyastk[$this->stackPos-(9-5)], 'loop' => $this->yyastk[$this->stackPos-(9-7)], 'stmts' => $this->yyastk[$this->stackPos-(9-9)]), $attributes); } - protected function reduceRule45($attributes) { - $this->semValue = new Node\Stmt\Return_($this->semStack[$this->stackPos-(3-2)], $attributes); + protected function yyn36($attributes) { + $this->yyval = new PHPParser_Node_Stmt_Switch($this->yyastk[$this->stackPos-(3-2)], $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule46($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(2-1)]; + protected function yyn37($attributes) { + $this->yyval = new PHPParser_Node_Stmt_Break(null, $attributes); } - protected function reduceRule47($attributes) { - $this->semValue = new Node\Stmt\Global_($this->semStack[$this->stackPos-(3-2)], $attributes); + protected function yyn38($attributes) { + $this->yyval = new PHPParser_Node_Stmt_Break($this->yyastk[$this->stackPos-(3-2)], $attributes); } - protected function reduceRule48($attributes) { - $this->semValue = new Node\Stmt\Static_($this->semStack[$this->stackPos-(3-2)], $attributes); + protected function yyn39($attributes) { + $this->yyval = new PHPParser_Node_Stmt_Continue(null, $attributes); } - protected function reduceRule49($attributes) { - $this->semValue = new Node\Stmt\Echo_($this->semStack[$this->stackPos-(3-2)], $attributes); + protected function yyn40($attributes) { + $this->yyval = new PHPParser_Node_Stmt_Continue($this->yyastk[$this->stackPos-(3-2)], $attributes); } - protected function reduceRule50($attributes) { - $this->semValue = new Node\Stmt\InlineHTML($this->semStack[$this->stackPos-(1-1)], $attributes); + protected function yyn41($attributes) { + $this->yyval = new PHPParser_Node_Stmt_Return(null, $attributes); } - protected function reduceRule51($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(2-1)]; + protected function yyn42($attributes) { + $this->yyval = new PHPParser_Node_Stmt_Return($this->yyastk[$this->stackPos-(3-2)], $attributes); } - protected function reduceRule52($attributes) { - $this->semValue = new Node\Stmt\Unset_($this->semStack[$this->stackPos-(5-3)], $attributes); + protected function yyn43($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(2-1)]; } - protected function reduceRule53($attributes) { - $this->semValue = new Node\Stmt\Foreach_($this->semStack[$this->stackPos-(7-3)], $this->semStack[$this->stackPos-(7-5)][0], array('keyVar' => null, 'byRef' => $this->semStack[$this->stackPos-(7-5)][1], 'stmts' => $this->semStack[$this->stackPos-(7-7)]), $attributes); + protected function yyn44($attributes) { + $this->yyval = new PHPParser_Node_Stmt_Global($this->yyastk[$this->stackPos-(3-2)], $attributes); } - protected function reduceRule54($attributes) { - $this->semValue = new Node\Stmt\Foreach_($this->semStack[$this->stackPos-(9-3)], $this->semStack[$this->stackPos-(9-7)][0], array('keyVar' => $this->semStack[$this->stackPos-(9-5)], 'byRef' => $this->semStack[$this->stackPos-(9-7)][1], 'stmts' => $this->semStack[$this->stackPos-(9-9)]), $attributes); + protected function yyn45($attributes) { + $this->yyval = new PHPParser_Node_Stmt_Static($this->yyastk[$this->stackPos-(3-2)], $attributes); } - protected function reduceRule55($attributes) { - $this->semValue = new Node\Stmt\Declare_($this->semStack[$this->stackPos-(5-3)], $this->semStack[$this->stackPos-(5-5)], $attributes); + protected function yyn46($attributes) { + $this->yyval = new PHPParser_Node_Stmt_Echo($this->yyastk[$this->stackPos-(3-2)], $attributes); } - protected function reduceRule56($attributes) { - $this->semValue = array(); /* means: no statement */ + protected function yyn47($attributes) { + $this->yyval = new PHPParser_Node_Stmt_InlineHTML($this->yyastk[$this->stackPos-(1-1)], $attributes); } - protected function reduceRule57($attributes) { - $this->semValue = new Node\Stmt\TryCatch($this->semStack[$this->stackPos-(6-3)], $this->semStack[$this->stackPos-(6-5)], $this->semStack[$this->stackPos-(6-6)], $attributes); + protected function yyn48($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(2-1)]; } - protected function reduceRule58($attributes) { - $this->semValue = new Node\Stmt\Throw_($this->semStack[$this->stackPos-(3-2)], $attributes); + protected function yyn49($attributes) { + $this->yyval = new PHPParser_Node_Stmt_Unset($this->yyastk[$this->stackPos-(5-3)], $attributes); } - protected function reduceRule59($attributes) { - $this->semValue = new Node\Stmt\Goto_($this->semStack[$this->stackPos-(3-2)], $attributes); + protected function yyn50($attributes) { + $this->yyval = new PHPParser_Node_Stmt_Foreach($this->yyastk[$this->stackPos-(7-3)], $this->yyastk[$this->stackPos-(7-5)][0], array('keyVar' => null, 'byRef' => $this->yyastk[$this->stackPos-(7-5)][1], 'stmts' => $this->yyastk[$this->stackPos-(7-7)]), $attributes); } - protected function reduceRule60($attributes) { - $this->semValue = new Node\Stmt\Label($this->semStack[$this->stackPos-(2-1)], $attributes); + protected function yyn51($attributes) { + $this->yyval = new PHPParser_Node_Stmt_Foreach($this->yyastk[$this->stackPos-(9-3)], $this->yyastk[$this->stackPos-(9-7)][0], array('keyVar' => $this->yyastk[$this->stackPos-(9-5)], 'byRef' => $this->yyastk[$this->stackPos-(9-7)][1], 'stmts' => $this->yyastk[$this->stackPos-(9-9)]), $attributes); } - protected function reduceRule61($attributes) { - $this->semValue = array(); + protected function yyn52($attributes) { + $this->yyval = new PHPParser_Node_Stmt_Declare($this->yyastk[$this->stackPos-(5-3)], $this->yyastk[$this->stackPos-(5-5)], $attributes); } - protected function reduceRule62($attributes) { - $this->semStack[$this->stackPos-(2-1)][] = $this->semStack[$this->stackPos-(2-2)]; $this->semValue = $this->semStack[$this->stackPos-(2-1)]; + protected function yyn53($attributes) { + $this->yyval = array(); /* means: no statement */ } - protected function reduceRule63($attributes) { - $this->semValue = new Node\Stmt\Catch_($this->semStack[$this->stackPos-(8-3)], substr($this->semStack[$this->stackPos-(8-4)], 1), $this->semStack[$this->stackPos-(8-7)], $attributes); + protected function yyn54($attributes) { + $this->yyval = new PHPParser_Node_Stmt_TryCatch($this->yyastk[$this->stackPos-(6-3)], $this->yyastk[$this->stackPos-(6-5)], $this->yyastk[$this->stackPos-(6-6)], $attributes); } - protected function reduceRule64($attributes) { - $this->semValue = null; + protected function yyn55($attributes) { + $this->yyval = new PHPParser_Node_Stmt_Throw($this->yyastk[$this->stackPos-(3-2)], $attributes); } - protected function reduceRule65($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(4-3)]; + protected function yyn56($attributes) { + $this->yyval = new PHPParser_Node_Stmt_Goto($this->yyastk[$this->stackPos-(3-2)], $attributes); } - protected function reduceRule66($attributes) { - $this->semValue = array($this->semStack[$this->stackPos-(1-1)]); + protected function yyn57($attributes) { + $this->yyval = new PHPParser_Node_Stmt_Label($this->yyastk[$this->stackPos-(2-1)], $attributes); } - protected function reduceRule67($attributes) { - $this->semStack[$this->stackPos-(3-1)][] = $this->semStack[$this->stackPos-(3-3)]; $this->semValue = $this->semStack[$this->stackPos-(3-1)]; + protected function yyn58($attributes) { + $this->yyval = array(); } - protected function reduceRule68($attributes) { - $this->semValue = false; + protected function yyn59($attributes) { + $this->yyastk[$this->stackPos-(2-1)][] = $this->yyastk[$this->stackPos-(2-2)]; $this->yyval = $this->yyastk[$this->stackPos-(2-1)]; } - protected function reduceRule69($attributes) { - $this->semValue = true; + protected function yyn60($attributes) { + $this->yyval = new PHPParser_Node_Stmt_Catch($this->yyastk[$this->stackPos-(8-3)], substr($this->yyastk[$this->stackPos-(8-4)], 1), $this->yyastk[$this->stackPos-(8-7)], $attributes); } - protected function reduceRule70($attributes) { - $this->semValue = false; + protected function yyn61($attributes) { + $this->yyval = null; } - protected function reduceRule71($attributes) { - $this->semValue = true; + protected function yyn62($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(4-3)]; } - protected function reduceRule72($attributes) { - $this->semValue = new Node\Stmt\Function_($this->semStack[$this->stackPos-(9-3)], array('byRef' => $this->semStack[$this->stackPos-(9-2)], 'params' => $this->semStack[$this->stackPos-(9-5)], 'stmts' => $this->semStack[$this->stackPos-(9-8)]), $attributes); + protected function yyn63($attributes) { + $this->yyval = array($this->yyastk[$this->stackPos-(1-1)]); } - protected function reduceRule73($attributes) { - $this->semValue = new Node\Stmt\Class_($this->semStack[$this->stackPos-(7-2)], array('type' => $this->semStack[$this->stackPos-(7-1)], 'extends' => $this->semStack[$this->stackPos-(7-3)], 'implements' => $this->semStack[$this->stackPos-(7-4)], 'stmts' => $this->semStack[$this->stackPos-(7-6)]), $attributes); + protected function yyn64($attributes) { + $this->yyastk[$this->stackPos-(3-1)][] = $this->yyastk[$this->stackPos-(3-3)]; $this->yyval = $this->yyastk[$this->stackPos-(3-1)]; } - protected function reduceRule74($attributes) { - $this->semValue = new Node\Stmt\Interface_($this->semStack[$this->stackPos-(6-2)], array('extends' => $this->semStack[$this->stackPos-(6-3)], 'stmts' => $this->semStack[$this->stackPos-(6-5)]), $attributes); + protected function yyn65($attributes) { + $this->yyval = false; } - protected function reduceRule75($attributes) { - $this->semValue = new Node\Stmt\Trait_($this->semStack[$this->stackPos-(5-2)], $this->semStack[$this->stackPos-(5-4)], $attributes); + protected function yyn66($attributes) { + $this->yyval = true; } - protected function reduceRule76($attributes) { - $this->semValue = 0; + protected function yyn67($attributes) { + $this->yyval = new PHPParser_Node_Stmt_Function($this->yyastk[$this->stackPos-(9-3)], array('byRef' => $this->yyastk[$this->stackPos-(9-2)], 'params' => $this->yyastk[$this->stackPos-(9-5)], 'stmts' => $this->yyastk[$this->stackPos-(9-8)]), $attributes); } - protected function reduceRule77($attributes) { - $this->semValue = Node\Stmt\Class_::MODIFIER_ABSTRACT; + protected function yyn68($attributes) { + $this->yyval = new PHPParser_Node_Stmt_Class($this->yyastk[$this->stackPos-(7-2)], array('type' => $this->yyastk[$this->stackPos-(7-1)], 'extends' => $this->yyastk[$this->stackPos-(7-3)], 'implements' => $this->yyastk[$this->stackPos-(7-4)], 'stmts' => $this->yyastk[$this->stackPos-(7-6)]), $attributes); } - protected function reduceRule78($attributes) { - $this->semValue = Node\Stmt\Class_::MODIFIER_FINAL; + protected function yyn69($attributes) { + $this->yyval = new PHPParser_Node_Stmt_Interface($this->yyastk[$this->stackPos-(6-2)], array('extends' => $this->yyastk[$this->stackPos-(6-3)], 'stmts' => $this->yyastk[$this->stackPos-(6-5)]), $attributes); } - protected function reduceRule79($attributes) { - $this->semValue = null; + protected function yyn70($attributes) { + $this->yyval = new PHPParser_Node_Stmt_Trait($this->yyastk[$this->stackPos-(5-2)], $this->yyastk[$this->stackPos-(5-4)], $attributes); } - protected function reduceRule80($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(2-2)]; + protected function yyn71($attributes) { + $this->yyval = 0; } - protected function reduceRule81($attributes) { - $this->semValue = array(); + protected function yyn72($attributes) { + $this->yyval = PHPParser_Node_Stmt_Class::MODIFIER_ABSTRACT; } - protected function reduceRule82($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(2-2)]; + protected function yyn73($attributes) { + $this->yyval = PHPParser_Node_Stmt_Class::MODIFIER_FINAL; } - protected function reduceRule83($attributes) { - $this->semValue = array(); + protected function yyn74($attributes) { + $this->yyval = null; } - protected function reduceRule84($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(2-2)]; + protected function yyn75($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(2-2)]; } - protected function reduceRule85($attributes) { - $this->semValue = array($this->semStack[$this->stackPos-(1-1)]); + protected function yyn76($attributes) { + $this->yyval = array(); } - protected function reduceRule86($attributes) { - $this->semStack[$this->stackPos-(3-1)][] = $this->semStack[$this->stackPos-(3-3)]; $this->semValue = $this->semStack[$this->stackPos-(3-1)]; + protected function yyn77($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(2-2)]; } - protected function reduceRule87($attributes) { - $this->semValue = is_array($this->semStack[$this->stackPos-(1-1)]) ? $this->semStack[$this->stackPos-(1-1)] : array($this->semStack[$this->stackPos-(1-1)]); + protected function yyn78($attributes) { + $this->yyval = array(); } - protected function reduceRule88($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(4-2)]; + protected function yyn79($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(2-2)]; } - protected function reduceRule89($attributes) { - $this->semValue = is_array($this->semStack[$this->stackPos-(1-1)]) ? $this->semStack[$this->stackPos-(1-1)] : array($this->semStack[$this->stackPos-(1-1)]); + protected function yyn80($attributes) { + $this->yyval = array($this->yyastk[$this->stackPos-(1-1)]); } - protected function reduceRule90($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(4-2)]; + protected function yyn81($attributes) { + $this->yyastk[$this->stackPos-(3-1)][] = $this->yyastk[$this->stackPos-(3-3)]; $this->yyval = $this->yyastk[$this->stackPos-(3-1)]; } - protected function reduceRule91($attributes) { - $this->semValue = is_array($this->semStack[$this->stackPos-(1-1)]) ? $this->semStack[$this->stackPos-(1-1)] : array($this->semStack[$this->stackPos-(1-1)]); + protected function yyn82($attributes) { + $this->yyval = is_array($this->yyastk[$this->stackPos-(1-1)]) ? $this->yyastk[$this->stackPos-(1-1)] : array($this->yyastk[$this->stackPos-(1-1)]); } - protected function reduceRule92($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(4-2)]; + protected function yyn83($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(4-2)]; } - protected function reduceRule93($attributes) { - $this->semValue = array($this->semStack[$this->stackPos-(1-1)]); + protected function yyn84($attributes) { + $this->yyval = is_array($this->yyastk[$this->stackPos-(1-1)]) ? $this->yyastk[$this->stackPos-(1-1)] : array($this->yyastk[$this->stackPos-(1-1)]); } - protected function reduceRule94($attributes) { - $this->semStack[$this->stackPos-(3-1)][] = $this->semStack[$this->stackPos-(3-3)]; $this->semValue = $this->semStack[$this->stackPos-(3-1)]; + protected function yyn85($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(4-2)]; } - protected function reduceRule95($attributes) { - $this->semValue = new Node\Stmt\DeclareDeclare($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn86($attributes) { + $this->yyval = is_array($this->yyastk[$this->stackPos-(1-1)]) ? $this->yyastk[$this->stackPos-(1-1)] : array($this->yyastk[$this->stackPos-(1-1)]); } - protected function reduceRule96($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(3-2)]; + protected function yyn87($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(4-2)]; } - protected function reduceRule97($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(4-3)]; + protected function yyn88($attributes) { + $this->yyval = array($this->yyastk[$this->stackPos-(1-1)]); } - protected function reduceRule98($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(4-2)]; + protected function yyn89($attributes) { + $this->yyastk[$this->stackPos-(3-1)][] = $this->yyastk[$this->stackPos-(3-3)]; $this->yyval = $this->yyastk[$this->stackPos-(3-1)]; } - protected function reduceRule99($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(5-3)]; + protected function yyn90($attributes) { + $this->yyval = new PHPParser_Node_Stmt_DeclareDeclare($this->yyastk[$this->stackPos-(3-1)], $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule100($attributes) { - $this->semValue = array(); + protected function yyn91($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(3-2)]; } - protected function reduceRule101($attributes) { - $this->semStack[$this->stackPos-(2-1)][] = $this->semStack[$this->stackPos-(2-2)]; $this->semValue = $this->semStack[$this->stackPos-(2-1)]; + protected function yyn92($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(4-3)]; } - protected function reduceRule102($attributes) { - $this->semValue = new Node\Stmt\Case_($this->semStack[$this->stackPos-(4-2)], $this->semStack[$this->stackPos-(4-4)], $attributes); + protected function yyn93($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(4-2)]; } - protected function reduceRule103($attributes) { - $this->semValue = new Node\Stmt\Case_(null, $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn94($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(5-3)]; } - protected function reduceRule104() { - $this->semValue = $this->semStack[$this->stackPos]; + protected function yyn95($attributes) { + $this->yyval = array(); } - protected function reduceRule105() { - $this->semValue = $this->semStack[$this->stackPos]; + protected function yyn96($attributes) { + $this->yyastk[$this->stackPos-(2-1)][] = $this->yyastk[$this->stackPos-(2-2)]; $this->yyval = $this->yyastk[$this->stackPos-(2-1)]; } - protected function reduceRule106($attributes) { - $this->semValue = is_array($this->semStack[$this->stackPos-(1-1)]) ? $this->semStack[$this->stackPos-(1-1)] : array($this->semStack[$this->stackPos-(1-1)]); + protected function yyn97($attributes) { + $this->yyval = new PHPParser_Node_Stmt_Case($this->yyastk[$this->stackPos-(4-2)], $this->yyastk[$this->stackPos-(4-4)], $attributes); } - protected function reduceRule107($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(4-2)]; + protected function yyn98($attributes) { + $this->yyval = new PHPParser_Node_Stmt_Case(null, $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule108($attributes) { - $this->semValue = array(); + protected function yyn99() { + $this->yyval = $this->yyastk[$this->stackPos]; } - protected function reduceRule109($attributes) { - $this->semStack[$this->stackPos-(2-1)][] = $this->semStack[$this->stackPos-(2-2)]; $this->semValue = $this->semStack[$this->stackPos-(2-1)]; + protected function yyn100() { + $this->yyval = $this->yyastk[$this->stackPos]; } - protected function reduceRule110($attributes) { - $this->semValue = new Node\Stmt\ElseIf_($this->semStack[$this->stackPos-(3-2)], is_array($this->semStack[$this->stackPos-(3-3)]) ? $this->semStack[$this->stackPos-(3-3)] : array($this->semStack[$this->stackPos-(3-3)]), $attributes); + protected function yyn101($attributes) { + $this->yyval = is_array($this->yyastk[$this->stackPos-(1-1)]) ? $this->yyastk[$this->stackPos-(1-1)] : array($this->yyastk[$this->stackPos-(1-1)]); } - protected function reduceRule111($attributes) { - $this->semValue = array(); + protected function yyn102($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(4-2)]; } - protected function reduceRule112($attributes) { - $this->semStack[$this->stackPos-(2-1)][] = $this->semStack[$this->stackPos-(2-2)]; $this->semValue = $this->semStack[$this->stackPos-(2-1)]; + protected function yyn103($attributes) { + $this->yyval = array(); } - protected function reduceRule113($attributes) { - $this->semValue = new Node\Stmt\ElseIf_($this->semStack[$this->stackPos-(4-2)], $this->semStack[$this->stackPos-(4-4)], $attributes); + protected function yyn104($attributes) { + $this->yyastk[$this->stackPos-(2-1)][] = $this->yyastk[$this->stackPos-(2-2)]; $this->yyval = $this->yyastk[$this->stackPos-(2-1)]; } - protected function reduceRule114($attributes) { - $this->semValue = null; + protected function yyn105($attributes) { + $this->yyval = new PHPParser_Node_Stmt_ElseIf($this->yyastk[$this->stackPos-(3-2)], is_array($this->yyastk[$this->stackPos-(3-3)]) ? $this->yyastk[$this->stackPos-(3-3)] : array($this->yyastk[$this->stackPos-(3-3)]), $attributes); } - protected function reduceRule115($attributes) { - $this->semValue = new Node\Stmt\Else_(is_array($this->semStack[$this->stackPos-(2-2)]) ? $this->semStack[$this->stackPos-(2-2)] : array($this->semStack[$this->stackPos-(2-2)]), $attributes); + protected function yyn106($attributes) { + $this->yyval = array(); } - protected function reduceRule116($attributes) { - $this->semValue = null; + protected function yyn107($attributes) { + $this->yyastk[$this->stackPos-(2-1)][] = $this->yyastk[$this->stackPos-(2-2)]; $this->yyval = $this->yyastk[$this->stackPos-(2-1)]; } - protected function reduceRule117($attributes) { - $this->semValue = new Node\Stmt\Else_($this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn108($attributes) { + $this->yyval = new PHPParser_Node_Stmt_ElseIf($this->yyastk[$this->stackPos-(4-2)], $this->yyastk[$this->stackPos-(4-4)], $attributes); } - protected function reduceRule118($attributes) { - $this->semValue = array($this->semStack[$this->stackPos-(1-1)], false); + protected function yyn109($attributes) { + $this->yyval = null; } - protected function reduceRule119($attributes) { - $this->semValue = array($this->semStack[$this->stackPos-(2-2)], true); + protected function yyn110($attributes) { + $this->yyval = new PHPParser_Node_Stmt_Else(is_array($this->yyastk[$this->stackPos-(2-2)]) ? $this->yyastk[$this->stackPos-(2-2)] : array($this->yyastk[$this->stackPos-(2-2)]), $attributes); } - protected function reduceRule120($attributes) { - $this->semValue = array($this->semStack[$this->stackPos-(1-1)], false); + protected function yyn111($attributes) { + $this->yyval = null; } - protected function reduceRule121($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(1-1)]; + protected function yyn112($attributes) { + $this->yyval = new PHPParser_Node_Stmt_Else($this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule122($attributes) { - $this->semValue = array(); + protected function yyn113($attributes) { + $this->yyval = array($this->yyastk[$this->stackPos-(1-1)], false); } - protected function reduceRule123($attributes) { - $this->semValue = array($this->semStack[$this->stackPos-(1-1)]); + protected function yyn114($attributes) { + $this->yyval = array($this->yyastk[$this->stackPos-(2-2)], true); } - protected function reduceRule124($attributes) { - $this->semStack[$this->stackPos-(3-1)][] = $this->semStack[$this->stackPos-(3-3)]; $this->semValue = $this->semStack[$this->stackPos-(3-1)]; + protected function yyn115($attributes) { + $this->yyval = array($this->yyastk[$this->stackPos-(1-1)], false); } - protected function reduceRule125($attributes) { - $this->semValue = new Node\Param(substr($this->semStack[$this->stackPos-(4-4)], 1), null, $this->semStack[$this->stackPos-(4-1)], $this->semStack[$this->stackPos-(4-2)], $this->semStack[$this->stackPos-(4-3)], $attributes); + protected function yyn116($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(1-1)]; } - protected function reduceRule126($attributes) { - $this->semValue = new Node\Param(substr($this->semStack[$this->stackPos-(6-4)], 1), $this->semStack[$this->stackPos-(6-6)], $this->semStack[$this->stackPos-(6-1)], $this->semStack[$this->stackPos-(6-2)], $this->semStack[$this->stackPos-(6-3)], $attributes); + protected function yyn117($attributes) { + $this->yyval = array(); } - protected function reduceRule127($attributes) { - $this->semValue = null; + protected function yyn118($attributes) { + $this->yyval = array($this->yyastk[$this->stackPos-(1-1)]); } - protected function reduceRule128($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(1-1)]; + protected function yyn119($attributes) { + $this->yyastk[$this->stackPos-(3-1)][] = $this->yyastk[$this->stackPos-(3-3)]; $this->yyval = $this->yyastk[$this->stackPos-(3-1)]; } - protected function reduceRule129($attributes) { - $this->semValue = 'array'; + protected function yyn120($attributes) { + $this->yyval = new PHPParser_Node_Param(substr($this->yyastk[$this->stackPos-(3-3)], 1), null, $this->yyastk[$this->stackPos-(3-1)], $this->yyastk[$this->stackPos-(3-2)], $attributes); } - protected function reduceRule130($attributes) { - $this->semValue = 'callable'; + protected function yyn121($attributes) { + $this->yyval = new PHPParser_Node_Param(substr($this->yyastk[$this->stackPos-(5-3)], 1), $this->yyastk[$this->stackPos-(5-5)], $this->yyastk[$this->stackPos-(5-1)], $this->yyastk[$this->stackPos-(5-2)], $attributes); } - protected function reduceRule131($attributes) { - $this->semValue = array(); + protected function yyn122($attributes) { + $this->yyval = null; } - protected function reduceRule132($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(3-2)]; + protected function yyn123($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(1-1)]; } - protected function reduceRule133($attributes) { - $this->semValue = array(new Node\Arg($this->semStack[$this->stackPos-(3-2)], false, false, $attributes)); + protected function yyn124($attributes) { + $this->yyval = 'array'; } - protected function reduceRule134($attributes) { - $this->semValue = array($this->semStack[$this->stackPos-(1-1)]); + protected function yyn125($attributes) { + $this->yyval = 'callable'; } - protected function reduceRule135($attributes) { - $this->semStack[$this->stackPos-(3-1)][] = $this->semStack[$this->stackPos-(3-3)]; $this->semValue = $this->semStack[$this->stackPos-(3-1)]; + protected function yyn126($attributes) { + $this->yyval = array(); } - protected function reduceRule136($attributes) { - $this->semValue = new Node\Arg($this->semStack[$this->stackPos-(1-1)], false, false, $attributes); + protected function yyn127($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(3-2)]; } - protected function reduceRule137($attributes) { - $this->semValue = new Node\Arg($this->semStack[$this->stackPos-(2-2)], true, false, $attributes); + protected function yyn128($attributes) { + $this->yyval = array(new PHPParser_Node_Arg($this->yyastk[$this->stackPos-(3-2)], false, $attributes)); } - protected function reduceRule138($attributes) { - $this->semValue = new Node\Arg($this->semStack[$this->stackPos-(2-2)], false, true, $attributes); + protected function yyn129($attributes) { + $this->yyval = array($this->yyastk[$this->stackPos-(1-1)]); } - protected function reduceRule139($attributes) { - $this->semStack[$this->stackPos-(3-1)][] = $this->semStack[$this->stackPos-(3-3)]; $this->semValue = $this->semStack[$this->stackPos-(3-1)]; + protected function yyn130($attributes) { + $this->yyastk[$this->stackPos-(3-1)][] = $this->yyastk[$this->stackPos-(3-3)]; $this->yyval = $this->yyastk[$this->stackPos-(3-1)]; } - protected function reduceRule140($attributes) { - $this->semValue = array($this->semStack[$this->stackPos-(1-1)]); + protected function yyn131($attributes) { + $this->yyval = new PHPParser_Node_Arg($this->yyastk[$this->stackPos-(1-1)], false, $attributes); } - protected function reduceRule141($attributes) { - $this->semValue = new Node\Expr\Variable(substr($this->semStack[$this->stackPos-(1-1)], 1), $attributes); + protected function yyn132($attributes) { + $this->yyval = new PHPParser_Node_Arg($this->yyastk[$this->stackPos-(2-2)], true, $attributes); } - protected function reduceRule142($attributes) { - $this->semValue = new Node\Expr\Variable($this->semStack[$this->stackPos-(2-2)], $attributes); + protected function yyn133($attributes) { + $this->yyastk[$this->stackPos-(3-1)][] = $this->yyastk[$this->stackPos-(3-3)]; $this->yyval = $this->yyastk[$this->stackPos-(3-1)]; } - protected function reduceRule143($attributes) { - $this->semValue = new Node\Expr\Variable($this->semStack[$this->stackPos-(4-3)], $attributes); + protected function yyn134($attributes) { + $this->yyval = array($this->yyastk[$this->stackPos-(1-1)]); } - protected function reduceRule144($attributes) { - $this->semStack[$this->stackPos-(3-1)][] = $this->semStack[$this->stackPos-(3-3)]; $this->semValue = $this->semStack[$this->stackPos-(3-1)]; + protected function yyn135($attributes) { + $this->yyval = new PHPParser_Node_Expr_Variable(substr($this->yyastk[$this->stackPos-(1-1)], 1), $attributes); } - protected function reduceRule145($attributes) { - $this->semValue = array($this->semStack[$this->stackPos-(1-1)]); + protected function yyn136($attributes) { + $this->yyval = new PHPParser_Node_Expr_Variable($this->yyastk[$this->stackPos-(2-2)], $attributes); } - protected function reduceRule146($attributes) { - $this->semValue = new Node\Stmt\StaticVar(substr($this->semStack[$this->stackPos-(1-1)], 1), null, $attributes); + protected function yyn137($attributes) { + $this->yyval = new PHPParser_Node_Expr_Variable($this->yyastk[$this->stackPos-(4-3)], $attributes); } - protected function reduceRule147($attributes) { - $this->semValue = new Node\Stmt\StaticVar(substr($this->semStack[$this->stackPos-(3-1)], 1), $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn138($attributes) { + $this->yyastk[$this->stackPos-(3-1)][] = $this->yyastk[$this->stackPos-(3-3)]; $this->yyval = $this->yyastk[$this->stackPos-(3-1)]; } - protected function reduceRule148($attributes) { - $this->semStack[$this->stackPos-(2-1)][] = $this->semStack[$this->stackPos-(2-2)]; $this->semValue = $this->semStack[$this->stackPos-(2-1)]; + protected function yyn139($attributes) { + $this->yyval = array($this->yyastk[$this->stackPos-(1-1)]); } - protected function reduceRule149($attributes) { - $this->semValue = array(); + protected function yyn140($attributes) { + $this->yyval = new PHPParser_Node_Stmt_StaticVar(substr($this->yyastk[$this->stackPos-(1-1)], 1), null, $attributes); } - protected function reduceRule150($attributes) { - $this->semValue = new Node\Stmt\Property($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-2)], $attributes); + protected function yyn141($attributes) { + $this->yyval = new PHPParser_Node_Stmt_StaticVar(substr($this->yyastk[$this->stackPos-(3-1)], 1), $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule151($attributes) { - $this->semValue = new Node\Stmt\ClassConst($this->semStack[$this->stackPos-(3-2)], $attributes); + protected function yyn142($attributes) { + $this->yyastk[$this->stackPos-(2-1)][] = $this->yyastk[$this->stackPos-(2-2)]; $this->yyval = $this->yyastk[$this->stackPos-(2-1)]; } - protected function reduceRule152($attributes) { - $this->semValue = new Node\Stmt\ClassMethod($this->semStack[$this->stackPos-(8-4)], array('type' => $this->semStack[$this->stackPos-(8-1)], 'byRef' => $this->semStack[$this->stackPos-(8-3)], 'params' => $this->semStack[$this->stackPos-(8-6)], 'stmts' => $this->semStack[$this->stackPos-(8-8)]), $attributes); + protected function yyn143($attributes) { + $this->yyval = array(); } - protected function reduceRule153($attributes) { - $this->semValue = new Node\Stmt\TraitUse($this->semStack[$this->stackPos-(3-2)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn144($attributes) { + $this->yyval = new PHPParser_Node_Stmt_Property($this->yyastk[$this->stackPos-(3-1)], $this->yyastk[$this->stackPos-(3-2)], $attributes); } - protected function reduceRule154($attributes) { - $this->semValue = array(); + protected function yyn145($attributes) { + $this->yyval = new PHPParser_Node_Stmt_ClassConst($this->yyastk[$this->stackPos-(3-2)], $attributes); } - protected function reduceRule155($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(3-2)]; + protected function yyn146($attributes) { + $this->yyval = new PHPParser_Node_Stmt_ClassMethod($this->yyastk[$this->stackPos-(8-4)], array('type' => $this->yyastk[$this->stackPos-(8-1)], 'byRef' => $this->yyastk[$this->stackPos-(8-3)], 'params' => $this->yyastk[$this->stackPos-(8-6)], 'stmts' => $this->yyastk[$this->stackPos-(8-8)]), $attributes); } - protected function reduceRule156($attributes) { - $this->semValue = array(); + protected function yyn147($attributes) { + $this->yyval = new PHPParser_Node_Stmt_TraitUse($this->yyastk[$this->stackPos-(3-2)], $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule157($attributes) { - $this->semStack[$this->stackPos-(2-1)][] = $this->semStack[$this->stackPos-(2-2)]; $this->semValue = $this->semStack[$this->stackPos-(2-1)]; + protected function yyn148($attributes) { + $this->yyval = array(); } - protected function reduceRule158($attributes) { - $this->semValue = new Node\Stmt\TraitUseAdaptation\Precedence($this->semStack[$this->stackPos-(4-1)][0], $this->semStack[$this->stackPos-(4-1)][1], $this->semStack[$this->stackPos-(4-3)], $attributes); + protected function yyn149($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(3-2)]; } - protected function reduceRule159($attributes) { - $this->semValue = new Node\Stmt\TraitUseAdaptation\Alias($this->semStack[$this->stackPos-(5-1)][0], $this->semStack[$this->stackPos-(5-1)][1], $this->semStack[$this->stackPos-(5-3)], $this->semStack[$this->stackPos-(5-4)], $attributes); + protected function yyn150($attributes) { + $this->yyval = array(); } - protected function reduceRule160($attributes) { - $this->semValue = new Node\Stmt\TraitUseAdaptation\Alias($this->semStack[$this->stackPos-(4-1)][0], $this->semStack[$this->stackPos-(4-1)][1], $this->semStack[$this->stackPos-(4-3)], null, $attributes); + protected function yyn151($attributes) { + $this->yyastk[$this->stackPos-(2-1)][] = $this->yyastk[$this->stackPos-(2-2)]; $this->yyval = $this->yyastk[$this->stackPos-(2-1)]; } - protected function reduceRule161($attributes) { - $this->semValue = new Node\Stmt\TraitUseAdaptation\Alias($this->semStack[$this->stackPos-(4-1)][0], $this->semStack[$this->stackPos-(4-1)][1], null, $this->semStack[$this->stackPos-(4-3)], $attributes); + protected function yyn152($attributes) { + $this->yyval = new PHPParser_Node_Stmt_TraitUseAdaptation_Precedence($this->yyastk[$this->stackPos-(4-1)][0], $this->yyastk[$this->stackPos-(4-1)][1], $this->yyastk[$this->stackPos-(4-3)], $attributes); } - protected function reduceRule162($attributes) { - $this->semValue = array($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)]); + protected function yyn153($attributes) { + $this->yyval = new PHPParser_Node_Stmt_TraitUseAdaptation_Alias($this->yyastk[$this->stackPos-(5-1)][0], $this->yyastk[$this->stackPos-(5-1)][1], $this->yyastk[$this->stackPos-(5-3)], $this->yyastk[$this->stackPos-(5-4)], $attributes); } - protected function reduceRule163($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(1-1)]; + protected function yyn154($attributes) { + $this->yyval = new PHPParser_Node_Stmt_TraitUseAdaptation_Alias($this->yyastk[$this->stackPos-(4-1)][0], $this->yyastk[$this->stackPos-(4-1)][1], $this->yyastk[$this->stackPos-(4-3)], null, $attributes); } - protected function reduceRule164($attributes) { - $this->semValue = array(null, $this->semStack[$this->stackPos-(1-1)]); + protected function yyn155($attributes) { + $this->yyval = new PHPParser_Node_Stmt_TraitUseAdaptation_Alias($this->yyastk[$this->stackPos-(4-1)][0], $this->yyastk[$this->stackPos-(4-1)][1], null, $this->yyastk[$this->stackPos-(4-3)], $attributes); } - protected function reduceRule165($attributes) { - $this->semValue = null; + protected function yyn156($attributes) { + $this->yyval = array($this->yyastk[$this->stackPos-(3-1)], $this->yyastk[$this->stackPos-(3-3)]); } - protected function reduceRule166($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(3-2)]; + protected function yyn157($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(1-1)]; } - protected function reduceRule167($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(1-1)]; + protected function yyn158($attributes) { + $this->yyval = array(null, $this->yyastk[$this->stackPos-(1-1)]); } - protected function reduceRule168($attributes) { - $this->semValue = Node\Stmt\Class_::MODIFIER_PUBLIC; + protected function yyn159($attributes) { + $this->yyval = null; } - protected function reduceRule169($attributes) { - $this->semValue = Node\Stmt\Class_::MODIFIER_PUBLIC; + protected function yyn160($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(3-2)]; } - protected function reduceRule170($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(1-1)]; + protected function yyn161($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(1-1)]; } - protected function reduceRule171($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(1-1)]; + protected function yyn162($attributes) { + $this->yyval = PHPParser_Node_Stmt_Class::MODIFIER_PUBLIC; } - protected function reduceRule172($attributes) { - Node\Stmt\Class_::verifyModifier($this->semStack[$this->stackPos-(2-1)], $this->semStack[$this->stackPos-(2-2)]); $this->semValue = $this->semStack[$this->stackPos-(2-1)] | $this->semStack[$this->stackPos-(2-2)]; + protected function yyn163($attributes) { + $this->yyval = PHPParser_Node_Stmt_Class::MODIFIER_PUBLIC; } - protected function reduceRule173($attributes) { - $this->semValue = Node\Stmt\Class_::MODIFIER_PUBLIC; + protected function yyn164($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(1-1)]; } - protected function reduceRule174($attributes) { - $this->semValue = Node\Stmt\Class_::MODIFIER_PROTECTED; + protected function yyn165($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(1-1)]; } - protected function reduceRule175($attributes) { - $this->semValue = Node\Stmt\Class_::MODIFIER_PRIVATE; + protected function yyn166($attributes) { + PHPParser_Node_Stmt_Class::verifyModifier($this->yyastk[$this->stackPos-(2-1)], $this->yyastk[$this->stackPos-(2-2)]); $this->yyval = $this->yyastk[$this->stackPos-(2-1)] | $this->yyastk[$this->stackPos-(2-2)]; } - protected function reduceRule176($attributes) { - $this->semValue = Node\Stmt\Class_::MODIFIER_STATIC; + protected function yyn167($attributes) { + $this->yyval = PHPParser_Node_Stmt_Class::MODIFIER_PUBLIC; } - protected function reduceRule177($attributes) { - $this->semValue = Node\Stmt\Class_::MODIFIER_ABSTRACT; + protected function yyn168($attributes) { + $this->yyval = PHPParser_Node_Stmt_Class::MODIFIER_PROTECTED; } - protected function reduceRule178($attributes) { - $this->semValue = Node\Stmt\Class_::MODIFIER_FINAL; + protected function yyn169($attributes) { + $this->yyval = PHPParser_Node_Stmt_Class::MODIFIER_PRIVATE; } - protected function reduceRule179($attributes) { - $this->semValue = array($this->semStack[$this->stackPos-(1-1)]); + protected function yyn170($attributes) { + $this->yyval = PHPParser_Node_Stmt_Class::MODIFIER_STATIC; } - protected function reduceRule180($attributes) { - $this->semStack[$this->stackPos-(3-1)][] = $this->semStack[$this->stackPos-(3-3)]; $this->semValue = $this->semStack[$this->stackPos-(3-1)]; + protected function yyn171($attributes) { + $this->yyval = PHPParser_Node_Stmt_Class::MODIFIER_ABSTRACT; } - protected function reduceRule181($attributes) { - $this->semValue = new Node\Stmt\PropertyProperty(substr($this->semStack[$this->stackPos-(1-1)], 1), null, $attributes); + protected function yyn172($attributes) { + $this->yyval = PHPParser_Node_Stmt_Class::MODIFIER_FINAL; } - protected function reduceRule182($attributes) { - $this->semValue = new Node\Stmt\PropertyProperty(substr($this->semStack[$this->stackPos-(3-1)], 1), $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn173($attributes) { + $this->yyval = array($this->yyastk[$this->stackPos-(1-1)]); } - protected function reduceRule183($attributes) { - $this->semStack[$this->stackPos-(3-1)][] = $this->semStack[$this->stackPos-(3-3)]; $this->semValue = $this->semStack[$this->stackPos-(3-1)]; + protected function yyn174($attributes) { + $this->yyastk[$this->stackPos-(3-1)][] = $this->yyastk[$this->stackPos-(3-3)]; $this->yyval = $this->yyastk[$this->stackPos-(3-1)]; } - protected function reduceRule184($attributes) { - $this->semValue = array($this->semStack[$this->stackPos-(1-1)]); + protected function yyn175($attributes) { + $this->yyval = new PHPParser_Node_Stmt_PropertyProperty(substr($this->yyastk[$this->stackPos-(1-1)], 1), null, $attributes); } - protected function reduceRule185($attributes) { - $this->semValue = array(); + protected function yyn176($attributes) { + $this->yyval = new PHPParser_Node_Stmt_PropertyProperty(substr($this->yyastk[$this->stackPos-(3-1)], 1), $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule186($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(1-1)]; + protected function yyn177($attributes) { + $this->yyastk[$this->stackPos-(3-1)][] = $this->yyastk[$this->stackPos-(3-3)]; $this->yyval = $this->yyastk[$this->stackPos-(3-1)]; } - protected function reduceRule187($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(1-1)]; + protected function yyn178($attributes) { + $this->yyval = array($this->yyastk[$this->stackPos-(1-1)]); } - protected function reduceRule188($attributes) { - $this->semValue = new Node\Expr\Assign($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn179($attributes) { + $this->yyval = array(); } - protected function reduceRule189($attributes) { - $this->semValue = new Node\Expr\Assign($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn180($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(1-1)]; } - protected function reduceRule190($attributes) { - $this->semValue = new Node\Expr\AssignRef($this->semStack[$this->stackPos-(4-1)], $this->semStack[$this->stackPos-(4-4)], $attributes); + protected function yyn181($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(1-1)]; } - protected function reduceRule191($attributes) { - $this->semValue = new Node\Expr\AssignRef($this->semStack[$this->stackPos-(4-1)], $this->semStack[$this->stackPos-(4-4)], $attributes); + protected function yyn182($attributes) { + $this->yyval = new PHPParser_Node_Expr_Assign($this->yyastk[$this->stackPos-(3-1)], $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule192($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(1-1)]; + protected function yyn183($attributes) { + $this->yyval = new PHPParser_Node_Expr_Assign($this->yyastk[$this->stackPos-(3-1)], $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule193($attributes) { - $this->semValue = new Node\Expr\Clone_($this->semStack[$this->stackPos-(2-2)], $attributes); + protected function yyn184($attributes) { + $this->yyval = new PHPParser_Node_Expr_AssignRef($this->yyastk[$this->stackPos-(4-1)], $this->yyastk[$this->stackPos-(4-4)], $attributes); } - protected function reduceRule194($attributes) { - $this->semValue = new Node\Expr\AssignOp\Plus($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn185($attributes) { + $this->yyval = new PHPParser_Node_Expr_AssignRef($this->yyastk[$this->stackPos-(4-1)], $this->yyastk[$this->stackPos-(4-4)], $attributes); } - protected function reduceRule195($attributes) { - $this->semValue = new Node\Expr\AssignOp\Minus($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn186($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(1-1)]; } - protected function reduceRule196($attributes) { - $this->semValue = new Node\Expr\AssignOp\Mul($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn187($attributes) { + $this->yyval = new PHPParser_Node_Expr_Clone($this->yyastk[$this->stackPos-(2-2)], $attributes); } - protected function reduceRule197($attributes) { - $this->semValue = new Node\Expr\AssignOp\Div($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn188($attributes) { + $this->yyval = new PHPParser_Node_Expr_AssignPlus($this->yyastk[$this->stackPos-(3-1)], $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule198($attributes) { - $this->semValue = new Node\Expr\AssignOp\Concat($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn189($attributes) { + $this->yyval = new PHPParser_Node_Expr_AssignMinus($this->yyastk[$this->stackPos-(3-1)], $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule199($attributes) { - $this->semValue = new Node\Expr\AssignOp\Mod($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn190($attributes) { + $this->yyval = new PHPParser_Node_Expr_AssignMul($this->yyastk[$this->stackPos-(3-1)], $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule200($attributes) { - $this->semValue = new Node\Expr\AssignOp\BitwiseAnd($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn191($attributes) { + $this->yyval = new PHPParser_Node_Expr_AssignDiv($this->yyastk[$this->stackPos-(3-1)], $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule201($attributes) { - $this->semValue = new Node\Expr\AssignOp\BitwiseOr($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn192($attributes) { + $this->yyval = new PHPParser_Node_Expr_AssignConcat($this->yyastk[$this->stackPos-(3-1)], $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule202($attributes) { - $this->semValue = new Node\Expr\AssignOp\BitwiseXor($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn193($attributes) { + $this->yyval = new PHPParser_Node_Expr_AssignMod($this->yyastk[$this->stackPos-(3-1)], $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule203($attributes) { - $this->semValue = new Node\Expr\AssignOp\ShiftLeft($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn194($attributes) { + $this->yyval = new PHPParser_Node_Expr_AssignBitwiseAnd($this->yyastk[$this->stackPos-(3-1)], $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule204($attributes) { - $this->semValue = new Node\Expr\AssignOp\ShiftRight($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn195($attributes) { + $this->yyval = new PHPParser_Node_Expr_AssignBitwiseOr($this->yyastk[$this->stackPos-(3-1)], $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule205($attributes) { - $this->semValue = new Node\Expr\AssignOp\Pow($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn196($attributes) { + $this->yyval = new PHPParser_Node_Expr_AssignBitwiseXor($this->yyastk[$this->stackPos-(3-1)], $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule206($attributes) { - $this->semValue = new Node\Expr\PostInc($this->semStack[$this->stackPos-(2-1)], $attributes); + protected function yyn197($attributes) { + $this->yyval = new PHPParser_Node_Expr_AssignShiftLeft($this->yyastk[$this->stackPos-(3-1)], $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule207($attributes) { - $this->semValue = new Node\Expr\PreInc($this->semStack[$this->stackPos-(2-2)], $attributes); + protected function yyn198($attributes) { + $this->yyval = new PHPParser_Node_Expr_AssignShiftRight($this->yyastk[$this->stackPos-(3-1)], $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule208($attributes) { - $this->semValue = new Node\Expr\PostDec($this->semStack[$this->stackPos-(2-1)], $attributes); + protected function yyn199($attributes) { + $this->yyval = new PHPParser_Node_Expr_PostInc($this->yyastk[$this->stackPos-(2-1)], $attributes); } - protected function reduceRule209($attributes) { - $this->semValue = new Node\Expr\PreDec($this->semStack[$this->stackPos-(2-2)], $attributes); + protected function yyn200($attributes) { + $this->yyval = new PHPParser_Node_Expr_PreInc($this->yyastk[$this->stackPos-(2-2)], $attributes); } - protected function reduceRule210($attributes) { - $this->semValue = new Node\Expr\BinaryOp\BooleanOr($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn201($attributes) { + $this->yyval = new PHPParser_Node_Expr_PostDec($this->yyastk[$this->stackPos-(2-1)], $attributes); } - protected function reduceRule211($attributes) { - $this->semValue = new Node\Expr\BinaryOp\BooleanAnd($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn202($attributes) { + $this->yyval = new PHPParser_Node_Expr_PreDec($this->yyastk[$this->stackPos-(2-2)], $attributes); } - protected function reduceRule212($attributes) { - $this->semValue = new Node\Expr\BinaryOp\LogicalOr($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn203($attributes) { + $this->yyval = new PHPParser_Node_Expr_BooleanOr($this->yyastk[$this->stackPos-(3-1)], $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule213($attributes) { - $this->semValue = new Node\Expr\BinaryOp\LogicalAnd($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn204($attributes) { + $this->yyval = new PHPParser_Node_Expr_BooleanAnd($this->yyastk[$this->stackPos-(3-1)], $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule214($attributes) { - $this->semValue = new Node\Expr\BinaryOp\LogicalXor($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn205($attributes) { + $this->yyval = new PHPParser_Node_Expr_LogicalOr($this->yyastk[$this->stackPos-(3-1)], $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule215($attributes) { - $this->semValue = new Node\Expr\BinaryOp\BitwiseOr($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn206($attributes) { + $this->yyval = new PHPParser_Node_Expr_LogicalAnd($this->yyastk[$this->stackPos-(3-1)], $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule216($attributes) { - $this->semValue = new Node\Expr\BinaryOp\BitwiseAnd($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn207($attributes) { + $this->yyval = new PHPParser_Node_Expr_LogicalXor($this->yyastk[$this->stackPos-(3-1)], $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule217($attributes) { - $this->semValue = new Node\Expr\BinaryOp\BitwiseXor($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn208($attributes) { + $this->yyval = new PHPParser_Node_Expr_BitwiseOr($this->yyastk[$this->stackPos-(3-1)], $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule218($attributes) { - $this->semValue = new Node\Expr\BinaryOp\Concat($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn209($attributes) { + $this->yyval = new PHPParser_Node_Expr_BitwiseAnd($this->yyastk[$this->stackPos-(3-1)], $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule219($attributes) { - $this->semValue = new Node\Expr\BinaryOp\Plus($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn210($attributes) { + $this->yyval = new PHPParser_Node_Expr_BitwiseXor($this->yyastk[$this->stackPos-(3-1)], $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule220($attributes) { - $this->semValue = new Node\Expr\BinaryOp\Minus($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn211($attributes) { + $this->yyval = new PHPParser_Node_Expr_Concat($this->yyastk[$this->stackPos-(3-1)], $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule221($attributes) { - $this->semValue = new Node\Expr\BinaryOp\Mul($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn212($attributes) { + $this->yyval = new PHPParser_Node_Expr_Plus($this->yyastk[$this->stackPos-(3-1)], $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule222($attributes) { - $this->semValue = new Node\Expr\BinaryOp\Div($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn213($attributes) { + $this->yyval = new PHPParser_Node_Expr_Minus($this->yyastk[$this->stackPos-(3-1)], $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule223($attributes) { - $this->semValue = new Node\Expr\BinaryOp\Mod($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn214($attributes) { + $this->yyval = new PHPParser_Node_Expr_Mul($this->yyastk[$this->stackPos-(3-1)], $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule224($attributes) { - $this->semValue = new Node\Expr\BinaryOp\ShiftLeft($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn215($attributes) { + $this->yyval = new PHPParser_Node_Expr_Div($this->yyastk[$this->stackPos-(3-1)], $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule225($attributes) { - $this->semValue = new Node\Expr\BinaryOp\ShiftRight($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn216($attributes) { + $this->yyval = new PHPParser_Node_Expr_Mod($this->yyastk[$this->stackPos-(3-1)], $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule226($attributes) { - $this->semValue = new Node\Expr\BinaryOp\Pow($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn217($attributes) { + $this->yyval = new PHPParser_Node_Expr_ShiftLeft($this->yyastk[$this->stackPos-(3-1)], $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule227($attributes) { - $this->semValue = new Node\Expr\UnaryPlus($this->semStack[$this->stackPos-(2-2)], $attributes); + protected function yyn218($attributes) { + $this->yyval = new PHPParser_Node_Expr_ShiftRight($this->yyastk[$this->stackPos-(3-1)], $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule228($attributes) { - $this->semValue = new Node\Expr\UnaryMinus($this->semStack[$this->stackPos-(2-2)], $attributes); + protected function yyn219($attributes) { + $this->yyval = new PHPParser_Node_Expr_UnaryPlus($this->yyastk[$this->stackPos-(2-2)], $attributes); } - protected function reduceRule229($attributes) { - $this->semValue = new Node\Expr\BooleanNot($this->semStack[$this->stackPos-(2-2)], $attributes); + protected function yyn220($attributes) { + $this->yyval = new PHPParser_Node_Expr_UnaryMinus($this->yyastk[$this->stackPos-(2-2)], $attributes); } - protected function reduceRule230($attributes) { - $this->semValue = new Node\Expr\BitwiseNot($this->semStack[$this->stackPos-(2-2)], $attributes); + protected function yyn221($attributes) { + $this->yyval = new PHPParser_Node_Expr_BooleanNot($this->yyastk[$this->stackPos-(2-2)], $attributes); } - protected function reduceRule231($attributes) { - $this->semValue = new Node\Expr\BinaryOp\Identical($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn222($attributes) { + $this->yyval = new PHPParser_Node_Expr_BitwiseNot($this->yyastk[$this->stackPos-(2-2)], $attributes); } - protected function reduceRule232($attributes) { - $this->semValue = new Node\Expr\BinaryOp\NotIdentical($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn223($attributes) { + $this->yyval = new PHPParser_Node_Expr_Identical($this->yyastk[$this->stackPos-(3-1)], $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule233($attributes) { - $this->semValue = new Node\Expr\BinaryOp\Equal($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn224($attributes) { + $this->yyval = new PHPParser_Node_Expr_NotIdentical($this->yyastk[$this->stackPos-(3-1)], $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule234($attributes) { - $this->semValue = new Node\Expr\BinaryOp\NotEqual($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn225($attributes) { + $this->yyval = new PHPParser_Node_Expr_Equal($this->yyastk[$this->stackPos-(3-1)], $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule235($attributes) { - $this->semValue = new Node\Expr\BinaryOp\Smaller($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn226($attributes) { + $this->yyval = new PHPParser_Node_Expr_NotEqual($this->yyastk[$this->stackPos-(3-1)], $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule236($attributes) { - $this->semValue = new Node\Expr\BinaryOp\SmallerOrEqual($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn227($attributes) { + $this->yyval = new PHPParser_Node_Expr_Smaller($this->yyastk[$this->stackPos-(3-1)], $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule237($attributes) { - $this->semValue = new Node\Expr\BinaryOp\Greater($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn228($attributes) { + $this->yyval = new PHPParser_Node_Expr_SmallerOrEqual($this->yyastk[$this->stackPos-(3-1)], $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule238($attributes) { - $this->semValue = new Node\Expr\BinaryOp\GreaterOrEqual($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn229($attributes) { + $this->yyval = new PHPParser_Node_Expr_Greater($this->yyastk[$this->stackPos-(3-1)], $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule239($attributes) { - $this->semValue = new Node\Expr\Instanceof_($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn230($attributes) { + $this->yyval = new PHPParser_Node_Expr_GreaterOrEqual($this->yyastk[$this->stackPos-(3-1)], $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule240($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(1-1)]; + protected function yyn231($attributes) { + $this->yyval = new PHPParser_Node_Expr_Instanceof($this->yyastk[$this->stackPos-(3-1)], $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule241($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(3-2)]; + protected function yyn232($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(1-1)]; } - protected function reduceRule242($attributes) { - $this->semValue = new Node\Expr\Ternary($this->semStack[$this->stackPos-(5-1)], $this->semStack[$this->stackPos-(5-3)], $this->semStack[$this->stackPos-(5-5)], $attributes); + protected function yyn233($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(3-2)]; } - protected function reduceRule243($attributes) { - $this->semValue = new Node\Expr\Ternary($this->semStack[$this->stackPos-(4-1)], null, $this->semStack[$this->stackPos-(4-4)], $attributes); + protected function yyn234($attributes) { + $this->yyval = new PHPParser_Node_Expr_Ternary($this->yyastk[$this->stackPos-(5-1)], $this->yyastk[$this->stackPos-(5-3)], $this->yyastk[$this->stackPos-(5-5)], $attributes); } - protected function reduceRule244($attributes) { - $this->semValue = new Node\Expr\Isset_($this->semStack[$this->stackPos-(4-3)], $attributes); + protected function yyn235($attributes) { + $this->yyval = new PHPParser_Node_Expr_Ternary($this->yyastk[$this->stackPos-(4-1)], null, $this->yyastk[$this->stackPos-(4-4)], $attributes); } - protected function reduceRule245($attributes) { - $this->semValue = new Node\Expr\Empty_($this->semStack[$this->stackPos-(4-3)], $attributes); + protected function yyn236($attributes) { + $this->yyval = new PHPParser_Node_Expr_Isset($this->yyastk[$this->stackPos-(4-3)], $attributes); } - protected function reduceRule246($attributes) { - $this->semValue = new Node\Expr\Include_($this->semStack[$this->stackPos-(2-2)], Node\Expr\Include_::TYPE_INCLUDE, $attributes); + protected function yyn237($attributes) { + $this->yyval = new PHPParser_Node_Expr_Empty($this->yyastk[$this->stackPos-(4-3)], $attributes); } - protected function reduceRule247($attributes) { - $this->semValue = new Node\Expr\Include_($this->semStack[$this->stackPos-(2-2)], Node\Expr\Include_::TYPE_INCLUDE_ONCE, $attributes); + protected function yyn238($attributes) { + $this->yyval = new PHPParser_Node_Expr_Include($this->yyastk[$this->stackPos-(2-2)], PHPParser_Node_Expr_Include::TYPE_INCLUDE, $attributes); } - protected function reduceRule248($attributes) { - $this->semValue = new Node\Expr\Eval_($this->semStack[$this->stackPos-(2-2)], $attributes); + protected function yyn239($attributes) { + $this->yyval = new PHPParser_Node_Expr_Include($this->yyastk[$this->stackPos-(2-2)], PHPParser_Node_Expr_Include::TYPE_INCLUDE_ONCE, $attributes); } - protected function reduceRule249($attributes) { - $this->semValue = new Node\Expr\Include_($this->semStack[$this->stackPos-(2-2)], Node\Expr\Include_::TYPE_REQUIRE, $attributes); + protected function yyn240($attributes) { + $this->yyval = new PHPParser_Node_Expr_Eval($this->yyastk[$this->stackPos-(2-2)], $attributes); } - protected function reduceRule250($attributes) { - $this->semValue = new Node\Expr\Include_($this->semStack[$this->stackPos-(2-2)], Node\Expr\Include_::TYPE_REQUIRE_ONCE, $attributes); + protected function yyn241($attributes) { + $this->yyval = new PHPParser_Node_Expr_Include($this->yyastk[$this->stackPos-(2-2)], PHPParser_Node_Expr_Include::TYPE_REQUIRE, $attributes); } - protected function reduceRule251($attributes) { - $this->semValue = new Node\Expr\Cast\Int($this->semStack[$this->stackPos-(2-2)], $attributes); + protected function yyn242($attributes) { + $this->yyval = new PHPParser_Node_Expr_Include($this->yyastk[$this->stackPos-(2-2)], PHPParser_Node_Expr_Include::TYPE_REQUIRE_ONCE, $attributes); } - protected function reduceRule252($attributes) { - $this->semValue = new Node\Expr\Cast\Double($this->semStack[$this->stackPos-(2-2)], $attributes); + protected function yyn243($attributes) { + $this->yyval = new PHPParser_Node_Expr_Cast_Int($this->yyastk[$this->stackPos-(2-2)], $attributes); } - protected function reduceRule253($attributes) { - $this->semValue = new Node\Expr\Cast\String($this->semStack[$this->stackPos-(2-2)], $attributes); + protected function yyn244($attributes) { + $this->yyval = new PHPParser_Node_Expr_Cast_Double($this->yyastk[$this->stackPos-(2-2)], $attributes); } - protected function reduceRule254($attributes) { - $this->semValue = new Node\Expr\Cast\Array_($this->semStack[$this->stackPos-(2-2)], $attributes); + protected function yyn245($attributes) { + $this->yyval = new PHPParser_Node_Expr_Cast_String($this->yyastk[$this->stackPos-(2-2)], $attributes); } - protected function reduceRule255($attributes) { - $this->semValue = new Node\Expr\Cast\Object($this->semStack[$this->stackPos-(2-2)], $attributes); + protected function yyn246($attributes) { + $this->yyval = new PHPParser_Node_Expr_Cast_Array($this->yyastk[$this->stackPos-(2-2)], $attributes); } - protected function reduceRule256($attributes) { - $this->semValue = new Node\Expr\Cast\Bool($this->semStack[$this->stackPos-(2-2)], $attributes); + protected function yyn247($attributes) { + $this->yyval = new PHPParser_Node_Expr_Cast_Object($this->yyastk[$this->stackPos-(2-2)], $attributes); } - protected function reduceRule257($attributes) { - $this->semValue = new Node\Expr\Cast\Unset_($this->semStack[$this->stackPos-(2-2)], $attributes); + protected function yyn248($attributes) { + $this->yyval = new PHPParser_Node_Expr_Cast_Bool($this->yyastk[$this->stackPos-(2-2)], $attributes); } - protected function reduceRule258($attributes) { - $this->semValue = new Node\Expr\Exit_($this->semStack[$this->stackPos-(2-2)], $attributes); + protected function yyn249($attributes) { + $this->yyval = new PHPParser_Node_Expr_Cast_Unset($this->yyastk[$this->stackPos-(2-2)], $attributes); } - protected function reduceRule259($attributes) { - $this->semValue = new Node\Expr\ErrorSuppress($this->semStack[$this->stackPos-(2-2)], $attributes); + protected function yyn250($attributes) { + $this->yyval = new PHPParser_Node_Expr_Exit($this->yyastk[$this->stackPos-(2-2)], $attributes); } - protected function reduceRule260($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(1-1)]; + protected function yyn251($attributes) { + $this->yyval = new PHPParser_Node_Expr_ErrorSuppress($this->yyastk[$this->stackPos-(2-2)], $attributes); } - protected function reduceRule261($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(1-1)]; + protected function yyn252($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(1-1)]; } - protected function reduceRule262($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(1-1)]; + protected function yyn253($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(1-1)]; } - protected function reduceRule263($attributes) { - $this->semValue = new Node\Expr\ShellExec($this->semStack[$this->stackPos-(3-2)], $attributes); + protected function yyn254($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(1-1)]; } - protected function reduceRule264($attributes) { - $this->semValue = new Node\Expr\Print_($this->semStack[$this->stackPos-(2-2)], $attributes); + protected function yyn255($attributes) { + $this->yyval = new PHPParser_Node_Expr_ShellExec($this->yyastk[$this->stackPos-(3-2)], $attributes); } - protected function reduceRule265($attributes) { - $this->semValue = new Node\Expr\Yield_(null, null, $attributes); + protected function yyn256($attributes) { + $this->yyval = new PHPParser_Node_Expr_Print($this->yyastk[$this->stackPos-(2-2)], $attributes); } - protected function reduceRule266($attributes) { - $this->semValue = new Node\Expr\Closure(array('static' => false, 'byRef' => $this->semStack[$this->stackPos-(9-2)], 'params' => $this->semStack[$this->stackPos-(9-4)], 'uses' => $this->semStack[$this->stackPos-(9-6)], 'stmts' => $this->semStack[$this->stackPos-(9-8)]), $attributes); + protected function yyn257($attributes) { + $this->yyval = new PHPParser_Node_Expr_Yield(null, null, $attributes); } - protected function reduceRule267($attributes) { - $this->semValue = new Node\Expr\Closure(array('static' => true, 'byRef' => $this->semStack[$this->stackPos-(10-3)], 'params' => $this->semStack[$this->stackPos-(10-5)], 'uses' => $this->semStack[$this->stackPos-(10-7)], 'stmts' => $this->semStack[$this->stackPos-(10-9)]), $attributes); + protected function yyn258($attributes) { + $this->yyval = new PHPParser_Node_Expr_Closure(array('static' => false, 'byRef' => $this->yyastk[$this->stackPos-(9-2)], 'params' => $this->yyastk[$this->stackPos-(9-4)], 'uses' => $this->yyastk[$this->stackPos-(9-6)], 'stmts' => $this->yyastk[$this->stackPos-(9-8)]), $attributes); } - protected function reduceRule268($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(3-2)]; + protected function yyn259($attributes) { + $this->yyval = new PHPParser_Node_Expr_Closure(array('static' => true, 'byRef' => $this->yyastk[$this->stackPos-(10-3)], 'params' => $this->yyastk[$this->stackPos-(10-5)], 'uses' => $this->yyastk[$this->stackPos-(10-7)], 'stmts' => $this->yyastk[$this->stackPos-(10-9)]), $attributes); } - protected function reduceRule269($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(3-2)]; + protected function yyn260($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(3-2)]; } - protected function reduceRule270($attributes) { - $this->semValue = new Node\Expr\Yield_($this->semStack[$this->stackPos-(2-2)], null, $attributes); + protected function yyn261($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(3-2)]; } - protected function reduceRule271($attributes) { - $this->semValue = new Node\Expr\Yield_($this->semStack[$this->stackPos-(4-4)], $this->semStack[$this->stackPos-(4-2)], $attributes); + protected function yyn262($attributes) { + $this->yyval = new PHPParser_Node_Expr_Yield($this->yyastk[$this->stackPos-(2-2)], null, $attributes); } - protected function reduceRule272($attributes) { - $this->semValue = new Node\Expr\Array_($this->semStack[$this->stackPos-(4-3)], $attributes); + protected function yyn263($attributes) { + $this->yyval = new PHPParser_Node_Expr_Yield($this->yyastk[$this->stackPos-(4-4)], $this->yyastk[$this->stackPos-(4-2)], $attributes); } - protected function reduceRule273($attributes) { - $this->semValue = new Node\Expr\Array_($this->semStack[$this->stackPos-(3-2)], $attributes); + protected function yyn264($attributes) { + $this->yyval = new PHPParser_Node_Expr_Array($this->yyastk[$this->stackPos-(4-3)], $attributes); } - protected function reduceRule274($attributes) { - $this->semValue = new Node\Expr\ArrayDimFetch($this->semStack[$this->stackPos-(4-1)], $this->semStack[$this->stackPos-(4-3)], $attributes); + protected function yyn265($attributes) { + $this->yyval = new PHPParser_Node_Expr_Array($this->yyastk[$this->stackPos-(3-2)], $attributes); } - protected function reduceRule275($attributes) { - $this->semValue = new Node\Expr\ArrayDimFetch(new Node\Scalar\String(Node\Scalar\String::parse($this->semStack[$this->stackPos-(4-1)]), $attributes), $this->semStack[$this->stackPos-(4-3)], $attributes); + protected function yyn266($attributes) { + $this->yyval = new PHPParser_Node_Expr_ArrayDimFetch($this->yyastk[$this->stackPos-(4-1)], $this->yyastk[$this->stackPos-(4-3)], $attributes); } - protected function reduceRule276($attributes) { - $this->semValue = new Node\Expr\ArrayDimFetch($this->semStack[$this->stackPos-(4-1)], $this->semStack[$this->stackPos-(4-3)], $attributes); + protected function yyn267($attributes) { + $this->yyval = new PHPParser_Node_Expr_ArrayDimFetch(new PHPParser_Node_Scalar_String(PHPParser_Node_Scalar_String::parse($this->yyastk[$this->stackPos-(4-1)]), $attributes), $this->yyastk[$this->stackPos-(4-3)], $attributes); } - protected function reduceRule277($attributes) { - $this->semValue = new Node\Expr\ArrayDimFetch($this->semStack[$this->stackPos-(4-1)], $this->semStack[$this->stackPos-(4-3)], $attributes); + protected function yyn268($attributes) { + $this->yyval = new PHPParser_Node_Expr_ArrayDimFetch($this->yyastk[$this->stackPos-(4-1)], $this->yyastk[$this->stackPos-(4-3)], $attributes); } - protected function reduceRule278($attributes) { - $this->semValue = new Node\Expr\New_($this->semStack[$this->stackPos-(3-2)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn269($attributes) { + $this->yyval = new PHPParser_Node_Expr_New($this->yyastk[$this->stackPos-(3-2)], $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule279($attributes) { - $this->semValue = array(); + protected function yyn270($attributes) { + $this->yyval = array(); } - protected function reduceRule280($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(4-3)]; + protected function yyn271($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(4-3)]; } - protected function reduceRule281($attributes) { - $this->semValue = array($this->semStack[$this->stackPos-(1-1)]); + protected function yyn272($attributes) { + $this->yyval = array($this->yyastk[$this->stackPos-(1-1)]); } - protected function reduceRule282($attributes) { - $this->semStack[$this->stackPos-(3-1)][] = $this->semStack[$this->stackPos-(3-3)]; $this->semValue = $this->semStack[$this->stackPos-(3-1)]; + protected function yyn273($attributes) { + $this->yyastk[$this->stackPos-(3-1)][] = $this->yyastk[$this->stackPos-(3-3)]; $this->yyval = $this->yyastk[$this->stackPos-(3-1)]; } - protected function reduceRule283($attributes) { - $this->semValue = new Node\Expr\ClosureUse(substr($this->semStack[$this->stackPos-(2-2)], 1), $this->semStack[$this->stackPos-(2-1)], $attributes); + protected function yyn274($attributes) { + $this->yyval = new PHPParser_Node_Expr_ClosureUse(substr($this->yyastk[$this->stackPos-(2-2)], 1), $this->yyastk[$this->stackPos-(2-1)], $attributes); } - protected function reduceRule284($attributes) { - $this->semValue = new Node\Expr\FuncCall($this->semStack[$this->stackPos-(2-1)], $this->semStack[$this->stackPos-(2-2)], $attributes); + protected function yyn275($attributes) { + $this->yyval = new PHPParser_Node_Expr_FuncCall($this->yyastk[$this->stackPos-(2-1)], $this->yyastk[$this->stackPos-(2-2)], $attributes); } - protected function reduceRule285($attributes) { - $this->semValue = new Node\Expr\StaticCall($this->semStack[$this->stackPos-(4-1)], $this->semStack[$this->stackPos-(4-3)], $this->semStack[$this->stackPos-(4-4)], $attributes); + protected function yyn276($attributes) { + $this->yyval = new PHPParser_Node_Expr_StaticCall($this->yyastk[$this->stackPos-(4-1)], $this->yyastk[$this->stackPos-(4-3)], $this->yyastk[$this->stackPos-(4-4)], $attributes); } - protected function reduceRule286($attributes) { - $this->semValue = new Node\Expr\StaticCall($this->semStack[$this->stackPos-(6-1)], $this->semStack[$this->stackPos-(6-4)], $this->semStack[$this->stackPos-(6-6)], $attributes); + protected function yyn277($attributes) { + $this->yyval = new PHPParser_Node_Expr_StaticCall($this->yyastk[$this->stackPos-(6-1)], $this->yyastk[$this->stackPos-(6-4)], $this->yyastk[$this->stackPos-(6-6)], $attributes); } - protected function reduceRule287($attributes) { + protected function yyn278($attributes) { - if ($this->semStack[$this->stackPos-(2-1)] instanceof Node\Expr\StaticPropertyFetch) { - $this->semValue = new Node\Expr\StaticCall($this->semStack[$this->stackPos-(2-1)]->class, new Node\Expr\Variable($this->semStack[$this->stackPos-(2-1)]->name, $attributes), $this->semStack[$this->stackPos-(2-2)], $attributes); - } elseif ($this->semStack[$this->stackPos-(2-1)] instanceof Node\Expr\ArrayDimFetch) { - $tmp = $this->semStack[$this->stackPos-(2-1)]; - while ($tmp->var instanceof Node\Expr\ArrayDimFetch) { + if ($this->yyastk[$this->stackPos-(2-1)] instanceof PHPParser_Node_Expr_StaticPropertyFetch) { + $this->yyval = new PHPParser_Node_Expr_StaticCall($this->yyastk[$this->stackPos-(2-1)]->class, new PHPParser_Node_Expr_Variable($this->yyastk[$this->stackPos-(2-1)]->name, $attributes), $this->yyastk[$this->stackPos-(2-2)], $attributes); + } elseif ($this->yyastk[$this->stackPos-(2-1)] instanceof PHPParser_Node_Expr_ArrayDimFetch) { + $tmp = $this->yyastk[$this->stackPos-(2-1)]; + while ($tmp->var instanceof PHPParser_Node_Expr_ArrayDimFetch) { $tmp = $tmp->var; } - $this->semValue = new Node\Expr\StaticCall($tmp->var->class, $this->semStack[$this->stackPos-(2-1)], $this->semStack[$this->stackPos-(2-2)], $attributes); - $tmp->var = new Node\Expr\Variable($tmp->var->name, $attributes); + $this->yyval = new PHPParser_Node_Expr_StaticCall($tmp->var->class, $this->yyastk[$this->stackPos-(2-1)], $this->yyastk[$this->stackPos-(2-2)], $attributes); + $tmp->var = new PHPParser_Node_Expr_Variable($tmp->var->name, $attributes); } else { - throw new \Exception; + throw new Exception; } } - protected function reduceRule288($attributes) { - $this->semValue = new Node\Expr\FuncCall($this->semStack[$this->stackPos-(2-1)], $this->semStack[$this->stackPos-(2-2)], $attributes); - } - - protected function reduceRule289($attributes) { - $this->semValue = new Node\Expr\ArrayDimFetch($this->semStack[$this->stackPos-(4-1)], $this->semStack[$this->stackPos-(4-3)], $attributes); - } - - protected function reduceRule290($attributes) { - $this->semValue = new Node\Name($this->semStack[$this->stackPos-(1-1)], $attributes); - } - - protected function reduceRule291($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(1-1)]; - } - - protected function reduceRule292($attributes) { - $this->semValue = new Node\Name($this->semStack[$this->stackPos-(1-1)], $attributes); - } - - protected function reduceRule293($attributes) { - $this->semValue = new Node\Name\FullyQualified($this->semStack[$this->stackPos-(2-2)], $attributes); - } - - protected function reduceRule294($attributes) { - $this->semValue = new Node\Name\Relative($this->semStack[$this->stackPos-(3-3)], $attributes); - } - - protected function reduceRule295($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(1-1)]; - } - - protected function reduceRule296($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(1-1)]; - } - - protected function reduceRule297($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(1-1)]; - } - - protected function reduceRule298($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(1-1)]; - } - - protected function reduceRule299($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(1-1)]; - } - - protected function reduceRule300($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(1-1)]; - } - - protected function reduceRule301($attributes) { - $this->semValue = new Node\Expr\PropertyFetch($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); - } - - protected function reduceRule302($attributes) { - $this->semValue = new Node\Expr\PropertyFetch($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); - } - - protected function reduceRule303($attributes) { - $this->semValue = new Node\Expr\ArrayDimFetch($this->semStack[$this->stackPos-(4-1)], $this->semStack[$this->stackPos-(4-3)], $attributes); - } - - protected function reduceRule304($attributes) { - $this->semValue = new Node\Expr\ArrayDimFetch($this->semStack[$this->stackPos-(4-1)], $this->semStack[$this->stackPos-(4-3)], $attributes); - } - - protected function reduceRule305($attributes) { - $this->semValue = null; - } - - protected function reduceRule306($attributes) { - $this->semValue = null; - } - - protected function reduceRule307($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(1-1)]; - } - - protected function reduceRule308($attributes) { - $this->semValue = array(); - } - - protected function reduceRule309($attributes) { - $this->semValue = array(Node\Scalar\String::parseEscapeSequences($this->semStack[$this->stackPos-(1-1)], '`')); - } - - protected function reduceRule310($attributes) { - foreach ($this->semStack[$this->stackPos-(1-1)] as &$s) { if (is_string($s)) { $s = Node\Scalar\String::parseEscapeSequences($s, '`'); } }; $this->semValue = $this->semStack[$this->stackPos-(1-1)]; - } - - protected function reduceRule311($attributes) { - $this->semValue = array(); - } - - protected function reduceRule312($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(1-1)]; - } - - protected function reduceRule313($attributes) { - $this->semValue = new Node\Scalar\LNumber(Node\Scalar\LNumber::parse($this->semStack[$this->stackPos-(1-1)]), $attributes); - } - - protected function reduceRule314($attributes) { - $this->semValue = new Node\Scalar\DNumber(Node\Scalar\DNumber::parse($this->semStack[$this->stackPos-(1-1)]), $attributes); - } - - protected function reduceRule315($attributes) { - $this->semValue = new Node\Scalar\String(Node\Scalar\String::parse($this->semStack[$this->stackPos-(1-1)]), $attributes); - } - - protected function reduceRule316($attributes) { - $this->semValue = new Node\Scalar\MagicConst\Line($attributes); - } - - protected function reduceRule317($attributes) { - $this->semValue = new Node\Scalar\MagicConst\File($attributes); - } - - protected function reduceRule318($attributes) { - $this->semValue = new Node\Scalar\MagicConst\Dir($attributes); - } - - protected function reduceRule319($attributes) { - $this->semValue = new Node\Scalar\MagicConst\Class_($attributes); - } - - protected function reduceRule320($attributes) { - $this->semValue = new Node\Scalar\MagicConst\Trait_($attributes); - } - - protected function reduceRule321($attributes) { - $this->semValue = new Node\Scalar\MagicConst\Method($attributes); + protected function yyn279($attributes) { + $this->yyval = new PHPParser_Node_Expr_FuncCall($this->yyastk[$this->stackPos-(2-1)], $this->yyastk[$this->stackPos-(2-2)], $attributes); } - protected function reduceRule322($attributes) { - $this->semValue = new Node\Scalar\MagicConst\Function_($attributes); + protected function yyn280($attributes) { + $this->yyval = new PHPParser_Node_Expr_ArrayDimFetch($this->yyastk[$this->stackPos-(4-1)], $this->yyastk[$this->stackPos-(4-3)], $attributes); } - protected function reduceRule323($attributes) { - $this->semValue = new Node\Scalar\MagicConst\Namespace_($attributes); + protected function yyn281($attributes) { + $this->yyval = new PHPParser_Node_Name('static', $attributes); } - protected function reduceRule324($attributes) { - $this->semValue = new Node\Scalar\String(Node\Scalar\String::parseDocString($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-2)]), $attributes); + protected function yyn282($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(1-1)]; } - protected function reduceRule325($attributes) { - $this->semValue = new Node\Scalar\String('', $attributes); + protected function yyn283($attributes) { + $this->yyval = new PHPParser_Node_Name($this->yyastk[$this->stackPos-(1-1)], $attributes); } - protected function reduceRule326($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(1-1)]; + protected function yyn284($attributes) { + $this->yyval = new PHPParser_Node_Name_FullyQualified($this->yyastk[$this->stackPos-(2-2)], $attributes); } - protected function reduceRule327($attributes) { - $this->semValue = new Node\Expr\ClassConstFetch($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn285($attributes) { + $this->yyval = new PHPParser_Node_Name_Relative($this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule328($attributes) { - $this->semValue = new Node\Expr\ConstFetch($this->semStack[$this->stackPos-(1-1)], $attributes); + protected function yyn286($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(1-1)]; } - protected function reduceRule329($attributes) { - $this->semValue = new Node\Expr\Array_($this->semStack[$this->stackPos-(4-3)], $attributes); + protected function yyn287($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(1-1)]; } - protected function reduceRule330($attributes) { - $this->semValue = new Node\Expr\Array_($this->semStack[$this->stackPos-(3-2)], $attributes); + protected function yyn288($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(1-1)]; } - protected function reduceRule331($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(1-1)]; + protected function yyn289($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(1-1)]; } - protected function reduceRule332($attributes) { - $this->semValue = new Node\Expr\BinaryOp\BooleanOr($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn290($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(1-1)]; } - protected function reduceRule333($attributes) { - $this->semValue = new Node\Expr\BinaryOp\BooleanAnd($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn291($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(1-1)]; } - protected function reduceRule334($attributes) { - $this->semValue = new Node\Expr\BinaryOp\LogicalOr($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn292() { + $this->yyval = $this->yyastk[$this->stackPos]; } - protected function reduceRule335($attributes) { - $this->semValue = new Node\Expr\BinaryOp\LogicalAnd($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn293($attributes) { + $this->yyval = new PHPParser_Node_Expr_PropertyFetch($this->yyastk[$this->stackPos-(3-1)], $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule336($attributes) { - $this->semValue = new Node\Expr\BinaryOp\LogicalXor($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn294($attributes) { + $this->yyval = new PHPParser_Node_Expr_PropertyFetch($this->yyastk[$this->stackPos-(3-1)], $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule337($attributes) { - $this->semValue = new Node\Expr\BinaryOp\BitwiseOr($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn295($attributes) { + $this->yyval = new PHPParser_Node_Expr_ArrayDimFetch($this->yyastk[$this->stackPos-(4-1)], $this->yyastk[$this->stackPos-(4-3)], $attributes); } - protected function reduceRule338($attributes) { - $this->semValue = new Node\Expr\BinaryOp\BitwiseAnd($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn296($attributes) { + $this->yyval = new PHPParser_Node_Expr_ArrayDimFetch($this->yyastk[$this->stackPos-(4-1)], $this->yyastk[$this->stackPos-(4-3)], $attributes); } - protected function reduceRule339($attributes) { - $this->semValue = new Node\Expr\BinaryOp\BitwiseXor($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn297($attributes) { + $this->yyval = null; } - protected function reduceRule340($attributes) { - $this->semValue = new Node\Expr\BinaryOp\Concat($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn298($attributes) { + $this->yyval = null; } - protected function reduceRule341($attributes) { - $this->semValue = new Node\Expr\BinaryOp\Plus($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn299($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(1-1)]; } - protected function reduceRule342($attributes) { - $this->semValue = new Node\Expr\BinaryOp\Minus($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn300($attributes) { + $this->yyval = array(); } - protected function reduceRule343($attributes) { - $this->semValue = new Node\Expr\BinaryOp\Mul($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn301($attributes) { + $this->yyval = array(PHPParser_Node_Scalar_String::parseEscapeSequences($this->yyastk[$this->stackPos-(1-1)], '`')); } - protected function reduceRule344($attributes) { - $this->semValue = new Node\Expr\BinaryOp\Div($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn302($attributes) { + foreach ($this->yyastk[$this->stackPos-(1-1)] as &$s) { if (is_string($s)) { $s = PHPParser_Node_Scalar_String::parseEscapeSequences($s, '`'); } }; $this->yyval = $this->yyastk[$this->stackPos-(1-1)]; } - protected function reduceRule345($attributes) { - $this->semValue = new Node\Expr\BinaryOp\Mod($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn303($attributes) { + $this->yyval = array(); } - protected function reduceRule346($attributes) { - $this->semValue = new Node\Expr\BinaryOp\ShiftLeft($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn304($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(1-1)]; } - protected function reduceRule347($attributes) { - $this->semValue = new Node\Expr\BinaryOp\ShiftRight($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn305($attributes) { + $this->yyval = new PHPParser_Node_Scalar_LNumber(PHPParser_Node_Scalar_LNumber::parse($this->yyastk[$this->stackPos-(1-1)]), $attributes); } - protected function reduceRule348($attributes) { - $this->semValue = new Node\Expr\BinaryOp\Pow($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn306($attributes) { + $this->yyval = new PHPParser_Node_Scalar_DNumber(PHPParser_Node_Scalar_DNumber::parse($this->yyastk[$this->stackPos-(1-1)]), $attributes); } - protected function reduceRule349($attributes) { - $this->semValue = new Node\Expr\UnaryPlus($this->semStack[$this->stackPos-(2-2)], $attributes); + protected function yyn307($attributes) { + $this->yyval = new PHPParser_Node_Scalar_String(PHPParser_Node_Scalar_String::parse($this->yyastk[$this->stackPos-(1-1)]), $attributes); } - protected function reduceRule350($attributes) { - $this->semValue = new Node\Expr\UnaryMinus($this->semStack[$this->stackPos-(2-2)], $attributes); + protected function yyn308($attributes) { + $this->yyval = new PHPParser_Node_Scalar_LineConst($attributes); } - protected function reduceRule351($attributes) { - $this->semValue = new Node\Expr\BooleanNot($this->semStack[$this->stackPos-(2-2)], $attributes); + protected function yyn309($attributes) { + $this->yyval = new PHPParser_Node_Scalar_FileConst($attributes); } - protected function reduceRule352($attributes) { - $this->semValue = new Node\Expr\BitwiseNot($this->semStack[$this->stackPos-(2-2)], $attributes); + protected function yyn310($attributes) { + $this->yyval = new PHPParser_Node_Scalar_DirConst($attributes); } - protected function reduceRule353($attributes) { - $this->semValue = new Node\Expr\BinaryOp\Identical($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn311($attributes) { + $this->yyval = new PHPParser_Node_Scalar_ClassConst($attributes); } - protected function reduceRule354($attributes) { - $this->semValue = new Node\Expr\BinaryOp\NotIdentical($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn312($attributes) { + $this->yyval = new PHPParser_Node_Scalar_TraitConst($attributes); } - protected function reduceRule355($attributes) { - $this->semValue = new Node\Expr\BinaryOp\Equal($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn313($attributes) { + $this->yyval = new PHPParser_Node_Scalar_MethodConst($attributes); } - protected function reduceRule356($attributes) { - $this->semValue = new Node\Expr\BinaryOp\NotEqual($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn314($attributes) { + $this->yyval = new PHPParser_Node_Scalar_FuncConst($attributes); } - protected function reduceRule357($attributes) { - $this->semValue = new Node\Expr\BinaryOp\Smaller($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn315($attributes) { + $this->yyval = new PHPParser_Node_Scalar_NSConst($attributes); } - protected function reduceRule358($attributes) { - $this->semValue = new Node\Expr\BinaryOp\SmallerOrEqual($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn316($attributes) { + $this->yyval = new PHPParser_Node_Scalar_String(PHPParser_Node_Scalar_String::parseDocString($this->yyastk[$this->stackPos-(3-1)], $this->yyastk[$this->stackPos-(3-2)]), $attributes); } - protected function reduceRule359($attributes) { - $this->semValue = new Node\Expr\BinaryOp\Greater($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn317($attributes) { + $this->yyval = new PHPParser_Node_Scalar_String('', $attributes); } - protected function reduceRule360($attributes) { - $this->semValue = new Node\Expr\BinaryOp\GreaterOrEqual($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn318($attributes) { + $this->yyval = new PHPParser_Node_Expr_ConstFetch($this->yyastk[$this->stackPos-(1-1)], $attributes); } - protected function reduceRule361($attributes) { - $this->semValue = new Node\Expr\Ternary($this->semStack[$this->stackPos-(5-1)], $this->semStack[$this->stackPos-(5-3)], $this->semStack[$this->stackPos-(5-5)], $attributes); + protected function yyn319($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(1-1)]; } - protected function reduceRule362($attributes) { - $this->semValue = new Node\Expr\Ternary($this->semStack[$this->stackPos-(4-1)], null, $this->semStack[$this->stackPos-(4-4)], $attributes); + protected function yyn320($attributes) { + $this->yyval = new PHPParser_Node_Expr_ClassConstFetch($this->yyastk[$this->stackPos-(3-1)], $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule363($attributes) { - $this->semValue = new Node\Expr\ArrayDimFetch($this->semStack[$this->stackPos-(4-1)], $this->semStack[$this->stackPos-(4-3)], $attributes); + protected function yyn321($attributes) { + $this->yyval = new PHPParser_Node_Expr_UnaryPlus($this->yyastk[$this->stackPos-(2-2)], $attributes); } - protected function reduceRule364($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(3-2)]; + protected function yyn322($attributes) { + $this->yyval = new PHPParser_Node_Expr_UnaryMinus($this->yyastk[$this->stackPos-(2-2)], $attributes); } - protected function reduceRule365($attributes) { - $this->semValue = new Node\Expr\ConstFetch($this->semStack[$this->stackPos-(1-1)], $attributes); + protected function yyn323($attributes) { + $this->yyval = new PHPParser_Node_Expr_Array($this->yyastk[$this->stackPos-(4-3)], $attributes); } - protected function reduceRule366($attributes) { - $this->semValue = new Node\Expr\ClassConstFetch($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn324($attributes) { + $this->yyval = new PHPParser_Node_Expr_Array($this->yyastk[$this->stackPos-(3-2)], $attributes); } - protected function reduceRule367($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(1-1)]; + protected function yyn325($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(1-1)]; } - protected function reduceRule368($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(1-1)]; + protected function yyn326($attributes) { + $this->yyval = new PHPParser_Node_Expr_ClassConstFetch($this->yyastk[$this->stackPos-(3-1)], $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule369($attributes) { - foreach ($this->semStack[$this->stackPos-(3-2)] as &$s) { if (is_string($s)) { $s = Node\Scalar\String::parseEscapeSequences($s, '"'); } }; $this->semValue = new Node\Scalar\Encapsed($this->semStack[$this->stackPos-(3-2)], $attributes); + protected function yyn327($attributes) { + foreach ($this->yyastk[$this->stackPos-(3-2)] as &$s) { if (is_string($s)) { $s = PHPParser_Node_Scalar_String::parseEscapeSequences($s, '"'); } }; $this->yyval = new PHPParser_Node_Scalar_Encapsed($this->yyastk[$this->stackPos-(3-2)], $attributes); } - protected function reduceRule370($attributes) { - foreach ($this->semStack[$this->stackPos-(3-2)] as &$s) { if (is_string($s)) { $s = Node\Scalar\String::parseEscapeSequences($s, null); } } $s = preg_replace('~(\r\n|\n|\r)$~', '', $s); if ('' === $s) array_pop($this->semStack[$this->stackPos-(3-2)]);; $this->semValue = new Node\Scalar\Encapsed($this->semStack[$this->stackPos-(3-2)], $attributes); + protected function yyn328($attributes) { + foreach ($this->yyastk[$this->stackPos-(3-2)] as &$s) { if (is_string($s)) { $s = PHPParser_Node_Scalar_String::parseEscapeSequences($s, null); } } $s = preg_replace('~(\r\n|\n|\r)$~', '', $s); if ('' === $s) array_pop($this->yyastk[$this->stackPos-(3-2)]);; $this->yyval = new PHPParser_Node_Scalar_Encapsed($this->yyastk[$this->stackPos-(3-2)], $attributes); } - protected function reduceRule371($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(1-1)]; + protected function yyn329($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(1-1)]; } - protected function reduceRule372($attributes) { - $this->semValue = 'class'; + protected function yyn330($attributes) { + $this->yyval = 'class'; } - protected function reduceRule373($attributes) { - $this->semValue = array(); + protected function yyn331($attributes) { + $this->yyval = array(); } - protected function reduceRule374($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(2-1)]; + protected function yyn332($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(2-1)]; } - protected function reduceRule375() { - $this->semValue = $this->semStack[$this->stackPos]; + protected function yyn333() { + $this->yyval = $this->yyastk[$this->stackPos]; } - protected function reduceRule376() { - $this->semValue = $this->semStack[$this->stackPos]; + protected function yyn334() { + $this->yyval = $this->yyastk[$this->stackPos]; } - protected function reduceRule377($attributes) { - $this->semStack[$this->stackPos-(3-1)][] = $this->semStack[$this->stackPos-(3-3)]; $this->semValue = $this->semStack[$this->stackPos-(3-1)]; + protected function yyn335($attributes) { + $this->yyastk[$this->stackPos-(3-1)][] = $this->yyastk[$this->stackPos-(3-3)]; $this->yyval = $this->yyastk[$this->stackPos-(3-1)]; } - protected function reduceRule378($attributes) { - $this->semValue = array($this->semStack[$this->stackPos-(1-1)]); + protected function yyn336($attributes) { + $this->yyval = array($this->yyastk[$this->stackPos-(1-1)]); } - protected function reduceRule379($attributes) { - $this->semValue = new Node\Expr\ArrayItem($this->semStack[$this->stackPos-(3-3)], $this->semStack[$this->stackPos-(3-1)], false, $attributes); + protected function yyn337($attributes) { + $this->yyval = new PHPParser_Node_Expr_ArrayItem($this->yyastk[$this->stackPos-(3-3)], $this->yyastk[$this->stackPos-(3-1)], false, $attributes); } - protected function reduceRule380($attributes) { - $this->semValue = new Node\Expr\ArrayItem($this->semStack[$this->stackPos-(1-1)], null, false, $attributes); + protected function yyn338($attributes) { + $this->yyval = new PHPParser_Node_Expr_ArrayItem($this->yyastk[$this->stackPos-(1-1)], null, false, $attributes); } - protected function reduceRule381($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(1-1)]; + protected function yyn339($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(1-1)]; } - protected function reduceRule382($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(1-1)]; + protected function yyn340($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(1-1)]; } - protected function reduceRule383($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(1-1)]; + protected function yyn341($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(1-1)]; } - protected function reduceRule384($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(1-1)]; + protected function yyn342($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(1-1)]; } - protected function reduceRule385($attributes) { - $this->semValue = new Node\Expr\ArrayDimFetch($this->semStack[$this->stackPos-(6-2)], $this->semStack[$this->stackPos-(6-5)], $attributes); + protected function yyn343($attributes) { + $this->yyval = new PHPParser_Node_Expr_ArrayDimFetch($this->yyastk[$this->stackPos-(6-2)], $this->yyastk[$this->stackPos-(6-5)], $attributes); } - protected function reduceRule386($attributes) { - $this->semValue = new Node\Expr\ArrayDimFetch($this->semStack[$this->stackPos-(4-1)], $this->semStack[$this->stackPos-(4-3)], $attributes); + protected function yyn344($attributes) { + $this->yyval = new PHPParser_Node_Expr_ArrayDimFetch($this->yyastk[$this->stackPos-(4-1)], $this->yyastk[$this->stackPos-(4-3)], $attributes); } - protected function reduceRule387($attributes) { - $this->semValue = new Node\Expr\PropertyFetch($this->semStack[$this->stackPos-(3-1)], $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn345($attributes) { + $this->yyval = new PHPParser_Node_Expr_PropertyFetch($this->yyastk[$this->stackPos-(3-1)], $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule388($attributes) { - $this->semValue = new Node\Expr\MethodCall($this->semStack[$this->stackPos-(4-1)], $this->semStack[$this->stackPos-(4-3)], $this->semStack[$this->stackPos-(4-4)], $attributes); + protected function yyn346($attributes) { + $this->yyval = new PHPParser_Node_Expr_MethodCall($this->yyastk[$this->stackPos-(4-1)], $this->yyastk[$this->stackPos-(4-3)], $this->yyastk[$this->stackPos-(4-4)], $attributes); } - protected function reduceRule389($attributes) { - $this->semValue = new Node\Expr\FuncCall($this->semStack[$this->stackPos-(2-1)], $this->semStack[$this->stackPos-(2-2)], $attributes); + protected function yyn347($attributes) { + $this->yyval = new PHPParser_Node_Expr_FuncCall($this->yyastk[$this->stackPos-(2-1)], $this->yyastk[$this->stackPos-(2-2)], $attributes); } - protected function reduceRule390($attributes) { - $this->semValue = new Node\Expr\ArrayDimFetch($this->semStack[$this->stackPos-(4-1)], $this->semStack[$this->stackPos-(4-3)], $attributes); + protected function yyn348($attributes) { + $this->yyval = new PHPParser_Node_Expr_ArrayDimFetch($this->yyastk[$this->stackPos-(4-1)], $this->yyastk[$this->stackPos-(4-3)], $attributes); } - protected function reduceRule391($attributes) { - $this->semValue = new Node\Expr\ArrayDimFetch($this->semStack[$this->stackPos-(4-1)], $this->semStack[$this->stackPos-(4-3)], $attributes); + protected function yyn349($attributes) { + $this->yyval = new PHPParser_Node_Expr_ArrayDimFetch($this->yyastk[$this->stackPos-(4-1)], $this->yyastk[$this->stackPos-(4-3)], $attributes); } - protected function reduceRule392($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(1-1)]; + protected function yyn350($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(1-1)]; } - protected function reduceRule393($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(3-2)]; + protected function yyn351($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(3-2)]; } - protected function reduceRule394($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(1-1)]; + protected function yyn352($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(1-1)]; } - protected function reduceRule395($attributes) { - $this->semValue = new Node\Expr\Variable($this->semStack[$this->stackPos-(2-2)], $attributes); + protected function yyn353($attributes) { + $this->yyval = new PHPParser_Node_Expr_Variable($this->yyastk[$this->stackPos-(2-2)], $attributes); } - protected function reduceRule396($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(1-1)]; + protected function yyn354($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(1-1)]; } - protected function reduceRule397($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(1-1)]; + protected function yyn355($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(1-1)]; } - protected function reduceRule398($attributes) { - $this->semValue = new Node\Expr\StaticPropertyFetch($this->semStack[$this->stackPos-(4-1)], $this->semStack[$this->stackPos-(4-4)], $attributes); + protected function yyn356($attributes) { + $this->yyval = new PHPParser_Node_Expr_StaticPropertyFetch($this->yyastk[$this->stackPos-(4-1)], $this->yyastk[$this->stackPos-(4-4)], $attributes); } - protected function reduceRule399($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(1-1)]; + protected function yyn357($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(1-1)]; } - protected function reduceRule400($attributes) { - $this->semValue = new Node\Expr\StaticPropertyFetch($this->semStack[$this->stackPos-(3-1)], substr($this->semStack[$this->stackPos-(3-3)], 1), $attributes); + protected function yyn358($attributes) { + $this->yyval = new PHPParser_Node_Expr_StaticPropertyFetch($this->yyastk[$this->stackPos-(3-1)], substr($this->yyastk[$this->stackPos-(3-3)], 1), $attributes); } - protected function reduceRule401($attributes) { - $this->semValue = new Node\Expr\StaticPropertyFetch($this->semStack[$this->stackPos-(6-1)], $this->semStack[$this->stackPos-(6-5)], $attributes); + protected function yyn359($attributes) { + $this->yyval = new PHPParser_Node_Expr_StaticPropertyFetch($this->yyastk[$this->stackPos-(6-1)], $this->yyastk[$this->stackPos-(6-5)], $attributes); } - protected function reduceRule402($attributes) { - $this->semValue = new Node\Expr\ArrayDimFetch($this->semStack[$this->stackPos-(4-1)], $this->semStack[$this->stackPos-(4-3)], $attributes); + protected function yyn360($attributes) { + $this->yyval = new PHPParser_Node_Expr_ArrayDimFetch($this->yyastk[$this->stackPos-(4-1)], $this->yyastk[$this->stackPos-(4-3)], $attributes); } - protected function reduceRule403($attributes) { - $this->semValue = new Node\Expr\ArrayDimFetch($this->semStack[$this->stackPos-(4-1)], $this->semStack[$this->stackPos-(4-3)], $attributes); + protected function yyn361($attributes) { + $this->yyval = new PHPParser_Node_Expr_ArrayDimFetch($this->yyastk[$this->stackPos-(4-1)], $this->yyastk[$this->stackPos-(4-3)], $attributes); } - protected function reduceRule404($attributes) { - $this->semValue = new Node\Expr\ArrayDimFetch($this->semStack[$this->stackPos-(4-1)], $this->semStack[$this->stackPos-(4-3)], $attributes); + protected function yyn362($attributes) { + $this->yyval = new PHPParser_Node_Expr_ArrayDimFetch($this->yyastk[$this->stackPos-(4-1)], $this->yyastk[$this->stackPos-(4-3)], $attributes); } - protected function reduceRule405($attributes) { - $this->semValue = new Node\Expr\ArrayDimFetch($this->semStack[$this->stackPos-(4-1)], $this->semStack[$this->stackPos-(4-3)], $attributes); + protected function yyn363($attributes) { + $this->yyval = new PHPParser_Node_Expr_ArrayDimFetch($this->yyastk[$this->stackPos-(4-1)], $this->yyastk[$this->stackPos-(4-3)], $attributes); } - protected function reduceRule406($attributes) { - $this->semValue = new Node\Expr\Variable(substr($this->semStack[$this->stackPos-(1-1)], 1), $attributes); + protected function yyn364($attributes) { + $this->yyval = new PHPParser_Node_Expr_Variable(substr($this->yyastk[$this->stackPos-(1-1)], 1), $attributes); } - protected function reduceRule407($attributes) { - $this->semValue = new Node\Expr\Variable($this->semStack[$this->stackPos-(4-3)], $attributes); + protected function yyn365($attributes) { + $this->yyval = new PHPParser_Node_Expr_Variable($this->yyastk[$this->stackPos-(4-3)], $attributes); } - protected function reduceRule408($attributes) { - $this->semValue = null; + protected function yyn366($attributes) { + $this->yyval = null; } - protected function reduceRule409($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(1-1)]; + protected function yyn367($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(1-1)]; } - protected function reduceRule410($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(1-1)]; + protected function yyn368($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(1-1)]; } - protected function reduceRule411($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(3-2)]; + protected function yyn369($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(3-2)]; } - protected function reduceRule412($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(1-1)]; + protected function yyn370($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(1-1)]; } - protected function reduceRule413($attributes) { - $this->semValue = new Node\Expr\List_($this->semStack[$this->stackPos-(4-3)], $attributes); + protected function yyn371($attributes) { + $this->yyval = new PHPParser_Node_Expr_List($this->yyastk[$this->stackPos-(4-3)], $attributes); } - protected function reduceRule414($attributes) { - $this->semStack[$this->stackPos-(3-1)][] = $this->semStack[$this->stackPos-(3-3)]; $this->semValue = $this->semStack[$this->stackPos-(3-1)]; + protected function yyn372($attributes) { + $this->yyastk[$this->stackPos-(3-1)][] = $this->yyastk[$this->stackPos-(3-3)]; $this->yyval = $this->yyastk[$this->stackPos-(3-1)]; } - protected function reduceRule415($attributes) { - $this->semValue = array($this->semStack[$this->stackPos-(1-1)]); + protected function yyn373($attributes) { + $this->yyval = array($this->yyastk[$this->stackPos-(1-1)]); } - protected function reduceRule416($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(1-1)]; + protected function yyn374($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(1-1)]; } - protected function reduceRule417($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(1-1)]; + protected function yyn375($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(1-1)]; } - protected function reduceRule418($attributes) { - $this->semValue = null; + protected function yyn376($attributes) { + $this->yyval = null; } - protected function reduceRule419($attributes) { - $this->semValue = array(); + protected function yyn377($attributes) { + $this->yyval = array(); } - protected function reduceRule420($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(2-1)]; + protected function yyn378($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(2-1)]; } - protected function reduceRule421($attributes) { - $this->semStack[$this->stackPos-(3-1)][] = $this->semStack[$this->stackPos-(3-3)]; $this->semValue = $this->semStack[$this->stackPos-(3-1)]; + protected function yyn379($attributes) { + $this->yyastk[$this->stackPos-(3-1)][] = $this->yyastk[$this->stackPos-(3-3)]; $this->yyval = $this->yyastk[$this->stackPos-(3-1)]; } - protected function reduceRule422($attributes) { - $this->semValue = array($this->semStack[$this->stackPos-(1-1)]); + protected function yyn380($attributes) { + $this->yyval = array($this->yyastk[$this->stackPos-(1-1)]); } - protected function reduceRule423($attributes) { - $this->semValue = new Node\Expr\ArrayItem($this->semStack[$this->stackPos-(3-3)], $this->semStack[$this->stackPos-(3-1)], false, $attributes); + protected function yyn381($attributes) { + $this->yyval = new PHPParser_Node_Expr_ArrayItem($this->yyastk[$this->stackPos-(3-3)], $this->yyastk[$this->stackPos-(3-1)], false, $attributes); } - protected function reduceRule424($attributes) { - $this->semValue = new Node\Expr\ArrayItem($this->semStack[$this->stackPos-(1-1)], null, false, $attributes); + protected function yyn382($attributes) { + $this->yyval = new PHPParser_Node_Expr_ArrayItem($this->yyastk[$this->stackPos-(1-1)], null, false, $attributes); } - protected function reduceRule425($attributes) { - $this->semValue = new Node\Expr\ArrayItem($this->semStack[$this->stackPos-(4-4)], $this->semStack[$this->stackPos-(4-1)], true, $attributes); + protected function yyn383($attributes) { + $this->yyval = new PHPParser_Node_Expr_ArrayItem($this->yyastk[$this->stackPos-(4-4)], $this->yyastk[$this->stackPos-(4-1)], true, $attributes); } - protected function reduceRule426($attributes) { - $this->semValue = new Node\Expr\ArrayItem($this->semStack[$this->stackPos-(2-2)], null, true, $attributes); + protected function yyn384($attributes) { + $this->yyval = new PHPParser_Node_Expr_ArrayItem($this->yyastk[$this->stackPos-(2-2)], null, true, $attributes); } - protected function reduceRule427($attributes) { - $this->semStack[$this->stackPos-(2-1)][] = $this->semStack[$this->stackPos-(2-2)]; $this->semValue = $this->semStack[$this->stackPos-(2-1)]; + protected function yyn385($attributes) { + $this->yyastk[$this->stackPos-(2-1)][] = $this->yyastk[$this->stackPos-(2-2)]; $this->yyval = $this->yyastk[$this->stackPos-(2-1)]; } - protected function reduceRule428($attributes) { - $this->semStack[$this->stackPos-(2-1)][] = $this->semStack[$this->stackPos-(2-2)]; $this->semValue = $this->semStack[$this->stackPos-(2-1)]; + protected function yyn386($attributes) { + $this->yyastk[$this->stackPos-(2-1)][] = $this->yyastk[$this->stackPos-(2-2)]; $this->yyval = $this->yyastk[$this->stackPos-(2-1)]; } - protected function reduceRule429($attributes) { - $this->semValue = array($this->semStack[$this->stackPos-(1-1)]); + protected function yyn387($attributes) { + $this->yyval = array($this->yyastk[$this->stackPos-(1-1)]); } - protected function reduceRule430($attributes) { - $this->semValue = array($this->semStack[$this->stackPos-(2-1)], $this->semStack[$this->stackPos-(2-2)]); + protected function yyn388($attributes) { + $this->yyval = array($this->yyastk[$this->stackPos-(2-1)], $this->yyastk[$this->stackPos-(2-2)]); } - protected function reduceRule431($attributes) { - $this->semValue = new Node\Expr\Variable(substr($this->semStack[$this->stackPos-(1-1)], 1), $attributes); + protected function yyn389($attributes) { + $this->yyval = new PHPParser_Node_Expr_Variable(substr($this->yyastk[$this->stackPos-(1-1)], 1), $attributes); } - protected function reduceRule432($attributes) { - $this->semValue = new Node\Expr\ArrayDimFetch(new Node\Expr\Variable(substr($this->semStack[$this->stackPos-(4-1)], 1), $attributes), $this->semStack[$this->stackPos-(4-3)], $attributes); + protected function yyn390($attributes) { + $this->yyval = new PHPParser_Node_Expr_ArrayDimFetch(new PHPParser_Node_Expr_Variable(substr($this->yyastk[$this->stackPos-(4-1)], 1), $attributes), $this->yyastk[$this->stackPos-(4-3)], $attributes); } - protected function reduceRule433($attributes) { - $this->semValue = new Node\Expr\PropertyFetch(new Node\Expr\Variable(substr($this->semStack[$this->stackPos-(3-1)], 1), $attributes), $this->semStack[$this->stackPos-(3-3)], $attributes); + protected function yyn391($attributes) { + $this->yyval = new PHPParser_Node_Expr_PropertyFetch(new PHPParser_Node_Expr_Variable(substr($this->yyastk[$this->stackPos-(3-1)], 1), $attributes), $this->yyastk[$this->stackPos-(3-3)], $attributes); } - protected function reduceRule434($attributes) { - $this->semValue = new Node\Expr\Variable($this->semStack[$this->stackPos-(3-2)], $attributes); + protected function yyn392($attributes) { + $this->yyval = new PHPParser_Node_Expr_Variable($this->yyastk[$this->stackPos-(3-2)], $attributes); } - protected function reduceRule435($attributes) { - $this->semValue = new Node\Expr\Variable($this->semStack[$this->stackPos-(3-2)], $attributes); + protected function yyn393($attributes) { + $this->yyval = new PHPParser_Node_Expr_Variable($this->yyastk[$this->stackPos-(3-2)], $attributes); } - protected function reduceRule436($attributes) { - $this->semValue = new Node\Expr\ArrayDimFetch(new Node\Expr\Variable($this->semStack[$this->stackPos-(6-2)], $attributes), $this->semStack[$this->stackPos-(6-4)], $attributes); + protected function yyn394($attributes) { + $this->yyval = new PHPParser_Node_Expr_ArrayDimFetch(new PHPParser_Node_Expr_Variable($this->yyastk[$this->stackPos-(6-2)], $attributes), $this->yyastk[$this->stackPos-(6-4)], $attributes); } - protected function reduceRule437($attributes) { - $this->semValue = $this->semStack[$this->stackPos-(3-2)]; + protected function yyn395($attributes) { + $this->yyval = $this->yyastk[$this->stackPos-(3-2)]; } - protected function reduceRule438($attributes) { - $this->semValue = new Node\Scalar\String($this->semStack[$this->stackPos-(1-1)], $attributes); + protected function yyn396($attributes) { + $this->yyval = new PHPParser_Node_Scalar_String($this->yyastk[$this->stackPos-(1-1)], $attributes); } - protected function reduceRule439($attributes) { - $this->semValue = new Node\Scalar\String($this->semStack[$this->stackPos-(1-1)], $attributes); + protected function yyn397($attributes) { + $this->yyval = new PHPParser_Node_Scalar_String($this->yyastk[$this->stackPos-(1-1)], $attributes); } - protected function reduceRule440($attributes) { - $this->semValue = new Node\Expr\Variable(substr($this->semStack[$this->stackPos-(1-1)], 1), $attributes); + protected function yyn398($attributes) { + $this->yyval = new PHPParser_Node_Expr_Variable(substr($this->yyastk[$this->stackPos-(1-1)], 1), $attributes); } } diff --git a/vendor/nikic/php-parser/lib/PHPParser/PrettyPrinterAbstract.php b/vendor/nikic/php-parser/lib/PHPParser/PrettyPrinterAbstract.php index 61511bb..def9ea3 100644 --- a/vendor/nikic/php-parser/lib/PHPParser/PrettyPrinterAbstract.php +++ b/vendor/nikic/php-parser/lib/PHPParser/PrettyPrinterAbstract.php @@ -1,73 +1,66 @@ array( 0, 1), - 'Expr_BitwiseNot' => array( 1, 1), - 'Expr_PreInc' => array( 1, 1), - 'Expr_PreDec' => array( 1, 1), - 'Expr_PostInc' => array( 1, -1), - 'Expr_PostDec' => array( 1, -1), - 'Expr_UnaryPlus' => array( 1, 1), - 'Expr_UnaryMinus' => array( 1, 1), - 'Expr_Cast_Int' => array( 1, 1), - 'Expr_Cast_Double' => array( 1, 1), - 'Expr_Cast_String' => array( 1, 1), - 'Expr_Cast_Array' => array( 1, 1), - 'Expr_Cast_Object' => array( 1, 1), - 'Expr_Cast_Bool' => array( 1, 1), - 'Expr_Cast_Unset' => array( 1, 1), - 'Expr_ErrorSuppress' => array( 1, 1), - 'Expr_Instanceof' => array( 2, 0), - 'Expr_BooleanNot' => array( 3, 1), - 'Expr_BinaryOp_Mul' => array( 4, -1), - 'Expr_BinaryOp_Div' => array( 4, -1), - 'Expr_BinaryOp_Mod' => array( 4, -1), - 'Expr_BinaryOp_Plus' => array( 5, -1), - 'Expr_BinaryOp_Minus' => array( 5, -1), - 'Expr_BinaryOp_Concat' => array( 5, -1), - 'Expr_BinaryOp_ShiftLeft' => array( 6, -1), - 'Expr_BinaryOp_ShiftRight' => array( 6, -1), - 'Expr_BinaryOp_Smaller' => array( 7, 0), - 'Expr_BinaryOp_SmallerOrEqual' => array( 7, 0), - 'Expr_BinaryOp_Greater' => array( 7, 0), - 'Expr_BinaryOp_GreaterOrEqual' => array( 7, 0), - 'Expr_BinaryOp_Equal' => array( 8, 0), - 'Expr_BinaryOp_NotEqual' => array( 8, 0), - 'Expr_BinaryOp_Identical' => array( 8, 0), - 'Expr_BinaryOp_NotIdentical' => array( 8, 0), - 'Expr_BinaryOp_BitwiseAnd' => array( 9, -1), - 'Expr_BinaryOp_BitwiseXor' => array(10, -1), - 'Expr_BinaryOp_BitwiseOr' => array(11, -1), - 'Expr_BinaryOp_BooleanAnd' => array(12, -1), - 'Expr_BinaryOp_BooleanOr' => array(13, -1), - 'Expr_Ternary' => array(14, -1), + 'Expr_BitwiseNot' => array( 1, 1), + 'Expr_PreInc' => array( 1, 1), + 'Expr_PreDec' => array( 1, 1), + 'Expr_PostInc' => array( 1, -1), + 'Expr_PostDec' => array( 1, -1), + 'Expr_UnaryPlus' => array( 1, 1), + 'Expr_UnaryMinus' => array( 1, 1), + 'Expr_Cast_Int' => array( 1, 1), + 'Expr_Cast_Double' => array( 1, 1), + 'Expr_Cast_String' => array( 1, 1), + 'Expr_Cast_Array' => array( 1, 1), + 'Expr_Cast_Object' => array( 1, 1), + 'Expr_Cast_Bool' => array( 1, 1), + 'Expr_Cast_Unset' => array( 1, 1), + 'Expr_ErrorSuppress' => array( 1, 1), + 'Expr_Instanceof' => array( 2, 0), + 'Expr_BooleanNot' => array( 3, 1), + 'Expr_Mul' => array( 4, -1), + 'Expr_Div' => array( 4, -1), + 'Expr_Mod' => array( 4, -1), + 'Expr_Plus' => array( 5, -1), + 'Expr_Minus' => array( 5, -1), + 'Expr_Concat' => array( 5, -1), + 'Expr_ShiftLeft' => array( 6, -1), + 'Expr_ShiftRight' => array( 6, -1), + 'Expr_Smaller' => array( 7, 0), + 'Expr_SmallerOrEqual' => array( 7, 0), + 'Expr_Greater' => array( 7, 0), + 'Expr_GreaterOrEqual' => array( 7, 0), + 'Expr_Equal' => array( 8, 0), + 'Expr_NotEqual' => array( 8, 0), + 'Expr_Identical' => array( 8, 0), + 'Expr_NotIdentical' => array( 8, 0), + 'Expr_BitwiseAnd' => array( 9, -1), + 'Expr_BitwiseXor' => array(10, -1), + 'Expr_BitwiseOr' => array(11, -1), + 'Expr_BooleanAnd' => array(12, -1), + 'Expr_BooleanOr' => array(13, -1), + 'Expr_Ternary' => array(14, -1), // parser uses %left for assignments, but they really behave as %right - 'Expr_Assign' => array(15, 1), - 'Expr_AssignRef' => array(15, 1), - 'Expr_AssignOp_Plus' => array(15, 1), - 'Expr_AssignOp_Minus' => array(15, 1), - 'Expr_AssignOp_Mul' => array(15, 1), - 'Expr_AssignOp_Div' => array(15, 1), - 'Expr_AssignOp_Concat' => array(15, 1), - 'Expr_AssignOp_Mod' => array(15, 1), - 'Expr_AssignOp_BitwiseAnd' => array(15, 1), - 'Expr_AssignOp_BitwiseOr' => array(15, 1), - 'Expr_AssignOp_BitwiseXor' => array(15, 1), - 'Expr_AssignOp_ShiftLeft' => array(15, 1), - 'Expr_AssignOp_ShiftRight' => array(15, 1), - 'Expr_AssignOp_Pow' => array(15, 1), - 'Expr_BinaryOp_LogicalAnd' => array(16, -1), - 'Expr_BinaryOp_LogicalXor' => array(17, -1), - 'Expr_BinaryOp_LogicalOr' => array(18, -1), - 'Expr_Include' => array(19, -1), + 'Expr_Assign' => array(15, 1), + 'Expr_AssignRef' => array(15, 1), + 'Expr_AssignPlus' => array(15, 1), + 'Expr_AssignMinus' => array(15, 1), + 'Expr_AssignMul' => array(15, 1), + 'Expr_AssignDiv' => array(15, 1), + 'Expr_AssignConcat' => array(15, 1), + 'Expr_AssignMod' => array(15, 1), + 'Expr_AssignBitwiseAnd' => array(15, 1), + 'Expr_AssignBitwiseOr' => array(15, 1), + 'Expr_AssignBitwiseXor' => array(15, 1), + 'Expr_AssignShiftLeft' => array(15, 1), + 'Expr_AssignShiftRight' => array(15, 1), + 'Expr_LogicalAnd' => array(16, -1), + 'Expr_LogicalXor' => array(17, -1), + 'Expr_LogicalOr' => array(18, -1), + 'Expr_Include' => array(19, -1), ); protected $noIndentToken; @@ -80,36 +73,36 @@ public function __construct() { /** * Pretty prints an array of statements. * - * @param Node[] $stmts Array of statements + * @param PHPParser_Node[] $stmts Array of statements * * @return string Pretty printed statements */ public function prettyPrint(array $stmts) { $this->preprocessNodes($stmts); - return ltrim(str_replace("\n" . $this->noIndentToken, "\n", $this->pStmts($stmts, false))); + return str_replace("\n" . $this->noIndentToken, "\n", $this->pStmts($stmts, false)); } /** * Pretty prints an expression. * - * @param Expr $node Expression node + * @param PHPParser_Node_Expr $node Expression node * * @return string Pretty printed node */ - public function prettyPrintExpr(Expr $node) { + public function prettyPrintExpr(PHPParser_Node_Expr $node) { return str_replace("\n" . $this->noIndentToken, "\n", $this->p($node)); } /** * Pretty prints a file of statements (includes the opening prettyPrint($stmts)); + $p = trim($this->prettyPrint($stmts)); $p = preg_replace('/^\?>\n?/', '', $p, -1, $count); $p = preg_replace('/<\?php$/', '', $p); @@ -124,13 +117,13 @@ public function prettyPrintFile(array $stmts) { /** * Preprocesses the top-level nodes to initialize pretty printer state. * - * @param Node[] $nodes Array of nodes + * @param PHPParser_Node[] $nodes Array of nodes */ protected function preprocessNodes(array $nodes) { /* We can use semicolon-namespaces unless there is a global namespace declaration */ $this->canUseSemicolonNamespaces = true; foreach ($nodes as $node) { - if ($node instanceof Stmt\Namespace_ && null === $node->name) { + if ($node instanceof PHPParser_Node_Stmt_Namespace && null === $node->name) { $this->canUseSemicolonNamespaces = false; } } @@ -139,39 +132,42 @@ protected function preprocessNodes(array $nodes) { /** * Pretty prints an array of nodes (statements) and indents them optionally. * - * @param Node[] $nodes Array of nodes - * @param bool $indent Whether to indent the printed nodes + * @param PHPParser_Node[] $nodes Array of nodes + * @param bool $indent Whether to indent the printed nodes * * @return string Pretty printed statements */ protected function pStmts(array $nodes, $indent = true) { - $result = ''; + $pNodes = array(); foreach ($nodes as $node) { - $result .= "\n" - . $this->pComments($node->getAttribute('comments', array())) - . $this->p($node) - . ($node instanceof Expr ? ';' : ''); + $pNodes[] = $this->pComments($node->getAttribute('comments', array())) + . $this->p($node) + . ($node instanceof PHPParser_Node_Expr ? ';' : ''); } if ($indent) { - return preg_replace('~\n(?!$|' . $this->noIndentToken . ')~', "\n ", $result); + return ' ' . preg_replace( + '~\n(?!$|' . $this->noIndentToken . ')~', + "\n" . ' ', + implode("\n", $pNodes) + ); } else { - return $result; + return implode("\n", $pNodes); } } /** * Pretty prints a node. * - * @param Node $node Node to be pretty printed + * @param PHPParser_Node $node Node to be pretty printed * * @return string Pretty printed node */ - protected function p(Node $node) { + protected function p(PHPParser_Node $node) { return $this->{'p' . $node->getType()}($node); } - protected function pInfixOp($type, Node $leftNode, $operatorString, Node $rightNode) { + protected function pInfixOp($type, PHPParser_Node $leftNode, $operatorString, PHPParser_Node $rightNode) { list($precedence, $associativity) = $this->precedenceMap[$type]; return $this->pPrec($leftNode, $precedence, $associativity, -1) @@ -179,12 +175,12 @@ protected function pInfixOp($type, Node $leftNode, $operatorString, Node $rightN . $this->pPrec($rightNode, $precedence, $associativity, 1); } - protected function pPrefixOp($type, $operatorString, Node $node) { + protected function pPrefixOp($type, $operatorString, PHPParser_Node $node) { list($precedence, $associativity) = $this->precedenceMap[$type]; return $operatorString . $this->pPrec($node, $precedence, $associativity, 1); } - protected function pPostfixOp($type, Node $node, $operatorString) { + protected function pPostfixOp($type, PHPParser_Node $node, $operatorString) { list($precedence, $associativity) = $this->precedenceMap[$type]; return $this->pPrec($node, $precedence, $associativity, -1) . $operatorString; } @@ -192,16 +188,16 @@ protected function pPostfixOp($type, Node $node, $operatorString) { /** * Prints an expression node with the least amount of parentheses necessary to preserve the meaning. * - * @param Node $node Node to pretty print - * @param int $parentPrecedence Precedence of the parent operator - * @param int $parentAssociativity Associativity of parent operator - * (-1 is left, 0 is nonassoc, 1 is right) - * @param int $childPosition Position of the node relative to the operator - * (-1 is left, 1 is right) + * @param PHPParser_Node $node Node to pretty print + * @param int $parentPrecedence Precedence of the parent operator + * @param int $parentAssociativity Associativity of parent operator + * (-1 is left, 0 is nonassoc, 1 is right) + * @param int $childPosition Position of the node relative to the operator + * (-1 is left, 1 is right) * * @return string The pretty printed node */ - protected function pPrec(Node $node, $parentPrecedence, $parentAssociativity, $childPosition) { + protected function pPrec(PHPParser_Node $node, $parentPrecedence, $parentAssociativity, $childPosition) { $type = $node->getType(); if (isset($this->precedenceMap[$type])) { $childPrecedence = $this->precedenceMap[$type][0]; @@ -218,8 +214,8 @@ protected function pPrec(Node $node, $parentPrecedence, $parentAssociativity, $c /** * Pretty prints an array of nodes and implodes the printed values. * - * @param Node[] $nodes Array of Nodes to be printed - * @param string $glue Character to implode with + * @param PHPParser_Node[] $nodes Array of Nodes to be printed + * @param string $glue Character to implode with * * @return string Imploded pretty printed nodes */ @@ -235,7 +231,7 @@ protected function pImplode(array $nodes, $glue = '') { /** * Pretty prints an array of nodes and implodes the printed values with commas. * - * @param Node[] $nodes Array of Nodes to be printed + * @param PHPParser_Node[] $nodes Array of Nodes to be printed * * @return string Comma separated pretty printed nodes */ diff --git a/vendor/nikic/php-parser/lib/PHPParser/Serializer.php b/vendor/nikic/php-parser/lib/PHPParser/Serializer.php index 7c173cd..e63decc 100644 --- a/vendor/nikic/php-parser/lib/PHPParser/Serializer.php +++ b/vendor/nikic/php-parser/lib/PHPParser/Serializer.php @@ -1,8 +1,6 @@ writer->startElement('node:' . $node->getType()); foreach ($node->getAttributes() as $name => $value) { @@ -54,9 +47,9 @@ protected function _serialize($node) { } $this->writer->endElement(); - } elseif ($node instanceof Comment) { + } elseif ($node instanceof PHPParser_Comment) { $this->writer->startElement('comment'); - $this->writer->writeAttribute('isDocComment', $node instanceof Comment\Doc ? 'true' : 'false'); + $this->writer->writeAttribute('isDocComment', $node instanceof PHPParser_Comment_Doc ? 'true' : 'false'); $this->writer->writeAttribute('line', $node->getLine()); $this->writer->text($node->getText()); $this->writer->endElement(); @@ -79,7 +72,7 @@ protected function _serialize($node) { } elseif (null === $node) { $this->writer->writeElement('scalar:null'); } else { - throw new \InvalidArgumentException('Unexpected node type'); + throw new InvalidArgumentException('Unexpected node type'); } } } \ No newline at end of file diff --git a/vendor/nikic/php-parser/lib/PHPParser/Unserializer.php b/vendor/nikic/php-parser/lib/PHPParser/Unserializer.php index 1e3a7db..34808c8 100644 --- a/vendor/nikic/php-parser/lib/PHPParser/Unserializer.php +++ b/vendor/nikic/php-parser/lib/PHPParser/Unserializer.php @@ -1,8 +1,6 @@ $new) { - class_alias($new, $old); + $file = dirname(dirname(__FILE__)) . '/' . strtr($class, '_', '/') . '.php'; + if (is_file($file)) { + require $file; } } - - private static $oldToNewMap = array( - 'PHPParser_Builder' => 'PhpParser\Builder', - 'PHPParser_BuilderAbstract' => 'PhpParser\BuilderAbstract', - 'PHPParser_BuilderFactory' => 'PhpParser\BuilderFactory', - 'PHPParser_Comment' => 'PhpParser\Comment', - 'PHPParser_Comment_Doc' => 'PhpParser\Comment\Doc', - 'PHPParser_Error' => 'PhpParser\Error', - 'PHPParser_Lexer' => 'PhpParser\Lexer', - 'PHPParser_Lexer_Emulative' => 'PhpParser\Lexer\Emulative', - 'PHPParser_Node' => 'PhpParser\Node', - 'PHPParser_NodeAbstract' => 'PhpParser\NodeAbstract', - 'PHPParser_NodeDumper' => 'PhpParser\NodeDumper', - 'PHPParser_NodeTraverser' => 'PhpParser\NodeTraverser', - 'PHPParser_NodeTraverserInterface' => 'PhpParser\NodeTraverserInterface', - 'PHPParser_NodeVisitor' => 'PhpParser\NodeVisitor', - 'PHPParser_NodeVisitor_NameResolver' => 'PhpParser\NodeVisitor\NameResolver', - 'PHPParser_NodeVisitorAbstract' => 'PhpParser\NodeVisitorAbstract', - 'PHPParser_Parser' => 'PhpParser\Parser', - 'PHPParser_PrettyPrinterAbstract' => 'PhpParser\PrettyPrinterAbstract', - 'PHPParser_PrettyPrinter_Default' => 'PhpParser\PrettyPrinter\Standard', - 'PHPParser_PrettyPrinter_Zend' => 'PhpParser\PrettyPrinter\Standard', - 'PHPParser_Serializer' => 'PhpParser\Serializer', - 'PHPParser_Serializer_XML' => 'PhpParser\Serializer\XML', - 'PHPParser_Unserializer' => 'PhpParser\Unserializer', - 'PHPParser_Unserializer_XML' => 'PhpParser\Unserializer\XML', - - 'PHPParser_Builder_Class' => 'PhpParser\Builder\Class_', - 'PHPParser_Builder_Function' => 'PhpParser\Builder\Function_', - 'PHPParser_Builder_Interface' => 'PhpParser\Builder\Interface_', - 'PHPParser_Builder_Method' => 'PhpParser\Builder\Method', - 'PHPParser_Builder_Param' => 'PhpParser\Builder\Param', - 'PHPParser_Builder_Property' => 'PhpParser\Builder\Property', - - 'PHPParser_Node_Arg' => 'PhpParser\Node\Arg', - 'PHPParser_Node_Const' => 'PhpParser\Node\Const_', - 'PHPParser_Node_Expr' => 'PhpParser\Node\Expr', - 'PHPParser_Node_Name' => 'PhpParser\Node\Name', - 'PHPParser_Node_Name_FullyQualified' => 'PhpParser\Node\Name\FullyQualified', - 'PHPParser_Node_Name_Relative' => 'PhpParser\Node\Name\Relative', - 'PHPParser_Node_Param' => 'PhpParser\Node\Param', - 'PHPParser_Node_Scalar' => 'PhpParser\Node\Scalar', - 'PHPParser_Node_Stmt' => 'PhpParser\Node\Stmt', - - 'PHPParser_Node_Stmt_Break' => 'PhpParser\Node\Stmt\Break_', - 'PHPParser_Node_Stmt_Case' => 'PhpParser\Node\Stmt\Case_', - 'PHPParser_Node_Stmt_Catch' => 'PhpParser\Node\Stmt\Catch_', - 'PHPParser_Node_Stmt_Class' => 'PhpParser\Node\Stmt\Class_', - 'PHPParser_Node_Stmt_ClassConst' => 'PhpParser\Node\Stmt\ClassConst', - 'PHPParser_Node_Stmt_ClassMethod' => 'PhpParser\Node\Stmt\ClassMethod', - 'PHPParser_Node_Stmt_Const' => 'PhpParser\Node\Stmt\Const_', - 'PHPParser_Node_Stmt_Continue' => 'PhpParser\Node\Stmt\Continue_', - 'PHPParser_Node_Stmt_Declare' => 'PhpParser\Node\Stmt\Declare_', - 'PHPParser_Node_Stmt_DeclareDeclare' => 'PhpParser\Node\Stmt\DeclareDeclare', - 'PHPParser_Node_Stmt_Do' => 'PhpParser\Node\Stmt\Do_', - 'PHPParser_Node_Stmt_Echo' => 'PhpParser\Node\Stmt\Echo_', - 'PHPParser_Node_Stmt_Else' => 'PhpParser\Node\Stmt\Else_', - 'PHPParser_Node_Stmt_ElseIf' => 'PhpParser\Node\Stmt\ElseIf_', - 'PHPParser_Node_Stmt_For' => 'PhpParser\Node\Stmt\For_', - 'PHPParser_Node_Stmt_Foreach' => 'PhpParser\Node\Stmt\Foreach_', - 'PHPParser_Node_Stmt_Function' => 'PhpParser\Node\Stmt\Function_', - 'PHPParser_Node_Stmt_Global' => 'PhpParser\Node\Stmt\Global_', - 'PHPParser_Node_Stmt_Goto' => 'PhpParser\Node\Stmt\Goto_', - 'PHPParser_Node_Stmt_HaltCompiler' => 'PhpParser\Node\Stmt\HaltCompiler', - 'PHPParser_Node_Stmt_If' => 'PhpParser\Node\Stmt\If_', - 'PHPParser_Node_Stmt_InlineHTML' => 'PhpParser\Node\Stmt\InlineHTML', - 'PHPParser_Node_Stmt_Interface' => 'PhpParser\Node\Stmt\Interface_', - 'PHPParser_Node_Stmt_Label' => 'PhpParser\Node\Stmt\Label', - 'PHPParser_Node_Stmt_Namespace' => 'PhpParser\Node\Stmt\Namespace_', - 'PHPParser_Node_Stmt_Property' => 'PhpParser\Node\Stmt\Property', - 'PHPParser_Node_Stmt_PropertyProperty' => 'PhpParser\Node\Stmt\PropertyProperty', - 'PHPParser_Node_Stmt_Return' => 'PhpParser\Node\Stmt\Return_', - 'PHPParser_Node_Stmt_Static' => 'PhpParser\Node\Stmt\Static_', - 'PHPParser_Node_Stmt_StaticVar' => 'PhpParser\Node\Stmt\StaticVar', - 'PHPParser_Node_Stmt_Switch' => 'PhpParser\Node\Stmt\Switch_', - 'PHPParser_Node_Stmt_Throw' => 'PhpParser\Node\Stmt\Throw_', - 'PHPParser_Node_Stmt_Trait' => 'PhpParser\Node\Stmt\Trait_', - 'PHPParser_Node_Stmt_TraitUse' => 'PhpParser\Node\Stmt\TraitUse', - 'PHPParser_Node_Stmt_TraitUseAdaptation' => 'PhpParser\Node\Stmt\TraitUseAdaptation', - 'PHPParser_Node_Stmt_TraitUseAdaptation_Alias' => 'PhpParser\Node\Stmt\TraitUseAdaptation\Alias', - 'PHPParser_Node_Stmt_TraitUseAdaptation_Precedence' => 'PhpParser\Node\Stmt\TraitUseAdaptation\Precedence', - 'PHPParser_Node_Stmt_TryCatch' => 'PhpParser\Node\Stmt\TryCatch', - 'PHPParser_Node_Stmt_Unset' => 'PhpParser\Node\Stmt\Unset_', - 'PHPParser_Node_Stmt_UseUse' => 'PhpParser\Node\Stmt\UseUse', - 'PHPParser_Node_Stmt_Use' => 'PhpParser\Node\Stmt\Use_', - 'PHPParser_Node_Stmt_While' => 'PhpParser\Node\Stmt\While_', - - 'PHPParser_Node_Expr_AssignBitwiseAnd' => 'PhpParser\Node\Expr\AssignOp\BitwiseAnd', - 'PHPParser_Node_Expr_AssignBitwiseOr' => 'PhpParser\Node\Expr\AssignOp\BitwiseOr', - 'PHPParser_Node_Expr_AssignBitwiseXor' => 'PhpParser\Node\Expr\AssignOp\BitwiseXor', - 'PHPParser_Node_Expr_AssignConcat' => 'PhpParser\Node\Expr\AssignOp\Concat', - 'PHPParser_Node_Expr_AssignDiv' => 'PhpParser\Node\Expr\AssignOp\Div', - 'PHPParser_Node_Expr_AssignMinus' => 'PhpParser\Node\Expr\AssignOp\Minus', - 'PHPParser_Node_Expr_AssignMod' => 'PhpParser\Node\Expr\AssignOp\Mod', - 'PHPParser_Node_Expr_AssignMul' => 'PhpParser\Node\Expr\AssignOp\Mul', - 'PHPParser_Node_Expr_AssignPlus' => 'PhpParser\Node\Expr\AssignOp\Plus', - 'PHPParser_Node_Expr_AssignShiftLeft' => 'PhpParser\Node\Expr\AssignOp\ShiftLeft', - 'PHPParser_Node_Expr_AssignShiftRight' => 'PhpParser\Node\Expr\AssignOp\ShiftRight', - - 'PHPParser_Node_Expr_Cast' => 'PhpParser\Node\Expr\Cast', - 'PHPParser_Node_Expr_Cast_Array' => 'PhpParser\Node\Expr\Cast\Array_', - 'PHPParser_Node_Expr_Cast_Bool' => 'PhpParser\Node\Expr\Cast\Bool', - 'PHPParser_Node_Expr_Cast_Double' => 'PhpParser\Node\Expr\Cast\Double', - 'PHPParser_Node_Expr_Cast_Int' => 'PhpParser\Node\Expr\Cast\Int', - 'PHPParser_Node_Expr_Cast_Object' => 'PhpParser\Node\Expr\Cast\Object', - 'PHPParser_Node_Expr_Cast_String' => 'PhpParser\Node\Expr\Cast\String', - 'PHPParser_Node_Expr_Cast_Unset' => 'PhpParser\Node\Expr\Cast\Unset_', - - 'PHPParser_Node_Expr_BitwiseAnd' => 'PhpParser\Node\Expr\BinaryOp\BitwiseAnd', - 'PHPParser_Node_Expr_BitwiseOr' => 'PhpParser\Node\Expr\BinaryOp\BitwiseOr', - 'PHPParser_Node_Expr_BitwiseXor' => 'PhpParser\Node\Expr\BinaryOp\BitwiseXor', - 'PHPParser_Node_Expr_BooleanAnd' => 'PhpParser\Node\Expr\BinaryOp\BooleanAnd', - 'PHPParser_Node_Expr_BooleanOr' => 'PhpParser\Node\Expr\BinaryOp\BooleanOr', - 'PHPParser_Node_Expr_Concat' => 'PhpParser\Node\Expr\BinaryOp\Concat', - 'PHPParser_Node_Expr_Div' => 'PhpParser\Node\Expr\BinaryOp\Div', - 'PHPParser_Node_Expr_Equal' => 'PhpParser\Node\Expr\BinaryOp\Equal', - 'PHPParser_Node_Expr_Greater' => 'PhpParser\Node\Expr\BinaryOp\Greater', - 'PHPParser_Node_Expr_GreaterOrEqual' => 'PhpParser\Node\Expr\BinaryOp\GreaterOrEqual', - 'PHPParser_Node_Expr_Identical' => 'PhpParser\Node\Expr\BinaryOp\Identical', - 'PHPParser_Node_Expr_LogicalAnd' => 'PhpParser\Node\Expr\BinaryOp\LogicalAnd', - 'PHPParser_Node_Expr_LogicalOr' => 'PhpParser\Node\Expr\BinaryOp\LogicalOr', - 'PHPParser_Node_Expr_LogicalXor' => 'PhpParser\Node\Expr\BinaryOp\LogicalXor', - 'PHPParser_Node_Expr_Minus' => 'PhpParser\Node\Expr\BinaryOp\Minus', - 'PHPParser_Node_Expr_Mod' => 'PhpParser\Node\Expr\BinaryOp\Mod', - 'PHPParser_Node_Expr_Mul' => 'PhpParser\Node\Expr\BinaryOp\Mul', - 'PHPParser_Node_Expr_NotEqual' => 'PhpParser\Node\Expr\BinaryOp\NotEqual', - 'PHPParser_Node_Expr_NotIdentical' => 'PhpParser\Node\Expr\BinaryOp\NotIdentical', - 'PHPParser_Node_Expr_Plus' => 'PhpParser\Node\Expr\BinaryOp\Plus', - 'PHPParser_Node_Expr_ShiftLeft' => 'PhpParser\Node\Expr\BinaryOp\ShiftLeft', - 'PHPParser_Node_Expr_ShiftRight' => 'PhpParser\Node\Expr\BinaryOp\ShiftRight', - 'PHPParser_Node_Expr_Smaller' => 'PhpParser\Node\Expr\BinaryOp\Smaller', - 'PHPParser_Node_Expr_SmallerOrEqual' => 'PhpParser\Node\Expr\BinaryOp\SmallerOrEqual', - - 'PHPParser_Node_Expr_Array' => 'PhpParser\Node\Expr\Array_', - 'PHPParser_Node_Expr_ArrayDimFetch' => 'PhpParser\Node\Expr\ArrayDimFetch', - 'PHPParser_Node_Expr_ArrayItem' => 'PhpParser\Node\Expr\ArrayItem', - 'PHPParser_Node_Expr_Assign' => 'PhpParser\Node\Expr\Assign', - 'PHPParser_Node_Expr_AssignRef' => 'PhpParser\Node\Expr\AssignRef', - 'PHPParser_Node_Expr_BitwiseNot' => 'PhpParser\Node\Expr\BitwiseNot', - 'PHPParser_Node_Expr_BooleanNot' => 'PhpParser\Node\Expr\BooleanNot', - 'PHPParser_Node_Expr_ClassConstFetch' => 'PhpParser\Node\Expr\ClassConstFetch', - 'PHPParser_Node_Expr_Clone' => 'PhpParser\Node\Expr\Clone_', - 'PHPParser_Node_Expr_Closure' => 'PhpParser\Node\Expr\Closure', - 'PHPParser_Node_Expr_ClosureUse' => 'PhpParser\Node\Expr\ClosureUse', - 'PHPParser_Node_Expr_ConstFetch' => 'PhpParser\Node\Expr\ConstFetch', - 'PHPParser_Node_Expr_Empty' => 'PhpParser\Node\Expr\Empty_', - 'PHPParser_Node_Expr_ErrorSuppress' => 'PhpParser\Node\Expr\ErrorSuppress', - 'PHPParser_Node_Expr_Eval' => 'PhpParser\Node\Expr\Eval_', - 'PHPParser_Node_Expr_Exit' => 'PhpParser\Node\Expr\Exit_', - 'PHPParser_Node_Expr_FuncCall' => 'PhpParser\Node\Expr\FuncCall', - 'PHPParser_Node_Expr_Include' => 'PhpParser\Node\Expr\Include_', - 'PHPParser_Node_Expr_Instanceof' => 'PhpParser\Node\Expr\Instanceof_', - 'PHPParser_Node_Expr_Isset' => 'PhpParser\Node\Expr\Isset_', - 'PHPParser_Node_Expr_List' => 'PhpParser\Node\Expr\List_', - 'PHPParser_Node_Expr_MethodCall' => 'PhpParser\Node\Expr\MethodCall', - 'PHPParser_Node_Expr_New' => 'PhpParser\Node\Expr\New_', - 'PHPParser_Node_Expr_PostDec' => 'PhpParser\Node\Expr\PostDec', - 'PHPParser_Node_Expr_PostInc' => 'PhpParser\Node\Expr\PostInc', - 'PHPParser_Node_Expr_PreDec' => 'PhpParser\Node\Expr\PreDec', - 'PHPParser_Node_Expr_PreInc' => 'PhpParser\Node\Expr\PreInc', - 'PHPParser_Node_Expr_Print' => 'PhpParser\Node\Expr\Print_', - 'PHPParser_Node_Expr_PropertyFetch' => 'PhpParser\Node\Expr\PropertyFetch', - 'PHPParser_Node_Expr_ShellExec' => 'PhpParser\Node\Expr\ShellExec', - 'PHPParser_Node_Expr_StaticCall' => 'PhpParser\Node\Expr\StaticCall', - 'PHPParser_Node_Expr_StaticPropertyFetch' => 'PhpParser\Node\Expr\StaticPropertyFetch', - 'PHPParser_Node_Expr_Ternary' => 'PhpParser\Node\Expr\Ternary', - 'PHPParser_Node_Expr_UnaryMinus' => 'PhpParser\Node\Expr\UnaryMinus', - 'PHPParser_Node_Expr_UnaryPlus' => 'PhpParser\Node\Expr\UnaryPlus', - 'PHPParser_Node_Expr_Variable' => 'PhpParser\Node\Expr\Variable', - 'PHPParser_Node_Expr_Yield' => 'PhpParser\Node\Expr\Yield_', - - 'PHPParser_Node_Scalar_ClassConst' => 'PhpParser\Node\Scalar\MagicConst\Class_', - 'PHPParser_Node_Scalar_DirConst' => 'PhpParser\Node\Scalar\MagicConst\Dir', - 'PHPParser_Node_Scalar_FileConst' => 'PhpParser\Node\Scalar\MagicConst\File', - 'PHPParser_Node_Scalar_FuncConst' => 'PhpParser\Node\Scalar\MagicConst\Function_', - 'PHPParser_Node_Scalar_LineConst' => 'PhpParser\Node\Scalar\MagicConst\Line', - 'PHPParser_Node_Scalar_MethodConst' => 'PhpParser\Node\Scalar\MagicConst\Method', - 'PHPParser_Node_Scalar_NSConst' => 'PhpParser\Node\Scalar\MagicConst\Namespace_', - 'PHPParser_Node_Scalar_TraitConst' => 'PhpParser\Node\Scalar\MagicConst\Trait_', - - 'PHPParser_Node_Scalar_DNumber' => 'PhpParser\Node\Scalar\DNumber', - 'PHPParser_Node_Scalar_Encapsed' => 'PhpParser\Node\Scalar\Encapsed', - 'PHPParser_Node_Scalar_LNumber' => 'PhpParser\Node\Scalar\LNumber', - 'PHPParser_Node_Scalar_String' => 'PhpParser\Node\Scalar\String', - ); -} - -class_alias('PhpParser\Autoloader', 'PHPParser_Autoloader'); \ No newline at end of file +} \ No newline at end of file diff --git a/vendor/nikic/php-parser/lib/PhpParser/BuilderAbstract.php b/vendor/nikic/php-parser/lib/PhpParser/BuilderAbstract.php index c804686..d17b060 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/BuilderAbstract.php +++ b/vendor/nikic/php-parser/lib/PhpParser/BuilderAbstract.php @@ -1,56 +1,36 @@ getNode(); - } elseif ($node instanceof Node) { + } elseif ($node instanceof PHPParser_Node) { return $node; } - throw new \LogicException('Expected node or builder object'); + throw new LogicException('Expected node or builder object'); } /** - * Normalizes a name: Converts plain string names to PhpParser\Node\Name. + * Normalizes a name: Converts plain string names to PHPParser_Node_Name. * - * @param Name|string $name The name to normalize + * @param PHPParser_Node_Name|string $name The name to normalize * - * @return Name The normalized name + * @return PHPParser_Node_Name The normalized name */ protected function normalizeName($name) { - if ($name instanceof Name) { + if ($name instanceof PHPParser_Node_Name) { return $name; - } elseif (is_string($name)) { - if (!$name) { - throw new \LogicException('Name cannot be empty'); - } - - if ($name[0] == '\\') { - return new Name\FullyQualified(substr($name, 1)); - } elseif (0 === strpos($name, 'namespace\\')) { - return new Name\Relative(substr($name, strlen('namespace\\'))); - } else { - return new Name($name); - } + } else { + return new PHPParser_Node_Name($name); } - - throw new \LogicException('Name must be a string or an instance of PhpParser\Node\Name'); } /** @@ -59,63 +39,46 @@ protected function normalizeName($name) { * * @param mixed $value The value to normalize * - * @return Expr The normalized value + * @return PHPParser_Node_Expr The normalized value */ protected function normalizeValue($value) { - if ($value instanceof Node) { + if ($value instanceof PHPParser_Node) { return $value; } elseif (is_null($value)) { - return new Expr\ConstFetch( - new Name('null') + return new PHPParser_Node_Expr_ConstFetch( + new PHPParser_Node_Name('null') ); } elseif (is_bool($value)) { - return new Expr\ConstFetch( - new Name($value ? 'true' : 'false') + return new PHPParser_Node_Expr_ConstFetch( + new PHPParser_Node_Name($value ? 'true' : 'false') ); } elseif (is_int($value)) { - return new Scalar\LNumber($value); + return new PHPParser_Node_Scalar_LNumber($value); } elseif (is_float($value)) { - return new Scalar\DNumber($value); + return new PHPParser_Node_Scalar_DNumber($value); } elseif (is_string($value)) { - return new Scalar\String($value); + return new PHPParser_Node_Scalar_String($value); } elseif (is_array($value)) { $items = array(); $lastKey = -1; foreach ($value as $itemKey => $itemValue) { // for consecutive, numeric keys don't generate keys if (null !== $lastKey && ++$lastKey === $itemKey) { - $items[] = new Expr\ArrayItem( + $items[] = new PHPParser_Node_Expr_ArrayItem( $this->normalizeValue($itemValue) ); } else { $lastKey = null; - $items[] = new Expr\ArrayItem( + $items[] = new PHPParser_Node_Expr_ArrayItem( $this->normalizeValue($itemValue), $this->normalizeValue($itemKey) ); } } - return new Expr\Array_($items); - } else { - throw new \LogicException('Invalid value'); - } - } - - /** - * Normalizes a doc comment: Converts plain strings to PhpParser\Comment\Doc. - * - * @param Comment\Doc|string $docComment The doc comment to normalize - * - * @return Comment\Doc The normalized doc comment - */ - protected function normalizeDocComment($docComment) { - if ($docComment instanceof Comment\Doc) { - return $docComment; - } else if (is_string($docComment)) { - return new Comment\Doc($docComment); + return new PHPParser_Node_Expr_Array($items); } else { - throw new \LogicException('Doc comment must be a string or an instance of PhpParser\Comment\Doc'); + throw new LogicException('Invalid value'); } } @@ -125,7 +88,7 @@ protected function normalizeDocComment($docComment) { * @param int $modifier Modifier to set */ protected function setModifier($modifier) { - Stmt\Class_::verifyModifier($this->type, $modifier); + PHPParser_Node_Stmt_Class::verifyModifier($this->type, $modifier); $this->type |= $modifier; } -} +} \ No newline at end of file diff --git a/vendor/nikic/php-parser/lib/PhpParser/Comment.php b/vendor/nikic/php-parser/lib/PhpParser/Comment.php index 128d02e..feae399 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Comment.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Comment.php @@ -1,8 +1,6 @@ array( - 'finally' => Parser::T_FINALLY, - 'yield' => Parser::T_YIELD, + '5.5.0-dev' => array( + 'finally' => PHPParser_Parser::T_FINALLY, + 'yield' => PHPParser_Parser::T_YIELD, + ), + '5.4.0-dev' => array( + 'callable' => PHPParser_Parser::T_CALLABLE, + 'insteadof' => PHPParser_Parser::T_INSTEADOF, + 'trait' => PHPParser_Parser::T_TRAIT, + '__trait__' => PHPParser_Parser::T_TRAIT_C, ), - self::PHP_5_4 => array( - 'callable' => Parser::T_CALLABLE, - 'insteadof' => Parser::T_INSTEADOF, - 'trait' => Parser::T_TRAIT, - '__trait__' => Parser::T_TRAIT_C, + '5.3.0-dev' => array( + '__dir__' => PHPParser_Parser::T_DIR, + 'goto' => PHPParser_Parser::T_GOTO, + 'namespace' => PHPParser_Parser::T_NAMESPACE, + '__namespace__' => PHPParser_Parser::T_NS_C, ), ); @@ -44,26 +38,19 @@ public function __construct(array $options = array()) { $this->newKeywords += $newKeywords; } - - if (version_compare(PHP_VERSION, self::PHP_5_6, '<')) { - $this->tokenMap[self::T_ELLIPSIS] = Parser::T_ELLIPSIS; - $this->tokenMap[self::T_POW] = Parser::T_POW; - $this->tokenMap[self::T_POW_EQUAL] = Parser::T_POW_EQUAL; - } } public function startLexing($code) { $this->inObjectAccess = false; - $preprocessedCode = $this->preprocessCode($code); - parent::startLexing($preprocessedCode); - if ($preprocessedCode !== $code) { + // on PHP 5.4 don't do anything + if (version_compare(PHP_VERSION, '5.4.0RC1', '>=')) { + parent::startLexing($code); + } else { + $code = $this->preprocessCode($code); + parent::startLexing($code); $this->postprocessTokens(); } - - // Set code property back to the original code, so __halt_compiler() - // handling and (start|end)FilePos attributes use the correct offsets - $this->code = $code; } /* @@ -71,24 +58,45 @@ public function startLexing($code) { * ~LABEL~ is never valid PHP code, that's why we can (to some degree) safely * use it here. * Later when preprocessing the tokens these sequences will either be replaced - * by real tokens or replaced with their original content (e.g. if they occurred + * by real tokens or replaced with their original content (e.g. if they occured * inside a string, i.e. a place where they don't have a special meaning). */ protected function preprocessCode($code) { - if (version_compare(PHP_VERSION, self::PHP_5_6, '>=')) { - return $code; + // binary notation (0b010101101001...) + $code = preg_replace('(\b0b[01]+\b)', '~__EMU__BINARY__$0__~', $code); + + if (version_compare(PHP_VERSION, '5.3.0', '<')) { + // namespace separator (backslash not followed by some special characters, + // which are not valid after a NS separator, but would cause problems with + // escape sequence parsing if one would replace the backslash there) + $code = preg_replace('(\\\\(?!["\'`${\\\\]))', '~__EMU__NS__~', $code); + + // nowdoc (<<<'ABC'\ncontent\nABC;) + $code = preg_replace_callback( + '((*BSR_ANYCRLF) # set \R to (?>\r\n|\r|\n) + (b?<<<[\t ]*\'([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)\'\R) # opening token + ((?:(?!\2;?\R).*\R)*) # content + (\2) # closing token + (?=;?\R) # must be followed by newline (with optional semicolon) + )x', + array($this, 'encodeNowdocCallback'), + $code + ); } - $code = str_replace('...', '~__EMU__ELLIPSIS__~', $code); - $code = preg_replace('((?=')) { - return $code; - } + return $code; + } - // binary notation (0b010101101001...) - return preg_replace('(\b0b[01]+\b)', '~__EMU__BINARY__$0__~', $code); + /* + * As nowdocs can have arbitrary content but LABELs can only contain a certain + * range of characters, the nowdoc content is encoded as hex and separated by + * 'x' tokens. So the result of the encoding will look like this: + * ~__EMU__NOWDOC__{HEX(START_TOKEN)}x{HEX(CONTENT)}x{HEX(END_TOKEN)}~ + */ + public function encodeNowdocCallback(array $matches) { + return '~__EMU__NOWDOC__' + . bin2hex($matches[1]) . 'x' . bin2hex($matches[3]) . 'x' . bin2hex($matches[4]) + . '__~'; } /* @@ -99,7 +107,7 @@ protected function postprocessTokens() { // we need to manually iterate and manage a count because we'll change // the tokens array on the way for ($i = 0, $c = count($this->tokens); $i < $c; ++$i) { - // first check that the following tokens are of form ~LABEL~, + // first check that the following tokens are form ~LABEL~, // then match the __EMU__... sequence. if ('~' === $this->tokens[$i] && isset($this->tokens[$i + 2]) @@ -113,18 +121,22 @@ protected function postprocessTokens() { $replace = array( array(is_int(bindec($matches[2])) ? T_LNUMBER : T_DNUMBER, $matches[2], $this->tokens[$i + 1][2]) ); - } else if ('ELLIPSIS' === $matches[1]) { - $replace = array( - array(self::T_ELLIPSIS, '...', $this->tokens[$i + 1][2]) - ); - } else if ('POW' === $matches[1]) { - $replace = array( - array(self::T_POW, '**', $this->tokens[$i + 1][2]) - ); - } else if ('POWEQUAL' === $matches[1]) { - $replace = array( - array(self::T_POW_EQUAL, '**=', $this->tokens[$i + 1][2]) - ); + } elseif ('NS' === $matches[1]) { + // a \ single char token is returned here and replaced by a + // PHPParser_Parser::T_NS_SEPARATOR token in ->getNextToken(). This hacks around + // the limitations arising from T_NS_SEPARATOR not being defined on 5.3 + $replace = array('\\'); + } elseif ('NOWDOC' === $matches[1]) { + // decode the encoded nowdoc payload; pack('H*' is bin2hex( for 5.3 + list($start, $content, $end) = explode('x', $matches[2]); + list($start, $content, $end) = array(pack('H*', $start), pack('H*', $content), pack('H*', $end)); + + $replace = array(); + $replace[] = array(T_START_HEREDOC, $start, $this->tokens[$i + 1][2]); + if ('' !== $content) { + $replace[] = array(T_ENCAPSED_AND_WHITESPACE, $content, -1); + } + $replace[] = array(T_END_HEREDOC, $end, -1); } else { // just ignore all other __EMU__ sequences continue; @@ -153,12 +165,11 @@ protected function postprocessTokens() { public function restoreContentCallback(array $matches) { if ('BINARY' === $matches[1]) { return $matches[2]; - } else if ('ELLIPSIS' === $matches[1]) { - return '...'; - } else if ('POW' === $matches[1]) { - return '**'; - } else if ('POWEQUAL' === $matches[1]) { - return '**='; + } elseif ('NS' === $matches[1]) { + return '\\'; + } elseif ('NOWDOC' === $matches[1]) { + list($start, $content, $end) = explode('x', $matches[2]); + return pack('H*', $start) . pack('H*', $content) . pack('H*', $end); } else { return $matches[0]; } @@ -170,12 +181,15 @@ public function getNextToken(&$value = null, &$startAttributes = null, &$endAttr // replace new keywords by their respective tokens. This is not done // if we currently are in an object access (e.g. in $obj->namespace // "namespace" stays a T_STRING tokens and isn't converted to T_NAMESPACE) - if (Parser::T_STRING === $token && !$this->inObjectAccess) { + if (PHPParser_Parser::T_STRING === $token && !$this->inObjectAccess) { if (isset($this->newKeywords[strtolower($value)])) { return $this->newKeywords[strtolower($value)]; } + // backslashes are replaced by T_NS_SEPARATOR tokens + } elseif (92 === $token) { // ord('\\') + return PHPParser_Parser::T_NS_SEPARATOR; // keep track of whether we currently are in an object access (after ->) - } elseif (Parser::T_OBJECT_OPERATOR === $token) { + } elseif (PHPParser_Parser::T_OBJECT_OPERATOR === $token) { $this->inObjectAccess = true; } else { $this->inObjectAccess = false; @@ -183,4 +197,4 @@ public function getNextToken(&$value = null, &$startAttributes = null, &$endAttr return $token; } -} +} \ No newline at end of file diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Arg.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Arg.php index 068e332..5893e25 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Arg.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Arg.php @@ -1,30 +1,23 @@ $value, - 'byRef' => $byRef, - 'unpack' => $unpack, + 'value' => $value, + 'byRef' => $byRef ), $attributes ); diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayDimFetch.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayDimFetch.php index 8530172..f7d8628 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayDimFetch.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayDimFetch.php @@ -1,23 +1,19 @@ $var, diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Assign.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Assign.php index dce66bb..1619425 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Assign.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Assign.php @@ -1,23 +1,19 @@ $var, diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignRef.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignRef.php index 801878f..0bcf0b0 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignRef.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignRef.php @@ -1,23 +1,19 @@ $var, diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Int.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Int.php index 7094d1c..85dff31 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Int.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Int.php @@ -1,9 +1,5 @@ $name diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/FuncCall.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/FuncCall.php index 06c961e..8f85df1 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/FuncCall.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/FuncCall.php @@ -1,21 +1,16 @@ $var diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreInc.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreInc.php index 1887319..0074966 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreInc.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreInc.php @@ -1,21 +1,17 @@ $var diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticPropertyFetch.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticPropertyFetch.php index 51f1af6..0e7826d 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticPropertyFetch.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticPropertyFetch.php @@ -1,22 +1,17 @@ $expr diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Name/Relative.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Name/Relative.php index 25676ce..c9d6f6d 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Name/Relative.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Name/Relative.php @@ -1,8 +1,6 @@ $type, - 'byRef' => $byRef, - 'variadic' => $variadic, - 'name' => $name, - 'default' => $default, + 'name' => $name, + 'default' => $default, + 'type' => $type, + 'byRef' => $byRef ), $attributes ); - - if ($variadic && null !== $default) { - throw new Error('Variadic parameter cannot have a default value'); - } } } \ No newline at end of file diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Encapsed.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Encapsed.php index 071263a..7f0b544 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Encapsed.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Encapsed.php @@ -1,13 +1,9 @@ '\\', @@ -36,8 +32,6 @@ public function __construct($value = '', array $attributes = array()) { } /** - * @internal - * * Parses a string token. * * @param string $str String token content @@ -62,8 +56,6 @@ public static function parse($str) { } /** - * @internal - * * Parses escape sequences in strings (all string types apart from single quoted). * * @param string $str String without quotes @@ -83,7 +75,7 @@ public static function parseEscapeSequences($str, $quote) { ); } - private static function parseCallback($matches) { + public static function parseCallback($matches) { $str = $matches[1]; if (isset(self::$replacements[$str])) { @@ -96,8 +88,6 @@ private static function parseCallback($matches) { } /** - * @internal - * * Parses a constant doc string. * * @param string $startToken Doc string start token content (<< $type, - 'byRef' => isset($subNodes['byRef']) ? $subNodes['byRef'] : false, - 'name' => $name, - 'params' => isset($subNodes['params']) ? $subNodes['params'] : array(), - 'stmts' => array_key_exists('stmts', $subNodes) ? $subNodes['stmts'] : array(), + $subNodes + array( + 'type' => PHPParser_Node_Stmt_Class::MODIFIER_PUBLIC, + 'byRef' => false, + 'params' => array(), + 'stmts' => array(), ), $attributes ); + $this->name = $name; - if ($this->type & Class_::MODIFIER_STATIC) { + if ($this->type & PHPParser_Node_Stmt_Class::MODIFIER_STATIC) { switch (strtolower($this->name)) { case '__construct': - throw new Error(sprintf('Constructor %s() cannot be static', $this->name)); + throw new PHPParser_Error(sprintf('Constructor %s() cannot be static', $this->name)); case '__destruct': - throw new Error(sprintf('Destructor %s() cannot be static', $this->name)); + throw new PHPParser_Error(sprintf('Destructor %s() cannot be static', $this->name)); case '__clone': - throw new Error(sprintf('Clone method %s() cannot be static', $this->name)); + throw new PHPParser_Error(sprintf('Clone method %s() cannot be static', $this->name)); } } } public function isPublic() { - return (bool) ($this->type & Class_::MODIFIER_PUBLIC); + return (bool) ($this->type & PHPParser_Node_Stmt_Class::MODIFIER_PUBLIC); } public function isProtected() { - return (bool) ($this->type & Class_::MODIFIER_PROTECTED); + return (bool) ($this->type & PHPParser_Node_Stmt_Class::MODIFIER_PROTECTED); } public function isPrivate() { - return (bool) ($this->type & Class_::MODIFIER_PRIVATE); + return (bool) ($this->type & PHPParser_Node_Stmt_Class::MODIFIER_PRIVATE); } public function isAbstract() { - return (bool) ($this->type & Class_::MODIFIER_ABSTRACT); + return (bool) ($this->type & PHPParser_Node_Stmt_Class::MODIFIER_ABSTRACT); } public function isFinal() { - return (bool) ($this->type & Class_::MODIFIER_FINAL); + return (bool) ($this->type & PHPParser_Node_Stmt_Class::MODIFIER_FINAL); } public function isStatic() { - return (bool) ($this->type & Class_::MODIFIER_STATIC); + return (bool) ($this->type & PHPParser_Node_Stmt_Class::MODIFIER_STATIC); } } diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/InlineHTML.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/InlineHTML.php index f0722c6..d0578de 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/InlineHTML.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/InlineHTML.php @@ -1,13 +1,9 @@ $name, diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/StaticVar.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/StaticVar.php index f800930..3c5b144 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/StaticVar.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/StaticVar.php @@ -1,23 +1,19 @@ $name, diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUse.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUse.php index afa2a3e..8db1b7e 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUse.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUse.php @@ -1,21 +1,17 @@ $trait, diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TryCatch.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TryCatch.php index 96203a6..796aae3 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TryCatch.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TryCatch.php @@ -1,28 +1,23 @@ getType() . '('; } elseif (is_array($node)) { $r = 'array('; } else { - throw new \InvalidArgumentException('Can only dump nodes and arrays.'); + throw new InvalidArgumentException('Can only dump nodes and arrays.'); } foreach ($node as $key => $value) { diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php b/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php index 6f8a328..cfe9bf1 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php +++ b/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php @@ -1,11 +1,9 @@ visitors[] = $visitor; } /** * Removes an added visitor. * - * @param NodeVisitor $visitor + * @param PHPParser_NodeVisitor $visitor */ - public function removeVisitor(NodeVisitor $visitor) { + public function removeVisitor(PHPParser_NodeVisitor $visitor) { foreach ($this->visitors as $index => $storedVisitor) { if ($storedVisitor === $visitor) { unset($this->visitors[$index]); @@ -42,9 +40,9 @@ public function removeVisitor(NodeVisitor $visitor) { /** * Traverses an array of nodes using the registered visitors. * - * @param Node[] $nodes Array of nodes + * @param PHPParser_Node[] $nodes Array of nodes * - * @return Node[] Traversed array of nodes + * @return PHPParser_Node[] Traversed array of nodes */ public function traverse(array $nodes) { foreach ($this->visitors as $visitor) { @@ -64,7 +62,7 @@ public function traverse(array $nodes) { return $nodes; } - protected function traverseNode(Node $node) { + protected function traverseNode(PHPParser_Node $node) { $node = clone $node; foreach ($node->getSubNodeNames() as $name) { @@ -72,20 +70,14 @@ protected function traverseNode(Node $node) { if (is_array($subNode)) { $subNode = $this->traverseArray($subNode); - } elseif ($subNode instanceof Node) { - $traverseChildren = true; + } elseif ($subNode instanceof PHPParser_Node) { foreach ($this->visitors as $visitor) { - $return = $visitor->enterNode($subNode); - if (self::DONT_TRAVERSE_CHILDREN === $return) { - $traverseChildren = false; - } else if (null !== $return) { + if (null !== $return = $visitor->enterNode($subNode)) { $subNode = $return; } } - if ($traverseChildren) { - $subNode = $this->traverseNode($subNode); - } + $subNode = $this->traverseNode($subNode); foreach ($this->visitors as $visitor) { if (null !== $return = $visitor->leaveNode($subNode)) { @@ -104,25 +96,19 @@ protected function traverseArray(array $nodes) { foreach ($nodes as $i => &$node) { if (is_array($node)) { $node = $this->traverseArray($node); - } elseif ($node instanceof Node) { - $traverseChildren = true; + } elseif ($node instanceof PHPParser_Node) { foreach ($this->visitors as $visitor) { - $return = $visitor->enterNode($node); - if (self::DONT_TRAVERSE_CHILDREN === $return) { - $traverseChildren = false; - } else if (null !== $return) { + if (null !== $return = $visitor->enterNode($node)) { $node = $return; } } - if ($traverseChildren) { - $node = $this->traverseNode($node); - } + $node = $this->traverseNode($node); foreach ($this->visitors as $visitor) { $return = $visitor->leaveNode($node); - if (self::REMOVE_NODE === $return) { + if (false === $return) { $doNodes[] = array($i, array()); break; } elseif (is_array($return)) { @@ -143,4 +129,4 @@ protected function traverseArray(array $nodes) { return $nodes; } -} +} \ No newline at end of file diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php b/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php index e86a3ad..25bffed 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php +++ b/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php @@ -1,38 +1,40 @@ [aliasName => originalName]] + * @var array Currently defined namespace and class aliases */ protected $aliases; public function beforeTraverse(array $nodes) { - $this->resetState(); + $this->namespace = null; + $this->aliases = array(); } - public function enterNode(Node $node) { - if ($node instanceof Stmt\Namespace_) { - $this->resetState($node->name); - } elseif ($node instanceof Stmt\Use_) { - foreach ($node->uses as $use) { - $this->addAlias($use, $node->type); + public function enterNode(PHPParser_Node $node) { + if ($node instanceof PHPParser_Node_Stmt_Namespace) { + $this->namespace = $node->name; + $this->aliases = array(); + } elseif ($node instanceof PHPParser_Node_Stmt_UseUse) { + $aliasName = strtolower($node->alias); + if (isset($this->aliases[$aliasName])) { + throw new PHPParser_Error( + sprintf( + 'Cannot use "%s" as "%s" because the name is already in use', + $node->name, $node->alias + ), + $node->getLine() + ); } - } elseif ($node instanceof Stmt\Class_) { + + $this->aliases[$aliasName] = $node->name; + } elseif ($node instanceof PHPParser_Node_Stmt_Class) { if (null !== $node->extends) { $node->extends = $this->resolveClassName($node->extends); } @@ -42,107 +44,51 @@ public function enterNode(Node $node) { } $this->addNamespacedName($node); - } elseif ($node instanceof Stmt\Interface_) { + } elseif ($node instanceof PHPParser_Node_Stmt_Interface) { foreach ($node->extends as &$interface) { $interface = $this->resolveClassName($interface); } $this->addNamespacedName($node); - } elseif ($node instanceof Stmt\Trait_) { + } elseif ($node instanceof PHPParser_Node_Stmt_Trait) { $this->addNamespacedName($node); - } elseif ($node instanceof Stmt\Function_) { + } elseif ($node instanceof PHPParser_Node_Stmt_Function) { $this->addNamespacedName($node); - } elseif ($node instanceof Stmt\Const_) { + } elseif ($node instanceof PHPParser_Node_Stmt_Const) { foreach ($node->consts as $const) { $this->addNamespacedName($const); } - } elseif ($node instanceof Expr\StaticCall - || $node instanceof Expr\StaticPropertyFetch - || $node instanceof Expr\ClassConstFetch - || $node instanceof Expr\New_ - || $node instanceof Expr\Instanceof_ + } elseif ($node instanceof PHPParser_Node_Expr_StaticCall + || $node instanceof PHPParser_Node_Expr_StaticPropertyFetch + || $node instanceof PHPParser_Node_Expr_ClassConstFetch + || $node instanceof PHPParser_Node_Expr_New + || $node instanceof PHPParser_Node_Expr_Instanceof ) { - if ($node->class instanceof Name) { + if ($node->class instanceof PHPParser_Node_Name) { $node->class = $this->resolveClassName($node->class); } - } elseif ($node instanceof Stmt\Catch_) { + } elseif ($node instanceof PHPParser_Node_Stmt_Catch) { $node->type = $this->resolveClassName($node->type); - } elseif ($node instanceof Expr\FuncCall) { - if ($node->name instanceof Name) { - $node->name = $this->resolveOtherName($node->name, Stmt\Use_::TYPE_FUNCTION); + } elseif ($node instanceof PHPParser_Node_Expr_FuncCall + || $node instanceof PHPParser_Node_Expr_ConstFetch + ) { + if ($node->name instanceof PHPParser_Node_Name) { + $node->name = $this->resolveOtherName($node->name); } - } elseif ($node instanceof Expr\ConstFetch) { - $node->name = $this->resolveOtherName($node->name, Stmt\Use_::TYPE_CONSTANT); - } elseif ($node instanceof Stmt\TraitUse) { + } elseif ($node instanceof PHPParser_Node_Stmt_TraitUse) { foreach ($node->traits as &$trait) { $trait = $this->resolveClassName($trait); } - - foreach($node->adaptations as $adaptation) { - if (null !== $adaptation->trait) { - $adaptation->trait = $this->resolveClassName($adaptation->trait); - } - - if ($adaptation instanceof Stmt\TraitUseAdaptation\Precedence) { - foreach ($adaptation->insteadof as &$insteadof) { - $insteadof = $this->resolveClassName($insteadof); - } - } - } - - } elseif ($node instanceof Node\Param - && $node->type instanceof Name + } elseif ($node instanceof PHPParser_Node_Param + && $node->type instanceof PHPParser_Node_Name ) { $node->type = $this->resolveClassName($node->type); } } - protected function resetState(Name $namespace = null) { - $this->namespace = $namespace; - $this->aliases = array( - Stmt\Use_::TYPE_NORMAL => array(), - Stmt\Use_::TYPE_FUNCTION => array(), - Stmt\Use_::TYPE_CONSTANT => array(), - ); - } - - protected function addAlias(Stmt\UseUse $use, $type) { - // Constant names are case sensitive, everything else case insensitive - if ($type === Stmt\Use_::TYPE_CONSTANT) { - $aliasName = $use->alias; - } else { - $aliasName = strtolower($use->alias); - } - - if (isset($this->aliases[$type][$aliasName])) { - $typeStringMap = array( - Stmt\Use_::TYPE_NORMAL => '', - Stmt\Use_::TYPE_FUNCTION => 'function ', - Stmt\Use_::TYPE_CONSTANT => 'const ', - ); - - throw new Error( - sprintf( - 'Cannot use %s%s as %s because the name is already in use', - $typeStringMap[$type], $use->name, $use->alias - ), - $use->getLine() - ); - } - - $this->aliases[$type][$aliasName] = $use->name; - } - - protected function resolveClassName(Name $name) { + protected function resolveClassName(PHPParser_Node_Name $name) { // don't resolve special class names - if (in_array(strtolower($name), array('self', 'parent', 'static'))) { - if (!$name->isUnqualified()) { - throw new Error( - sprintf("'\\%s' is an invalid class name", $name->toString()), - $name->getLine() - ); - } - + if (in_array((string) $name, array('self', 'parent', 'static'))) { return $name; } @@ -151,55 +97,43 @@ protected function resolveClassName(Name $name) { return $name; } + // resolve aliases (for non-relative names) $aliasName = strtolower($name->getFirst()); - if (!$name->isRelative() && isset($this->aliases[Stmt\Use_::TYPE_NORMAL][$aliasName])) { - // resolve aliases (for non-relative names) - $name->setFirst($this->aliases[Stmt\Use_::TYPE_NORMAL][$aliasName]); + if (!$name->isRelative() && isset($this->aliases[$aliasName])) { + $name->setFirst($this->aliases[$aliasName]); + // if no alias exists prepend current namespace } elseif (null !== $this->namespace) { - // if no alias exists prepend current namespace $name->prepend($this->namespace); } - return new Name\FullyQualified($name->parts, $name->getAttributes()); + return new PHPParser_Node_Name_FullyQualified($name->parts, $name->getAttributes()); } - protected function resolveOtherName(Name $name, $type) { - // fully qualified names are already resolved - if ($name->isFullyQualified()) { + protected function resolveOtherName(PHPParser_Node_Name $name) { + // fully qualified names are already resolved and we can't do anything about unqualified + // ones at compiler-time + if ($name->isFullyQualified() || $name->isUnqualified()) { return $name; } // resolve aliases for qualified names $aliasName = strtolower($name->getFirst()); - if ($name->isQualified() && isset($this->aliases[Stmt\Use_::TYPE_NORMAL][$aliasName])) { - $name->setFirst($this->aliases[Stmt\Use_::TYPE_NORMAL][$aliasName]); - } elseif ($name->isUnqualified()) { - if ($type === Stmt\Use_::TYPE_CONSTANT) { - // constant aliases are case-sensitive, function aliases case-insensitive - $aliasName = $name->getFirst(); - } - - if (isset($this->aliases[$type][$aliasName])) { - // resolve unqualified aliases - $name->set($this->aliases[$type][$aliasName]); - } else { - // unqualified, unaliased names cannot be resolved at compile-time - return $name; - } + if ($name->isQualified() && isset($this->aliases[$aliasName])) { + $name->setFirst($this->aliases[$aliasName]); + // prepend namespace for relative names } elseif (null !== $this->namespace) { - // if no alias exists prepend current namespace $name->prepend($this->namespace); } - return new Name\FullyQualified($name->parts, $name->getAttributes()); + return new PHPParser_Node_Name_FullyQualified($name->parts, $name->getAttributes()); } - protected function addNamespacedName(Node $node) { + protected function addNamespacedName(PHPParser_Node $node) { if (null !== $this->namespace) { $node->namespacedName = clone $this->namespace; $node->namespacedName->append($node->name); } else { - $node->namespacedName = new Name($node->name, $node->getAttributes()); + $node->namespacedName = new PHPParser_Node_Name($node->name, $node->getAttributes()); } } } diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitorAbstract.php b/vendor/nikic/php-parser/lib/PhpParser/NodeVisitorAbstract.php index 3e1743a..75ae698 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitorAbstract.php +++ b/vendor/nikic/php-parser/lib/PhpParser/NodeVisitorAbstract.php @@ -1,14 +1,12 @@ getClassNameFromType($this->reader->localName); + protected function readNode() + { + $className = 'PHPParser_Node_' . $this->reader->localName; // create the node without calling it's constructor $node = unserialize( @@ -127,23 +122,12 @@ protected function readScalar() { protected function readComment() { $className = $this->reader->getAttribute('isDocComment') === 'true' - ? 'PhpParser\Comment\Doc' - : 'PhpParser\Comment' + ? 'PHPParser_Comment_Doc' + : 'PHPParser_Comment' ; return new $className( $this->reader->readString(), $this->reader->getAttribute('line') ); } - - protected function getClassNameFromType($type) { - $className = 'PhpParser\\Node\\' . strtr($type, '_', '\\'); - if (!class_exists($className)) { - $className .= '_'; - } - if (!class_exists($className)) { - throw new DomainException(sprintf('Unknown node type "%s"', $type)); - } - return $className; - } } diff --git a/vendor/patchwork/utf8/.travis.yml b/vendor/patchwork/utf8/.travis.yml index 6c89261..7988d56 100644 --- a/vendor/patchwork/utf8/.travis.yml +++ b/vendor/patchwork/utf8/.travis.yml @@ -5,8 +5,14 @@ php: - 5.4 - 5.5 - 5.6 + - nightly - hhvm-nightly +matrix: + allow_failures: + - php: nightly + - php: hhvm-nightly + script: - phpunit --coverage-text - phpunit --group unicode --coverage-text diff --git a/vendor/patchwork/utf8/CHANGELOG.md b/vendor/patchwork/utf8/CHANGELOG.md index 1ae2a5b..1695ada 100644 --- a/vendor/patchwork/utf8/CHANGELOG.md +++ b/vendor/patchwork/utf8/CHANGELOG.md @@ -1,3 +1,33 @@ +## v1.2.2 (2015-04-26) + +- Fix ucwords to be functionally the same as in-built PHP version +- Fix iconv_set_encoding deprecation notice in PHP 5.6.0 +- remove legacy test for HHVM/PHP7 +- mb_parse_str() should have no return value + +## v1.2.1 (2015-01-28) + +- fix double declaration in mbstring shim + +## v1.2.0 (2015-01-12) + +- add u::strwidth() to get the width of a string when printed on a terminal +- add more mbstring shims +- add a note about https://bugs.php.net/65358 +- fail properly when COM is not loaded +- fallback on stat() when lstat() fails + +## v1.2.0-beta (2014-08-05) + +- add best-fit mappings for UTF-8 to Code Page approximations +- add portable Unicode filesystem access under Windows and other OSes + +## v1.1.29 (2015-04-26) + +- fix ucwords to be functionally the same as in-built PHP version +- fix iconv_set_encoding deprecation notice in PHP 5.6.0 +- remove legacy test for HHVM/PHP7 + ## v1.1.28 (2015-01-12) - fix mbstring shim for html-entities diff --git a/vendor/patchwork/utf8/README.md b/vendor/patchwork/utf8/README.md index c2a0118..e194a17 100644 --- a/vendor/patchwork/utf8/README.md +++ b/vendor/patchwork/utf8/README.md @@ -19,6 +19,10 @@ It can also serve as a documentation source referencing the practical problems that arise when handling UTF-8 in PHP: Unicode concepts, related algorithms, bugs in PHP core, workarounds, etc. +Version 1.2 adds best-fit mappings for UTF-8 to *Code Page* approximations. +It also adds Unicode filesystem access under Windows, using preferably +[wfio](https://github.com/kenjiuno/php-wfio) or a COM based fallback otherwise. + Portability ----------- @@ -35,10 +39,11 @@ server even if one or more of those extensions are not enabled: - *utf8_encode, utf8_decode*, - `mbstring`: *mb_check_encoding, mb_convert_case, mb_convert_encoding, mb_decode_mimeheader, mb_detect_encoding, mb_detect_order, - mb_encode_mimeheader, mb_encoding_aliases, mb_internal_encoding, mb_language, - mb_list_encodings, mb_strlen, mb_strpos, mb_strrpos, mb_strtolower, + mb_encode_mimeheader, mb_encoding_aliases, mb_get_info, mb_http_input, + mb_http_output, mb_internal_encoding, mb_language, mb_list_encodings, + mb_output_handler, mb_strlen, mb_strpos, mb_strrpos, mb_strtolower, mb_strtoupper, mb_stripos, mb_stristr, mb_strrchr, mb_strrichr, mb_strripos, - mb_strstr, mb_substitute_character, mb_substr*, + mb_strstr, mb_strwidth, mb_substitute_character, mb_substr, mb_substr_count*, - `iconv`: *iconv, iconv_mime_decode, iconv_mime_decode_headers, iconv_get_encoding, iconv_set_encoding, iconv_mime_encode, ob_iconv_handler, iconv_strlen, iconv_strpos, iconv_strrpos, iconv_substr*, @@ -62,7 +67,9 @@ Some more functions are also provided to help handling UTF-8 strings: - *isUtf8()*: checks if a string contains well formed UTF-8 data, - *toAscii()*: generic UTF-8 to ASCII transliteration, - *strtocasefold()*: unicode transformation for caseless matching, -- *strtonatfold()*: generic case sensitive transformation for collation matching +- *strtonatfold()*: generic case sensitive transformation for collation matching, +- *strwidth()*: computes the width of a string when printed on a terminal, +- *wrapPath()*: unicode filesystem access under Windows and other OSes. Mirrored string functions are: *strlen, substr, strpos, stripos, strrpos, strripos, strstr, stristr, strrchr, @@ -91,7 +98,7 @@ the `php composer.phar install` command to install it: { "require": { - "patchwork/utf8": "~1.1" + "patchwork/utf8": "~1.2" } } @@ -124,7 +131,8 @@ through. When dealing with badly formed UTF-8, you should not try to fix it Instead, consider it as [CP-1252](http://wikipedia.org/wiki/CP-1252) and use `Patchwork\Utf8::utf8_encode()` to get an UTF-8 string. Don't forget also to choose one unicode normalization form and stick to it. NFC is now the defacto -standard. `Patchwork\Utf8::filter()` implements this behavior. +standard. `Patchwork\Utf8::filter()` implements this behavior: it converts from +CP1252 and to NFC. This library is orthogonal to `mbstring.func_overload` and will not work if the php.ini setting is enabled. diff --git a/vendor/patchwork/utf8/class/Patchwork/PHP/Shim/Mbstring.php b/vendor/patchwork/utf8/class/Patchwork/PHP/Shim/Mbstring.php index 040df1f..d299c4d 100644 --- a/vendor/patchwork/utf8/class/Patchwork/PHP/Shim/Mbstring.php +++ b/vendor/patchwork/utf8/class/Patchwork/PHP/Shim/Mbstring.php @@ -18,8 +18,12 @@ * - mb_decode_mimeheader - Decode string in MIME header field * - mb_encode_mimeheader - Encode string for MIME header XXX NATIVE IMPLEMENTATION IS REALLY BUGGED * - mb_convert_case - Perform case folding on a string + * - mb_get_info - Get internal settings of mbstring + * - mb_http_input - Detect HTTP input character encoding + * - mb_http_output - Set/Get HTTP output character encoding * - mb_internal_encoding - Set/Get internal character encoding * - mb_list_encodings - Returns an array of all supported encodings + * - mb_output_handler - Callback function converts character encoding in output buffer * - mb_strlen - Get string length * - mb_strpos - Find position of first occurrence of string in a string * - mb_strrpos - Find position of last occurrence of a string in a string @@ -33,28 +37,23 @@ * - mb_strrichr - Finds the last occurrence of a character in a string within another, case insensitive * - mb_strripos - Finds position of last occurrence of a string within another, case insensitive * - mb_strstr - Finds first occurrence of a string within anothers + * - mb_strwidth - Return width of string + * - mb_substr_count - Count the number of substring occurrences * * Not implemented: - * - mb_convert_kana - Convert "kana" one from another ("zen-kaku", "han-kaku" and more) - * - mb_convert_variables - Convert character code in variable(s) - * - mb_decode_numericentity - Decode HTML numeric string reference to character - * - mb_encode_numericentity - Encode character to HTML numeric string reference - * - mb_ereg* - Regular expression with multibyte support - * - mb_get_info - Get internal settings of mbstring - * - mb_http_input - Detect HTTP input character encoding - * - mb_http_output - Set/Get HTTP output character encoding - * - mb_list_mime_names - Returns an array or string of all supported mime names - * - mb_output_handler - Callback function converts character encoding in output buffer - * - mb_parse_str - Parse GET/POST/COOKIE data and set global variable - * - mb_preferred_mime_name - Get MIME charset string - * - mb_regex_encoding - Returns current encoding for multibyte regex as string - * - mb_regex_set_options - Set/Get the default options for mbregex functions - * - mb_send_mail - Send encoded mail - * - mb_split - Split multibyte string using regular expression - * - mb_strcut - Get part of string - * - mb_strimwidth - Get truncated string with specified width - * - mb_strwidth - Return width of string - * - mb_substr_count - Count the number of substring occurrences + * - mb_convert_kana - Convert "kana" one from another ("zen-kaku", "han-kaku" and more) + * - mb_convert_variables - Convert character code in variable(s) + * - mb_decode_numericentity - Decode HTML numeric string reference to character + * - mb_encode_numericentity - Encode character to HTML numeric string reference + * - mb_ereg_* - Regular expression with multibyte support + * - mb_parse_str - Parse GET/POST/COOKIE data and set global variable + * - mb_preferred_mime_name - Get MIME charset string + * - mb_regex_encoding - Returns current encoding for multibyte regex as string + * - mb_regex_set_options - Set/Get the default options for mbregex functions + * - mb_send_mail - Send encoded mail + * - mb_split - Split multibyte string using regular expression + * - mb_strcut - Get part of string + * - mb_strimwidth - Get truncated string with specified width */ class Mbstring { @@ -408,6 +407,68 @@ static function mb_strstr($haystack, $needle, $part = false, $encoding = INF) else return substr($haystack, $pos); } + static function mb_get_info($type = 'all') + { + $info = array( + 'internal_encoding' => self::$internal_encoding, + 'http_output' => 'pass', + 'http_output_conv_mimetypes' => '^(text/|application/xhtml\+xml)', + 'func_overload' => 0, + 'func_overload_list' => 'no overload', + 'mail_charset' => 'UTF-8', + 'mail_header_encoding' => 'BASE64', + 'mail_body_encoding' => 'BASE64', + 'illegal_chars' => 0, + 'encoding_translation' => 'Off', + 'language' => self::$language, + 'detect_order' => self::$encoding_list, + 'substitute_character' => 'none', + 'strict_detection' => 'Off', + ); + + if ('all' === $type) { + return $info; + } elseif (isset($info[$type])) { + return $info[$type]; + } else { + return false; + } + } + + static function mb_http_input($type = '') + { + return false; + } + + static function mb_http_output($encoding = INF) + { + return INF !== $encoding ? 'pass' === $encoding : 'pass'; + } + + static function mb_strwidth($s, $encoding = INF) + { + $encoding = INF === $encoding ? self::$internal_encoding : strtoupper($encoding); + + if ('UTF-8' !== $encoding && 'UTF8' !== $encoding) { + $s = iconv($encoding, 'UTF-8//IGNORE', $s); + } + + $s = preg_replace('/[\x00-\x19]/', '', $s); + + preg_replace('/[\x{0020}-\x{1FFF}\x{FF61}-\x{FF9F}]/u', '', $s, -1, $narrow); + + return (iconv_strlen($s, 'UTF-8') << 1) - $narrow; + } + + static function mb_substr_count($haystack, $needle, $encoding = INF) + { + return substr_count($haystack, $needle); + } + + static function mb_output_handler($contents, $status) + { + return $contents; + } protected static function getSubpart($pos, $part, $haystack, $encoding) { diff --git a/vendor/patchwork/utf8/class/Patchwork/Utf8.php b/vendor/patchwork/utf8/class/Patchwork/Utf8.php index 61abfe8..0614cff 100644 --- a/vendor/patchwork/utf8/class/Patchwork/Utf8.php +++ b/vendor/patchwork/utf8/class/Patchwork/Utf8.php @@ -21,6 +21,7 @@ class Utf8 { protected static + $pathPrefix, $commonCaseFold = array( array('µ','ſ',"\xCD\x85",'ς',"\xCF\x90","\xCF\x91","\xCF\x95","\xCF\x96","\xCF\xB0","\xCF\xB1","\xCF\xB5","\xE1\xBA\x9B","\xE1\xBE\xBE"), array('μ','s','ι', 'σ','β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', "\xE1\xB9\xA1",'ι' ) @@ -89,6 +90,30 @@ static function toAscii($s, $subst_chr = '?') return $s; } + static function wrapPath($path = '') + { + if (null === static::$pathPrefix) + { + if (extension_loaded('wfio')) + { + static::$pathPrefix = 'wfio://'; + } + else if ('\\' === DIRECTORY_SEPARATOR && class_exists('COM', false)) + { + static::$pathPrefix = 'utf8'.mt_rand(); + stream_wrapper_register(static::$pathPrefix, 'Patchwork\Utf8\WindowsStreamWrapper'); + static::$pathPrefix .= '://'; + } else { + if ('\\' === DIRECTORY_SEPARATOR) { + trigger_error('The `wfio` or `com_dotnet` extension is required to handle UTF-8 filesystem access on Windows'); + } + static::$pathPrefix = 'file://'; + } + } + + return static::$pathPrefix . $path; + } + static function filter($var, $normalization_form = 4 /* n::NFC */, $leading_combining = '◌') { switch (gettype($var)) @@ -541,7 +566,13 @@ static function lcfirst($s) static function ucwords($s) { - return mb_convert_case($s, MB_CASE_TITLE, 'UTF-8'); + return preg_replace_callback( + "/\b(.)/u", + function ($matches) { + return mb_convert_case($matches[1], MB_CASE_TITLE, 'UTF-8'); + }, + $s + ); } static function number_format($number, $decimals = 0, $dec_point = '.', $thousands_sep = ',') @@ -574,6 +605,30 @@ static function utf8_decode($s) return utf8_decode($s); } + static function strwidth($s) + { + if (false !== strpos($s, "\r")) + { + $s = str_replace("\r\n", "\n", $s); + $s = strtr($s, "\r", "\n"); + } + $width = 0; + + foreach (explode("\n", $s) as $s) + { + $s = preg_replace('/\x1B\[[\d;]*m/', '', $s); + $c = substr_count($s, "\xAD") - substr_count($s, "\x08"); + $s = preg_replace('/[\x00\x05\x07\p{Mn}\p{Me}\p{Cf}\x{1160}-\x{11FF}\x{200B}]+/u', '', $s); + preg_replace('/[\x{1100}-\x{115F}\x{2329}\x{232A}\x{2E80}-\x{303E}\x{3040}-\x{A4CF}\x{AC00}-\x{D7A3}\x{F900}-\x{FAFF}\x{FE10}-\x{FE19}\x{FE30}-\x{FE6F}\x{FF00}-\x{FF60}\x{FFE0}-\x{FFE6}\x{20000}-\x{2FFFD}\x{30000}-\x{3FFFD}]/u', '', $s, -1, $wide); + + if ($width < $c = iconv_strlen($s, 'UTF-8') + $wide + $c) + { + $width = $c; + } + } + + return $width; + } protected static function rxClass($s, $class = '') { diff --git a/vendor/patchwork/utf8/class/Patchwork/Utf8/BestFit.php b/vendor/patchwork/utf8/class/Patchwork/Utf8/BestFit.php new file mode 100644 index 0000000..72b0d00 --- /dev/null +++ b/vendor/patchwork/utf8/class/Patchwork/Utf8/BestFit.php @@ -0,0 +1,68 @@ + 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4); + + $s .= ''; + $cp = (string) (int) $cp; + $result = '9' === $cp[0] ? $s . $s : $s; + + if ('932' === $cp && 2 === func_num_args()) $placeholder = "\x81\x45"; // Katakana Middle Dot in CP932 + + if (!isset($map[$cp])) + { + $i = static::getData('to.bestfit' . $cp); + if (false === $i) return false; + $map[$cp] = $i; + } + + $i = $j = 0; + $cp = $map[$cp]; + + while ($i < $len) + { + if ($s[$i] < "\x80") $uchr = $s[$i++]; + else + { + $ulen = $ulen_mask[$s[$i] & "\xF0"]; + $uchr = substr($s, $i, $ulen); + $i += $ulen; + } + + if (isset($cp[$uchr])) $uchr = $cp[$uchr]; + else $uchr = $placeholder; + + isset($uchr[0]) && $result[$j++] = $uchr[0]; + isset($uchr[1]) && $result[$j++] = $uchr[1]; + } + + return substr($result, 0, $j); + } + + protected static function getData($file) + { + $file = __DIR__ . '/data/' . $file . '.ser'; + if (file_exists($file)) return unserialize(file_get_contents($file)); + else return false; + } +} diff --git a/vendor/patchwork/utf8/class/Patchwork/Utf8/Bootup.php b/vendor/patchwork/utf8/class/Patchwork/Utf8/Bootup.php index 493d4a4..851dd90 100644 --- a/vendor/patchwork/utf8/class/Patchwork/Utf8/Bootup.php +++ b/vendor/patchwork/utf8/class/Patchwork/Utf8/Bootup.php @@ -84,19 +84,19 @@ static function initIconv() { if (extension_loaded('iconv')) { - if ('UTF-8' !== iconv_get_encoding('input_encoding')) + if ('UTF-8' !== strtoupper(iconv_get_encoding('input_encoding'))) { iconv_set_encoding('input_encoding', 'UTF-8'); } - if ('UTF-8' !== iconv_get_encoding('internal_encoding')) + if ('UTF-8' !== strtoupper(iconv_get_encoding('internal_encoding'))) { iconv_set_encoding('internal_encoding', 'UTF-8'); } - if ('UTF-8' !== iconv_get_encoding('output_encoding')) + if ('UTF-8' !== strtoupper(iconv_get_encoding('output_encoding'))) { - iconv_set_encoding('output_encoding' , 'UTF-8'); + iconv_set_encoding('output_encoding', 'UTF-8'); } } else if (!defined('ICONV_IMPL')) diff --git a/vendor/patchwork/utf8/class/Patchwork/Utf8/Bootup/mbstring.php b/vendor/patchwork/utf8/class/Patchwork/Utf8/Bootup/mbstring.php index 0af741b..9b0c6d8 100644 --- a/vendor/patchwork/utf8/class/Patchwork/Utf8/Bootup/mbstring.php +++ b/vendor/patchwork/utf8/class/Patchwork/Utf8/Bootup/mbstring.php @@ -28,13 +28,12 @@ function mb_encoding_aliases($encoding) {return s\Mbstring::mb_encoding_aliases( function mb_check_encoding($var = INF, $encoding = INF) {return s\Mbstring::mb_check_encoding($var, $encoding);} function mb_detect_encoding($str, $encoding_list = INF, $strict = false) {return s\Mbstring::mb_detect_encoding($str, $encoding_list, $strict);} function mb_detect_order($encoding_list = INF) {return s\Mbstring::mb_detect_order($encoding_list);} -function mb_parse_str($s, &$result = array()) {return parse_str($s, $result);}; +function mb_parse_str($s, &$result = array()) {parse_str($s, $result);}; function mb_strlen($s, $enc = INF) {return s\Mbstring::mb_strlen($s, $enc);}; function mb_strpos($s, $needle, $offset = 0, $enc = INF) {return s\Mbstring::mb_strpos($s, $needle, $offset, $enc);}; function mb_strtolower($s, $enc = INF) {return s\Mbstring::mb_strtolower($s, $enc);}; function mb_strtoupper($s, $enc = INF) {return s\Mbstring::mb_strtoupper($s, $enc);}; function mb_substitute_character($char = INF) {return s\Mbstring::mb_substitute_character($char);}; -function mb_substr_count($s, $needle) {return substr_count($s, $needle);}; function mb_substr($s, $start, $length = 2147483647, $enc = INF) {return s\Mbstring::mb_substr($s, $start, $length, $enc);}; function mb_stripos($s, $needle, $offset = 0, $enc = INF) {return s\Mbstring::mb_stripos($s, $needle, $offset, $enc);}; function mb_stristr($s, $needle, $part = false, $enc = INF) {return s\Mbstring::mb_stristr($s, $needle, $part, $enc);}; @@ -43,3 +42,9 @@ function mb_strrichr($s, $needle, $part = false, $enc = INF) {return s\Mbstring: function mb_strripos($s, $needle, $offset = 0, $enc = INF) {return s\Mbstring::mb_strripos($s, $needle, $offset, $enc);}; function mb_strrpos($s, $needle, $offset = 0, $enc = INF) {return s\Mbstring::mb_strrpos($s, $needle, $offset, $enc);}; function mb_strstr($s, $needle, $part = false, $enc = INF) {return s\Mbstring::mb_strstr($s, $needle, $part, $enc);}; +function mb_get_info($type = 'all') {return s\Mbstring::mb_get_info($type);} +function mb_http_output($enc = INF) {return s\Mbstring::mb_http_output($enc);} +function mb_strwidth($s, $enc = INF) {return s\Mbstring::mb_strwidth($s, $enc);} +function mb_substr_count($haystack, $needle, $enc = INF) {return s\Mbstring::mb_substr_count($haystack, $needle, $enc);} +function mb_output_handler($contents, $status) {return s\Mbstring::mb_output_handler($contents, $status);} +function mb_http_input($type = '') {return s\Mbstring::mb_http_input($type);} diff --git a/vendor/patchwork/utf8/class/Patchwork/Utf8/WindowsStreamWrapper.php b/vendor/patchwork/utf8/class/Patchwork/Utf8/WindowsStreamWrapper.php new file mode 100644 index 0000000..6ee7fe6 --- /dev/null +++ b/vendor/patchwork/utf8/class/Patchwork/Utf8/WindowsStreamWrapper.php @@ -0,0 +1,405 @@ +FileExists($path)) $fs->GetFile($path)->Attributes |= 2; + else if ($fs->FolderExists($path)) $fs->GetFolder($path)->Attributes |= 2; + else return false; + + return true; + } + + static function fs($path, $is_utf8 = true) + { + static $fs; + + if (! class_exists('COM', false)) { + throw new \RuntimeException('The `wfio` or `com_dotnet` extension is required to handle UTF-8 filesystem access on Windows'); + } + + isset($fs) or $fs = new \COM('Scripting.FileSystemObject', null, CP_UTF8); + + $path = explode('://', $path, 2); + $path = $path[(int) isset($path[1])]; + $path = strtr($path, '/', '\\'); + $pre = ''; + + if (! isset($path[0]) + || ( '/' !== $path[0] + && '\\' !== $path[0] + && false === strpos($path, ':') ) ) + { + $pre = getcwd() . '\\'; + } + + $pre = new \VARIANT($pre); + + if ($is_utf8) $path = new \VARIANT($path, VT_BSTR, CP_UTF8); + else $path = new \VARIANT($path); + + return array($fs, $fs->getAbsolutePathName(variant_cat($pre, $path))); + } + + function dir_closedir() + { + $this->handle = null; + + return true; + } + + function dir_opendir($path, $options) + { + list($fs, $path) = self::fs($path); + if (! $fs->FolderExists($path)) return false; + + $dir = $fs->GetFolder($path); + + try + { + $f = array('.', '..'); + + foreach ($dir->SubFolders() as $v) $f[] = $v->Name; + foreach ($dir->Files as $v) $f[] = $v->Name; + } + catch (\Exception $f) + { + $f = array(); + } + + $this->handle = $f; + + return true; + } + + function dir_readdir() + { + if (list(, $c) = each($this->handle)) return $c; + + return false; + } + + function dir_rewinddir() + { + reset($this->handle); + + return true; + } + + function mkdir($path, $mode, $options) + { + list($fs, $path) = self::fs($path); + + try + { + if ($options & STREAM_MKDIR_RECURSIVE) + { + $path = $fs->GetAbsolutePathName($path); + + $path = explode('\\', $path); + + if (isset($path[3]) && '' === $path[0] . $path[1]) + { + $pre = '\\\\' . $path[2] . '\\' . $path[3] . '\\'; + $i = 4; + } + else if (isset($path[1])) + { + $pre = $path[0] . '\\'; + $i = 1; + } + else + { + $pre = ''; + $i = 0; + } + + while (isset($path[$i]) && $fs->FolderExists($pre . $path[$i])) + { + $pre .= $path[$i++] . '\\'; + } + + if (! isset($path[$i])) return false; + + while (isset($path[$i])) + { + $fs->CreateFolder($pre .= $path[$i++] . '\\'); + } + + return true; + } + else + { + $fs->CreateFolder($path); + } + + return true; + } + catch (\Exception $e) + { + return false; + } + } + + function rename($from, $to) + { + list($fs, $to) = self::fs($to); + + if ($fs->FileExists($to) || $fs->FolderExists($to)) + { + return false; + } + + list(,$from) = self::fs($from); + + try + { + if ($fs->FileExists($from)) + { + $fs->MoveFile($from, $to); + + return true; + } + + if ($fs->FolderExists($from)) + { + $fs->MoveFolder($from, $to); + + return true; + } + } + catch (\Exception $e) {} + + return false; + } + + function rmdir($path, $options) + { + list($fs, $path) = self::fs($path); + + if ($fs->FolderExists($path)) return rmdir($fs->GetFolder($path)->ShortPath); + + return false; + } + + // @todo function stream_cast($cast_as) + + function stream_close() + { + fclose($this->handle); + $this->handle = null; + } + + function stream_eof() + { + return feof($this->handle); + } + + function stream_flush() + { + return fflush($this->handle); + } + + function stream_lock($operation) + { + return flock($this->handle, $operation); + } + + function stream_metadata($path, $option, $value) + { + list($fs, $path) = self::fs($path); + + if ($fs->FileExists($path)) $f = $fs->GetFile($path); + else if ($fs->FileExists($path)) $f = $fs->GetFolder($path); + else $f = false; + + if (STREAM_META_TOUCH === $option) + { + if ($f) return touch($f->ShortPath); + + try + { + $fs->OpenTextFile($path, 8, true, 0)->Close(); + + return true; + } + catch (\Exception $e) {} + } + + if (! $f) return false; + + switch ($option) + { + case STREAM_META_ACCESS: return chmod($f->ShortPath, $value); + case STREAM_META_OWNER: + case STREAM_META_OWNER_NAME: return chown($f->ShortPath, $value); + case STREAM_META_GROUP: + case STREAM_META_GROUP_NAME: return chgrp($f->ShortPath, $value); + default: return false; + } + } + + function stream_open($path, $mode, $options, &$opened_path) + { + $mode .= ''; + list($fs, $path) = self::fs($path); + + if ($fs->FolderExists($path)) return false; + + try + { + if ('x' === $m = substr($mode, 0, 1)) + { + $fs->CreateTextFile($path, false)->Close(); + $f = $fs->GetFile($path); + $mode[0] = 'w'; + } + else + { + $f = $fs->GetFile($path); + } + } + catch (\Exception $f) + { + try + { + switch ($m) + { + case 'w': + case 'c': + case 'a': + $h = $fs->CreateTextFile($path, true); + $f = $fs->GetFile($path); + $h->Close(); + break; + + default: return false; + } + } + catch (\Exception $e) + { + return false; + } + } + + if (! (STREAM_REPORT_ERRORS & $options)) + { + set_error_handler('var_dump', 0); + $e = error_reporting(0); + } + + $this->handle = fopen($f->ShortPath, $mode); + + if (! (STREAM_REPORT_ERRORS & $options)) + { + error_reporting($e); + restore_error_handler(); + } + + if ($this->handle) return true; + if (isset($h)) $f->Delete(true); + + return false; + } + + function stream_read($count) + { + return fread($this->handle, $count); + } + + function stream_seek($offset, $whence = SEEK_SET) + { + return fseek($this->handle, $offset, $whence); + } + + function stream_set_option($option, $arg1, $arg2) + { + switch ($option) + { + case STREAM_OPTION_BLOCKING: return stream_set_blocking($this->handle, $arg1); + case STREAM_OPTION_READ_TIMEOUT: return stream_set_timeout($this->handle, $arg1, $arg2); + case STREAM_OPTION_WRITE_BUFFER: return stream_set_write_buffer($this->handle, $arg1, $arg2); + default: return false; + } + } + + function stream_stat() + { + return fstat($this->handle); + } + + function stream_tell() + { + return ftell($this->handle); + } + + function stream_truncate($new_size) + { + return ftruncate($this->handle, $new_size); + } + + function stream_write($data) + { + return fwrite($this->handle, $data, strlen($data)); + } + + function unlink($path) + { + list($fs, $path) = self::fs($path); + + if ($fs->FileExists($path)) return unlink($fs->GetFile($path)->ShortPath); + + return false; + } + + function url_stat($path, $flags) + { + list($fs, $path) = self::fs($path); + + if ($fs->FileExists($path)) $f = $fs->GetFile($path); + else if ($fs->FolderExists($path)) $f = $fs->GetFolder($path); + else return false; + + if (STREAM_URL_STAT_QUIET & $flags) + { + set_error_handler('var_dump', 0); + $e = error_reporting(0); + } + + if (STREAM_URL_STAT_LINK & $flags) $f = @lstat($f->ShortPath) ?: stat($f->ShortPath); + else $f = stat($f->ShortPath); + + if (STREAM_URL_STAT_QUIET & $flags) + { + error_reporting($e); + restore_error_handler(); + } + + return $f; + } +} diff --git a/vendor/patchwork/utf8/class/Patchwork/Utf8/data/to.bestfit1250.ser b/vendor/patchwork/utf8/class/Patchwork/Utf8/data/to.bestfit1250.ser new file mode 100644 index 0000000..6b90ecc Binary files /dev/null and b/vendor/patchwork/utf8/class/Patchwork/Utf8/data/to.bestfit1250.ser differ diff --git a/vendor/patchwork/utf8/class/Patchwork/Utf8/data/to.bestfit1251.ser b/vendor/patchwork/utf8/class/Patchwork/Utf8/data/to.bestfit1251.ser new file mode 100644 index 0000000..981e180 Binary files /dev/null and b/vendor/patchwork/utf8/class/Patchwork/Utf8/data/to.bestfit1251.ser differ diff --git a/vendor/patchwork/utf8/class/Patchwork/Utf8/data/to.bestfit1252.ser b/vendor/patchwork/utf8/class/Patchwork/Utf8/data/to.bestfit1252.ser new file mode 100644 index 0000000..d43292b Binary files /dev/null and b/vendor/patchwork/utf8/class/Patchwork/Utf8/data/to.bestfit1252.ser differ diff --git a/vendor/patchwork/utf8/class/Patchwork/Utf8/data/to.bestfit1253.ser b/vendor/patchwork/utf8/class/Patchwork/Utf8/data/to.bestfit1253.ser new file mode 100644 index 0000000..4904d69 Binary files /dev/null and b/vendor/patchwork/utf8/class/Patchwork/Utf8/data/to.bestfit1253.ser differ diff --git a/vendor/patchwork/utf8/class/Patchwork/Utf8/data/to.bestfit1254.ser b/vendor/patchwork/utf8/class/Patchwork/Utf8/data/to.bestfit1254.ser new file mode 100644 index 0000000..9b9c71d Binary files /dev/null and b/vendor/patchwork/utf8/class/Patchwork/Utf8/data/to.bestfit1254.ser differ diff --git a/vendor/patchwork/utf8/class/Patchwork/Utf8/data/to.bestfit1255.ser b/vendor/patchwork/utf8/class/Patchwork/Utf8/data/to.bestfit1255.ser new file mode 100644 index 0000000..6aa32b4 Binary files /dev/null and b/vendor/patchwork/utf8/class/Patchwork/Utf8/data/to.bestfit1255.ser differ diff --git a/vendor/patchwork/utf8/class/Patchwork/Utf8/data/to.bestfit1256.ser b/vendor/patchwork/utf8/class/Patchwork/Utf8/data/to.bestfit1256.ser new file mode 100644 index 0000000..17ca822 Binary files /dev/null and b/vendor/patchwork/utf8/class/Patchwork/Utf8/data/to.bestfit1256.ser differ diff --git a/vendor/patchwork/utf8/class/Patchwork/Utf8/data/to.bestfit1257.ser b/vendor/patchwork/utf8/class/Patchwork/Utf8/data/to.bestfit1257.ser new file mode 100644 index 0000000..3c3fa7d Binary files /dev/null and b/vendor/patchwork/utf8/class/Patchwork/Utf8/data/to.bestfit1257.ser differ diff --git a/vendor/patchwork/utf8/class/Patchwork/Utf8/data/to.bestfit1258.ser b/vendor/patchwork/utf8/class/Patchwork/Utf8/data/to.bestfit1258.ser new file mode 100644 index 0000000..4afc772 Binary files /dev/null and b/vendor/patchwork/utf8/class/Patchwork/Utf8/data/to.bestfit1258.ser differ diff --git a/vendor/patchwork/utf8/class/Patchwork/Utf8/data/to.bestfit874.ser b/vendor/patchwork/utf8/class/Patchwork/Utf8/data/to.bestfit874.ser new file mode 100644 index 0000000..f554c7e Binary files /dev/null and b/vendor/patchwork/utf8/class/Patchwork/Utf8/data/to.bestfit874.ser differ diff --git a/vendor/patchwork/utf8/class/Patchwork/Utf8/data/to.bestfit932.ser b/vendor/patchwork/utf8/class/Patchwork/Utf8/data/to.bestfit932.ser new file mode 100644 index 0000000..bf0a160 Binary files /dev/null and b/vendor/patchwork/utf8/class/Patchwork/Utf8/data/to.bestfit932.ser differ diff --git a/vendor/patchwork/utf8/class/Patchwork/Utf8/data/to.bestfit936.ser b/vendor/patchwork/utf8/class/Patchwork/Utf8/data/to.bestfit936.ser new file mode 100644 index 0000000..683fc30 Binary files /dev/null and b/vendor/patchwork/utf8/class/Patchwork/Utf8/data/to.bestfit936.ser differ diff --git a/vendor/patchwork/utf8/class/Patchwork/Utf8/data/to.bestfit949.ser b/vendor/patchwork/utf8/class/Patchwork/Utf8/data/to.bestfit949.ser new file mode 100644 index 0000000..6afa623 Binary files /dev/null and b/vendor/patchwork/utf8/class/Patchwork/Utf8/data/to.bestfit949.ser differ diff --git a/vendor/patchwork/utf8/class/Patchwork/Utf8/data/to.bestfit950.ser b/vendor/patchwork/utf8/class/Patchwork/Utf8/data/to.bestfit950.ser new file mode 100644 index 0000000..c2e828d Binary files /dev/null and b/vendor/patchwork/utf8/class/Patchwork/Utf8/data/to.bestfit950.ser differ diff --git a/vendor/patchwork/utf8/composer.json b/vendor/patchwork/utf8/composer.json index f688bbb..e06e85c 100644 --- a/vendor/patchwork/utf8/composer.json +++ b/vendor/patchwork/utf8/composer.json @@ -16,6 +16,7 @@ "lib-pcre": ">=7.3" }, "suggest": { + "ext-wfio": "Use WFIO for UTF-8 filesystem access on Windows", "ext-intl": "Use Intl for best performance", "ext-iconv": "Use iconv for best performance", "ext-mbstring": "Use Mbstring for best performance" @@ -25,5 +26,10 @@ "Patchwork": "class/", "Normalizer": "class/" } + }, + "extra": { + "branch-alias": { + "dev-master": "1.2-dev" + } } } diff --git a/vendor/phpdocumentor/reflection-docblock/.gitignore b/vendor/phpdocumentor/reflection-docblock/.gitignore deleted file mode 100644 index 3ce5adb..0000000 --- a/vendor/phpdocumentor/reflection-docblock/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -.idea -vendor diff --git a/vendor/phpdocumentor/reflection-docblock/.travis.yml b/vendor/phpdocumentor/reflection-docblock/.travis.yml deleted file mode 100644 index eef782c..0000000 --- a/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/vendor/phpdocumentor/reflection-docblock/LICENSE b/vendor/phpdocumentor/reflection-docblock/LICENSE deleted file mode 100644 index 792e404..0000000 --- a/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/vendor/phpdocumentor/reflection-docblock/README.md b/vendor/phpdocumentor/reflection-docblock/README.md deleted file mode 100644 index 6405d1a..0000000 --- a/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/vendor/phpdocumentor/reflection-docblock/composer.lock b/vendor/phpdocumentor/reflection-docblock/composer.lock deleted file mode 100644 index 4c6a8bb..0000000 --- a/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/vendor/phpdocumentor/reflection-docblock/phpunit.xml.dist b/vendor/phpdocumentor/reflection-docblock/phpunit.xml.dist deleted file mode 100644 index f67ad2a..0000000 --- a/vendor/phpdocumentor/reflection-docblock/phpunit.xml.dist +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - ./tests/ - - - - - ./src/ - - - diff --git a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock.php deleted file mode 100644 index 02968b1..0000000 --- a/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/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Context.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Context.php deleted file mode 100644 index 81aa83c..0000000 --- a/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/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Description.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Description.php deleted file mode 100644 index d41142e..0000000 --- a/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/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Location.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Location.php deleted file mode 100644 index 966ed44..0000000 --- a/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/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Serializer.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Serializer.php deleted file mode 100644 index c161785..0000000 --- a/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/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag.php deleted file mode 100644 index a96db09..0000000 --- a/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/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/AuthorTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/AuthorTag.php deleted file mode 100644 index bacf52e..0000000 --- a/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/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/CoversTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/CoversTag.php deleted file mode 100644 index bd31b56..0000000 --- a/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/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/DeprecatedTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/DeprecatedTag.php deleted file mode 100644 index 7226316..0000000 --- a/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/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ExampleTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ExampleTag.php deleted file mode 100644 index 0e163ea..0000000 --- a/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/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/LinkTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/LinkTag.php deleted file mode 100644 index f79f25d..0000000 --- a/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/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/MethodTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/MethodTag.php deleted file mode 100644 index 7a5ce79..0000000 --- a/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/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ParamTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ParamTag.php deleted file mode 100644 index 9bc0270..0000000 --- a/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/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyReadTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyReadTag.php deleted file mode 100644 index 3340602..0000000 --- a/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/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyTag.php deleted file mode 100644 index 288ecff..0000000 --- a/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/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyWriteTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyWriteTag.php deleted file mode 100644 index ec4e866..0000000 --- a/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/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ReturnTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ReturnTag.php deleted file mode 100644 index 9293db9..0000000 --- a/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/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/SeeTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/SeeTag.php deleted file mode 100644 index 4f5f22c..0000000 --- a/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/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/SinceTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/SinceTag.php deleted file mode 100644 index ba009c4..0000000 --- a/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/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/SourceTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/SourceTag.php deleted file mode 100644 index 3400220..0000000 --- a/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/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ThrowsTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ThrowsTag.php deleted file mode 100644 index 58ee44a..0000000 --- a/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/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/UsesTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/UsesTag.php deleted file mode 100644 index da0d663..0000000 --- a/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/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/VarTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/VarTag.php deleted file mode 100644 index 236b2c8..0000000 --- a/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/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/VersionTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/VersionTag.php deleted file mode 100644 index 260f698..0000000 --- a/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/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Type/Collection.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Type/Collection.php deleted file mode 100644 index 90ead3f..0000000 --- a/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/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/DescriptionTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/DescriptionTest.php deleted file mode 100644 index a6ca7b3..0000000 --- a/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/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/CoversTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/CoversTagTest.php deleted file mode 100644 index ff257aa..0000000 --- a/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/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/DeprecatedTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/DeprecatedTagTest.php deleted file mode 100644 index 7a75e79..0000000 --- a/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/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ExampleTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ExampleTagTest.php deleted file mode 100644 index 519a61b..0000000 --- a/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/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/LinkTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/LinkTagTest.php deleted file mode 100644 index 0c64ed0..0000000 --- a/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/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/MethodTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/MethodTagTest.php deleted file mode 100644 index efc3a15..0000000 --- a/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/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ParamTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ParamTagTest.php deleted file mode 100644 index 0e05382..0000000 --- a/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/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ReturnTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ReturnTagTest.php deleted file mode 100644 index 9e2aec0..0000000 --- a/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/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SeeTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SeeTagTest.php deleted file mode 100644 index 6829b04..0000000 --- a/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/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SinceTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SinceTagTest.php deleted file mode 100644 index 8caf25d..0000000 --- a/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/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SourceTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SourceTagTest.php deleted file mode 100644 index 2a40e0a..0000000 --- a/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/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ThrowsTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ThrowsTagTest.php deleted file mode 100644 index 3c669d5..0000000 --- a/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/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/UsesTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/UsesTagTest.php deleted file mode 100644 index 45868d7..0000000 --- a/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/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/VarTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/VarTagTest.php deleted file mode 100644 index 9ae2aa5..0000000 --- a/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/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/VersionTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/VersionTagTest.php deleted file mode 100644 index e145386..0000000 --- a/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/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/TagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/TagTest.php deleted file mode 100644 index 9e873ec..0000000 --- a/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/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Type/CollectionTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Type/CollectionTest.php deleted file mode 100644 index 78c7306..0000000 --- a/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/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlockTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlockTest.php deleted file mode 100644 index 30eedfc..0000000 --- a/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/vendor/phpseclib/phpseclib/.scrutinizer.yml b/vendor/phpseclib/phpseclib/.scrutinizer.yml index 4ad008a..17c1ef3 100644 --- a/vendor/phpseclib/phpseclib/.scrutinizer.yml +++ b/vendor/phpseclib/phpseclib/.scrutinizer.yml @@ -4,3 +4,4 @@ imports: tools: external_code_coverage: runs: 5 # No Code Coverage on PHP 5.2 and HHVM + timeout: 2700 # 45 minutes diff --git a/vendor/phpseclib/phpseclib/.travis.yml b/vendor/phpseclib/phpseclib/.travis.yml index f5c96a8..e19f009 100644 --- a/vendor/phpseclib/phpseclib/.travis.yml +++ b/vendor/phpseclib/phpseclib/.travis.yml @@ -20,6 +20,8 @@ env: before_install: true install: + - sudo apt-get install parallel + - eval `ssh-agent -s` - travis/setup-secure-shell.sh - sh -c "if [ '$TRAVIS_PHP_VERSION' != 'hhvm' ]; then travis/install-php-extensions.sh; fi" - sh -c "if [ '$TRAVIS_PHP_VERSION' != '5.2' ]; then travis/setup-composer.sh; fi" diff --git a/vendor/phpseclib/phpseclib/composer.json b/vendor/phpseclib/phpseclib/composer.json index 5828ef7..c151c6a 100644 --- a/vendor/phpseclib/phpseclib/composer.json +++ b/vendor/phpseclib/phpseclib/composer.json @@ -49,10 +49,10 @@ "php": ">=5.0.0" }, "require-dev": { - "phing/phing": "2.7.*", - "phpunit/phpunit": "4.0.*", - "sami/sami": "1.*", - "squizlabs/php_codesniffer": "1.*" + "phing/phing": "~2.7", + "phpunit/phpunit": "~4.0", + "sami/sami": "~2.0", + "squizlabs/php_codesniffer": "~1.5" }, "suggest": { "ext-mcrypt": "Install the Mcrypt extension in order to speed up a wide variety of cryptographic operations.", diff --git a/vendor/phpseclib/phpseclib/composer.lock b/vendor/phpseclib/phpseclib/composer.lock index ccb397a..6d4d708 100644 --- a/vendor/phpseclib/phpseclib/composer.lock +++ b/vendor/phpseclib/phpseclib/composer.lock @@ -4,11 +4,63 @@ "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "9cd5afc2a6149e787c5b50511476b94b", - "packages": [ - - ], + "hash": "dcec513bef49f692870f013fcfed86ab", + "packages": [], "packages-dev": [ + { + "name": "doctrine/instantiator", + "version": "1.0.4", + "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" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "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" + ], + "time": "2014-10-13 12:58:55" + }, { "name": "michelf/php-markdown", "version": "1.4.1", @@ -62,19 +114,20 @@ }, { "name": "nikic/php-parser", - "version": "v0.9.4", + "version": "v0.9.5", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "1e5e280ae88a27effa2ae4aa2bd088494ed8594f" + "reference": "ef70767475434bdb3615b43c327e2cae17ef12eb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/1e5e280ae88a27effa2ae4aa2bd088494ed8594f", - "reference": "1e5e280ae88a27effa2ae4aa2bd088494ed8594f", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/ef70767475434bdb3615b43c327e2cae17ef12eb", + "reference": "ef70767475434bdb3615b43c327e2cae17ef12eb", "shasum": "" }, "require": { + "ext-tokenizer": "*", "php": ">=5.2" }, "type": "library", @@ -102,29 +155,65 @@ "parser", "php" ], - "time": "2013-08-25 17:11:40" + "time": "2014-07-23 18:24:17" }, { "name": "phing/phing", - "version": "2.7.0", + "version": "2.9.0", "source": { "type": "git", "url": "https://github.com/phingofficial/phing.git", - "reference": "bd2689790c620ac745b3ad29765c641a0dd5d007" + "reference": "12af1264dd4c5b88e28ee787e829de13c5ec172e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phingofficial/phing/zipball/bd2689790c620ac745b3ad29765c641a0dd5d007", - "reference": "bd2689790c620ac745b3ad29765c641a0dd5d007", + "url": "https://api.github.com/repos/phingofficial/phing/zipball/12af1264dd4c5b88e28ee787e829de13c5ec172e", + "reference": "12af1264dd4c5b88e28ee787e829de13c5ec172e", "shasum": "" }, "require": { "php": ">=5.2.0" }, + "require-dev": { + "ext-pdo_sqlite": "*", + "lastcraft/simpletest": "@dev", + "pdepend/pdepend": "1.x", + "pear-pear.php.net/http_request2": "2.2.x", + "pear-pear.php.net/net_growl": "2.7.x", + "pear-pear.php.net/pear_packagefilemanager": "1.7.x", + "pear-pear.php.net/pear_packagefilemanager2": "1.0.x", + "pear-pear.php.net/xml_serializer": "0.20.x", + "pear/pear_exception": "@dev", + "pear/versioncontrol_git": "@dev", + "pear/versioncontrol_svn": "@dev", + "phpdocumentor/phpdocumentor": "2.x", + "phploc/phploc": "2.x", + "phpunit/phpunit": ">=3.7", + "sebastian/phpcpd": "2.x", + "squizlabs/php_codesniffer": "1.5.x" + }, + "suggest": { + "pdepend/pdepend": "PHP version of JDepend", + "pear/archive_tar": "Tar file management class", + "pear/versioncontrol_git": "A library that provides OO interface to handle Git repository", + "pear/versioncontrol_svn": "A simple OO-style interface for Subversion, the free/open-source version control system", + "phpdocumentor/phpdocumentor": "Documentation Generator for PHP", + "phploc/phploc": "A tool for quickly measuring the size of a PHP project", + "phpmd/phpmd": "PHP version of PMD tool", + "phpunit/php-code-coverage": "Library that provides collection, processing, and rendering functionality for PHP code coverage information", + "phpunit/phpunit": "The PHP Unit Testing Framework", + "sebastian/phpcpd": "Copy/Paste Detector (CPD) for PHP code", + "tedivm/jshrink": "Javascript Minifier built in PHP" + }, "bin": [ "bin/phing" ], "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.9.x-dev" + } + }, "autoload": { "classmap": [ "classes/phing/" @@ -135,57 +224,58 @@ "classes" ], "license": [ - "LGPL3" + "LGPL-3.0" ], "authors": [ - { - "name": "Michiel Rook", - "email": "mrook@php.net", - "role": "Lead" - }, { "name": "Phing Community", "homepage": "http://www.phing.info/trac/wiki/Development/Contributors" + }, + { + "name": "Michiel Rook", + "email": "mrook@php.net" } ], "description": "PHing Is Not GNU make; it's a PHP project build system or build tool based on Apache Ant.", "homepage": "http://www.phing.info/", "keywords": [ "build", + "phing", "task", "tool" ], - "time": "2014-02-13 13:17:59" + "time": "2014-11-25 14:58:59" }, { "name": "phpunit/php-code-coverage", - "version": "2.0.5", + "version": "2.0.12", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "3dcca2120451b98a98fe60221ca279a184ee64db" + "reference": "7ce9da20f96964bb7a4033f53834df13328dbeab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/3dcca2120451b98a98fe60221ca279a184ee64db", - "reference": "3dcca2120451b98a98fe60221ca279a184ee64db", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/7ce9da20f96964bb7a4033f53834df13328dbeab", + "reference": "7ce9da20f96964bb7a4033f53834df13328dbeab", "shasum": "" }, "require": { "php": ">=5.3.3", - "phpunit/php-file-iterator": "~1.3.1", + "phpunit/php-file-iterator": "~1.3", "phpunit/php-text-template": "~1.2", - "phpunit/php-token-stream": "~1.2.2", + "phpunit/php-token-stream": "~1.3", "sebastian/environment": "~1.0", - "sebastian/version": "~1.0.3" + "sebastian/version": "~1.0" }, "require-dev": { "ext-xdebug": ">=2.1.4", - "phpunit/phpunit": ">=4.0.0,<4.1.0" + "phpunit/phpunit": "~4.1" }, "suggest": { "ext-dom": "*", - "ext-xdebug": ">=2.2.1" + "ext-xdebug": ">=2.2.1", + "ext-xmlwriter": "*" }, "type": "library", "extra": { @@ -219,7 +309,7 @@ "testing", "xunit" ], - "time": "2014-03-28 10:54:55" + "time": "2014-12-02 13:17:01" }, { "name": "phpunit/php-file-iterator", @@ -356,45 +446,44 @@ }, { "name": "phpunit/php-token-stream", - "version": "1.2.2", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "ad4e1e23ae01b483c16f600ff1bebec184588e32" + "reference": "f8d5d08c56de5cfd592b3340424a81733259a876" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/ad4e1e23ae01b483c16f600ff1bebec184588e32", - "reference": "ad4e1e23ae01b483c16f600ff1bebec184588e32", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/f8d5d08c56de5cfd592b3340424a81733259a876", + "reference": "f8d5d08c56de5cfd592b3340424a81733259a876", "shasum": "" }, "require": { "ext-tokenizer": "*", "php": ">=5.3.3" }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "1.3-dev" } }, "autoload": { "classmap": [ - "PHP/" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "email": "sebastian@phpunit.de" } ], "description": "Wrapper around PHP's tokenizer extension.", @@ -402,43 +491,42 @@ "keywords": [ "tokenizer" ], - "time": "2014-03-03 05:10:30" + "time": "2014-08-31 06:12:13" }, { "name": "phpunit/phpunit", - "version": "4.0.14", + "version": "4.3.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "a80b77d92a6c7723d77c6728b4ae37e92a65ac1d" + "reference": "2dab9d593997db4abcf58d0daf798eb4e9cecfe1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a80b77d92a6c7723d77c6728b4ae37e92a65ac1d", - "reference": "a80b77d92a6c7723d77c6728b4ae37e92a65ac1d", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/2dab9d593997db4abcf58d0daf798eb4e9cecfe1", + "reference": "2dab9d593997db4abcf58d0daf798eb4e9cecfe1", "shasum": "" }, "require": { "ext-dom": "*", + "ext-json": "*", "ext-pcre": "*", "ext-reflection": "*", "ext-spl": "*", "php": ">=5.3.3", - "phpunit/php-code-coverage": ">=2.0.0,<2.1.0", - "phpunit/php-file-iterator": "~1.3.1", + "phpunit/php-code-coverage": "~2.0", + "phpunit/php-file-iterator": "~1.3.2", "phpunit/php-text-template": "~1.2", "phpunit/php-timer": "~1.0.2", - "phpunit/phpunit-mock-objects": ">=2.0.0,<2.1.0", + "phpunit/phpunit-mock-objects": "~2.3", + "sebastian/comparator": "~1.0", "sebastian/diff": "~1.1", "sebastian/environment": "~1.0", - "sebastian/exporter": "~1.0.1", - "sebastian/version": "~1.0.3", + "sebastian/exporter": "~1.0", + "sebastian/version": "~1.0", "symfony/yaml": "~2.0" }, "suggest": { - "ext-json": "*", - "ext-simplexml": "*", - "ext-tokenizer": "*", "phpunit/php-invoker": "~1.1" }, "bin": [ @@ -447,7 +535,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0.x-dev" + "dev-master": "4.3.x-dev" } }, "autoload": { @@ -477,28 +565,29 @@ "testing", "xunit" ], - "time": "2014-03-28 11:10:03" + "time": "2014-11-11 10:11:09" }, { "name": "phpunit/phpunit-mock-objects", - "version": "2.0.4", + "version": "2.3.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "c5e6274b8f2bf983cf883bb375cf44f99aff200e" + "reference": "c63d2367247365f688544f0d500af90a11a44c65" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/c5e6274b8f2bf983cf883bb375cf44f99aff200e", - "reference": "c5e6274b8f2bf983cf883bb375cf44f99aff200e", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/c63d2367247365f688544f0d500af90a11a44c65", + "reference": "c63d2367247365f688544f0d500af90a11a44c65", "shasum": "" }, "require": { + "doctrine/instantiator": "~1.0,>=1.0.1", "php": ">=5.3.3", "phpunit/php-text-template": "~1.2" }, "require-dev": { - "phpunit/phpunit": ">=4.0.0,<4.1.0" + "phpunit/phpunit": "~4.3" }, "suggest": { "ext-soap": "*" @@ -506,7 +595,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "2.3.x-dev" } }, "autoload": { @@ -515,9 +604,6 @@ ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], "license": [ "BSD-3-Clause" ], @@ -534,20 +620,20 @@ "mock", "xunit" ], - "time": "2014-03-18 08:56:48" + "time": "2014-10-03 05:12:11" }, { "name": "pimple/pimple", - "version": "v1.0.2", + "version": "v2.1.1", "source": { "type": "git", - "url": "https://github.com/fabpot/Pimple.git", - "reference": "ae11e57e8c2bb414b2ff93396dbbfc0eb92feb94" + "url": "https://github.com/silexphp/Pimple.git", + "reference": "ea22fb2880faf7b7b0e17c9809c6fe25b071fd76" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fabpot/Pimple/zipball/ae11e57e8c2bb414b2ff93396dbbfc0eb92feb94", - "reference": "ae11e57e8c2bb414b2ff93396dbbfc0eb92feb94", + "url": "https://api.github.com/repos/silexphp/Pimple/zipball/ea22fb2880faf7b7b0e17c9809c6fe25b071fd76", + "reference": "ea22fb2880faf7b7b0e17c9809c6fe25b071fd76", "shasum": "" }, "require": { @@ -556,12 +642,12 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.1.x-dev" } }, "autoload": { "psr-0": { - "Pimple": "lib/" + "Pimple": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -571,9 +657,7 @@ "authors": [ { "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" + "email": "fabien@symfony.com" } ], "description": "Pimple is a simple Dependency Injection Container for PHP 5.3", @@ -582,27 +666,27 @@ "container", "dependency injection" ], - "time": "2013-03-08 08:21:40" + "time": "2014-07-24 07:10:08" }, { "name": "sami/sami", - "version": "v1.4", + "version": "v2.0.0", "source": { "type": "git", - "url": "https://github.com/fabpot/Sami.git", - "reference": "70f29c781f7bef30181c814b9471b2ceac694454" + "url": "https://github.com/FriendsOfPHP/Sami.git", + "reference": "fa58b324f41aa2aefe21dac4f22d8c98965fc012" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fabpot/Sami/zipball/70f29c781f7bef30181c814b9471b2ceac694454", - "reference": "70f29c781f7bef30181c814b9471b2ceac694454", + "url": "https://api.github.com/repos/FriendsOfPHP/Sami/zipball/fa58b324f41aa2aefe21dac4f22d8c98965fc012", + "reference": "fa58b324f41aa2aefe21dac4f22d8c98965fc012", "shasum": "" }, "require": { "michelf/php-markdown": "~1.3", "nikic/php-parser": "0.9.*", "php": ">=5.3.0", - "pimple/pimple": "1.0.*", + "pimple/pimple": "2.*", "symfony/console": "~2.1", "symfony/filesystem": "~2.1", "symfony/finder": "~2.1", @@ -616,7 +700,7 @@ "type": "application", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -631,9 +715,7 @@ "authors": [ { "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" + "email": "fabien@symfony.com" } ], "description": "Sami, an API documentation generator", @@ -641,29 +723,96 @@ "keywords": [ "phpdoc" ], - "time": "2014-06-25 11:24:03" + "time": "2014-06-25 12:05:18" + }, + { + "name": "sebastian/comparator", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "e54a01c0da1b87db3c5a3c4c5277ddf331da4aef" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/e54a01c0da1b87db3c5a3c4c5277ddf331da4aef", + "reference": "e54a01c0da1b87db3c5a3c4c5277ddf331da4aef", + "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": "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" + ], + "time": "2014-05-11 23:00:21" }, { "name": "sebastian/diff", - "version": "1.1.0", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "1e091702a5a38e6b4c1ba9ca816e3dd343df2e2d" + "reference": "5843509fed39dee4b356a306401e9dd1a931fec7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/1e091702a5a38e6b4c1ba9ca816e3dd343df2e2d", - "reference": "1e091702a5a38e6b4c1ba9ca816e3dd343df2e2d", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/5843509fed39dee4b356a306401e9dd1a931fec7", + "reference": "5843509fed39dee4b356a306401e9dd1a931fec7", "shasum": "" }, "require": { "php": ">=5.3.3" }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-master": "1.2-dev" } }, "autoload": { @@ -676,14 +825,13 @@ "BSD-3-Clause" ], "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - }, { "name": "Kore Nordmann", "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" } ], "description": "Diff implementation", @@ -691,32 +839,32 @@ "keywords": [ "diff" ], - "time": "2013-08-03 16:46:33" + "time": "2014-08-15 10:29:00" }, { "name": "sebastian/environment", - "version": "1.0.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "79517609ec01139cd7e9fded0dd7ce08c952ef6a" + "reference": "6e6c71d918088c251b181ba8b3088af4ac336dd7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/79517609ec01139cd7e9fded0dd7ce08c952ef6a", - "reference": "79517609ec01139cd7e9fded0dd7ce08c952ef6a", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6e6c71d918088c251b181ba8b3088af4ac336dd7", + "reference": "6e6c71d918088c251b181ba8b3088af4ac336dd7", "shasum": "" }, "require": { "php": ">=5.3.3" }, "require-dev": { - "phpunit/phpunit": "4.0.*@dev" + "phpunit/phpunit": "~4.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { @@ -731,8 +879,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "email": "sebastian@phpunit.de" } ], "description": "Provides functionality to handle HHVM/PHP environments", @@ -742,27 +889,27 @@ "environment", "hhvm" ], - "time": "2014-02-18 16:17:19" + "time": "2014-10-25 08:00:45" }, { "name": "sebastian/exporter", - "version": "1.0.1", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "1f9a98e6f5dfe0524cb8c6166f7c82f3e9ae1529" + "reference": "c7d59948d6e82818e1bdff7cadb6c34710eb7dc0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/1f9a98e6f5dfe0524cb8c6166f7c82f3e9ae1529", - "reference": "1f9a98e6f5dfe0524cb8c6166f7c82f3e9ae1529", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/c7d59948d6e82818e1bdff7cadb6c34710eb7dc0", + "reference": "c7d59948d6e82818e1bdff7cadb6c34710eb7dc0", "shasum": "" }, "require": { "php": ">=5.3.3" }, "require-dev": { - "phpunit/phpunit": "4.0.*@dev" + "phpunit/phpunit": "~4.0" }, "type": "library", "extra": { @@ -780,11 +927,6 @@ "BSD-3-Clause" ], "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - }, { "name": "Jeff Welch", "email": "whatthejeff@gmail.com" @@ -793,14 +935,17 @@ "name": "Volker Dusch", "email": "github@wallbash.com" }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net", - "role": "Lead" - }, { "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", @@ -809,7 +954,7 @@ "export", "exporter" ], - "time": "2014-02-16 08:26:31" + "time": "2014-09-10 00:51:36" }, { "name": "sebastian/version", @@ -848,16 +993,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "1.5.2", + "version": "1.5.6", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "a76a39b317ce8106abe6264daa505e24e1731860" + "reference": "6f3e42d311b882b25b4d409d23a289f4d3b803d5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/a76a39b317ce8106abe6264daa505e24e1731860", - "reference": "a76a39b317ce8106abe6264daa505e24e1731860", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/6f3e42d311b882b25b4d409d23a289f4d3b803d5", + "reference": "6f3e42d311b882b25b4d409d23a289f4d3b803d5", "shasum": "" }, "require": { @@ -871,6 +1016,11 @@ "scripts/phpcs" ], "type": "library", + "extra": { + "branch-alias": { + "dev-phpcs-fixer": "2.0.x-dev" + } + }, "autoload": { "classmap": [ "CodeSniffer.php", @@ -914,21 +1064,21 @@ "phpcs", "standards" ], - "time": "2014-02-04 23:49:58" + "time": "2014-12-04 22:32:15" }, { "name": "symfony/console", - "version": "v2.5.2", + "version": "v2.6.0", "target-dir": "Symfony/Component/Console", "source": { "type": "git", "url": "https://github.com/symfony/Console.git", - "reference": "386fa63407805959bd2c5fe540294721ad4224c8" + "reference": "d3bac228fd7a2aac9193e241b239880b3ba39a10" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Console/zipball/386fa63407805959bd2c5fe540294721ad4224c8", - "reference": "386fa63407805959bd2c5fe540294721ad4224c8", + "url": "https://api.github.com/repos/symfony/Console/zipball/d3bac228fd7a2aac9193e241b239880b3ba39a10", + "reference": "d3bac228fd7a2aac9193e241b239880b3ba39a10", "shasum": "" }, "require": { @@ -936,16 +1086,18 @@ }, "require-dev": { "psr/log": "~1.0", - "symfony/event-dispatcher": "~2.1" + "symfony/event-dispatcher": "~2.1", + "symfony/process": "~2.1" }, "suggest": { "psr/log": "For using the console logger", - "symfony/event-dispatcher": "" + "symfony/event-dispatcher": "", + "symfony/process": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.5-dev" + "dev-master": "2.6-dev" } }, "autoload": { @@ -958,34 +1110,32 @@ "MIT" ], "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, { "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-07-15 14:15:12" + "time": "2014-11-20 13:24:23" }, { "name": "symfony/filesystem", - "version": "v2.5.2", + "version": "v2.6.0", "target-dir": "Symfony/Component/Filesystem", "source": { "type": "git", "url": "https://github.com/symfony/Filesystem.git", - "reference": "c1309b0ee195ad264a4314435bdaecdfacb8ae9c" + "reference": "6f7c7e42f20ee200d8ac5d2ec1d2a524138305e0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Filesystem/zipball/c1309b0ee195ad264a4314435bdaecdfacb8ae9c", - "reference": "c1309b0ee195ad264a4314435bdaecdfacb8ae9c", + "url": "https://api.github.com/repos/symfony/Filesystem/zipball/6f7c7e42f20ee200d8ac5d2ec1d2a524138305e0", + "reference": "6f7c7e42f20ee200d8ac5d2ec1d2a524138305e0", "shasum": "" }, "require": { @@ -994,7 +1144,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.5-dev" + "dev-master": "2.6-dev" } }, "autoload": { @@ -1007,34 +1157,32 @@ "MIT" ], "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, { "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-07-09 09:05:48" + "time": "2014-11-16 17:28:09" }, { "name": "symfony/finder", - "version": "v2.5.2", + "version": "v2.6.0", "target-dir": "Symfony/Component/Finder", "source": { "type": "git", "url": "https://github.com/symfony/Finder.git", - "reference": "576d8f69feec477067e91b6bd0367c113e76a1a0" + "reference": "d574347c652a14cfee0349f744c7880e1d9029fd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Finder/zipball/576d8f69feec477067e91b6bd0367c113e76a1a0", - "reference": "576d8f69feec477067e91b6bd0367c113e76a1a0", + "url": "https://api.github.com/repos/symfony/Finder/zipball/d574347c652a14cfee0349f744c7880e1d9029fd", + "reference": "d574347c652a14cfee0349f744c7880e1d9029fd", "shasum": "" }, "require": { @@ -1043,7 +1191,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.5-dev" + "dev-master": "2.6-dev" } }, "autoload": { @@ -1056,34 +1204,32 @@ "MIT" ], "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, { "name": "Symfony Community", "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" } ], "description": "Symfony Finder Component", "homepage": "http://symfony.com", - "time": "2014-07-15 14:15:12" + "time": "2014-11-28 10:00:40" }, { "name": "symfony/process", - "version": "v2.5.2", + "version": "v2.6.0", "target-dir": "Symfony/Component/Process", "source": { "type": "git", "url": "https://github.com/symfony/Process.git", - "reference": "5e53efbf61a7fbf73c79e3e08feea50f64c20bfa" + "reference": "dc88f75d1c07791e5733f90be747961dce26cf05" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Process/zipball/5e53efbf61a7fbf73c79e3e08feea50f64c20bfa", - "reference": "5e53efbf61a7fbf73c79e3e08feea50f64c20bfa", + "url": "https://api.github.com/repos/symfony/Process/zipball/dc88f75d1c07791e5733f90be747961dce26cf05", + "reference": "dc88f75d1c07791e5733f90be747961dce26cf05", "shasum": "" }, "require": { @@ -1092,7 +1238,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.5-dev" + "dev-master": "2.6-dev" } }, "autoload": { @@ -1105,34 +1251,32 @@ "MIT" ], "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, { "name": "Symfony Community", "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" } ], "description": "Symfony Process Component", "homepage": "http://symfony.com", - "time": "2014-07-09 09:05:48" + "time": "2014-11-04 14:29:39" }, { "name": "symfony/yaml", - "version": "v2.4.3", + "version": "v2.6.0", "target-dir": "Symfony/Component/Yaml", "source": { "type": "git", "url": "https://github.com/symfony/Yaml.git", - "reference": "77a41c2835ab7cfe8bf6d15e25d3af8f3eb3bacd" + "reference": "51c845cf3e4bfc182d1d5c05ed1c7338361d86f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/77a41c2835ab7cfe8bf6d15e25d3af8f3eb3bacd", - "reference": "77a41c2835ab7cfe8bf6d15e25d3af8f3eb3bacd", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/51c845cf3e4bfc182d1d5c05ed1c7338361d86f8", + "reference": "51c845cf3e4bfc182d1d5c05ed1c7338361d86f8", "shasum": "" }, "require": { @@ -1141,7 +1285,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.4-dev" + "dev-master": "2.6-dev" } }, "autoload": { @@ -1154,33 +1298,31 @@ "MIT" ], "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, { "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-03-12 18:29:58" + "time": "2014-11-20 13:24:23" }, { "name": "twig/twig", - "version": "v1.16.0", + "version": "v1.16.2", "source": { "type": "git", - "url": "https://github.com/fabpot/Twig.git", - "reference": "8ce37115802e257a984a82d38254884085060024" + "url": "https://github.com/twigphp/Twig.git", + "reference": "42f758d9fe2146d1f0470604fc05ee43580873fc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fabpot/Twig/zipball/8ce37115802e257a984a82d38254884085060024", - "reference": "8ce37115802e257a984a82d38254884085060024", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/42f758d9fe2146d1f0470604fc05ee43580873fc", + "reference": "42f758d9fe2146d1f0470604fc05ee43580873fc", "shasum": "" }, "require": { @@ -1209,7 +1351,7 @@ "role": "Lead Developer" }, { - "name": "Armin Ronacher2", + "name": "Armin Ronacher", "email": "armin.ronacher@active-4.com", "role": "Project Founder" }, @@ -1224,20 +1366,15 @@ "keywords": [ "templating" ], - "time": "2014-07-05 12:19:05" + "time": "2014-10-17 12:53:44" } ], - "aliases": [ - - ], + "aliases": [], "minimum-stability": "stable", - "stability-flags": [ - - ], + "stability-flags": [], + "prefer-stable": false, "platform": { "php": ">=5.0.0" }, - "platform-dev": [ - - ] + "platform-dev": [] } diff --git a/vendor/phpseclib/phpseclib/phpseclib/Crypt/AES.php b/vendor/phpseclib/phpseclib/phpseclib/Crypt/AES.php index 9085a8f..6b1f9da 100644 --- a/vendor/phpseclib/phpseclib/phpseclib/Crypt/AES.php +++ b/vendor/phpseclib/phpseclib/phpseclib/Crypt/AES.php @@ -56,7 +56,7 @@ * @category Crypt * @package Crypt_AES * @author Jim Wigginton - * @copyright MMVIII Jim Wigginton + * @copyright 2008 Jim Wigginton * @license http://www.opensource.org/licenses/mit-license.html MIT License * @link http://phpseclib.sourceforge.net */ diff --git a/vendor/phpseclib/phpseclib/phpseclib/Crypt/Base.php b/vendor/phpseclib/phpseclib/phpseclib/Crypt/Base.php index 2248ed4..4df2a2d 100644 --- a/vendor/phpseclib/phpseclib/phpseclib/Crypt/Base.php +++ b/vendor/phpseclib/phpseclib/phpseclib/Crypt/Base.php @@ -47,7 +47,7 @@ * @package Crypt_Base * @author Jim Wigginton * @author Hans-Juergen Petrich - * @copyright MMVII Jim Wigginton + * @copyright 2007 Jim Wigginton * @license http://www.opensource.org/licenses/mit-license.html MIT License * @link http://phpseclib.sourceforge.net */ diff --git a/vendor/phpseclib/phpseclib/phpseclib/Crypt/Blowfish.php b/vendor/phpseclib/phpseclib/phpseclib/Crypt/Blowfish.php index 90587ca..f39f17d 100644 --- a/vendor/phpseclib/phpseclib/phpseclib/Crypt/Blowfish.php +++ b/vendor/phpseclib/phpseclib/phpseclib/Crypt/Blowfish.php @@ -48,7 +48,7 @@ * @package Crypt_Blowfish * @author Jim Wigginton * @author Hans-Juergen Petrich - * @copyright MMVII Jim Wigginton + * @copyright 2007 Jim Wigginton * @license http://www.opensource.org/licenses/mit-license.html MIT License * @link http://phpseclib.sourceforge.net */ diff --git a/vendor/phpseclib/phpseclib/phpseclib/Crypt/DES.php b/vendor/phpseclib/phpseclib/phpseclib/Crypt/DES.php index 3334eb9..f92f30b 100644 --- a/vendor/phpseclib/phpseclib/phpseclib/Crypt/DES.php +++ b/vendor/phpseclib/phpseclib/phpseclib/Crypt/DES.php @@ -53,7 +53,7 @@ * @category Crypt * @package Crypt_DES * @author Jim Wigginton - * @copyright MMVII Jim Wigginton + * @copyright 2007 Jim Wigginton * @license http://www.opensource.org/licenses/mit-license.html MIT License * @link http://phpseclib.sourceforge.net */ diff --git a/vendor/phpseclib/phpseclib/phpseclib/Crypt/Hash.php b/vendor/phpseclib/phpseclib/phpseclib/Crypt/Hash.php index ea7824d..4ab75b2 100644 --- a/vendor/phpseclib/phpseclib/phpseclib/Crypt/Hash.php +++ b/vendor/phpseclib/phpseclib/phpseclib/Crypt/Hash.php @@ -49,7 +49,7 @@ * @category Crypt * @package Crypt_Hash * @author Jim Wigginton - * @copyright MMVII Jim Wigginton + * @copyright 2007 Jim Wigginton * @license http://www.opensource.org/licenses/mit-license.html MIT License * @link http://phpseclib.sourceforge.net */ diff --git a/vendor/phpseclib/phpseclib/phpseclib/Crypt/RC4.php b/vendor/phpseclib/phpseclib/phpseclib/Crypt/RC4.php index 4880735..d5eda8c 100644 --- a/vendor/phpseclib/phpseclib/phpseclib/Crypt/RC4.php +++ b/vendor/phpseclib/phpseclib/phpseclib/Crypt/RC4.php @@ -55,7 +55,7 @@ * @category Crypt * @package Crypt_RC4 * @author Jim Wigginton - * @copyright MMVII Jim Wigginton + * @copyright 2007 Jim Wigginton * @license http://www.opensource.org/licenses/mit-license.html MIT License * @link http://phpseclib.sourceforge.net */ diff --git a/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA.php b/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA.php index a0fbc28..53f9435 100644 --- a/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA.php +++ b/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA.php @@ -62,7 +62,7 @@ * @category Crypt * @package Crypt_RSA * @author Jim Wigginton - * @copyright MMIX Jim Wigginton + * @copyright 2009 Jim Wigginton * @license http://www.opensource.org/licenses/mit-license.html MIT License * @link http://phpseclib.sourceforge.net */ @@ -515,9 +515,16 @@ function Crypt_RSA() $versions = array(); if (!empty($matches[1])) { - for ($i = 0; $i < count($matches[1]); $i++) { - $versions[$matches[1][$i]] = trim(str_replace('=>', '', strip_tags($matches[2][$i]))); - } + for ($i = 0; $i < count($matches[1]); $i++) { + $fullVersion = trim(str_replace('=>', '', strip_tags($matches[2][$i]))); + + // Remove letter part in OpenSSL version + if (!preg_match('/(\d+\.\d+\.\d+)/i', $fullVersion, $m)) { + $versions[$matches[1][$i]] = $fullVersion; + } else { + $versions[$matches[1][$i]] = $m[0]; + } + } } // it doesn't appear that OpenSSL versions were reported upon until PHP 5.3+ diff --git a/vendor/phpseclib/phpseclib/phpseclib/Crypt/Random.php b/vendor/phpseclib/phpseclib/phpseclib/Crypt/Random.php index 55c6763..918b97b 100644 --- a/vendor/phpseclib/phpseclib/phpseclib/Crypt/Random.php +++ b/vendor/phpseclib/phpseclib/phpseclib/Crypt/Random.php @@ -38,7 +38,7 @@ * @category Crypt * @package Crypt_Random * @author Jim Wigginton - * @copyright MMVII Jim Wigginton + * @copyright 2007 Jim Wigginton * @license http://www.opensource.org/licenses/mit-license.html MIT License * @link http://phpseclib.sourceforge.net */ diff --git a/vendor/phpseclib/phpseclib/phpseclib/Crypt/Rijndael.php b/vendor/phpseclib/phpseclib/phpseclib/Crypt/Rijndael.php index dcc0c19..a131b26 100644 --- a/vendor/phpseclib/phpseclib/phpseclib/Crypt/Rijndael.php +++ b/vendor/phpseclib/phpseclib/phpseclib/Crypt/Rijndael.php @@ -65,7 +65,7 @@ * @category Crypt * @package Crypt_Rijndael * @author Jim Wigginton - * @copyright MMVIII Jim Wigginton + * @copyright 2008 Jim Wigginton * @license http://www.opensource.org/licenses/mit-license.html MIT License * @link http://phpseclib.sourceforge.net */ diff --git a/vendor/phpseclib/phpseclib/phpseclib/Crypt/TripleDES.php b/vendor/phpseclib/phpseclib/phpseclib/Crypt/TripleDES.php index 77b1437..06ea09b 100644 --- a/vendor/phpseclib/phpseclib/phpseclib/Crypt/TripleDES.php +++ b/vendor/phpseclib/phpseclib/phpseclib/Crypt/TripleDES.php @@ -47,7 +47,7 @@ * @category Crypt * @package Crypt_TripleDES * @author Jim Wigginton - * @copyright MMVII Jim Wigginton + * @copyright 2007 Jim Wigginton * @license http://www.opensource.org/licenses/mit-license.html MIT License * @link http://phpseclib.sourceforge.net */ diff --git a/vendor/phpseclib/phpseclib/phpseclib/Crypt/Twofish.php b/vendor/phpseclib/phpseclib/phpseclib/Crypt/Twofish.php index acd52c1..8dd7933 100644 --- a/vendor/phpseclib/phpseclib/phpseclib/Crypt/Twofish.php +++ b/vendor/phpseclib/phpseclib/phpseclib/Crypt/Twofish.php @@ -48,7 +48,7 @@ * @package Crypt_Twofish * @author Jim Wigginton * @author Hans-Juergen Petrich - * @copyright MMVII Jim Wigginton + * @copyright 2007 Jim Wigginton * @license http://www.opensource.org/licenses/mit-license.html MIT License * @link http://phpseclib.sourceforge.net */ diff --git a/vendor/phpseclib/phpseclib/phpseclib/File/ANSI.php b/vendor/phpseclib/phpseclib/phpseclib/File/ANSI.php index 682ba43..3ff1b7d 100644 --- a/vendor/phpseclib/phpseclib/phpseclib/File/ANSI.php +++ b/vendor/phpseclib/phpseclib/phpseclib/File/ANSI.php @@ -31,7 +31,7 @@ * @category File * @package File_ANSI * @author Jim Wigginton - * @copyright MMXII Jim Wigginton + * @copyright 2012 Jim Wigginton * @license http://www.opensource.org/licenses/mit-license.html MIT License * @link http://phpseclib.sourceforge.net */ diff --git a/vendor/phpseclib/phpseclib/phpseclib/File/ASN1.php b/vendor/phpseclib/phpseclib/phpseclib/File/ASN1.php index eaa47ef..1d66793 100644 --- a/vendor/phpseclib/phpseclib/phpseclib/File/ASN1.php +++ b/vendor/phpseclib/phpseclib/phpseclib/File/ASN1.php @@ -34,7 +34,7 @@ * @category File * @package File_ASN1 * @author Jim Wigginton - * @copyright MMXII Jim Wigginton + * @copyright 2012 Jim Wigginton * @license http://www.opensource.org/licenses/mit-license.html MIT License * @link http://phpseclib.sourceforge.net */ @@ -347,24 +347,31 @@ function _decode_ber($encoded, $start = 0) case FILE_ASN1_CLASS_APPLICATION: case FILE_ASN1_CLASS_PRIVATE: case FILE_ASN1_CLASS_CONTEXT_SPECIFIC: - if ($constructed) { + if (!$constructed) { + return array( + 'type' => $class, + 'constant' => $tag, + 'content' => $content, + 'length' => $length + $start - $current['start'] + ); + } + + $newcontent = array(); + if (strlen($content)) { $newcontent = $this->_decode_ber($content, $start); $length = $newcontent['length']; if (substr($content, $length, 2) == "\0\0") { $length+= 2; } - - // the array encapsulation is for BC with the old format - $content = array($newcontent); + $start+= $length; + $newcontent = array($newcontent); } - $start+= $length; - return array( 'type' => $class, 'constant' => $tag, // the array encapsulation is for BC with the old format - 'content' => $content, + 'content' => $newcontent, // the only time when $content['headerlength'] isn't defined is when the length is indefinite. // the absence of $content['headerlength'] is how we know if something is indefinite or not. // technically, it could be defined to be 2 and then another indicator could be used but whatever. diff --git a/vendor/phpseclib/phpseclib/phpseclib/File/X509.php b/vendor/phpseclib/phpseclib/phpseclib/File/X509.php index 0f8f4bb..36a6287 100644 --- a/vendor/phpseclib/phpseclib/phpseclib/File/X509.php +++ b/vendor/phpseclib/phpseclib/phpseclib/File/X509.php @@ -37,7 +37,7 @@ * @category File * @package File_X509 * @author Jim Wigginton - * @copyright MMXII Jim Wigginton + * @copyright 2012 Jim Wigginton * @license http://www.opensource.org/licenses/mit-license.html MIT License * @link http://phpseclib.sourceforge.net */ diff --git a/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger.php b/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger.php index 109d346..8e54f74 100644 --- a/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger.php +++ b/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger.php @@ -63,7 +63,7 @@ * @category Math * @package Math_BigInteger * @author Jim Wigginton - * @copyright MMVI Jim Wigginton + * @copyright 2006 Jim Wigginton * @license http://www.opensource.org/licenses/mit-license.html MIT License * @link http://pear.php.net/package/Math_BigInteger */ @@ -278,7 +278,14 @@ function Math_BigInteger($x = 0, $base = 10) $versions = array(); if (!empty($matches[1])) { for ($i = 0; $i < count($matches[1]); $i++) { - $versions[$matches[1][$i]] = trim(str_replace('=>', '', strip_tags($matches[2][$i]))); + $fullVersion = trim(str_replace('=>', '', strip_tags($matches[2][$i]))); + + // Remove letter part in OpenSSL version + if (!preg_match('/(\d+\.\d+\.\d+)/i', $fullVersion, $m)) { + $versions[$matches[1][$i]] = $fullVersion; + } else { + $versions[$matches[1][$i]] = $m[0]; + } } } diff --git a/vendor/phpseclib/phpseclib/phpseclib/Net/SCP.php b/vendor/phpseclib/phpseclib/phpseclib/Net/SCP.php index 8fae6e6..b5cd2f5 100644 --- a/vendor/phpseclib/phpseclib/phpseclib/Net/SCP.php +++ b/vendor/phpseclib/phpseclib/phpseclib/Net/SCP.php @@ -44,7 +44,7 @@ * @category Net * @package Net_SCP * @author Jim Wigginton - * @copyright MMX Jim Wigginton + * @copyright 2010 Jim Wigginton * @license http://www.opensource.org/licenses/mit-license.html MIT License * @link http://phpseclib.sourceforge.net */ @@ -129,7 +129,7 @@ function Net_SCP($ssh) } switch (strtolower(get_class($ssh))) { - case'net_ssh2': + case 'net_ssh2': $this->mode = NET_SCP_SSH2; break; case 'net_ssh1': @@ -170,7 +170,7 @@ function put($remote_file, $data, $mode = NET_SCP_STRING, $callback = null) return false; } - if (!$this->ssh->exec('scp -t "' . $remote_file . '"', false)) { // -t = to + if (!$this->ssh->exec('scp -t ' . escapeshellarg($remote_file), false)) { // -t = to return false; } @@ -195,7 +195,6 @@ function put($remote_file, $data, $mode = NET_SCP_STRING, $callback = null) $fp = @fopen($data, 'rb'); if (!$fp) { - fclose($fp); return false; } $size = filesize($data); @@ -245,7 +244,7 @@ function get($remote_file, $local_file = false) return false; } - if (!$this->ssh->exec('scp -f "' . $remote_file . '"', false)) { // -f = from + if (!$this->ssh->exec('scp -f ' . escapeshellarg($remote_file), false)) { // -f = from return false; } diff --git a/vendor/phpseclib/phpseclib/phpseclib/Net/SFTP.php b/vendor/phpseclib/phpseclib/phpseclib/Net/SFTP.php index 0fe88e0..5f7d366 100644 --- a/vendor/phpseclib/phpseclib/phpseclib/Net/SFTP.php +++ b/vendor/phpseclib/phpseclib/phpseclib/Net/SFTP.php @@ -48,7 +48,7 @@ * @category Net * @package Net_SFTP * @author Jim Wigginton - * @copyright MMIX Jim Wigginton + * @copyright 2009 Jim Wigginton * @license http://www.opensource.org/licenses/mit-license.html MIT License * @link http://phpseclib.sourceforge.net */ diff --git a/vendor/phpseclib/phpseclib/phpseclib/Net/SFTP/Stream.php b/vendor/phpseclib/phpseclib/phpseclib/Net/SFTP/Stream.php index e9afb3e..eda1cdb 100644 --- a/vendor/phpseclib/phpseclib/phpseclib/Net/SFTP/Stream.php +++ b/vendor/phpseclib/phpseclib/phpseclib/Net/SFTP/Stream.php @@ -28,7 +28,7 @@ * @category Net * @package Net_SFTP_Stream * @author Jim Wigginton - * @copyright MMXIII Jim Wigginton + * @copyright 2013 Jim Wigginton * @license http://www.opensource.org/licenses/mit-license.html MIT License * @link http://phpseclib.sourceforge.net */ @@ -48,7 +48,6 @@ class Net_SFTP_Stream * Rather than re-create the connection we re-use instances if possible * * @var Array - * @access static */ static $instances; diff --git a/vendor/phpseclib/phpseclib/phpseclib/Net/SSH1.php b/vendor/phpseclib/phpseclib/phpseclib/Net/SSH1.php index 15e659a..f1fae02 100644 --- a/vendor/phpseclib/phpseclib/phpseclib/Net/SSH1.php +++ b/vendor/phpseclib/phpseclib/phpseclib/Net/SSH1.php @@ -59,7 +59,7 @@ * @category Net * @package Net_SSH1 * @author Jim Wigginton - * @copyright MMVII Jim Wigginton + * @copyright 2007 Jim Wigginton * @license http://www.opensource.org/licenses/mit-license.html MIT License * @link http://phpseclib.sourceforge.net */ @@ -1128,6 +1128,7 @@ function _get_binary_packet() $padding_length = 8 - ($temp['length'] & 7); $length = $temp['length'] + $padding_length; + $raw = ''; while ($length > 0) { $temp = fread($this->fsock, $length); diff --git a/vendor/phpseclib/phpseclib/phpseclib/Net/SSH2.php b/vendor/phpseclib/phpseclib/phpseclib/Net/SSH2.php index 73259cd..d613456 100644 --- a/vendor/phpseclib/phpseclib/phpseclib/Net/SSH2.php +++ b/vendor/phpseclib/phpseclib/phpseclib/Net/SSH2.php @@ -61,7 +61,7 @@ * @category Net * @package Net_SSH2 * @author Jim Wigginton - * @copyright MMVII Jim Wigginton + * @copyright 2007 Jim Wigginton * @license http://www.opensource.org/licenses/mit-license.html MIT License * @link http://phpseclib.sourceforge.net */ @@ -2261,7 +2261,7 @@ function getStdError() /** * Execute Command * - * If $block is set to false then Net_SSH2::_get_channel_packet(NET_SSH2_CHANNEL_EXEC) will need to be called manually. + * If $callback is set to false then Net_SSH2::_get_channel_packet(NET_SSH2_CHANNEL_EXEC) will need to be called manually. * In all likelihood, this is not a feature you want to be taking advantage of. * * @param String $command @@ -3275,27 +3275,23 @@ function _append_log($message_number, $message) */ function _send_channel_packet($client_channel, $data) { - /* The maximum amount of data allowed is determined by the maximum - packet size for the channel, and the current window size, whichever - is smaller. - - -- http://tools.ietf.org/html/rfc4254#section-5.2 */ - $max_size = min( - $this->packet_size_client_to_server[$client_channel], - $this->window_size_client_to_server[$client_channel] - ); - while (strlen($data) > $max_size) { + while (strlen($data)) { if (!$this->window_size_client_to_server[$client_channel]) { $this->bitmap^= NET_SSH2_MASK_WINDOW_ADJUST; // using an invalid channel will let the buffers be built up for the valid channels - $output = $this->_get_channel_packet(-1); + $this->_get_channel_packet(-1); $this->bitmap^= NET_SSH2_MASK_WINDOW_ADJUST; - $max_size = min( - $this->packet_size_client_to_server[$client_channel], - $this->window_size_client_to_server[$client_channel] - ); } + /* The maximum amount of data allowed is determined by the maximum + packet size for the channel, and the current window size, whichever + is smaller. + -- http://tools.ietf.org/html/rfc4254#section-5.2 */ + $max_size = min( + $this->packet_size_client_to_server[$client_channel], + $this->window_size_client_to_server[$client_channel] + ); + $temp = $this->_string_shift($data, $max_size); $packet = pack('CN2a*', NET_SSH2_MSG_CHANNEL_DATA, @@ -3303,27 +3299,13 @@ function _send_channel_packet($client_channel, $data) strlen($temp), $temp ); - $this->window_size_client_to_server[$client_channel]-= strlen($temp); - if (!$this->_send_binary_packet($packet)) { return false; } } - if (strlen($data) >= $this->window_size_client_to_server[$client_channel]) { - $this->bitmap^= NET_SSH2_MASK_WINDOW_ADJUST; - $this->_get_channel_packet(-1); - $this->bitmap^= NET_SSH2_MASK_WINDOW_ADJUST; - } - - $this->window_size_client_to_server[$client_channel]-= strlen($data); - - return $this->_send_binary_packet(pack('CN2a*', - NET_SSH2_MSG_CHANNEL_DATA, - $this->server_channels[$client_channel], - strlen($data), - $data)); + return true; } /** @@ -3372,7 +3354,7 @@ function _close_channel($client_channel, $want_reply = false) */ function _disconnect($reason) { - if ($this->bitmap) { + if ($this->bitmap & NET_SSH2_MASK_CONNECTED) { $data = pack('CNNa*Na*', NET_SSH2_MSG_DISCONNECT, $reason, 0, '', 0, ''); $this->_send_binary_packet($data); $this->bitmap = 0; diff --git a/vendor/phpseclib/phpseclib/phpseclib/System/SSH/Agent.php b/vendor/phpseclib/phpseclib/phpseclib/System/SSH/Agent.php index ead905f..4c0ef73 100644 --- a/vendor/phpseclib/phpseclib/phpseclib/System/SSH/Agent.php +++ b/vendor/phpseclib/phpseclib/phpseclib/System/SSH/Agent.php @@ -43,7 +43,7 @@ * @category System * @package System_SSH_Agent * @author Jim Wigginton - * @copyright MMXIV Jim Wigginton + * @copyright 2014 Jim Wigginton * @license http://www.opensource.org/licenses/mit-license.html MIT License * @link http://phpseclib.sourceforge.net * @internal See http://api.libssh.org/rfc/PROTOCOL.agent diff --git a/vendor/phpseclib/phpseclib/phpseclib/System/SSH_Agent.php b/vendor/phpseclib/phpseclib/phpseclib/System/SSH_Agent.php index 0a00165..ea434b9 100644 --- a/vendor/phpseclib/phpseclib/phpseclib/System/SSH_Agent.php +++ b/vendor/phpseclib/phpseclib/phpseclib/System/SSH_Agent.php @@ -30,7 +30,7 @@ * @category System * @package System_SSH_Agent * @author Jim Wigginton - * @copyright MMXIV Jim Wigginton + * @copyright 2014 Jim Wigginton * @license http://www.opensource.org/licenses/mit-license.html MIT License * @link http://phpseclib.sourceforge.net * @internal See http://api.libssh.org/rfc/PROTOCOL.agent diff --git a/vendor/phpseclib/phpseclib/tests/Functional/Net/SCPSSH2UserStoryTest.php b/vendor/phpseclib/phpseclib/tests/Functional/Net/SCPSSH2UserStoryTest.php new file mode 100644 index 0000000..295e982 --- /dev/null +++ b/vendor/phpseclib/phpseclib/tests/Functional/Net/SCPSSH2UserStoryTest.php @@ -0,0 +1,88 @@ + + * @copyright 2014 Andreas Fischer + * @license http://www.opensource.org/licenses/mit-license.html MIT License + */ + +class Functional_Net_SCPSSH2UserStoryTest extends PhpseclibFunctionalTestCase +{ + static protected $remoteFile; + static protected $exampleData; + static protected $exampleDataLength; + + static public function setUpBeforeClass() + { + parent::setUpBeforeClass(); + self::$remoteFile = uniqid('phpseclib-scp-ssh2-') . '.txt'; + self::$exampleData = str_repeat('abscp12345', 1000); + self::$exampleDataLength = 10000; + } + + public function testConstructSSH2() + { + $ssh = new Net_SSH2($this->getEnv('SSH_HOSTNAME')); + $this->assertTrue( + $ssh->login( + $this->getEnv('SSH_USERNAME'), + $this->getEnv('SSH_PASSWORD') + ) + ); + return $ssh; + } + + /** @depends testConstructSSH2 */ + public function testConstructor($ssh) + { + $scp = new Net_SCP($ssh); + $this->assertTrue( + is_object($scp), + 'Could not construct Net_SCP object.' + ); + return $scp; + } + + /** @depends testConstructor */ + public function testPutGetString($scp) + { + $this->assertTrue( + $scp->put(self::$remoteFile, self::$exampleData), + 'Failed asserting that data could successfully be put() into file.' + ); + $content = $scp->get(self::$remoteFile); + // TODO: Address https://github.com/phpseclib/phpseclib/issues/146 + $this->assertContains( + strlen($content), + array(self::$exampleDataLength, self::$exampleDataLength + 1), + 'Failed asserting that string length matches expected length.' + ); + $this->assertContains( + $content, + array(self::$exampleData, self::$exampleData . "\0"), + 'Failed asserting that string content matches expected content.' + ); + return $scp; + } + + /** @depends testPutGetString */ + public function testGetFile($scp) + { + $localFilename = $this->createTempFile(); + $this->assertTrue( + $scp->get(self::$remoteFile, $localFilename), + 'Failed asserting that get() into file was successful.' + ); + // TODO: Address https://github.com/phpseclib/phpseclib/issues/146 + $this->assertContains( + filesize($localFilename), + array(self::$exampleDataLength, self::$exampleDataLength + 1), + 'Failed asserting that filesize matches expected data size.' + ); + $this->assertContains( + file_get_contents($localFilename), + array(self::$exampleData, self::$exampleData . "\0"), + 'Failed asserting that file content matches expected content.' + ); + } +} diff --git a/vendor/phpseclib/phpseclib/tests/Functional/Net/SFTPLargeFileTest.php b/vendor/phpseclib/phpseclib/tests/Functional/Net/SFTPLargeFileTest.php new file mode 100644 index 0000000..1c78f49 --- /dev/null +++ b/vendor/phpseclib/phpseclib/tests/Functional/Net/SFTPLargeFileTest.php @@ -0,0 +1,74 @@ + + * @copyright 2014 Andreas Fischer + * @license http://www.opensource.org/licenses/mit-license.html MIT License + */ + +require_once 'Crypt/Base.php'; + +class Functional_Net_SFTPLargeFileTest extends PhpseclibFunctionalTestCase +{ + protected $sftp; + protected $scratchDir; + + static public function setUpBeforeClass() + { + if (!extension_loaded('mcrypt')) { + self::markTestSkipped('This test depends on mcrypt for performance.'); + } + parent::setUpBeforeClass(); + self::ensureConstant('CRYPT_AES_MODE', CRYPT_MODE_MCRYPT); + self::ensureConstant('CRYPT_BLOWFISH_MODE', CRYPT_MODE_MCRYPT); + self::ensureConstant('CRYPT_DES_MODE', CRYPT_MODE_MCRYPT); + self::ensureConstant('CRYPT_RC2_MODE', CRYPT_MODE_MCRYPT); + self::ensureConstant('CRYPT_RC4_MODE', CRYPT_MODE_MCRYPT); + self::ensureConstant('CRYPT_RIJNDAEL_MODE', CRYPT_MODE_MCRYPT); + self::ensureConstant('CRYPT_TWOFISH_MODE', CRYPT_MODE_MCRYPT); + } + + public function setUp() + { + $this->scratchDir = uniqid('phpseclib-sftp-large-scratch-'); + + $this->sftp = new Net_SFTP($this->getEnv('SSH_HOSTNAME')); + $this->assertTrue($this->sftp->login( + $this->getEnv('SSH_USERNAME'), + $this->getEnv('SSH_PASSWORD') + )); + $this->assertTrue($this->sftp->mkdir($this->scratchDir)); + $this->assertTrue($this->sftp->chdir($this->scratchDir)); + } + + public function tearDown() + { + if ($this->sftp) { + $this->sftp->chdir($this->getEnv('SSH_HOME')); + $this->sftp->delete($this->scratchDir); + } + parent::tearDown(); + } + + /** + * @group github298 + * @group github455 + * @group github457 + */ + public function testPutSizeLocalFile() + { + $tmp_filename = $this->createTempFile(128, 1024 * 1024); + $filename = 'file-large-from-local.txt'; + + $this->assertTrue( + $this->sftp->put($filename, $tmp_filename, NET_SFTP_LOCAL_FILE), + 'Failed asserting that local file could be successfully put().' + ); + + $this->assertSame( + 128 * 1024 * 1024, + $this->sftp->size($filename), + 'Failed asserting that uploaded local file has the expected length.' + ); + } +} diff --git a/vendor/phpseclib/phpseclib/tests/Functional/Net/SFTPUserStoryTest.php b/vendor/phpseclib/phpseclib/tests/Functional/Net/SFTPUserStoryTest.php index faf5680..b5c57de 100644 --- a/vendor/phpseclib/phpseclib/tests/Functional/Net/SFTPUserStoryTest.php +++ b/vendor/phpseclib/phpseclib/tests/Functional/Net/SFTPUserStoryTest.php @@ -2,7 +2,7 @@ /** * @author Andreas Fischer - * @copyright MMXIV Andreas Fischer + * @copyright 2014 Andreas Fischer * @license http://www.opensource.org/licenses/mit-license.html MIT License */ @@ -14,12 +14,6 @@ class Functional_Net_SFTPUserStoryTest extends PhpseclibFunctionalTestCase static public function setUpBeforeClass() { - if (getenv('TRAVIS') && version_compare(PHP_VERSION, '5.3.3', '<=')) { - self::markTestIncomplete( - 'This test hangs on Travis CI on PHP 5.3.3 and below.' - ); - } - parent::setUpBeforeClass(); self::$scratchDir = uniqid('phpseclib-sftp-scratch-'); diff --git a/vendor/phpseclib/phpseclib/tests/Functional/Net/SSH2AgentTest.php b/vendor/phpseclib/phpseclib/tests/Functional/Net/SSH2AgentTest.php new file mode 100644 index 0000000..d92bb70 --- /dev/null +++ b/vendor/phpseclib/phpseclib/tests/Functional/Net/SSH2AgentTest.php @@ -0,0 +1,31 @@ + + * @copyright 2014 Andreas Fischer + * @license http://www.opensource.org/licenses/mit-license.html MIT License + */ + +class Functional_Net_SSH2AgentTest extends PhpseclibFunctionalTestCase +{ + public static function setUpBeforeClass() + { + if (!isset($_SERVER['SSH_AUTH_SOCK'])) { + self::markTestSkipped( + 'This test requires an SSH Agent (SSH_AUTH_SOCK env variable).' + ); + } + parent::setUpBeforeClass(); + } + + public function testAgentLogin() + { + $ssh = new Net_SSH2($this->getEnv('SSH_HOSTNAME')); + $agent = new System_SSH_Agent; + + $this->assertTrue( + $ssh->login($this->getEnv('SSH_USERNAME'), $agent), + 'SSH2 login using Agent failed.' + ); + } +} diff --git a/vendor/phpseclib/phpseclib/tests/Functional/Net/SSH2Test.php b/vendor/phpseclib/phpseclib/tests/Functional/Net/SSH2Test.php index f07f27c..f4ce67a 100644 --- a/vendor/phpseclib/phpseclib/tests/Functional/Net/SSH2Test.php +++ b/vendor/phpseclib/phpseclib/tests/Functional/Net/SSH2Test.php @@ -2,22 +2,12 @@ /** * @author Andreas Fischer - * @copyright MMXIV Andreas Fischer + * @copyright 2014 Andreas Fischer * @license http://www.opensource.org/licenses/mit-license.html MIT License */ class Functional_Net_SSH2Test extends PhpseclibFunctionalTestCase { - public function setUp() - { - if (getenv('TRAVIS') && version_compare(PHP_VERSION, '5.3.3', '<=')) { - $this->markTestIncomplete( - 'This test hangs on Travis CI on PHP 5.3.3 and below.' - ); - } - parent::setUp(); - } - public function testConstructor() { $ssh = new Net_SSH2($this->getEnv('SSH_HOSTNAME')); diff --git a/vendor/phpseclib/phpseclib/tests/PhpseclibFunctionalTestCase.php b/vendor/phpseclib/phpseclib/tests/PhpseclibFunctionalTestCase.php index 62e41b8..5575c97 100644 --- a/vendor/phpseclib/phpseclib/tests/PhpseclibFunctionalTestCase.php +++ b/vendor/phpseclib/phpseclib/tests/PhpseclibFunctionalTestCase.php @@ -1,7 +1,7 @@ - * @copyright MMXIV Andreas Fischer + * @copyright 2014 Andreas Fischer * @license http://www.opensource.org/licenses/mit-license.html MIT License */ @@ -10,7 +10,21 @@ abstract class PhpseclibFunctionalTestCase extends PhpseclibTestCase static public function setUpBeforeClass() { if (extension_loaded('runkit')) { - self::ensureConstant('MATH_BIGINTEGER_MODE', MATH_BIGINTEGER_MODE_GMP); + if (extension_loaded('gmp')) { + self::ensureConstant( + 'MATH_BIGINTEGER_MODE', + MATH_BIGINTEGER_MODE_GMP + ); + } elseif (extension_loaded('bcmath')) { + self::ensureConstant( + 'MATH_BIGINTEGER_MODE', + MATH_BIGINTEGER_MODE_BCMATH + ); + } else { + self::markTestSkipped( + 'Should have gmp or bcmath extension for functional test.' + ); + } self::ensureConstant('CRYPT_HASH_MODE', CRYPT_HASH_MODE_HASH); self::reRequireFile('Math/BigInteger.php'); self::reRequireFile('Crypt/Hash.php'); diff --git a/vendor/phpseclib/phpseclib/tests/PhpseclibTestCase.php b/vendor/phpseclib/phpseclib/tests/PhpseclibTestCase.php index 3369ad1..5cdfe04 100644 --- a/vendor/phpseclib/phpseclib/tests/PhpseclibTestCase.php +++ b/vendor/phpseclib/phpseclib/tests/PhpseclibTestCase.php @@ -1,12 +1,52 @@ - * @copyright MMXIII Andreas Fischer + * @copyright 2013 Andreas Fischer * @license http://www.opensource.org/licenses/mit-license.html MIT License */ abstract class PhpseclibTestCase extends PHPUnit_Framework_TestCase { + protected $tempFilesToUnlinkOnTearDown = array(); + + public function tearDown() + { + foreach ($this->tempFilesToUnlinkOnTearDown as $filename) { + if (!file_exists($filename) || unlink($filename)) { + unset($this->tempFilesToUnlinkOnTearDown[$filename]); + } + } + parent::tearDown(); + } + + /** + * Creates a temporary file on the local filesystem and returns its path. + * The $number_of_writes and $bytes_per_write parameters can be used to + * write $number_of_writes * $bytes_per_write times the character 'a' to the + * temporary file. All files created using this method will be deleted from + * the filesystem on tearDown(), i.e. after each test method was run. + * + * @param int $number_of_writes + * @param int $bytes_per_write + * + * @return string + */ + protected function createTempFile($number_of_writes = 0, $bytes_per_write = 0) + { + $filename = tempnam(sys_get_temp_dir(), 'phpseclib-test-'); + $this->assertTrue(file_exists($filename)); + $this->tempFilesToUnlinkOnTearDown[] = $filename; + if ($number_of_writes > 0 && $bytes_per_write > 0) { + $fp = fopen($filename, 'wb'); + for ($i = 0; $i < $number_of_writes; ++$i) { + fwrite($fp, str_repeat('a', $bytes_per_write)); + } + fclose($fp); + $this->assertSame($number_of_writes * $bytes_per_write, filesize($filename)); + } + return $filename; + } + /** * @param string $constant * @param mixed $expected diff --git a/vendor/phpseclib/phpseclib/tests/Unit/Crypt/AES/InternalTest.php b/vendor/phpseclib/phpseclib/tests/Unit/Crypt/AES/InternalTest.php index 2a9652c..105f78a 100644 --- a/vendor/phpseclib/phpseclib/tests/Unit/Crypt/AES/InternalTest.php +++ b/vendor/phpseclib/phpseclib/tests/Unit/Crypt/AES/InternalTest.php @@ -1,7 +1,7 @@ - * @copyright MMXIII Andreas Fischer + * @copyright 2013 Andreas Fischer * @license http://www.opensource.org/licenses/mit-license.html MIT License */ diff --git a/vendor/phpseclib/phpseclib/tests/Unit/Crypt/AES/McryptTest.php b/vendor/phpseclib/phpseclib/tests/Unit/Crypt/AES/McryptTest.php index 4327c7e..84475b6 100644 --- a/vendor/phpseclib/phpseclib/tests/Unit/Crypt/AES/McryptTest.php +++ b/vendor/phpseclib/phpseclib/tests/Unit/Crypt/AES/McryptTest.php @@ -1,7 +1,7 @@ - * @copyright MMXIII Andreas Fischer + * @copyright 2013 Andreas Fischer * @license http://www.opensource.org/licenses/mit-license.html MIT License */ diff --git a/vendor/phpseclib/phpseclib/tests/Unit/Crypt/AES/TestCase.php b/vendor/phpseclib/phpseclib/tests/Unit/Crypt/AES/TestCase.php index 91cb979..02434ae 100644 --- a/vendor/phpseclib/phpseclib/tests/Unit/Crypt/AES/TestCase.php +++ b/vendor/phpseclib/phpseclib/tests/Unit/Crypt/AES/TestCase.php @@ -1,7 +1,7 @@ - * @copyright MMXIII Andreas Fischer + * @copyright 2013 Andreas Fischer * @license http://www.opensource.org/licenses/mit-license.html MIT License */ diff --git a/vendor/phpseclib/phpseclib/tests/Unit/Crypt/Hash/MD5Test.php b/vendor/phpseclib/phpseclib/tests/Unit/Crypt/Hash/MD5Test.php index 3651147..e7d2846 100644 --- a/vendor/phpseclib/phpseclib/tests/Unit/Crypt/Hash/MD5Test.php +++ b/vendor/phpseclib/phpseclib/tests/Unit/Crypt/Hash/MD5Test.php @@ -1,7 +1,7 @@ - * @copyright MMXII Andreas Fischer + * @copyright 2012 Andreas Fischer * @license http://www.opensource.org/licenses/mit-license.html MIT License */ diff --git a/vendor/phpseclib/phpseclib/tests/Unit/Crypt/Hash/SHA256Test.php b/vendor/phpseclib/phpseclib/tests/Unit/Crypt/Hash/SHA256Test.php index 61b5480..097e699 100644 --- a/vendor/phpseclib/phpseclib/tests/Unit/Crypt/Hash/SHA256Test.php +++ b/vendor/phpseclib/phpseclib/tests/Unit/Crypt/Hash/SHA256Test.php @@ -1,7 +1,7 @@ - * @copyright MMXIV Andreas Fischer + * @copyright 2014 Andreas Fischer * @license http://www.opensource.org/licenses/mit-license.html MIT License */ diff --git a/vendor/phpseclib/phpseclib/tests/Unit/Crypt/Hash/SHA256_96Test.php b/vendor/phpseclib/phpseclib/tests/Unit/Crypt/Hash/SHA256_96Test.php index a9cfc43..685d73b 100644 --- a/vendor/phpseclib/phpseclib/tests/Unit/Crypt/Hash/SHA256_96Test.php +++ b/vendor/phpseclib/phpseclib/tests/Unit/Crypt/Hash/SHA256_96Test.php @@ -1,7 +1,7 @@ - * @copyright MMXIV Andreas Fischer + * @copyright 2014 Andreas Fischer * @license http://www.opensource.org/licenses/mit-license.html MIT License */ diff --git a/vendor/phpseclib/phpseclib/tests/Unit/Crypt/Hash/SHA512Test.php b/vendor/phpseclib/phpseclib/tests/Unit/Crypt/Hash/SHA512Test.php index 6e60c66..66140a8 100644 --- a/vendor/phpseclib/phpseclib/tests/Unit/Crypt/Hash/SHA512Test.php +++ b/vendor/phpseclib/phpseclib/tests/Unit/Crypt/Hash/SHA512Test.php @@ -1,7 +1,7 @@ - * @copyright MMXIV Andreas Fischer + * @copyright 2014 Andreas Fischer * @license http://www.opensource.org/licenses/mit-license.html MIT License */ diff --git a/vendor/phpseclib/phpseclib/tests/Unit/Crypt/Hash/SHA512_96Test.php b/vendor/phpseclib/phpseclib/tests/Unit/Crypt/Hash/SHA512_96Test.php index 44af854..78a43f5 100644 --- a/vendor/phpseclib/phpseclib/tests/Unit/Crypt/Hash/SHA512_96Test.php +++ b/vendor/phpseclib/phpseclib/tests/Unit/Crypt/Hash/SHA512_96Test.php @@ -1,7 +1,7 @@ - * @copyright MMXIV Andreas Fischer + * @copyright 2014 Andreas Fischer * @license http://www.opensource.org/licenses/mit-license.html MIT License */ diff --git a/vendor/phpseclib/phpseclib/tests/Unit/Crypt/Hash/TestCase.php b/vendor/phpseclib/phpseclib/tests/Unit/Crypt/Hash/TestCase.php index 040bce2..d33d2d0 100644 --- a/vendor/phpseclib/phpseclib/tests/Unit/Crypt/Hash/TestCase.php +++ b/vendor/phpseclib/phpseclib/tests/Unit/Crypt/Hash/TestCase.php @@ -1,7 +1,7 @@ - * @copyright MMXII Andreas Fischer + * @copyright 2012 Andreas Fischer * @license http://www.opensource.org/licenses/mit-license.html MIT License */ diff --git a/vendor/phpseclib/phpseclib/tests/Unit/Crypt/RSA/LoadKeyTest.php b/vendor/phpseclib/phpseclib/tests/Unit/Crypt/RSA/LoadKeyTest.php index 6506c47..a657c06 100644 --- a/vendor/phpseclib/phpseclib/tests/Unit/Crypt/RSA/LoadKeyTest.php +++ b/vendor/phpseclib/phpseclib/tests/Unit/Crypt/RSA/LoadKeyTest.php @@ -1,7 +1,7 @@ - * @copyright MMXIII Jim Wigginton + * @copyright 2013 Jim Wigginton * @license http://www.opensource.org/licenses/mit-license.html MIT License */ diff --git a/vendor/phpseclib/phpseclib/tests/Unit/Crypt/RandomTest.php b/vendor/phpseclib/phpseclib/tests/Unit/Crypt/RandomTest.php new file mode 100644 index 0000000..0703613 --- /dev/null +++ b/vendor/phpseclib/phpseclib/tests/Unit/Crypt/RandomTest.php @@ -0,0 +1,53 @@ + + * @copyright 2014 Andreas Fischer + * @license http://www.opensource.org/licenses/mit-license.html MIT License + */ + +class Unit_Crypt_RandomTest extends PhpseclibTestCase +{ + public function stringLengthData() + { + return array_map(array($this, 'wrap'), array( + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 17, 19, 20, 23, 29, 31, 37, + 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 111, 128, 1000, + 1024, 10000, 12345, 100000, 123456 + )); + } + + /** @dataProvider stringLengthData */ + public function testStringLength($length) + { + $this->assertSame( + $length, + strlen(crypt_random_string($length)), + 'Failed asserting that a string of expected length was generated.' + ); + } + + /** + * Takes a set of random values of length 128 bits and asserts all taken + * values are unique. + */ + public function testStringUniqueness() + { + $values = array(); + for ($i = 0; $i < 10000; ++$i) { + $rand = crypt_random_string(16); + $this->assertSame(16, strlen($rand)); + $this->assertArrayNotHasKey( + $rand, + $values, + 'Failed asserting that generated value does not exist in set.' + ); + $values[$rand] = true; + } + } + + protected function wrap($x) + { + // array() is not a function, but $this->wrap() is. + return array($x); + } +} diff --git a/vendor/phpseclib/phpseclib/tests/Unit/File/ASN1Test.php b/vendor/phpseclib/phpseclib/tests/Unit/File/ASN1Test.php index 5a5e6ef..77ab052 100644 --- a/vendor/phpseclib/phpseclib/tests/Unit/File/ASN1Test.php +++ b/vendor/phpseclib/phpseclib/tests/Unit/File/ASN1Test.php @@ -1,7 +1,7 @@ - * @copyright MMXIV Jim Wigginton + * @copyright 2014 Jim Wigginton * @license http://www.opensource.org/licenses/mit-license.html MIT License */ @@ -278,4 +278,15 @@ public function testContextSpecificNonConstructed() $decoded = $asn1->decodeBER(base64_decode('MBaAFJtUo7c00HsI5EPZ4bkICfkOY2Pv')); $this->assertInternalType('string', $decoded[0]['content'][0]['content']); } + + /** + * @group github602 + */ + public function testEmptyContextTag() + { + $asn1 = new File_ASN1(); + $decoded = $asn1->decodeBER("\xa0\x00"); + $this->assertInternalType('array', $decoded); + $this->assertCount(0, $decoded[0]['content']); + } } diff --git a/vendor/phpseclib/phpseclib/tests/Unit/File/X509/CSRTest.php b/vendor/phpseclib/phpseclib/tests/Unit/File/X509/CSRTest.php new file mode 100644 index 0000000..57bce68 --- /dev/null +++ b/vendor/phpseclib/phpseclib/tests/Unit/File/X509/CSRTest.php @@ -0,0 +1,31 @@ + + * @copyright 2014 Jim Wigginton + * @license http://www.opensource.org/licenses/mit-license.html MIT License + */ + +require_once 'File/X509.php'; + +class Unit_File_X509_CSRTest extends PhpseclibTestCase +{ + public function testLoadCSR() + { + $test = '-----BEGIN CERTIFICATE REQUEST----- +MIIBWzCBxQIBADAeMRwwGgYDVQQKDBNwaHBzZWNsaWIgZGVtbyBjZXJ0MIGdMAsG +CSqGSIb3DQEBAQOBjQAwgYkCgYEAtHDb4zoUyiRYsJ5PZrF/IJKAF9ZoHRpTxMA8 +a7iyFdsl/vvZLNPsNnFTXXnGdvsyFDEsF7AubaIXw8UKFPYqQRTzSVsvnNgIoVYj +tTAXlB4oHipr7Kxcn4CXfmR0TYogyLvVZSZJYxh+CAuG4V9XM4HqkeE5gyBOsKGy +5FUU8zMCAwEAAaAAMA0GCSqGSIb3DQEBBQUAA4GBAJjdaA9K9DN5xvSiOlCmmV1E +npzHkI1Trraveu0gtRjT/EzHoqjCBI0ekCZ9+fhrex8Sm6Nsq9IgHYyrqnE+PQko +4Nf2w2U3DWxU26D5E9DlI+bLyOCq4jqATLjHyyAsOZY/2+U73AZ82MJM/mGdh5fQ +v5RwaQHmQEzHofTzF7I+ +-----END CERTIFICATE REQUEST-----'; + + $x509 = new File_X509(); + + $spkac = $x509->loadCSR($test); + + $this->assertInternalType('array', $spkac); + } +} diff --git a/vendor/phpseclib/phpseclib/tests/Unit/File/X509/SPKACTest.php b/vendor/phpseclib/phpseclib/tests/Unit/File/X509/SPKACTest.php index 3690d77..7f53f18 100644 --- a/vendor/phpseclib/phpseclib/tests/Unit/File/X509/SPKACTest.php +++ b/vendor/phpseclib/phpseclib/tests/Unit/File/X509/SPKACTest.php @@ -1,7 +1,7 @@ - * @copyright MMXIV Jim Wigginton + * @copyright 2014 Jim Wigginton * @license http://www.opensource.org/licenses/mit-license.html MIT License */ diff --git a/vendor/phpseclib/phpseclib/tests/Unit/Math/BigInteger/BCMathTest.php b/vendor/phpseclib/phpseclib/tests/Unit/Math/BigInteger/BCMathTest.php index d856c1a..ebb215f 100644 --- a/vendor/phpseclib/phpseclib/tests/Unit/Math/BigInteger/BCMathTest.php +++ b/vendor/phpseclib/phpseclib/tests/Unit/Math/BigInteger/BCMathTest.php @@ -1,7 +1,7 @@ - * @copyright MMXIII Andreas Fischer + * @copyright 2013 Andreas Fischer * @license http://www.opensource.org/licenses/mit-license.html MIT License */ diff --git a/vendor/phpseclib/phpseclib/tests/Unit/Math/BigInteger/GMPTest.php b/vendor/phpseclib/phpseclib/tests/Unit/Math/BigInteger/GMPTest.php index 02a1cae..94328c8 100644 --- a/vendor/phpseclib/phpseclib/tests/Unit/Math/BigInteger/GMPTest.php +++ b/vendor/phpseclib/phpseclib/tests/Unit/Math/BigInteger/GMPTest.php @@ -1,7 +1,7 @@ - * @copyright MMXIII Andreas Fischer + * @copyright 2013 Andreas Fischer * @license http://www.opensource.org/licenses/mit-license.html MIT License */ diff --git a/vendor/phpseclib/phpseclib/tests/Unit/Math/BigInteger/InternalOpenSSLTest.php b/vendor/phpseclib/phpseclib/tests/Unit/Math/BigInteger/InternalOpenSSLTest.php index 06d57a6..ba72179 100644 --- a/vendor/phpseclib/phpseclib/tests/Unit/Math/BigInteger/InternalOpenSSLTest.php +++ b/vendor/phpseclib/phpseclib/tests/Unit/Math/BigInteger/InternalOpenSSLTest.php @@ -1,7 +1,7 @@ - * @copyright MMXIII Andreas Fischer + * @copyright 2013 Andreas Fischer * @license http://www.opensource.org/licenses/mit-license.html MIT License */ diff --git a/vendor/phpseclib/phpseclib/tests/Unit/Math/BigInteger/InternalTest.php b/vendor/phpseclib/phpseclib/tests/Unit/Math/BigInteger/InternalTest.php index 784d865..76f68bd 100644 --- a/vendor/phpseclib/phpseclib/tests/Unit/Math/BigInteger/InternalTest.php +++ b/vendor/phpseclib/phpseclib/tests/Unit/Math/BigInteger/InternalTest.php @@ -1,7 +1,7 @@ - * @copyright MMXIII Andreas Fischer + * @copyright 2013 Andreas Fischer * @license http://www.opensource.org/licenses/mit-license.html MIT License */ diff --git a/vendor/phpseclib/phpseclib/tests/Unit/Math/BigInteger/TestCase.php b/vendor/phpseclib/phpseclib/tests/Unit/Math/BigInteger/TestCase.php index 87addfd..b52a66d 100644 --- a/vendor/phpseclib/phpseclib/tests/Unit/Math/BigInteger/TestCase.php +++ b/vendor/phpseclib/phpseclib/tests/Unit/Math/BigInteger/TestCase.php @@ -1,7 +1,7 @@ - * @copyright MMXII Andreas Fischer + * @copyright 2012 Andreas Fischer * @license http://www.opensource.org/licenses/mit-license.html MIT License */ diff --git a/vendor/phpseclib/phpseclib/tests/Unit/Net/SFTPStreamTest.php b/vendor/phpseclib/phpseclib/tests/Unit/Net/SFTPStreamTest.php index f54f79f..f5f8345 100644 --- a/vendor/phpseclib/phpseclib/tests/Unit/Net/SFTPStreamTest.php +++ b/vendor/phpseclib/phpseclib/tests/Unit/Net/SFTPStreamTest.php @@ -1,7 +1,7 @@ - * @copyright MMXIV Andreas Fischer + * @copyright 2014 Andreas Fischer * @license http://www.opensource.org/licenses/mit-license.html MIT License */ diff --git a/vendor/phpseclib/phpseclib/tests/Unit/Net/SSH1Test.php b/vendor/phpseclib/phpseclib/tests/Unit/Net/SSH1Test.php index 5f4778f..b0b2aae 100644 --- a/vendor/phpseclib/phpseclib/tests/Unit/Net/SSH1Test.php +++ b/vendor/phpseclib/phpseclib/tests/Unit/Net/SSH1Test.php @@ -1,7 +1,7 @@ - * @copyright MMXIII Marc Scholten + * @copyright 2013 Marc Scholten * @license http://www.opensource.org/licenses/mit-license.html MIT License */ diff --git a/vendor/phpseclib/phpseclib/tests/Unit/Net/SSH2Test.php b/vendor/phpseclib/phpseclib/tests/Unit/Net/SSH2Test.php index ce8f17b..d166ae4 100644 --- a/vendor/phpseclib/phpseclib/tests/Unit/Net/SSH2Test.php +++ b/vendor/phpseclib/phpseclib/tests/Unit/Net/SSH2Test.php @@ -2,7 +2,7 @@ /** * @author Marc Scholten - * @copyright MMXIII Marc Scholten + * @copyright 2013 Marc Scholten * @license http://www.opensource.org/licenses/mit-license.html MIT License */ diff --git a/vendor/phpseclib/phpseclib/travis/run-phpunit.sh b/vendor/phpseclib/phpseclib/travis/run-phpunit.sh index 713e98d..600a1d9 100755 --- a/vendor/phpseclib/phpseclib/travis/run-phpunit.sh +++ b/vendor/phpseclib/phpseclib/travis/run-phpunit.sh @@ -14,15 +14,21 @@ else PHPUNIT="$(dirname "$0")/../vendor/bin/phpunit" fi -PHPUNIT_EXTRA_ARGS='' +PHPUNIT_ARGS='--verbose' if [ `php -r "echo (int) version_compare(PHP_VERSION, '5.4', '<');"` = "1" ] then - PHPUNIT_EXTRA_ARGS="$PHPUNIT_EXTRA_ARGS -d zend.enable_gc=0" + PHPUNIT_ARGS="$PHPUNIT_ARGS -d zend.enable_gc=0" fi -"$PHPUNIT" \ - $PHPUNIT_EXTRA_ARGS \ - --verbose \ - --coverage-text \ - --coverage-clover code_coverage/clover.xml \ - --coverage-html code_coverage/ +if [ "$TRAVIS_PHP_VERSION" = 'hhvm' ] +then + find tests -type f -name "*Test.php" | \ + parallel --gnu --keep-order \ + "echo '== {} =='; \"$PHPUNIT\" $PHPUNIT_ARGS {};" +else + "$PHPUNIT" \ + $PHPUNIT_ARGS \ + --coverage-text \ + --coverage-clover code_coverage/clover.xml \ + --coverage-html code_coverage/ +fi diff --git a/vendor/phpseclib/phpseclib/travis/setup-secure-shell.sh b/vendor/phpseclib/phpseclib/travis/setup-secure-shell.sh index 8dd4e35..fdcaaa0 100755 --- a/vendor/phpseclib/phpseclib/travis/setup-secure-shell.sh +++ b/vendor/phpseclib/phpseclib/travis/setup-secure-shell.sh @@ -13,5 +13,19 @@ set -x USERNAME='phpseclib' PASSWORD='EePoov8po1aethu2kied1ne0' +# Create phpseclib user and home directory sudo useradd --create-home --base-dir /home "$USERNAME" + +# Set phpseclib user password echo "$USERNAME:$PASSWORD" | sudo chpasswd + +# Create a 1024 bit RSA SSH key pair without passphrase for the travis user +ssh-keygen -t rsa -b 1024 -f "$HOME/.ssh/id_rsa" -q -N "" + +# Add the generated private key to SSH agent of travis user +ssh-add "$HOME/.ssh/id_rsa" + +# Allow the private key of the travis user to log in as phpseclib user +sudo mkdir -p "/home/$USERNAME/.ssh/" +sudo cp "$HOME/.ssh/id_rsa.pub" "/home/$USERNAME/.ssh/authorized_keys" +sudo chown "$USERNAME:$USERNAME" "/home/$USERNAME/.ssh/" -R diff --git a/vendor/phpspec/php-diff/README b/vendor/phpspec/php-diff/README deleted file mode 100644 index f596115..0000000 --- a/vendor/phpspec/php-diff/README +++ /dev/null @@ -1,58 +0,0 @@ -PHP Diff Class --------------- - -Introduction ------------- -A comprehensive library for generating differences between -two hashable objects (strings or arrays). Generated differences can be -rendered in all of the standard formats including: - * Unified - * Context - * Inline HTML - * Side by Side HTML - -The logic behind the core of the diff engine (ie, the sequence matcher) -is primarily based on the Python difflib package. The reason for doing -so is primarily because of its high degree of accuracy. - -Example Use ------------ -A quick usage example can be found in the example/ directory and under -example.php. - -More complete documentation will be available shortly. - -Todo ----- - * Ability to ignore blank line changes - * 3 way diff support - * Performance optimizations - -License (BSD License) ---------------------- -Copyright (c) 2009 Chris Boulton -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 the Chris Boulton 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. \ No newline at end of file diff --git a/vendor/phpspec/php-diff/composer.json b/vendor/phpspec/php-diff/composer.json deleted file mode 100644 index 5e91b0f..0000000 --- a/vendor/phpspec/php-diff/composer.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "phpspec/php-diff", - "type": "library", - "description": "A comprehensive library for generating differences between two hashable objects (strings or arrays).", - "license": "BSD-3-Clause", - - "authors": [ - { - "name": "Chris Boulton", - "homepage": "http://github.com/chrisboulton" - } - ], - - "autoload": { - "psr-0": { - "Diff": "lib/" - } - } -} diff --git a/vendor/phpspec/php-diff/example/a.txt b/vendor/phpspec/php-diff/example/a.txt deleted file mode 100644 index 6f3897b..0000000 --- a/vendor/phpspec/php-diff/example/a.txt +++ /dev/null @@ -1,13 +0,0 @@ - - - - Hello World! - - -

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.

- -

A heading we'll be removing

- -

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.

- - \ No newline at end of file diff --git a/vendor/phpspec/php-diff/example/b.txt b/vendor/phpspec/php-diff/example/b.txt deleted file mode 100644 index 5918964..0000000 --- a/vendor/phpspec/php-diff/example/b.txt +++ /dev/null @@ -1,14 +0,0 @@ - - - - Goodbye Cruel World! - - -

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.

- - -

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.

- -

Just a small amount of new text...

- - \ No newline at end of file diff --git a/vendor/phpspec/php-diff/example/example.php b/vendor/phpspec/php-diff/example/example.php deleted file mode 100644 index 234bc2c..0000000 --- a/vendor/phpspec/php-diff/example/example.php +++ /dev/null @@ -1,69 +0,0 @@ - - - - - PHP LibDiff - Examples - - - -

PHP LibDiff - Examples

-
- true, - //'ignoreCase' => true, - ); - - // Initialize the diff class - $diff = new Diff($a, $b, $options); - - ?> -

Side by Side Diff

- Render($renderer); - - ?> -

Inline Diff

- render($renderer); - - ?> -

Unified Diff

-
render($renderer));
-
-		?>
-		
-

Context Diff

-
render($renderer));
-		?>
-		
- - \ No newline at end of file diff --git a/vendor/phpspec/php-diff/example/styles.css b/vendor/phpspec/php-diff/example/styles.css deleted file mode 100644 index 5454896..0000000 --- a/vendor/phpspec/php-diff/example/styles.css +++ /dev/null @@ -1,93 +0,0 @@ -body { - background: #fff; - font-family: Arial; - font-size: 12px; -} -.Differences { - width: 100%; - border-collapse: collapse; - border-spacing: 0; - empty-cells: show; -} - -.Differences thead th { - text-align: left; - border-bottom: 1px solid #000; - background: #aaa; - color: #000; - padding: 4px; -} -.Differences tbody th { - text-align: right; - background: #ccc; - width: 4em; - padding: 1px 2px; - border-right: 1px solid #000; - vertical-align: top; - font-size: 13px; -} - -.Differences td { - padding: 1px 2px; - font-family: Consolas, monospace; - font-size: 13px; -} - -.DifferencesSideBySide .ChangeInsert td.Left { - background: #dfd; -} - -.DifferencesSideBySide .ChangeInsert td.Right { - background: #cfc; -} - -.DifferencesSideBySide .ChangeDelete td.Left { - background: #f88; -} - -.DifferencesSideBySide .ChangeDelete td.Right { - background: #faa; -} - -.DifferencesSideBySide .ChangeReplace .Left { - background: #fe9; -} - -.DifferencesSideBySide .ChangeReplace .Right { - background: #fd8; -} - -.Differences ins, .Differences del { - text-decoration: none; -} - -.DifferencesSideBySide .ChangeReplace ins, .DifferencesSideBySide .ChangeReplace del { - background: #fc0; -} - -.Differences .Skipped { - background: #f7f7f7; -} - -.DifferencesInline .ChangeReplace .Left, -.DifferencesInline .ChangeDelete .Left { - background: #fdd; -} - -.DifferencesInline .ChangeReplace .Right, -.DifferencesInline .ChangeInsert .Right { - background: #dfd; -} - -.DifferencesInline .ChangeReplace ins { - background: #9e9; -} - -.DifferencesInline .ChangeReplace del { - background: #e99; -} - -pre { - width: 100%; - overflow: auto; -} \ No newline at end of file diff --git a/vendor/phpspec/php-diff/lib/Diff.php b/vendor/phpspec/php-diff/lib/Diff.php deleted file mode 100644 index d6cecb7..0000000 --- a/vendor/phpspec/php-diff/lib/Diff.php +++ /dev/null @@ -1,177 +0,0 @@ - - * - * 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 the Chris Boulton 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. - * - * @package Diff - * @author Chris Boulton - * @copyright (c) 2009 Chris Boulton - * @license New BSD License http://www.opensource.org/licenses/bsd-license.php - * @version 1.1 - * @link http://github.com/chrisboulton/php-diff - */ - -class Diff -{ - /** - * @var array The "old" sequence to use as the basis for the comparison. - */ - private $a = null; - - /** - * @var array The "new" sequence to generate the changes for. - */ - private $b = null; - - /** - * @var array Array containing the generated opcodes for the differences between the two items. - */ - private $groupedCodes = null; - - /** - * @var array Associative array of the default options available for the diff class and their default value. - */ - private $defaultOptions = array( - 'context' => 3, - 'ignoreNewLines' => false, - 'ignoreWhitespace' => false, - 'ignoreCase' => false - ); - - /** - * @var array Array of the options that have been applied for generating the diff. - */ - private $options = array(); - - /** - * The constructor. - * - * @param array $a Array containing the lines of the first string to compare. - * @param array $b Array containing the lines for the second string to compare. - * @param array $options - */ - public function __construct($a, $b, $options=array()) - { - $this->a = $a; - $this->b = $b; - - $this->options = array_merge($this->defaultOptions, $options); - } - - /** - * Render a diff using the supplied rendering class and return it. - * - * @param Diff_Renderer_Abstract $renderer An instance of the rendering object to use for generating the diff. - * @return mixed The generated diff. Exact return value depends on the rendered. - */ - public function render(Diff_Renderer_Abstract $renderer) - { - $renderer->diff = $this; - return $renderer->render(); - } - - /** - * Get a range of lines from $start to $end from the first comparison string - * and return them as an array. If no values are supplied, the entire string - * is returned. It's also possible to specify just one line to return only - * that line. - * - * @param int $start The starting number. - * @param int $end The ending number. If not supplied, only the item in $start will be returned. - * @return array Array of all of the lines between the specified range. - */ - public function getA($start=0, $end=null) - { - if($start == 0 && $end === null) { - return $this->a; - } - - if($end === null) { - $length = 1; - } - else { - $length = $end - $start; - } - - return array_slice($this->a, $start, $length); - - } - - /** - * Get a range of lines from $start to $end from the second comparison string - * and return them as an array. If no values are supplied, the entire string - * is returned. It's also possible to specify just one line to return only - * that line. - * - * @param int $start The starting number. - * @param int $end The ending number. If not supplied, only the item in $start will be returned. - * @return array Array of all of the lines between the specified range. - */ - public function getB($start=0, $end=null) - { - if($start == 0 && $end === null) { - return $this->b; - } - - if($end === null) { - $length = 1; - } - else { - $length = $end - $start; - } - - return array_slice($this->b, $start, $length); - } - - /** - * Generate a list of the compiled and grouped opcodes for the differences between the - * two strings. Generally called by the renderer, this class instantiates the sequence - * matcher and performs the actual diff generation and return an array of the opcodes - * for it. Once generated, the results are cached in the diff class instance. - * - * @return array Array of the grouped opcodes for the generated diff. - */ - public function getGroupedOpcodes() - { - if(!is_null($this->groupedCodes)) { - return $this->groupedCodes; - } - - require_once dirname(__FILE__).'/Diff/SequenceMatcher.php'; - $sequenceMatcher = new Diff_SequenceMatcher($this->a, $this->b, null, $this->options); - $this->groupedCodes = $sequenceMatcher->getGroupedOpcodes(); - return $this->groupedCodes; - } -} \ No newline at end of file diff --git a/vendor/phpspec/php-diff/lib/Diff/Renderer/Abstract.php b/vendor/phpspec/php-diff/lib/Diff/Renderer/Abstract.php deleted file mode 100644 index f63c3e7..0000000 --- a/vendor/phpspec/php-diff/lib/Diff/Renderer/Abstract.php +++ /dev/null @@ -1,82 +0,0 @@ - - * - * 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 the Chris Boulton 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. - * - * @package DiffLib - * @author Chris Boulton - * @copyright (c) 2009 Chris Boulton - * @license New BSD License http://www.opensource.org/licenses/bsd-license.php - * @version 1.1 - * @link http://github.com/chrisboulton/php-diff - */ - -abstract class Diff_Renderer_Abstract -{ - /** - * @var object Instance of the diff class that this renderer is generating the rendered diff for. - */ - public $diff; - - /** - * @var array Array of the default options that apply to this renderer. - */ - protected $defaultOptions = array(); - - /** - * @var array Array containing the user applied and merged default options for the renderer. - */ - protected $options = array(); - - /** - * The constructor. Instantiates the rendering engine and if options are passed, - * sets the options for the renderer. - * - * @param array $options Optionally, an array of the options for the renderer. - */ - public function __construct(array $options = array()) - { - $this->setOptions($options); - } - - /** - * Set the options of the renderer to those supplied in the passed in array. - * Options are merged with the default to ensure that there aren't any missing - * options. - * - * @param array $options Array of options to set. - */ - public function setOptions(array $options) - { - $this->options = array_merge($this->defaultOptions, $options); - } -} \ No newline at end of file diff --git a/vendor/phpspec/php-diff/lib/Diff/Renderer/Html/Array.php b/vendor/phpspec/php-diff/lib/Diff/Renderer/Html/Array.php deleted file mode 100644 index 7113a17..0000000 --- a/vendor/phpspec/php-diff/lib/Diff/Renderer/Html/Array.php +++ /dev/null @@ -1,225 +0,0 @@ - - * - * 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 the Chris Boulton 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. - * - * @package DiffLib - * @author Chris Boulton - * @copyright (c) 2009 Chris Boulton - * @license New BSD License http://www.opensource.org/licenses/bsd-license.php - * @version 1.1 - * @link http://github.com/chrisboulton/php-diff - */ - -require_once dirname(__FILE__).'/../Abstract.php'; - -class Diff_Renderer_Html_Array extends Diff_Renderer_Abstract -{ - /** - * @var array Array of the default options that apply to this renderer. - */ - protected $defaultOptions = array( - 'tabSize' => 4 - ); - - /** - * Render and return an array structure suitable for generating HTML - * based differences. Generally called by subclasses that generate a - * HTML based diff and return an array of the changes to show in the diff. - * - * @return array An array of the generated chances, suitable for presentation in HTML. - */ - public function render() - { - // As we'll be modifying a & b to include our change markers, - // we need to get the contents and store them here. That way - // we're not going to destroy the original data - $a = $this->diff->getA(); - $b = $this->diff->getB(); - - $changes = array(); - $opCodes = $this->diff->getGroupedOpcodes(); - foreach($opCodes as $group) { - $blocks = array(); - $lastTag = null; - $lastBlock = 0; - foreach($group as $code) { - list($tag, $i1, $i2, $j1, $j2) = $code; - - if($tag == 'replace' && $i2 - $i1 == $j2 - $j1) { - for($i = 0; $i < ($i2 - $i1); ++$i) { - $fromLine = $a[$i1 + $i]; - $toLine = $b[$j1 + $i]; - - list($start, $end) = $this->getChangeExtent($fromLine, $toLine); - if($start != 0 || $end != 0) { - $last = $end + strlen($fromLine); - $fromLine = substr_replace($fromLine, "\0", $start, 0); - $fromLine = substr_replace($fromLine, "\1", $last + 1, 0); - $last = $end + strlen($toLine); - $toLine = substr_replace($toLine, "\0", $start, 0); - $toLine = substr_replace($toLine, "\1", $last + 1, 0); - $a[$i1 + $i] = $fromLine; - $b[$j1 + $i] = $toLine; - } - } - } - - if($tag != $lastTag) { - $blocks[] = array( - 'tag' => $tag, - 'base' => array( - 'offset' => $i1, - 'lines' => array() - ), - 'changed' => array( - 'offset' => $j1, - 'lines' => array() - ) - ); - $lastBlock = count($blocks)-1; - } - - $lastTag = $tag; - - if($tag == 'equal') { - $lines = array_slice($a, $i1, ($i2 - $i1)); - $blocks[$lastBlock]['base']['lines'] += $this->formatLines($lines); - $lines = array_slice($b, $j1, ($j2 - $j1)); - $blocks[$lastBlock]['changed']['lines'] += $this->formatLines($lines); - } - else { - if($tag == 'replace' || $tag == 'delete') { - $lines = array_slice($a, $i1, ($i2 - $i1)); - $lines = $this->formatLines($lines); - $lines = str_replace(array("\0", "\1"), array('', ''), $lines); - $blocks[$lastBlock]['base']['lines'] += $lines; - } - - if($tag == 'replace' || $tag == 'insert') { - $lines = array_slice($b, $j1, ($j2 - $j1)); - $lines = $this->formatLines($lines); - $lines = str_replace(array("\0", "\1"), array('', ''), $lines); - $blocks[$lastBlock]['changed']['lines'] += $lines; - } - } - } - $changes[] = $blocks; - } - return $changes; - } - - /** - * Given two strings, determine where the changes in the two strings - * begin, and where the changes in the two strings end. - * - * @param string $fromLine The first string. - * @param string $toLine The second string. - * @return array Array containing the starting position (0 by default) and the ending position (-1 by default) - */ - private function getChangeExtent($fromLine, $toLine) - { - $start = 0; - $limit = min(strlen($fromLine), strlen($toLine)); - while($start < $limit && $fromLine{$start} == $toLine{$start}) { - ++$start; - } - $end = -1; - $limit = $limit - $start; - while(-$end <= $limit && substr($fromLine, $end, 1) == substr($toLine, $end, 1)) { - --$end; - } - return array( - $start, - $end + 1 - ); - } - - /** - * Format a series of lines suitable for output in a HTML rendered diff. - * This involves replacing tab characters with spaces, making the HTML safe - * for output, ensuring that double spaces are replaced with   etc. - * - * @param array $lines Array of lines to format. - * @return array Array of the formatted lines. - */ - private function formatLines($lines) - { - $lines = array_map(array($this, 'ExpandTabs'), $lines); - $lines = array_map(array($this, 'HtmlSafe'), $lines); - foreach($lines as &$line) { - $line = preg_replace_callback('# ( +)|^ #', __CLASS__."::fixSpaces", $line); - } - return $lines; - } - - /** - * Replace a string containing spaces with a HTML representation using  . - * - * @param string $matches Regex matches array. - * @return string The HTML representation of the string. - */ - public static function fixSpaces($matches) - { - $spaces = isset($matches[1]) ? $matches[1] : ''; - $count = strlen($spaces); - if($count == 0) { - return ''; - } - - $div = floor($count / 2); - $mod = $count % 2; - return str_repeat('  ', $div).str_repeat(' ', $mod); - } - - /** - * Replace tabs in a single line with a number of spaces as defined by the tabSize option. - * - * @param string $line The containing tabs to convert. - * @return string The line with the tabs converted to spaces. - */ - private function expandTabs($line) - { - return str_replace("\t", str_repeat(' ', $this->options['tabSize']), $line); - } - - /** - * Make a string containing HTML safe for output on a page. - * - * @param string $string The string. - * @return string The string with the HTML characters replaced by entities. - */ - private function htmlSafe($string) - { - return htmlspecialchars($string, ENT_NOQUOTES, 'UTF-8'); - } -} \ No newline at end of file diff --git a/vendor/phpspec/php-diff/lib/Diff/Renderer/Html/Inline.php b/vendor/phpspec/php-diff/lib/Diff/Renderer/Html/Inline.php deleted file mode 100644 index 60e8005..0000000 --- a/vendor/phpspec/php-diff/lib/Diff/Renderer/Html/Inline.php +++ /dev/null @@ -1,143 +0,0 @@ - - * - * 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 the Chris Boulton 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. - * - * @package DiffLib - * @author Chris Boulton - * @copyright (c) 2009 Chris Boulton - * @license New BSD License http://www.opensource.org/licenses/bsd-license.php - * @version 1.1 - * @link http://github.com/chrisboulton/php-diff - */ - -require_once dirname(__FILE__).'/Array.php'; - -class Diff_Renderer_Html_Inline extends Diff_Renderer_Html_Array -{ - /** - * Render a and return diff with changes between the two sequences - * displayed inline (under each other) - * - * @return string The generated inline diff. - */ - public function render() - { - $changes = parent::render(); - $html = ''; - if(empty($changes)) { - return $html; - } - - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - foreach($changes as $i => $blocks) { - // If this is a separate block, we're condensing code so output ..., - // indicating a significant portion of the code has been collapsed as - // it is the same - if($i > 0) { - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - } - - foreach($blocks as $change) { - $html .= ''; - // Equal changes should be shown on both sides of the diff - if($change['tag'] == 'equal') { - foreach($change['base']['lines'] as $no => $line) { - $fromLine = $change['base']['offset'] + $no + 1; - $toLine = $change['changed']['offset'] + $no + 1; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - } - } - // Added lines only on the right side - else if($change['tag'] == 'insert') { - foreach($change['changed']['lines'] as $no => $line) { - $toLine = $change['changed']['offset'] + $no + 1; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - } - } - // Show deleted lines only on the left side - else if($change['tag'] == 'delete') { - foreach($change['base']['lines'] as $no => $line) { - $fromLine = $change['base']['offset'] + $no + 1; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - } - } - // Show modified lines on both sides - else if($change['tag'] == 'replace') { - foreach($change['base']['lines'] as $no => $line) { - $fromLine = $change['base']['offset'] + $no + 1; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - } - - foreach($change['changed']['lines'] as $no => $line) { - $toLine = $change['changed']['offset'] + $no + 1; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - } - } - $html .= ''; - } - } - $html .= '
OldNewDifferences
 
'.$fromLine.''.$toLine.''.$line.'
 '.$toLine.''.$line.' 
'.$fromLine.' '.$line.' 
'.$fromLine.' '.$line.'
'.$toLine.' '.$line.'
'; - return $html; - } -} \ No newline at end of file diff --git a/vendor/phpspec/php-diff/lib/Diff/Renderer/Html/SideBySide.php b/vendor/phpspec/php-diff/lib/Diff/Renderer/Html/SideBySide.php deleted file mode 100644 index 307af1c..0000000 --- a/vendor/phpspec/php-diff/lib/Diff/Renderer/Html/SideBySide.php +++ /dev/null @@ -1,163 +0,0 @@ - - * - * 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 the Chris Boulton 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. - * - * @package DiffLib - * @author Chris Boulton - * @copyright (c) 2009 Chris Boulton - * @license New BSD License http://www.opensource.org/licenses/bsd-license.php - * @version 1.1 - * @link http://github.com/chrisboulton/php-diff - */ - -require_once dirname(__FILE__).'/Array.php'; - -class Diff_Renderer_Html_SideBySide extends Diff_Renderer_Html_Array -{ - /** - * Render a and return diff with changes between the two sequences - * displayed side by side. - * - * @return string The generated side by side diff. - */ - public function render() - { - $changes = parent::render(); - - $html = ''; - if(empty($changes)) { - return $html; - } - - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - foreach($changes as $i => $blocks) { - if($i > 0) { - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - } - - foreach($blocks as $change) { - $html .= ''; - // Equal changes should be shown on both sides of the diff - if($change['tag'] == 'equal') { - foreach($change['base']['lines'] as $no => $line) { - $fromLine = $change['base']['offset'] + $no + 1; - $toLine = $change['changed']['offset'] + $no + 1; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - } - } - // Added lines only on the right side - else if($change['tag'] == 'insert') { - foreach($change['changed']['lines'] as $no => $line) { - $toLine = $change['changed']['offset'] + $no + 1; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - } - } - // Show deleted lines only on the left side - else if($change['tag'] == 'delete') { - foreach($change['base']['lines'] as $no => $line) { - $fromLine = $change['base']['offset'] + $no + 1; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - } - } - // Show modified lines on both sides - else if($change['tag'] == 'replace') { - if(count($change['base']['lines']) >= count($change['changed']['lines'])) { - foreach($change['base']['lines'] as $no => $line) { - $fromLine = $change['base']['offset'] + $no + 1; - $html .= ''; - $html .= ''; - $html .= ''; - if(!isset($change['changed']['lines'][$no])) { - $toLine = ' '; - $changedLine = ' '; - } - else { - $toLine = $change['base']['offset'] + $no + 1; - $changedLine = ''.$change['changed']['lines'][$no].''; - } - $html .= ''; - $html .= ''; - $html .= ''; - } - } - else { - foreach($change['changed']['lines'] as $no => $changedLine) { - if(!isset($change['base']['lines'][$no])) { - $fromLine = ' '; - $line = ' '; - } - else { - $fromLine = $change['base']['offset'] + $no + 1; - $line = ''.$change['base']['lines'][$no].''; - } - $html .= ''; - $html .= ''; - $html .= ''; - $toLine = $change['changed']['offset'] + $no + 1; - $html .= ''; - $html .= ''; - $html .= ''; - } - } - } - $html .= ''; - } - } - $html .= '
Old VersionNew Version
  
'.$fromLine.''.$line.' '.$toLine.''.$line.' 
  '.$toLine.''.$line.' 
'.$fromLine.''.$line.'   
'.$fromLine.''.$line.' '.$toLine.''.$changedLine.'
'.$fromLine.''.$line.' '.$toLine.''.$changedLine.'
'; - return $html; - } -} \ No newline at end of file diff --git a/vendor/phpspec/php-diff/lib/Diff/Renderer/Text/Context.php b/vendor/phpspec/php-diff/lib/Diff/Renderer/Text/Context.php deleted file mode 100644 index 1200b01..0000000 --- a/vendor/phpspec/php-diff/lib/Diff/Renderer/Text/Context.php +++ /dev/null @@ -1,128 +0,0 @@ - - * - * 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 the Chris Boulton 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. - * - * @package DiffLib - * @author Chris Boulton - * @copyright (c) 2009 Chris Boulton - * @license New BSD License http://www.opensource.org/licenses/bsd-license.php - * @version 1.1 - * @link http://github.com/chrisboulton/php-diff - */ - -require_once dirname(__FILE__).'/../Abstract.php'; - -class Diff_Renderer_Text_Context extends Diff_Renderer_Abstract -{ - /** - * @var array Array of the different opcode tags and how they map to the context diff equivalent. - */ - private $tagMap = array( - 'insert' => '+', - 'delete' => '-', - 'replace' => '!', - 'equal' => ' ' - ); - - /** - * Render and return a context formatted (old school!) diff file. - * - * @return string The generated context diff. - */ - public function render() - { - $diff = ''; - $opCodes = $this->diff->getGroupedOpcodes(); - foreach($opCodes as $group) { - $diff .= "***************\n"; - $lastItem = count($group)-1; - $i1 = $group[0][1]; - $i2 = $group[$lastItem][2]; - $j1 = $group[0][3]; - $j2 = $group[$lastItem][4]; - - if($i2 - $i1 >= 2) { - $diff .= '*** '.($group[0][1] + 1).','.$i2." ****\n"; - } - else { - $diff .= '*** '.$i2." ****\n"; - } - - if($j2 - $j1 >= 2) { - $separator = '--- '.($j1 + 1).','.$j2." ----\n"; - } - else { - $separator = '--- '.$j2." ----\n"; - } - - $hasVisible = false; - foreach($group as $code) { - if($code[0] == 'replace' || $code[0] == 'delete') { - $hasVisible = true; - break; - } - } - - if($hasVisible) { - foreach($group as $code) { - list($tag, $i1, $i2, $j1, $j2) = $code; - if($tag == 'insert') { - continue; - } - $diff .= $this->tagMap[$tag].' '.implode("\n".$this->tagMap[$tag].' ', $this->diff->GetA($i1, $i2))."\n"; - } - } - - $hasVisible = false; - foreach($group as $code) { - if($code[0] == 'replace' || $code[0] == 'insert') { - $hasVisible = true; - break; - } - } - - $diff .= $separator; - - if($hasVisible) { - foreach($group as $code) { - list($tag, $i1, $i2, $j1, $j2) = $code; - if($tag == 'delete') { - continue; - } - $diff .= $this->tagMap[$tag].' '.implode("\n".$this->tagMap[$tag].' ', $this->diff->GetB($j1, $j2))."\n"; - } - } - } - return $diff; - } -} \ No newline at end of file diff --git a/vendor/phpspec/php-diff/lib/Diff/Renderer/Text/Unified.php b/vendor/phpspec/php-diff/lib/Diff/Renderer/Text/Unified.php deleted file mode 100644 index e94d951..0000000 --- a/vendor/phpspec/php-diff/lib/Diff/Renderer/Text/Unified.php +++ /dev/null @@ -1,87 +0,0 @@ - - * - * 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 the Chris Boulton 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. - * - * @package DiffLib - * @author Chris Boulton - * @copyright (c) 2009 Chris Boulton - * @license New BSD License http://www.opensource.org/licenses/bsd-license.php - * @version 1.1 - * @link http://github.com/chrisboulton/php-diff - */ - -require_once dirname(__FILE__).'/../Abstract.php'; - -class Diff_Renderer_Text_Unified extends Diff_Renderer_Abstract -{ - /** - * Render and return a unified diff. - * - * @return string The unified diff. - */ - public function render() - { - $diff = ''; - $opCodes = $this->diff->getGroupedOpcodes(); - foreach($opCodes as $group) { - $lastItem = count($group)-1; - $i1 = $group[0][1]; - $i2 = $group[$lastItem][2]; - $j1 = $group[0][3]; - $j2 = $group[$lastItem][4]; - - if($i1 == 0 && $i2 == 0) { - $i1 = -1; - $i2 = -1; - } - - $diff .= '@@ -'.($i1 + 1).','.($i2 - $i1).' +'.($j1 + 1).','.($j2 - $j1)." @@\n"; - foreach($group as $code) { - list($tag, $i1, $i2, $j1, $j2) = $code; - if($tag == 'equal') { - $diff .= ' '.implode("\n ", $this->diff->GetA($i1, $i2))."\n"; - } - else { - if($tag == 'replace' || $tag == 'delete') { - $diff .= '-'.implode("\n-", $this->diff->GetA($i1, $i2))."\n"; - } - - if($tag == 'replace' || $tag == 'insert') { - $diff .= '+'.implode("\n+", $this->diff->GetB($j1, $j2))."\n"; - } - } - } - } - return $diff; - } -} \ No newline at end of file diff --git a/vendor/phpspec/php-diff/lib/Diff/SequenceMatcher.php b/vendor/phpspec/php-diff/lib/Diff/SequenceMatcher.php deleted file mode 100644 index 67a903b..0000000 --- a/vendor/phpspec/php-diff/lib/Diff/SequenceMatcher.php +++ /dev/null @@ -1,748 +0,0 @@ - - * - * 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 the Chris Boulton 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. - * - * @package Diff - * @author Chris Boulton - * @copyright (c) 2009 Chris Boulton - * @license New BSD License http://www.opensource.org/licenses/bsd-license.php - * @version 1.1 - * @link http://github.com/chrisboulton/php-diff - */ - -class Diff_SequenceMatcher -{ - /** - * @var string|array Either a string or an array containing a callback function to determine if a line is "junk" or not. - */ - private $junkCallback = null; - - /** - * @var array The first sequence to compare against. - */ - private $a = null; - - /** - * @var array The second sequence. - */ - private $b = null; - - /** - * @var array Array of characters that are considered junk from the second sequence. Characters are the array key. - */ - private $junkDict = array(); - - /** - * @var array Array of indices that do not contain junk elements. - */ - private $b2j = array(); - - private $options = array(); - - private $defaultOptions = array( - 'ignoreNewLines' => false, - 'ignoreWhitespace' => false, - 'ignoreCase' => false - ); - - /** - * The constructor. With the sequences being passed, they'll be set for the - * sequence matcher and it will perform a basic cleanup & calculate junk - * elements. - * - * @param string|array $a A string or array containing the lines to compare against. - * @param string|array $b A string or array containing the lines to compare. - * @param string|array $junkCallback Either an array or string that references a callback function (if there is one) to determine 'junk' characters. - * @param array $options - */ - public function __construct($a, $b, $junkCallback=null, $options) - { - $this->a = null; - $this->b = null; - $this->junkCallback = $junkCallback; - $this->setOptions($options); - $this->setSequences($a, $b); - } - - /** - * Set new options - * - * @param array $options - */ - public function setOptions($options) - { - $this->options = array_merge($this->defaultOptions, $options); - } - - /** - * Set the first and second sequences to use with the sequence matcher. - * - * @param string|array $a A string or array containing the lines to compare against. - * @param string|array $b A string or array containing the lines to compare. - */ - public function setSequences($a, $b) - { - $this->setSeq1($a); - $this->setSeq2($b); - } - - /** - * Set the first sequence ($a) and reset any internal caches to indicate that - * when calling the calculation methods, we need to recalculate them. - * - * @param string|array $a The sequence to set as the first sequence. - */ - public function setSeq1($a) - { - if(!is_array($a)) { - $a = str_split($a); - } - if($a == $this->a) { - return; - } - - $this->a= $a; - $this->matchingBlocks = null; - $this->opCodes = null; - } - - /** - * Set the second sequence ($b) and reset any internal caches to indicate that - * when calling the calculation methods, we need to recalculate them. - * - * @param string|array $b The sequence to set as the second sequence. - */ - public function setSeq2($b) - { - if(!is_array($b)) { - $b = str_split($b); - } - if($b == $this->b) { - return; - } - - $this->b = $b; - $this->matchingBlocks = null; - $this->opCodes = null; - $this->fullBCount = null; - $this->chainB(); - } - - /** - * Generate the internal arrays containing the list of junk and non-junk - * characters for the second ($b) sequence. - */ - private function chainB() - { - $length = count ($this->b); - $this->b2j = array(); - $popularDict = array(); - - for($i = 0; $i < $length; ++$i) { - $char = $this->b[$i]; - if(isset($this->b2j[$char])) { - if($length >= 200 && count($this->b2j[$char]) * 100 > $length) { - $popularDict[$char] = 1; - unset($this->b2j[$char]); - } - else { - $this->b2j[$char][] = $i; - } - } - else { - $this->b2j[$char] = array( - $i - ); - } - } - - // Remove leftovers - foreach(array_keys($popularDict) as $char) { - unset($this->b2j[$char]); - } - - $this->junkDict = array(); - if(is_callable($this->junkCallback)) { - foreach(array_keys($popularDict) as $char) { - if(call_user_func($this->junkCallback, $char)) { - $this->junkDict[$char] = 1; - unset($popularDict[$char]); - } - } - - foreach(array_keys($this->b2j) as $char) { - if(call_user_func($this->junkCallback, $char)) { - $this->junkDict[$char] = 1; - unset($this->b2j[$char]); - } - } - } - } - - /** - * Checks if a particular character is in the junk dictionary - * for the list of junk characters. - * @param $b - * @return boolean True if the character is considered junk. False if not. - */ - private function isBJunk($b) - { - if(isset($this->juncDict[$b])) { - return true; - } - - return false; - } - - /** - * Find the longest matching block in the two sequences, as defined by the - * lower and upper constraints for each sequence. (for the first sequence, - * $alo - $ahi and for the second sequence, $blo - $bhi) - * - * Essentially, of all of the maximal matching blocks, return the one that - * startest earliest in $a, and all of those maximal matching blocks that - * start earliest in $a, return the one that starts earliest in $b. - * - * If the junk callback is defined, do the above but with the restriction - * that the junk element appears in the block. Extend it as far as possible - * by matching only junk elements in both $a and $b. - * - * @param int $alo The lower constraint for the first sequence. - * @param int $ahi The upper constraint for the first sequence. - * @param int $blo The lower constraint for the second sequence. - * @param int $bhi The upper constraint for the second sequence. - * @return array Array containing the longest match that includes the starting position in $a, start in $b and the length/size. - */ - public function findLongestMatch($alo, $ahi, $blo, $bhi) - { - $a = $this->a; - $b = $this->b; - - $bestI = $alo; - $bestJ = $blo; - $bestSize = 0; - - $j2Len = array(); - $nothing = array(); - - for($i = $alo; $i < $ahi; ++$i) { - $newJ2Len = array(); - $jDict = $this->arrayGetDefault($this->b2j, $a[$i], $nothing); - foreach($jDict as $jKey => $j) { - if($j < $blo) { - continue; - } - else if($j >= $bhi) { - break; - } - - $k = $this->arrayGetDefault($j2Len, $j -1, 0) + 1; - $newJ2Len[$j] = $k; - if($k > $bestSize) { - $bestI = $i - $k + 1; - $bestJ = $j - $k + 1; - $bestSize = $k; - } - } - - $j2Len = $newJ2Len; - } - - while($bestI > $alo && $bestJ > $blo && !$this->isBJunk($b[$bestJ - 1]) && - !$this->linesAreDifferent($bestI - 1, $bestJ - 1)) { - --$bestI; - --$bestJ; - ++$bestSize; - } - - while($bestI + $bestSize < $ahi && ($bestJ + $bestSize) < $bhi && - !$this->isBJunk($b[$bestJ + $bestSize]) && !$this->linesAreDifferent($bestI + $bestSize, $bestJ + $bestSize)) { - ++$bestSize; - } - - while($bestI > $alo && $bestJ > $blo && $this->isBJunk($b[$bestJ - 1]) && - !$this->isLineDifferent($bestI - 1, $bestJ - 1)) { - --$bestI; - --$bestJ; - ++$bestSize; - } - - while($bestI + $bestSize < $ahi && $bestJ + $bestSize < $bhi && - $this->isBJunk($b[$bestJ + $bestSize]) && !$this->linesAreDifferent($bestI + $bestSize, $bestJ + $bestSize)) { - ++$bestSize; - } - - return array( - $bestI, - $bestJ, - $bestSize - ); - } - - /** - * Check if the two lines at the given indexes are different or not. - * - * @param int $aIndex Line number to check against in a. - * @param int $bIndex Line number to check against in b. - * @return boolean True if the lines are different and false if not. - */ - public function linesAreDifferent($aIndex, $bIndex) - { - $lineA = $this->a[$aIndex]; - $lineB = $this->b[$bIndex]; - - if($this->options['ignoreWhitespace']) { - $replace = array("\t", ' '); - $lineA = str_replace($replace, '', $lineA); - $lineB = str_replace($replace, '', $lineB); - } - - if($this->options['ignoreCase']) { - $lineA = strtolower($lineA); - $lineB = strtolower($lineB); - } - - if($lineA != $lineB) { - return true; - } - - return false; - } - - /** - * Return a nested set of arrays for all of the matching sub-sequences - * in the strings $a and $b. - * - * Each block contains the lower constraint of the block in $a, the lower - * constraint of the block in $b and finally the number of lines that the - * block continues for. - * - * @return array Nested array of the matching blocks, as described by the function. - */ - public function getMatchingBlocks() - { - if(!empty($this->matchingBlocks)) { - return $this->matchingBlocks; - } - - $aLength = count($this->a); - $bLength = count($this->b); - - $queue = array( - array( - 0, - $aLength, - 0, - $bLength - ) - ); - - $matchingBlocks = array(); - while(!empty($queue)) { - list($alo, $ahi, $blo, $bhi) = array_pop($queue); - $x = $this->findLongestMatch($alo, $ahi, $blo, $bhi); - list($i, $j, $k) = $x; - if($k) { - $matchingBlocks[] = $x; - if($alo < $i && $blo < $j) { - $queue[] = array( - $alo, - $i, - $blo, - $j - ); - } - - if($i + $k < $ahi && $j + $k < $bhi) { - $queue[] = array( - $i + $k, - $ahi, - $j + $k, - $bhi - ); - } - } - } - - usort($matchingBlocks, array($this, 'tupleSort')); - - $i1 = 0; - $j1 = 0; - $k1 = 0; - $nonAdjacent = array(); - foreach($matchingBlocks as $block) { - list($i2, $j2, $k2) = $block; - if($i1 + $k1 == $i2 && $j1 + $k1 == $j2) { - $k1 += $k2; - } - else { - if($k1) { - $nonAdjacent[] = array( - $i1, - $j1, - $k1 - ); - } - - $i1 = $i2; - $j1 = $j2; - $k1 = $k2; - } - } - - if($k1) { - $nonAdjacent[] = array( - $i1, - $j1, - $k1 - ); - } - - $nonAdjacent[] = array( - $aLength, - $bLength, - 0 - ); - - $this->matchingBlocks = $nonAdjacent; - return $this->matchingBlocks; - } - - /** - * Return a list of all of the opcodes for the differences between the - * two strings. - * - * The nested array returned contains an array describing the opcode - * which includes: - * 0 - The type of tag (as described below) for the opcode. - * 1 - The beginning line in the first sequence. - * 2 - The end line in the first sequence. - * 3 - The beginning line in the second sequence. - * 4 - The end line in the second sequence. - * - * The different types of tags include: - * replace - The string from $i1 to $i2 in $a should be replaced by - * the string in $b from $j1 to $j2. - * delete - The string in $a from $i1 to $j2 should be deleted. - * insert - The string in $b from $j1 to $j2 should be inserted at - * $i1 in $a. - * equal - The two strings with the specified ranges are equal. - * - * @return array Array of the opcodes describing the differences between the strings. - */ - public function getOpCodes() - { - if(!empty($this->opCodes)) { - return $this->opCodes; - } - - $i = 0; - $j = 0; - $this->opCodes = array(); - - $blocks = $this->getMatchingBlocks(); - foreach($blocks as $block) { - list($ai, $bj, $size) = $block; - $tag = ''; - if($i < $ai && $j < $bj) { - $tag = 'replace'; - } - else if($i < $ai) { - $tag = 'delete'; - } - else if($j < $bj) { - $tag = 'insert'; - } - - if($tag) { - $this->opCodes[] = array( - $tag, - $i, - $ai, - $j, - $bj - ); - } - - $i = $ai + $size; - $j = $bj + $size; - - if($size) { - $this->opCodes[] = array( - 'equal', - $ai, - $i, - $bj, - $j - ); - } - } - return $this->opCodes; - } - - /** - * Return a series of nested arrays containing different groups of generated - * opcodes for the differences between the strings with up to $context lines - * of surrounding content. - * - * Essentially what happens here is any big equal blocks of strings are stripped - * out, the smaller subsets of changes are then arranged in to their groups. - * This means that the sequence matcher and diffs do not need to include the full - * content of the different files but can still provide context as to where the - * changes are. - * - * @param int $context The number of lines of context to provide around the groups. - * @return array Nested array of all of the grouped opcodes. - */ - public function getGroupedOpcodes($context=3) - { - $opCodes = $this->getOpCodes(); - if(empty($opCodes)) { - $opCodes = array( - array( - 'equal', - 0, - 1, - 0, - 1 - ) - ); - } - - if($opCodes[0][0] == 'equal') { - $opCodes[0] = array( - $opCodes[0][0], - max($opCodes[0][1], $opCodes[0][2] - $context), - $opCodes[0][2], - max($opCodes[0][3], $opCodes[0][4] - $context), - $opCodes[0][4] - ); - } - - $lastItem = count($opCodes) - 1; - if($opCodes[$lastItem][0] == 'equal') { - list($tag, $i1, $i2, $j1, $j2) = $opCodes[$lastItem]; - $opCodes[$lastItem] = array( - $tag, - $i1, - min($i2, $i1 + $context), - $j1, - min($j2, $j1 + $context) - ); - } - - $maxRange = $context * 2; - $groups = array(); - $group = array(); - foreach($opCodes as $code) { - list($tag, $i1, $i2, $j1, $j2) = $code; - if($tag == 'equal' && $i2 - $i1 > $maxRange) { - $group[] = array( - $tag, - $i1, - min($i2, $i1 + $context), - $j1, - min($j2, $j1 + $context) - ); - $groups[] = $group; - $group = array(); - $i1 = max($i1, $i2 - $context); - $j1 = max($j1, $j2 - $context); - } - $group[] = array( - $tag, - $i1, - $i2, - $j1, - $j2 - ); - } - - if(!empty($group) && !(count($group) == 1 && $group[0][0] == 'equal')) { - $groups[] = $group; - } - - return $groups; - } - - /** - * Return a measure of the similarity between the two sequences. - * This will be a float value between 0 and 1. - * - * Out of all of the ratio calculation functions, this is the most - * expensive to call if getMatchingBlocks or getOpCodes is yet to be - * called. The other calculation methods (quickRatio and realquickRatio) - * can be used to perform quicker calculations but may be less accurate. - * - * The ratio is calculated as (2 * number of matches) / total number of - * elements in both sequences. - * - * @return float The calculated ratio. - */ - public function Ratio() - { - $matches = array_reduce($this->getMatchingBlocks(), array($this, 'ratioReduce'), 0); - return $this->calculateRatio($matches, count ($this->a) + count ($this->b)); - } - - /** - * Helper function to calculate the number of matches for Ratio(). - * - * @param int $sum The running total for the number of matches. - * @param array $triple Array containing the matching block triple to add to the running total. - * @return int The new running total for the number of matches. - */ - private function ratioReduce($sum, $triple) - { - return $sum + ($triple[count($triple) - 1]); - } - - /** - * Quickly return an upper bound ratio for the similarity of the strings. - * This is quicker to compute than Ratio(). - * - * @return float The calculated ratio. - */ - private function quickRatio() - { - if($this->fullBCount === null) { - $this->fullBCount = array(); - $bLength = count ($this->b); - for($i = 0; $i < $bLength; ++$i) { - $char = $this->b[$i]; - $this->fullBCount[$char] = $this->arrayGetDefault($this->fullBCount, $char, 0) + 1; - } - } - - $avail = array(); - $matches = 0; - $aLength = count ($this->a); - for($i = 0; $i < $aLength; ++$i) { - $char = $this->a[$i]; - if(isset($avail[$char])) { - $numb = $avail[$char]; - } - else { - $numb = $this->arrayGetDefault($this->fullBCount, $char, 0); - } - $avail[$char] = $numb - 1; - if($numb > 0) { - ++$matches; - } - } - - $this->calculateRatio($matches, count ($this->a) + count ($this->b)); - } - - /** - * Return an upper bound ratio really quickly for the similarity of the strings. - * This is quicker to compute than Ratio() and quickRatio(). - * - * @return float The calculated ratio. - */ - private function realquickRatio() - { - $aLength = count ($this->a); - $bLength = count ($this->b); - - return $this->calculateRatio(min($aLength, $bLength), $aLength + $bLength); - } - - /** - * Helper function for calculating the ratio to measure similarity for the strings. - * The ratio is defined as being 2 * (number of matches / total length) - * - * @param int $matches The number of matches in the two strings. - * @param int $length The length of the two strings. - * @return float The calculated ratio. - */ - private function calculateRatio($matches, $length=0) - { - if($length) { - return 2 * ($matches / $length); - } - else { - return 1; - } - } - - /** - * Helper function that provides the ability to return the value for a key - * in an array of it exists, or if it doesn't then return a default value. - * Essentially cleaner than doing a series of if(isset()) {} else {} calls. - * - * @param array $array The array to search. - * @param string $key The key to check that exists. - * @param mixed $default The value to return as the default value if the key doesn't exist. - * @return mixed The value from the array if the key exists or otherwise the default. - */ - private function arrayGetDefault($array, $key, $default) - { - if(isset($array[$key])) { - return $array[$key]; - } - else { - return $default; - } - } - - /** - * Sort an array by the nested arrays it contains. Helper function for getMatchingBlocks - * - * @param array $a First array to compare. - * @param array $b Second array to compare. - * @return int -1, 0 or 1, as expected by the usort function. - */ - private function tupleSort($a, $b) - { - $max = max(count($a), count($b)); - for($i = 0; $i < $max; ++$i) { - if($a[$i] < $b[$i]) { - return -1; - } - else if($a[$i] > $b[$i]) { - return 1; - } - } - - if(count($a) == count($b)) { - return 0; - } - else if(count($a) < count($b)) { - return -1; - } - else { - return 1; - } - } -} \ No newline at end of file diff --git a/vendor/phpspec/phpspec/.gitattributes b/vendor/phpspec/phpspec/.gitattributes deleted file mode 100644 index 46a0596..0000000 --- a/vendor/phpspec/phpspec/.gitattributes +++ /dev/null @@ -1,4 +0,0 @@ -* text=auto -*.bat eol=crlf - -docs export-ignore diff --git a/vendor/phpspec/phpspec/.gitignore b/vendor/phpspec/phpspec/.gitignore deleted file mode 100644 index 4d8371b..0000000 --- a/vendor/phpspec/phpspec/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -*.tgz -*.phar -behat.yml -vendor -composer.lock -phpspec.phar diff --git a/vendor/phpspec/phpspec/.scrutinizer.yml b/vendor/phpspec/phpspec/.scrutinizer.yml deleted file mode 100644 index 4eaa0e3..0000000 --- a/vendor/phpspec/phpspec/.scrutinizer.yml +++ /dev/null @@ -1,21 +0,0 @@ -imports: - - javascript - - php - -tools: - php_code_sniffer: - filter: - excluded-paths: [ spec/* ] - - php_analyzer: - filter: - excluded-paths: [ spec/* ] - - php_sim: - filter: - excluded-paths: [ spec/* ] - -filter: - excluded_paths: - - docs/* - - vendor/* diff --git a/vendor/phpspec/phpspec/.travis.yml b/vendor/phpspec/phpspec/.travis.yml deleted file mode 100644 index 46270d6..0000000 --- a/vendor/phpspec/phpspec/.travis.yml +++ /dev/null @@ -1,28 +0,0 @@ -language: php - -php: [5.3, 5.4, 5.5, 5.6, hhvm, hhvm-nightly] - -env: - - COMPOSER_OPTIONS='install' - -matrix: - include: - - php: 5.3.3 - env: COMPOSER_OPTIONS='update --prefer-lowest' - -sudo: false - -cache: - directories: - - $HOME/.composer/cache - -before_install: - - echo 'hhvm.libxml.ext_entity_whitelist = file' > travis.hhvm.ini - - composer selfupdate - -install: - - COMPOSER_ROOT_VERSION=dev-master composer $COMPOSER_OPTIONS - -script: - - sh -c 'if [ "$TRAVIS_PHP_VERSION" = "hhvm" -o "$TRAVIS_PHP_VERSION" = "hhvm-nightly" ]; then hhvm -c travis.hhvm.ini bin/phpspec run; else bin/phpspec run; fi;' - - sh -c 'if [ "$TRAVIS_PHP_VERSION" = "hhvm" -o "$TRAVIS_PHP_VERSION" = "hhvm-nightly" ]; then hhvm -c travis.hhvm.ini ./vendor/behat/behat/bin/behat --format=pretty; else ./vendor/bin/behat --format=pretty; fi;' diff --git a/vendor/phpspec/phpspec/CHANGES.md b/vendor/phpspec/phpspec/CHANGES.md deleted file mode 100644 index 5ab5d64..0000000 --- a/vendor/phpspec/phpspec/CHANGES.md +++ /dev/null @@ -1,132 +0,0 @@ -2.1.1 / 2015-01-09 -================== - - * Smoother rendering for progress bar - * Fixed progress bar for case where no examples are found - * Tidier output alignment + block width - * Removed deprecated calls to Yaml::parse - * More accurate lower bounds for composer installation - -2.1.0 / 2014-12-14 -================== - - * No changes from RC3 - -2.1.0-RC3 / 2014-12-04 -====================== - - * Removed minor BC break introduced in RC2 - -2.1.0-RC2 / 2014-11-14 -====================== - - * Specify bootstrap file via configuration - * Correct error codes while using --stop-on-failure - * Better detection of empty specs - * Fixed issue where non-spec files in spec folder caused errors - * Better PSR-4 support - -2.1.0-RC1 / 2014-09-14 -====================== - - * Allow objects to be instantiated via static factory methods - * Automatic generation of return statements using '--fake' - * Test suite is automatically rerun when classes or methods have been generated - * Allow examples to mark themselves as skipped - * PSR-4 support - * PSR-0 locator now supports underscores correctly - * Ability to specify a custom bootstrap file using '--bootstrap' (for autoloader registration etc) - * Ability to have a personal .phpspec.yml in home folder - * Progress bar grows from left to right and flickers less - * Improved diffs for object comparison - * Throw an exception when construction method is redefined - * Non-zero exit code when dependencies are missing - * Respect exit code of commands other than 'run' - * Higher CLI verbosity levels are handled properly - * Code Generation and Stop on Failure are configurable through phpspec.yml - * Fixes for object instantiation changes in newer versions of PHP - * PHP 5.6 support - * Fixes for progress bar sometimes rounding up to 100% when not all specs passed - * Support for non-standard Composer autoloader location - * Improved hhvm support - * Extensions can now register new command - * Resource locator de-duplicates resources (supports custom locators in extensions) - -2.0.1 / 2014-07-01 -================== - - * Fixed the loading of the autoloader for projects using a custom composer vendor folder - -2.0.0 / 2014-03-19 -================== - - * Improve support to windows - * Improve support to hhvm - * Improve acceptance tests coverage with Behat - -2.0.0-RC4 / 2014-02-21 -====================== - - * Revamped junit formatter - * Fixed #269 Problem with exception masking and generation for not found class - * HHVM is officially supported - * Add psr0 validator - * Remove Nyan from core - * Added an exception if the specified config file does not exist - * Fixed a problem with generating a constructor when it is first time added - * Improved help - * Fixed the suite runner in fast machines - -2.0.0-RC3 / 2014-01-01 -====================== - - * Fixed the Prophecy constraint as the new release is 1.1 - * Refactored formatters to be defined as services - -2.0.0-RC2 / 2013-12-30 -====================== - - * Fixed the invocation of methods expecting an argument passed by reference - * Fixed the instantiation of the wrapped object in shouldThrow - -2.0.0-RC1 / 2013-12-26 -====================== - - * Bump the Prophecy requirement to ``~1.0.5@dev`` - * Added a JUnit formatter - * Added the ``--stop-on-failure`` option - * Fixed the support of the ``--no-interaction`` option - * Added more events to add extension points - * Added the number of specs in the console output - * Fixed the handling of Windows line endings in the StringEngine and in reading doc comments - * Added extension points in the template loading - * Added a constructor generator - * Added a HTML formatter - * Added a nyan cat formatter - -2.0.0beta4 / 2013-05-19 -======================= - - * Add collaborator constructor setter - * Fix couple of bugs in Prophecy integration layer - * New (old) dot formatter - -2.0.0beta3 / 2013-05-01 -======================= - - * Prevent loading of unexisting PHP files - * Fix typos in the error messages - -2.0.0beta2 / 2013-04-30 -======================= - - * Bump required Prophecy version to 1.0.1 - * Support non-string values with ArrayContain matcher - * Create `src` folder if does not exist - * Fix stack trace and matchers failure printing - -2.0.0beta1 / 2013-04-29 -======================= - - * Initial release - diff --git a/vendor/phpspec/phpspec/LICENSE b/vendor/phpspec/phpspec/LICENSE deleted file mode 100644 index 6ca5348..0000000 --- a/vendor/phpspec/phpspec/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright (c) 2013-2014 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/vendor/phpspec/phpspec/Makefile b/vendor/phpspec/phpspec/Makefile deleted file mode 100644 index b75c34c..0000000 --- a/vendor/phpspec/phpspec/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -all: - @echo "Only build-phar target is currently supported." - -build-phar: - @echo "--> Checking for composer command line tool" - command -v composer >/dev/null && continue || { echo "composer command not found."; exit 1; } - @echo "--> Cleaning vendor directory" - rm -Rfv vendor - @echo "--> Installing dependencies without dev" - composer install --no-dev - @echo "--> Building Phar" - box build - @echo "--> Success" diff --git a/vendor/phpspec/phpspec/README.rst b/vendor/phpspec/phpspec/README.rst deleted file mode 100644 index 13d021a..0000000 --- a/vendor/phpspec/phpspec/README.rst +++ /dev/null @@ -1,29 +0,0 @@ -phpspec -======= - -The main website with documentation is at `http://phpspec.net `_. - -.. image:: https://travis-ci.org/phpspec/phpspec.svg?branch=master - :target: http://travis-ci.org/phpspec/phpspec - :alt: Master Travis Build Status - -.. image:: https://scrutinizer-ci.com/g/phpspec/phpspec/badges/quality-score.png?b=master - :target: https://scrutinizer-ci.com/g/phpspec/phpspec/build-status/master - :alt: Master Scrutinizer Quality Score - -Installing Dependencies ------------------------ - -Dependencies are handled via `composer `_:: - - wget -nc http://getcomposer.org/composer.phar - php composer.phar install - -Developer's mailing list ------------------------- - -For development discussion subscribe to `phpspec-dev@googlegroups.com `_. - -Community ---------- -Check out #phpspec on irc.freenode.net. diff --git a/vendor/phpspec/phpspec/behat.yml.dist b/vendor/phpspec/phpspec/behat.yml.dist deleted file mode 100644 index ccc8aa4..0000000 --- a/vendor/phpspec/phpspec/behat.yml.dist +++ /dev/null @@ -1,6 +0,0 @@ -default: - suites: - application: - contexts: [ ApplicationContext, FilesystemContext ] - formatters: - progress: ~ diff --git a/vendor/phpspec/phpspec/bin/phpspec b/vendor/phpspec/phpspec/bin/phpspec deleted file mode 100644 index fa8fe95..0000000 --- a/vendor/phpspec/phpspec/bin/phpspec +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env php -run(); diff --git a/vendor/phpspec/phpspec/box.json b/vendor/phpspec/phpspec/box.json deleted file mode 100644 index ba5ef43..0000000 --- a/vendor/phpspec/phpspec/box.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "chmod": "0755", - "directories": [ - "src" - ], - "files": [ - "LICENSE" - ], - "finder": [ - { - "name": "*.php", - "exclude": ["Tests"], - "in": "vendor" - } - ], - "main": "bin/phpspec", - "output": "phpspec.phar", - "stub": true -} diff --git a/vendor/phpspec/phpspec/composer.json b/vendor/phpspec/phpspec/composer.json deleted file mode 100644 index 65412b8..0000000 --- a/vendor/phpspec/phpspec/composer.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "name": "phpspec/phpspec", - "description": "Specification-oriented BDD framework for PHP 5.3+", - "keywords": ["BDD", "SpecBDD", "TDD", "spec", "specification", "tests", "testing"], - "homepage": "http://phpspec.net/", - "type": "library", - "license": "MIT", - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "homepage": "http://marcelloduarte.net/" - } - ], - - "require": { - "php": ">=5.3.3", - "phpspec/prophecy": "~1.1", - "phpspec/php-diff": "~1.0.0", - "sebastian/exporter": "~1.0", - "symfony/console": "~2.3", - "symfony/event-dispatcher": "~2.1", - "symfony/finder": "~2.1", - "symfony/process": "~2.1", - "symfony/yaml": "~2.1", - "doctrine/instantiator": "~1.0,>=1.0.1" - }, - - "require-dev": { - "behat/behat": "~3.0,>=3.0.11", - "bossa/phpspec2-expect": "~1.0", - "symfony/filesystem": "~2.1" - }, - - "suggest": { - "phpspec/nyan-formatters": "~1.0 – Adds Nyan formatters" - }, - - "autoload": { - "psr-0": { - "PhpSpec": "src/" - } - }, - - "bin": ["bin/phpspec"], - - "extra": { - "branch-alias": { - "dev-master": "2.1.x-dev" - } - } -} diff --git a/vendor/phpspec/phpspec/features/bootstrap/ApplicationContext.php b/vendor/phpspec/phpspec/features/bootstrap/ApplicationContext.php deleted file mode 100644 index 8515f78..0000000 --- a/vendor/phpspec/phpspec/features/bootstrap/ApplicationContext.php +++ /dev/null @@ -1,236 +0,0 @@ -application = new Application('2.1-dev'); - $this->application->setAutoExit(false); - - $this->tester = new ApplicationTester($this->application); - - $this->setupDialogHelper(); - $this->setupReRunner(); - } - - private function setupDialogHelper() - { - $this->dialogHelper = new DialogHelper(); - - $helperSet = $this->application->getHelperSet(); - $helperSet->set($this->dialogHelper); - } - - private function setupReRunner() - { - $this->reRunner = new ReRunner; - $this->application->getContainer()->set('process.rerunner.platformspecific', $this->reRunner); - } - - /** - * @Given I have started describing the :class class - * @Given I start describing the :class class - */ - public function iDescribeTheClass($class) - { - $arguments = array( - 'command' => 'describe', - 'class' => $class - ); - - expect($this->tester->run($arguments, array('interactive' => false)))->toBe(0); - } - - /** - * @When I run phpspec (non interactively) - * @When I run phpspec using the :formatter format - * @When I run phpspec with the :option option - * @When /I run phpspec with option (?P
  • (Dashboard)